mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 07:42:59 +00:00
[EXPLORER]
Remove notification icons when their attached HWND is no longer valid. Patch by Joachim Henze (reactosfanboy), with some extra newlines by me. CORE-9537 #resolve svn path=/trunk/; revision=67583
This commit is contained in:
parent
9e03420395
commit
f6f2e8dbac
1 changed files with 20 additions and 0 deletions
|
@ -256,7 +256,27 @@ private:
|
||||||
NOTIFYICONDATA * notifyItem = GetItemData(wIndex);
|
NOTIFYICONDATA * notifyItem = GetItemData(wIndex);
|
||||||
|
|
||||||
if (!::IsWindow(notifyItem->hWnd))
|
if (!::IsWindow(notifyItem->hWnd))
|
||||||
|
{
|
||||||
|
// We detect and destroy icons with invalid handles only on mouse move over systray, same as MS does.
|
||||||
|
// Alternatively we could search for them periodically (would waste more resources).
|
||||||
|
TRACE("destroying icon with invalid handle\n");
|
||||||
|
|
||||||
|
HWND parentHWND = GetParent();
|
||||||
|
parentHWND = ::GetParent(parentHWND);
|
||||||
|
|
||||||
|
RECT windowRect;
|
||||||
|
::GetClientRect(parentHWND, &windowRect);
|
||||||
|
|
||||||
|
RemoveButton(notifyItem);
|
||||||
|
|
||||||
|
SendMessage(parentHWND,
|
||||||
|
WM_SIZE,
|
||||||
|
0,
|
||||||
|
MAKELONG(windowRect.right - windowRect.left,
|
||||||
|
windowRect.bottom - windowRect.top));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
|
if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue