做系统托盘时用到
procedure WMNID(var msg:TMessage); message WM_NID;//这里不能通过[错误] MsgMain.pas(115): Unknown directive: 'message'begin
  case msg.LParam of
    WM_LBUTTONUp: Form1.Visible:=not Form1.Visible;
    WM_RBUTTONUP: ShowMessage('您点击的是右键');
  End;
End;

解决方案 »

  1.   

    procedure WMNID(var msg:TMessage);begin
      case msg.LParam of
        WM_LBUTTONUp: Form1.Visible:=not Form1.Visible;
        WM_RBUTTONUP: ShowMessage('您点击的是右键');
      End;
    End;
      

  2.   

    做系统托盘程序,完全按照网上给的代码,可惜不行,帮帮忙,分不够在加//****************系统托盘****************
        //NotifyIcon为全局变量,在程序的开头已经定义了
        with NotifyIcon do
        begin
          cbSize:=SizeOf(TNotifyIconData);
          Wnd:=Handle;   //指向当前窗体Form1的句柄
          uID:=1;
          uFlags:=NIM_ICON or NIM_MESSAGE or NIM_TIP;//这里也编不通,[错误] MsgMain.pas(154): Undeclared identifier: 'NIM_ICON'      uCallBackMessage:=WM_NID;
          hIcon:=Application.Icon.Handle;
          szTip:='众恒汽修管理软件';
      

  3.   

    把message WM_NID;
    去掉后,procedure WMNID(var msg:TMessage);不起作用了