Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Jul : Delphi 9: Weird PostMessage Behavior
| Subject: | Delphi 9: Weird PostMessage Behavior |
| Posted by: | "Jaimy Azle" (jazle@nospam.nospam.com) |
| Date: | Tue, 12 Jul 2005 10:29:33 |
I simply have a little problem, Delphi 9 seems do not handle PostMessage
properly:
unit Unit2;
..
..
const
WMTest_2 = WM_USER + 1;
type
TForm2 = class(TForm)
private
procedure WMTestProc(var Message: TMessage); message WMTest_2;
end;
...
procedure TForm2.WMTestProc(var Message: TMessage);
begin
ShowMessage('Hello World');
end;
I tried to call it from Form1:
procedure TForm1.Button1Click(Sender: TObject);
var
MyForm: TForm2;
begin
MyForm := TForm2.Create(nil);
with MyForm do
try
PostMessage(MyForm.Handle, WMTest_2, 0, 0);
ShowModal;
finally
Free;
end;
end;
and WMTestProc(..) seems never been executed. Is there any solution for this
one since it works with previous delphi version.
Regards,
-Jaimy