procedure WMCommand(var Msg:TWMCommand);message WM_COMMAND;
procedure TForm1.WMCommand(var Msg: TWMCommand);
begin
if Msg.ItemID=OPen1.Command then
showmessage('ok');
inherited;
end;
查看Win32帮助uItem为:
uItem = (UINT) LOWORD(wParam)
所以要产生消息如下:
procedure TForm1.Button1Click(Sender: TObject);
var
Msg:TMessage;
begin
Msg.WParamLo:=Open1.Command;
SendMessage(handle,WM_COMMAND,Msg.wParam,0);
end;