From e24c42bb6b8069473b59c3d452d75b3b09e27b65 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sat, 19 Mar 2005 09:37:46 +0000 Subject: [PATCH] - unregister task manager window at termination svn path=/trunk/; revision=14190 --- reactos/subsys/system/explorer/Makefile | 4 +- reactos/subsys/system/explorer/doc/TODO.txt | 6 +++ reactos/subsys/system/explorer/explorer.cpp | 8 ++++ .../system/explorer/taskbar/taskbar.cpp | 40 +++++++------------ 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/reactos/subsys/system/explorer/Makefile b/reactos/subsys/system/explorer/Makefile index b0d40a24e3d..f2206470cf6 100644 --- a/reactos/subsys/system/explorer/Makefile +++ b/reactos/subsys/system/explorer/Makefile @@ -25,8 +25,8 @@ TARGET_CPPFLAGS := $(TARGET_CFLAGS) TARGET_RCFLAGS := -D__USE_W32API -DWIN32 -D_ROS_ -D__WINDRES__ TARGET_SDKLIBS := \ - gdi32.a comctl32.a ole32.a oleaut32.a shell32.a expat.a \ - notifyhook.a ws2_32.a msimg32.a user32.a + gdi32.a user32.a comctl32.a ole32.a oleaut32.a shell32.a expat.a \ + notifyhook.a ws2_32.a msimg32.a TARGET_GCCLIBS := stdc++ uuid diff --git a/reactos/subsys/system/explorer/doc/TODO.txt b/reactos/subsys/system/explorer/doc/TODO.txt index 06d29af573c..572ce5c0cfb 100644 --- a/reactos/subsys/system/explorer/doc/TODO.txt +++ b/reactos/subsys/system/explorer/doc/TODO.txt @@ -28,3 +28,9 @@ - Search Programs -> performance monitor.msv -> Abort + + Martin, I would have a whish concerning explorer: I often want to start a program and give it some parameters. So nice featue: "Start with param..." + Nonvo: shell extension + tinus: we should think about installing some default shell extensions + m-fuchs: perhaps, but it'd be nice if they actually were shell extensions + diff --git a/reactos/subsys/system/explorer/explorer.cpp b/reactos/subsys/system/explorer/explorer.cpp index 90e91efff22..05a9b6cd493 100644 --- a/reactos/subsys/system/explorer/explorer.cpp +++ b/reactos/subsys/system/explorer/explorer.cpp @@ -729,6 +729,14 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)path, l*sizeof(TCHAR)); RegCloseKey(hkey); } + + if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) { + + ///@todo save previous shell application in config file + + RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)TEXT(""), l*sizeof(TCHAR)); + RegCloseKey(hkey); + } } HWND shellWindow = GetShellWindow(); diff --git a/reactos/subsys/system/explorer/taskbar/taskbar.cpp b/reactos/subsys/system/explorer/taskbar/taskbar.cpp index 50df13d31a5..aa3b5224697 100644 --- a/reactos/subsys/system/explorer/taskbar/taskbar.cpp +++ b/reactos/subsys/system/explorer/taskbar/taskbar.cpp @@ -32,6 +32,11 @@ #include "traynotify.h" // for NOTIFYAREA_WIDTH_DEF +DynamicFct g_SetTaskmanWindow(TEXT("user32"), "SetTaskmanWindow"); +DynamicFct g_RegisterShellHookWindow(TEXT("user32"), "RegisterShellHookWindow"); +DynamicFct g_DeregisterShellHookWindow(TEXT("user32"), "DeregisterShellHookWindow"); + + TaskBarEntry::TaskBarEntry() { _id = 0; @@ -61,12 +66,13 @@ TaskBar::TaskBar(HWND hwnd) TaskBar::~TaskBar() { - DynamicFct DeregisterShellHookWindow(TEXT("user32"), "DeregisterShellHookWindow"); - - if (DeregisterShellHookWindow) - (*DeregisterShellHookWindow)(_hwnd); + if (g_DeregisterShellHookWindow) + (*g_DeregisterShellHookWindow)(_hwnd); else KillTimer(_hwnd, 0); + + if (g_SetTaskmanWindow) + (*g_SetTaskmanWindow)(0); } HWND TaskBar::Create(HWND hwndParent) @@ -100,15 +106,13 @@ LRESULT TaskBar::Init(LPCREATESTRUCT pcs) _next_id = IDC_FIRST_APP; // register ourselved as task manager window to make the following call to RegisterShellHookWindow working - DynamicFct SetTaskmanWindow(TEXT("user32"), "SetTaskmanWindow"); - if (SetTaskmanWindow) - (*SetTaskmanWindow)(_hwnd); + if (g_SetTaskmanWindow) + (*g_SetTaskmanWindow)(_hwnd); - DynamicFct RegisterShellHookWindow(TEXT("user32"), "RegisterShellHookWindow"); - if (RegisterShellHookWindow) { + if (g_RegisterShellHookWindow) { LOG(TEXT("Using shell hooks for notification of shell events.")); - (*RegisterShellHookWindow)(_hwnd); + (*g_RegisterShellHookWindow)(_hwnd); } else { LOG(TEXT("Shell hooks not available.")); SetTimer(_hwnd, 0, 200, NULL); @@ -139,23 +143,7 @@ LRESULT TaskBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) break; // avoid displaying context menu for application button _and_ desktop bar at the same time goto def;} -/* -//#define PM_SHELLHOOK_NOTIFY (WM_APP+0x10) - case PM_SHELLHOOK_NOTIFY: { - int code = lparam; - - switch(code) { - case HSHELL_WINDOWCREATED: - case HSHELL_WINDOWDESTROYED: - case HSHELL_WINDOWACTIVATED: - case HSHELL_WINDOWREPLACED: - Refresh(); - break; - } - Refresh(); - break;} -*/ case PM_GET_LAST_ACTIVE: return (LRESULT)(HWND)_last_foreground_wnd;