X
xiewenrui
Unregistered / Unconfirmed
GUEST, unregistred user!
各位同仁:<br> 本人写了一个消息映射的问题,在delphi5下运行是没有问题,但是在delphi7下<br>当调用函数postMessage时,却报说参数不够,不知是什么原因。程序如下:<br><br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>const<br> WM_MYMESSAGE = WM_USER + $100;<br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br><br> private<br> procedure ShowMe(var Msg: TMessage);message WM_MYMESSAGE;<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br><br>implementation<br><br>{$R *.dfm}<br><br>procedure TForm1.ShowMe(var Msg: TMessage);<br>BEGIN<br> ShowMessage('Right');<br>END;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> postmessage(self.Handle,ShowMe,0,0);<br>end;<br><br>end.<br>