API structure

Windows specific forum
chippy73
User
User
Posts: 59
Joined: Wed Feb 16, 2005 6:11 pm
Location: S.W.Wales

API structure

Post 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
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: API structure

Post 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)
Good programmers don't comment their code. It was hard to write, should be hard to read.
chippy73
User
User
Posts: 59
Joined: Wed Feb 16, 2005 6:11 pm
Location: S.W.Wales

Post by chippy73 »

Thanks, Traumatic. That has helped a lot.

Alan
Post Reply