include explorer windows in desktop switching
authorMartin Fuchs <fuchs.martin@gmail.com>
Thu, 26 Feb 2004 21:20:51 +0000 (21:20 +0000)
committerMartin Fuchs <fuchs.martin@gmail.com>
Thu, 26 Feb 2004 21:20:51 +0000 (21:20 +0000)
svn path=/branches/lean-explorer/; revision=8414

reactos/subsys/system/explorer/desktop/desktop.cpp
reactos/subsys/system/explorer/explorer.cpp
reactos/subsys/system/explorer/globals.h
reactos/subsys/system/explorer/utility/window.cpp

index a59d357..451ddab 100644 (file)
@@ -65,14 +65,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;
 }
index eb2602c..7260fff 100644 (file)
@@ -58,6 +58,7 @@ ExplorerGlobals::ExplorerGlobals()
 #endif
        _hwndDesktopBar = 0;
        _hwndShellView = 0;
+       _hwndDesktop = 0;
 }
 
 
@@ -639,12 +640,10 @@ 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();
 
                if (autostart) {
                        char* argv[] = {"", "s"};       // call startup routine in SESSION_START mode
@@ -658,7 +657,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);
index 38c0073..0c268e9 100644 (file)
@@ -161,8 +161,6 @@ struct Desktops : public vector<DesktopRef>
        void    init();
        void    SwitchToDesktop(int idx);
 
-       DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];}
-
        int             _current_desktop;
 };
 
@@ -192,6 +190,7 @@ extern struct ExplorerGlobals
 
        HWND            _hwndDesktopBar;
        HWND            _hwndShellView;
+       HWND            _hwndDesktop;
 
        Desktops        _desktops;
 } g_Globals;
index 1707ce4..e447b02 100644 (file)
@@ -836,7 +836,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) {