做系统托盘时用到
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;
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;
case msg.LParam of
WM_LBUTTONUp: Form1.Visible:=not Form1.Visible;
WM_RBUTTONUP: ShowMessage('您点击的是右键');
End;
End;
//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:='众恒汽修管理软件';
去掉后,procedure WMNID(var msg:TMessage);不起作用了