W
wwwww
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个程序中象另一个程序中发送WM_CHAR消息如:
程序一中:
handle:=....;//handle的值为另一个程序的Form的handle
SendMessage(handle,WM_CHAR,0,0);
另一个中:
在private中定义:
private
{ Private declarations }
procedure WMChar(var M: TWMKEYDOWN);Message WM_KeyDown;
..............
procedure TForm2.WMChar(var Me: TWMKEYDOWN);
begin
inherited;
ShowMessage(chr(Me.CharCode));
end;
程序一中:
handle:=....;//handle的值为另一个程序的Form的handle
SendMessage(handle,WM_CHAR,0,0);
另一个中:
在private中定义:
private
{ Private declarations }
procedure WMChar(var M: TWMKEYDOWN);Message WM_KeyDown;
..............
procedure TForm2.WMChar(var Me: TWMKEYDOWN);
begin
inherited;
ShowMessage(chr(Me.CharCode));
end;