diff --git a/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp b/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp index 02e8717eccb..cf8934cd833 100644 --- a/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp +++ b/dll/win32/shell32/shellmenu/CMenuDeskBar.cpp @@ -645,7 +645,8 @@ HRESULT CMenuDeskBar::_CloseBar() if (FAILED_UNEXPECTEDLY(hr)) return hr; - SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE); + if (m_hWnd) + SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE); return UIActivateIO(FALSE, NULL); }