Page 1 of 1

API structure

Posted: Mon Feb 21, 2005 10:37 am
by chippy73
I want to use the following:-

CallFunction(0,"ReadConsoleInputA",hConsoleInput.l, lpBuffer.PUT_RECORD, nLength.l, lpNumberOfEventsRead.l)

Can someone help me with structuring of the parameters and also the PUT_RECORD layout.

I don't know how to define them.

Many thanks

Alan

Re: API structure

Posted: Mon Feb 21, 2005 12:59 pm
by traumatic
See here:

http://msdn.microsoft.com/library/defau ... einput.asp

Code: Select all

Structure INPUT_RECORD_EVENT
  StructureUnion
    KeyEvent.KEY_EVENT_RECORD
    MouseEvent.MOUSE_EVENT_RECORD
    WindowBufferSizeEvent.WINDOW_BUFFER_SIZE_RECORD
    MenuEvent.MENU_EVENT_RECORD
    FocusEvent.FOCUS_EVENT_RECORD
  EndStructureUnion
EndStructure

Structure INPUT_RECORD
  EventType.w
  Event.INPUT_RECORD_EVENT
EndStructure

Code: Select all

Dim inputBuffer.INPUT_RECORD(127)

hStdIn.l = GetStdHandle_(#STD_INPUT_HANDLE)
ReadConsoleInput_(hStdin, inputBuffer(), 128, @numRead.l)

Posted: Mon Feb 21, 2005 4:10 pm
by chippy73
Thanks, Traumatic. That has helped a lot.

Alan