One more problem comes to light. If some application has system-tray-icon but for some time no clicking it by user, Windows hides this icon. Then when I'm trying to clean system tray, my project cleans only visible area of system tray. So hidden icon sleel present and confuse my project.
It's appears such arrow-button:
http://img443.imageshack.us/img443/2699/9kma.pngSo to completely cleaning I must to click it and run cursor over the area. But it is very hard to do it by messages.
Can anybody help me? (;_;)
I have tryed to find NotifyIconOhidverflowWindow - window, but in Windows XP there is no such window.
Well, such code as follow works:
Code: [Select]
function FindTrayToolbar: HWND;
var arrow_btn: HWND;
begin
Result := FindWindow('Shell_TrayWND', nil);
Result := FindWindowEx(Result, 0, 'TrayNotifyWnd', nil);
arrow_btn := FindWindowEx(Result, 0, 'Button', nil);
if arrow_btn <> 0 then begin
SendMessage(arrow_btn, WM_LBUTTONDOWN, 0, 0);
SendMessage(arrow_btn, WM_LBUTTONUP, 0, 0);
end;
Result := FindWindowEx(Result, 0, 'SysPager', nil);
Result := FindWindowEx(Result, 0, 'ToolbarWindow32', nil);
end;
But I am not sure.