我之前做了一个 托盘系统,当鼠标移动到托盘程序的小图标时,触发一个事件查询数据库信息,并显示在小图标浮标信息中
代码如下:
procedure Tmainform.WndProc(var Msg:TMessage);
var
pt:TPoint;
I:integer;
begin
if Msg.Msg = WM_TRAYNOTIFY then
begin
// IconID:= Msg.WParam;
GetCursorPos(pt);
case Msg.LParam of
WM_MOUSEMOVE:
begin
//鼠标在图标上移动 StrpCopy(NotifyIcon.szTip, getstr('b')); //pchar(getstr)
Shell_NotifyIcon(NIM_MODIFY, @NotifyIcon);
end;
end;其中getstr('b')是一个 function 函数但是现在运行出来以后,但不运行 发现系统重复运行上面的代码,导致服务器查询oracel数据出错,系统出错。
求高手怎么修改代码,使鼠标移动到图标上的时候只运行一次代码?
小弟不胜感激,另外加分
代码如下:
procedure Tmainform.WndProc(var Msg:TMessage);
var
pt:TPoint;
I:integer;
begin
if Msg.Msg = WM_TRAYNOTIFY then
begin
// IconID:= Msg.WParam;
GetCursorPos(pt);
case Msg.LParam of
WM_MOUSEMOVE:
begin
//鼠标在图标上移动 StrpCopy(NotifyIcon.szTip, getstr('b')); //pchar(getstr)
Shell_NotifyIcon(NIM_MODIFY, @NotifyIcon);
end;
end;其中getstr('b')是一个 function 函数但是现在运行出来以后,但不运行 发现系统重复运行上面的代码,导致服务器查询oracel数据出错,系统出错。
求高手怎么修改代码,使鼠标移动到图标上的时候只运行一次代码?
小弟不胜感激,另外加分
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货