mirror of
https://github.com/reactos/reactos.git
synced 2024-08-26 05:08:39 +00:00
include explorer windows in desktop switching
svn path=/trunk/; revision=8413
This commit is contained in:
parent
907d42478e
commit
9bcc74655c
|
@ -162,14 +162,9 @@ static BOOL CALLBACK DesktopEnumFct(HWND hwnd, LPARAM lparam)
|
||||||
{
|
{
|
||||||
WindowSet& windows = *(WindowSet*)lparam;
|
WindowSet& windows = *(WindowSet*)lparam;
|
||||||
|
|
||||||
if (IsWindowVisible(hwnd)) {
|
if (IsWindowVisible(hwnd))
|
||||||
DWORD pid;
|
if (hwnd!=g_Globals._hwndDesktopBar && hwnd!=g_Globals._hwndDesktop)
|
||||||
|
|
||||||
GetWindowThreadProcessId(hwnd, &pid);
|
|
||||||
|
|
||||||
if (pid != GetCurrentProcessId())
|
|
||||||
windows.insert(hwnd);
|
windows.insert(hwnd);
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ ExplorerGlobals::ExplorerGlobals()
|
||||||
#endif
|
#endif
|
||||||
_hwndDesktopBar = 0;
|
_hwndDesktopBar = 0;
|
||||||
_hwndShellView = 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
|
// initialize COM and OLE before creating the desktop window
|
||||||
OleInit usingCOM;
|
OleInit usingCOM;
|
||||||
|
|
||||||
HWND hwndDesktop = 0;
|
|
||||||
|
|
||||||
if (startup_desktop) {
|
if (startup_desktop) {
|
||||||
g_Globals._desktops.init();
|
g_Globals._desktops.init();
|
||||||
|
|
||||||
hwndDesktop = DesktopWindow::Create();
|
g_Globals._hwndDesktop = DesktopWindow::Create();
|
||||||
#ifdef _USE_HDESK
|
#ifdef _USE_HDESK
|
||||||
g_Globals._desktops.get_current_Desktop()->_hwndDesktop = hwndDesktop;
|
g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (autostart) {
|
if (autostart) {
|
||||||
|
@ -709,7 +708,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
||||||
lpCmdLine[_tcslen(lpCmdLine)-1] = '\0';
|
lpCmdLine[_tcslen(lpCmdLine)-1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hwndDesktop)
|
if (g_Globals._hwndDesktop)
|
||||||
g_Globals._desktop_mode = true;
|
g_Globals._desktop_mode = true;
|
||||||
|
|
||||||
int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);
|
int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);
|
||||||
|
|
|
@ -196,7 +196,9 @@ struct Desktops : public vector<DesktopRef>
|
||||||
void init();
|
void init();
|
||||||
void SwitchToDesktop(int idx);
|
void SwitchToDesktop(int idx);
|
||||||
|
|
||||||
|
#ifdef _USE_HDESK
|
||||||
DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];}
|
DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];}
|
||||||
|
#endif
|
||||||
|
|
||||||
int _current_desktop;
|
int _current_desktop;
|
||||||
};
|
};
|
||||||
|
@ -227,6 +229,7 @@ extern struct ExplorerGlobals
|
||||||
|
|
||||||
HWND _hwndDesktopBar;
|
HWND _hwndDesktopBar;
|
||||||
HWND _hwndShellView;
|
HWND _hwndShellView;
|
||||||
|
HWND _hwndDesktop;
|
||||||
|
|
||||||
Desktops _desktops;
|
Desktops _desktops;
|
||||||
} g_Globals;
|
} g_Globals;
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ LRESULT FlatButton::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
||||||
|
|
||||||
if (IsWindowEnabled(_hwnd)) {
|
if (IsWindowEnabled(_hwnd)) {
|
||||||
DWORD pid_foreground;
|
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);
|
GetWindowThreadProcessId(hwnd_foreground, &pid_foreground);
|
||||||
|
|
||||||
if (GetCurrentProcessId() == pid_foreground) {
|
if (GetCurrentProcessId() == pid_foreground) {
|
||||||
|
|
Loading…
Reference in a new issue