[EXPLORER_NEW]

- Hide minimized window captions (and enable shell notifications, thus fixing taskbar buttons). This should have been in r57978, but got lost.
- From Andrew Green's GSoC branch. Spotted by Edijus.
CORE-6899 #resolve

svn path=/trunk/; revision=58186
This commit is contained in:
Thomas Faber 2013-01-17 11:02:30 +00:00
parent a5192cf84c
commit b8577036db

View file

@ -348,6 +348,25 @@ GetVersionInfoString(IN TCHAR *szFileName,
return bRet;
}
static VOID
HideMinimizedWindows(IN BOOL bHide)
{
MINIMIZEDMETRICS mm;
mm.cbSize = sizeof(mm);
if (!SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0))
{
DbgPrint("SystemParametersInfo failed with %lu\n", GetLastError());
return;
}
if (bHide)
mm.iArrange |= ARW_HIDE;
else
mm.iArrange &= ~ARW_HIDE;
if (!SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0))
DbgPrint("SystemParametersInfo failed with %lu\n", GetLastError());
}
INT WINAPI
_tWinMain(IN HINSTANCE hInstance,
IN HINSTANCE hPrevInstance,
@ -392,6 +411,11 @@ _tWinMain(IN HINSTANCE hInstance,
if (RegisterTrayWindowClass() && RegisterTaskSwitchWndClass())
{
Tray = CreateTrayWindow();
/* This not only hides the minimized window captions in the bottom
left screen corner, but is also needed in order to receive
HSHELL_* notification messages (which are required for taskbar
buttons to work right) */
HideMinimizedWindows(TRUE);
if (Tray != NULL)
hShellDesktop = DesktopCreateWindow(Tray);
@ -415,6 +439,7 @@ _tWinMain(IN HINSTANCE hInstance,
{
RegisterHotKey(NULL, IDHK_RUN, MOD_WIN, 'R');
TrayMessageLoop(Tray);
HideMinimizedWindows(FALSE);
ITrayWindow_Release(Tray);
UnregisterTrayWindowClass();
}