Question

I wrote my own task bar replacement, I am using it for many years happily (sort of) but I have some issues unresolved. Please help! I have "hint" windows appear in my task bar. Those (usually yellow) windows that appear when you hover the mouse over a tab in a browser or a button or a link in some program. Normally those windows should disappear once you move your mouse, and normally they should not be detected as separate windows and should not be displayed in the task bar. Bot for me they are often not closed and stay on teh screen forever, until reboot, or closed partially, the yellow window with a text of a hint disappears but the "shadow" that was surrounding it stays in place (sometimes with a white box

Screenshot of improperly handled ).

Please help to understand how to avoid those windows to be detected as "normal windows" and explain why I have them unclosed.

I looked into ReactOS task bar source code, but for me it looks very similar to my own implementation, I cannot find any serious difference. SO I must be missing something. Here is some code I use:

//making taskbar window
SHELLHOOK = RegisterWindowMessageA("SHELLHOOK");
SetTaskmanWindow(prog->handle);
RegisterShellHookWindow(prog->handle);
prog->setCaption("Shell_TrayWnd");
SendMessage(prog->handle, SHELLHOOK, 0, 0);
SendMessage((void*)0xffff, tray.WM_TASKBARCREATED, 0, 0);


//enumerating windows to put into taskbar
int __stdcall enum_proc(void * H, WindowsList &L)
{
       // try to filter out unnecessary windows
     if (H == mainWindow.handle) return true;
     if (
        GetWindow(H, GW_OWNER)
        || !IsWindowVisible(H)
        || !IsWindow(H)
        || GetParent(H) != 0
     ) return true;
     str s; s.setLength(1024); // try to filter out 'tooltips' by classname or size
     s.setLength(GetClassNameA(H, *s, s.length));
     s.lower();
     if (s.pos("tooltip") >= 0) return true; //did it work? (nope)
     int S = GetWindowLong(H, GWL_STYLE);
     RECT R; GetWindowRect(H, &R); int h = R.bottom - R.top;
     //if (h > 10 && h < 30) return true; // this is not a solution sadly..
     if (S & TTS_NOPREFIX) return true;
     if (S & TTS_ALWAYSTIP) return true;
     L.addWindowHandle(H); 
     return true;
}


void get_sys_window_list(WindowsList &L)
{
   EnumWindows(enum_proc, &L);
}
Était-ce utile?

La solution

I don't know how did you missed it while looking at the source code of ReactOS, but tooltips have the WS_EX_TOOLWINDOW extended style. Windows with this style set should not be displayed on the taskbar.

Relevant line in ReactOS.

As for the issue about:

"shadow" that was surrounding it stays in place

I didn't understand how that's related to the issue. You attached a screenshot of Chrome. Does it mean that somehow your taskbar causes the tooltip's shadow to stay on screen?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top