其实我也并不知道你想怎么用,下面只是我遇到的一种情况:判断用户对我的程序执行了什么操作<br><br>const cm_about=WM_USER+102;<br>const cm_exit=WM_USER+103;<br>const cm_GetSendMessage=WM_USER+104;<br>const cm_DisConnect=WM_USER+105;<br>CONST cm_StartGAME=WM_USER+106;<br><br>procedure TForm1.WndProc(var Message:Tmessage);<br>var s:string;<br>begin<br> if(Message.WParam=cm_exit) then<br> showmessage('退出程序');<br> else if Message.wparam=cm_GetSendMessage then<br> showmessage('打开程序');<br> else if Message.WParam =cm_startgame then<br> begin<br> s:='c:/game/game.exe';<br> shellexecute(0,nil,pchar(s),nil,nil,sw_shownormal);<br> {运行程序}<br> end<br> else if Message.wparam=SC_MINIMIZE then <br> showmessage('最小化');<br> inherited WndProc(Message);<br>end;<br>