Also bei mir gehts ...
Delphi-Quellcode:
var
Form1: TForm1;
msgid: Cardinal;
implementation
{$R *.dfm}
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if Msg.message = msgid then
begin
Memo1.Lines.Add('Olé ! ' + IntToStr(Msg.hwnd));
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
PostMessage(HWND_BROADCAST, msgid, 0, 0);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
msgid := RegisterWindowMessage('MyCoolTestProg');
Memo1.Text := IntToStr(msgid);
Memo1.Lines.Add(inttostr(Application.Handle));
Memo1.Lines.Add(inttostr(Form1.Handle));
end;
end.
Die Message komt allerdings zweimal an ... einmal bei der Application und einmal ... bin ich grad am gucken