Plurk
How to send and handle a custom Windows message
Just a memo for message using in DELPHI!
Define custommessage
const
WM_MY_MESSAGE_0 = WM_USER + 0;
WM_MY_MESSAGE_1 = WM_USER + 1;
Define a handler for custom message
type
TMyForm = class(TForm)
.
.
.
private
procedure OnMessage_0(var Msg: TMessage); message WM_MY_MESSAGE_0;
procedure OnMessage_1(var Msg: TMessage); message WM_MY_MESSAGE_1;
.
.
Send the custom message via sendmessage or postmessage
PostMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
or
SendMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
訂閱:
張貼留言 (Atom)
0 意見:
張貼留言