diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp index 45d1e4ce827..8ee02097f55 100644 --- a/dll/win32/shell32/CDefView.cpp +++ b/dll/win32/shell32/CDefView.cpp @@ -1027,7 +1027,8 @@ HRESULT CDefView::FillList() LRESULT CDefView::OnShowWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) { - m_ListView.UpdateWindow(); + if (m_ListView.IsWindow()) + m_ListView.UpdateWindow(); bHandled = FALSE; return 0; } diff --git a/dll/win32/shell32/changenotify.cpp b/dll/win32/shell32/changenotify.cpp index c35201cce7c..4666771734b 100644 --- a/dll/win32/shell32/changenotify.cpp +++ b/dll/win32/shell32/changenotify.cpp @@ -66,14 +66,9 @@ EXTERN_C void FreeChangeNotifications(void) // The new delivery method is enabled by SHCNRF_NewDelivery flag. // With the new delivery method the server directly sends the delivery message. -typedef CWinTraits < - WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - WS_EX_TOOLWINDOW -> CBrokerTraits; - // This class brokers all notifications that don't have the SHCNRF_NewDelivery flag class CChangeNotifyBroker : - public CWindowImpl + public CWindowImpl { public: CChangeNotifyBroker(HWND hwndClient, UINT uMsg) : @@ -139,13 +134,15 @@ CreateNotificationBroker(HWND hwnd, UINT wMsg) return NULL; } - HWND hwndBroker = pBroker->Create(0); + HWND hwndBroker = SHCreateDefaultWorkerWindow(); if (hwndBroker == NULL) { ERR("hwndBroker == NULL\n"); delete pBroker; + return NULL; } + pBroker->SubclassWindow(hwndBroker); return hwndBroker; } diff --git a/dll/win32/shell32/precomp.h b/dll/win32/shell32/precomp.h index 9b422353e6c..983e619d358 100644 --- a/dll/win32/shell32/precomp.h +++ b/dll/win32/shell32/precomp.h @@ -1,6 +1,10 @@ #ifndef _PRECOMP_H__ #define _PRECOMP_H__ +#if DBG && !defined(_DEBUG) + #define _DEBUG // CORE-17505 +#endif + #include #include diff --git a/dll/win32/shell32/shelldesktop/CChangeNotifyServer.cpp b/dll/win32/shell32/shelldesktop/CChangeNotifyServer.cpp index c0835faa919..55918cad656 100644 --- a/dll/win32/shell32/shelldesktop/CChangeNotifyServer.cpp +++ b/dll/win32/shell32/shelldesktop/CChangeNotifyServer.cpp @@ -23,11 +23,6 @@ struct ITEM CDirectoryWatcher *pDirWatch; // for filesystem notification }; -typedef CWinTraits < - WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - WS_EX_TOOLWINDOW -> CChangeNotifyServerTraits; - ////////////////////////////////////////////////////////////////////////////// // CChangeNotifyServer // @@ -37,7 +32,7 @@ typedef CWinTraits < // to this window where all processing takes place. class CChangeNotifyServer : - public CWindowImpl, + public CWindowImpl, public CComObjectRootEx, public IOleWindow { @@ -470,10 +465,10 @@ HRESULT WINAPI CChangeNotifyServer::ContextSensitiveHelp(BOOL fEnterMode) HRESULT CChangeNotifyServer::Initialize() { // This is called by CChangeNotifyServer_CreateInstance right after instantiation. - // Create the window of the server here. - Create(0); - if (!m_hWnd) + HWND hwnd = SHCreateDefaultWorkerWindow(); + if (!hwnd) return E_FAIL; + SubclassWindow(hwnd); return S_OK; } diff --git a/dll/win32/shell32/shelldesktop/CChangeNotifyServer.h b/dll/win32/shell32/shelldesktop/CChangeNotifyServer.h index 4c5dc9083de..3f6e5174fce 100644 --- a/dll/win32/shell32/shelldesktop/CChangeNotifyServer.h +++ b/dll/win32/shell32/shelldesktop/CChangeNotifyServer.h @@ -6,6 +6,8 @@ */ #pragma once +#include // for SHCreateWorkerWindowW + ///////////////////////////////////////////////////////////////////////////// // CChangeNotifyServer is a delivery worker window that is managed by CDesktopBrowser. // The process of CChangeNotifyServer is same as the process of CDesktopBrowser. @@ -89,3 +91,13 @@ typedef struct HANDBAG #define HANDBAG_MAGIC 0xFACEB00C HRESULT CChangeNotifyServer_CreateInstance(REFIID riid, void **ppv); + +#define WORKER_STYLE (WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN) +#define WORKER_EXSTYLE WS_EX_TOOLWINDOW + +typedef CWinTraits CWorkerTraits; + +inline HWND SHCreateDefaultWorkerWindow(VOID) +{ + return SHCreateWorkerWindowW(NULL, NULL, WORKER_EXSTYLE, WORKER_STYLE, NULL, 0); +}