Index: base/shell/explorer-new/precomp.h =================================================================== --- base/shell/explorer-new/precomp.h (revision 58156) +++ base/shell/explorer-new/precomp.h (working copy) @@ -168,6 +168,8 @@ * traywnd.c */ +HWND hTaskBarProp; + typedef HMENU (*PCREATECTXMENU)(IN HWND hWndOwner, IN PVOID *ppcmContext, IN PVOID Context OPTIONAL); Index: base/shell/explorer-new/trayprop.c =================================================================== --- base/shell/explorer-new/trayprop.c (revision 58156) +++ base/shell/explorer-new/trayprop.c (working copy) @@ -368,6 +368,7 @@ PROPSHEETHEADER psh; PROPSHEETPAGE psp[5]; TCHAR szCaption[256]; + HWND hStaticWnd; pPropInfo = HeapAlloc(hProcessHeap, HEAP_ZERO_MEMORY, @@ -389,10 +390,23 @@ return NULL; } + hStaticWnd = CreateWindowEx(0, + WC_STATIC, + NULL, + WS_OVERLAPPED | WS_DISABLED | WS_CLIPSIBLINGS | WS_BORDER | SS_LEFT, + CW_USEDEFAULT, + 0, + CW_USEDEFAULT, + 0, + NULL, + NULL, + NULL, + NULL); + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; - psh.hwndParent = NULL; + psh.hwndParent = hStaticWnd; psh.hInstance = hExplorerInstance; psh.hIcon = NULL; psh.pszCaption = szCaption; @@ -406,8 +420,14 @@ InitPropSheetPage(&psp[3], IDD_TASKBARPROP_TOOLBARS, ToolbarsPageProc, (LPARAM)pPropInfo); InitPropSheetPage(&psp[4], IDD_TASKBARPROP_ADVANCED, AdvancedSettingsPageProc, (LPARAM)pPropInfo); + hTaskBarProp = hStaticWnd; //hTaskBarProp is global + PropertySheet(&psh); + /* By now TaskBar Properties window is closed! */ + DestroyWindow(hStaticWnd); + hTaskBarProp = NULL; + HeapFree(hProcessHeap, 0, pPropInfo); Index: base/shell/explorer-new/traywnd.c =================================================================== --- base/shell/explorer-new/traywnd.c (revision 58156) +++ base/shell/explorer-new/traywnd.c (working copy) @@ -1754,13 +1754,19 @@ { ITrayWindowImpl *This = impl_from_ITrayWindow(iface); - if (This->hWndTrayProperties != NULL) + if (hTaskBarProp != NULL) { - BringWindowToTop(This->hWndTrayProperties); - return This->hWndTrayProperties; + SetForegroundWindow(GetNextWindow(hTaskBarProp, GW_HWNDPREV)); + return GetNextWindow(hTaskBarProp, GW_HWNDPREV); } - This->hWndTrayProperties = DisplayTrayProperties(ITrayWindow_from_impl(This)); + DisplayTrayProperties(ITrayWindow_from_impl(This)); + /* + We reach 'return' statment when TaskBar Properties window + is closed and global variable hTaskBarProp is NULLed. + So, here in ITrayWindowImpl_DisplayProperties we return 0 + as This->hWndTrayProperties. + */ return This->hWndTrayProperties; }