文件名称:Delphi 移除无效的托盘图标.rar
文件大小:8KB
文件格式:RAR
更新时间:2022-07-30 12:44:04
Delphi源码-系统相关
Delphi refreshtray移除无效的Windows系统托盘图标,非鼠标移动模拟方法,相关的代码: begin hStatus := FindWindow('Shell_TrayWnd',nil); //得到任务栏句柄 if not iswindow(hStatus) then exit; hNotify := FindWindowEx(hStatus,0,'TrayNotifyWnd',nil); //右下角区域 if not iswindow(hNotify) then exit; hNotify1 := FindWindowEx(hNotify,0,'SysPager',nil); if not iswindow(hNotify1) then exit; hNotify1_0 := FindWindowEx(hNotify1,0,'ToolBarWindow32',nil);//右下角区域(不包括时间) if not iswindow(hNotify1_0) then exit; //以上是得到任务栏右下脚一块地方的句柄 GetWindowThreadProcessId(hNotify1_0,pid); if (pid = 0) then exit; hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_ALL_ACCESS,true,pid); if (hProcess = 0) then exit; SendMessage(hNotify1_0,WM_PAINT ,0,0); GetWindowRect(hNotify1_0,rect); InvalidateRect(hNotify1_0,@rect,false); iNum := SendMessage(hNotify1_0,TB_BUTTONCOUNT ,0,0); //获取任务栏上图标个数
【文件预览】:
srcfans.com
----Delphi refreshtrayarea()
--------Unit1.ddp(51B)
--------Project1.res(2KB)
--------Unit1.dcu(6KB)
--------Unit1.dfm(508B)
--------Project1.cfg(459B)
--------Project1.dpr(188B)
--------Project1.dof(3KB)
--------Unit1.pas(3KB)