diff --git a/reactos/subsys/system/explorer/desktop/desktop.cpp b/reactos/subsys/system/explorer/desktop/desktop.cpp index 3b37236fae8..a307c3bd6ab 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.cpp +++ b/reactos/subsys/system/explorer/desktop/desktop.cpp @@ -162,14 +162,9 @@ static BOOL CALLBACK DesktopEnumFct(HWND hwnd, LPARAM lparam) { WindowSet& windows = *(WindowSet*)lparam; - if (IsWindowVisible(hwnd)) { - DWORD pid; - - GetWindowThreadProcessId(hwnd, &pid); - - if (pid != GetCurrentProcessId()) + if (IsWindowVisible(hwnd)) + if (hwnd!=g_Globals._hwndDesktopBar && hwnd!=g_Globals._hwndDesktop) windows.insert(hwnd); - } return TRUE; } diff --git a/reactos/subsys/system/explorer/explorer.cpp b/reactos/subsys/system/explorer/explorer.cpp index a39a2e8482b..de8c4e1257c 100644 --- a/reactos/subsys/system/explorer/explorer.cpp +++ b/reactos/subsys/system/explorer/explorer.cpp @@ -66,6 +66,7 @@ ExplorerGlobals::ExplorerGlobals() #endif _hwndDesktopBar = 0; _hwndShellView = 0; + _hwndDesktop = 0; } @@ -687,14 +688,12 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL // initialize COM and OLE before creating the desktop window OleInit usingCOM; - HWND hwndDesktop = 0; - if (startup_desktop) { g_Globals._desktops.init(); - hwndDesktop = DesktopWindow::Create(); + g_Globals._hwndDesktop = DesktopWindow::Create(); #ifdef _USE_HDESK - g_Globals._desktops.get_current_Desktop()->_hwndDesktop = hwndDesktop; + g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop; #endif if (autostart) { @@ -709,7 +708,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL lpCmdLine[_tcslen(lpCmdLine)-1] = '\0'; } - if (hwndDesktop) + if (g_Globals._hwndDesktop) g_Globals._desktop_mode = true; int ret = explorer_main(hInstance, lpCmdLine, nShowCmd); diff --git a/reactos/subsys/system/explorer/globals.h b/reactos/subsys/system/explorer/globals.h index d5339cc39f4..aff1290747b 100644 --- a/reactos/subsys/system/explorer/globals.h +++ b/reactos/subsys/system/explorer/globals.h @@ -196,7 +196,9 @@ struct Desktops : public vector void init(); void SwitchToDesktop(int idx); +#ifdef _USE_HDESK DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];} +#endif int _current_desktop; }; @@ -227,6 +229,7 @@ extern struct ExplorerGlobals HWND _hwndDesktopBar; HWND _hwndShellView; + HWND _hwndDesktop; Desktops _desktops; } g_Globals; diff --git a/reactos/subsys/system/explorer/utility/window.cpp b/reactos/subsys/system/explorer/utility/window.cpp index 1a3d6d1bfad..793414709a6 100644 --- a/reactos/subsys/system/explorer/utility/window.cpp +++ b/reactos/subsys/system/explorer/utility/window.cpp @@ -1057,7 +1057,7 @@ LRESULT FlatButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) if (IsWindowEnabled(_hwnd)) { DWORD pid_foreground; - HWND hwnd_foreground = GetForegroundWindow(); //@@ vielleicht besser über WM_ACTIVATEAPP-Abfrage + HWND hwnd_foreground = GetForegroundWindow(); //@@ may be better look for WM_ACTIVATEAPP ? GetWindowThreadProcessId(hwnd_foreground, &pid_foreground); if (GetCurrentProcessId() == pid_foreground) {