Touch-It Virtual Keyboard Version 4.9.2
Trap Windows messages

Delphi example of how to trap Windows messages within your application. Messages are dispatched using Windows Message key.

Two arguments must be supplied:
  • wParam is reserved for the up/down button state
  • lParam is the key ID
Interface

type

TForm1 = class(TForm)
protected

//Override the Windows messages manager
procedure WndProc(var Message :TMessage); override;

end;


var

//Variables for unique Windows message ID
WM_TOUCHITTEST :integer;
WM_TOUCHITSTART :integer;


implementation

procedure TForm1.WndProc(var Message :TMessage);
begin

if Message.Msg = WM_TOUCHITTEST then
begin

case Message.wParam of

0 : //Insert the button up event code here...
1 : //Insert the button down event code here...

end;
end


else if Message.Msg = WM_TOUCHITSTART then
begin

//Received when Touch-It starts up => Initialization.
end


else inherited:

end;

//Create the unique Windows message ID
initialization

WM_TOUCHITTEST := RegisterWindowMessage('WM_TOUCHITTEST');
WM_TOUCHITSTART := RegisterWindowMessage('WM_TOUCHITSTART');

Copyright © 2011 Chessware SA