8 modified files
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- En.rc 25 Jul 2004 16:02:48 -0000 1.1
+++ En.rc 30 Jul 2004 13:39:56 -0000 1.2
@@ -117,10 +117,13 @@
IDR_TRAY_POPUP MENU DISCARDABLE
BEGIN
- MENUITEM "&Restore", ID_RESTORE
- MENUITEM "&Close", ID_FILE_EXIT
- MENUITEM SEPARATOR
- MENUITEM "&Always On Top", ID_OPTIONS_ALWAYSONTOP, CHECKED
+ POPUP "DUMMY"
+ BEGIN
+ MENUITEM "&Restore", ID_RESTORE
+ MENUITEM "&Close", ID_FILE_EXIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Always On Top", ID_OPTIONS_ALWAYSONTOP
+ END
END
IDR_PROCESS_PAGE_CONTEXT MENU DISCARDABLE
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- Es.rc 25 Jul 2004 16:02:48 -0000 1.1
+++ Es.rc 30 Jul 2004 13:39:56 -0000 1.2
@@ -133,11 +133,13 @@
IDR_TRAY_POPUP MENU DISCARDABLE
BEGIN
- MENUITEM "&Restaurar", ID_RESTORE
- MENUITEM "&Cerrar", ID_FILE_EXIT
- MENUITEM SEPARATOR
- MENUITEM "&Siempre Visible", ID_OPTIONS_ALWAYSONTOP,
-CHECKED
+ POPUP "DUMMY"
+ BEGIN
+ MENUITEM "&Restaurar", ID_RESTORE
+ MENUITEM "&Cerrar", ID_FILE_EXIT
+ MENUITEM SEPARATOR
+ MENUITEM "&Siempre Visible", ID_OPTIONS_ALWAYSONTOP
+ END
END
IDR_PROCESS_PAGE_CONTEXT MENU DISCARDABLE
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- optnmenu.c 10 Jan 2004 02:14:13 -0000 1.1
+++ optnmenu.c 30 Jul 2004 13:39:56 -0000 1.2
@@ -39,8 +39,6 @@
#include "optnmenu.h"
#include "procpage.h"
-#define OPTIONS_MENU_INDEX 1
-
void TaskManager_OnOptionsAlwaysOnTop(void)
{
HMENU hMenu;
@@ -53,7 +51,7 @@
* Check or uncheck the always on top menu item
* and update main window.
*/
- if (GetMenuState(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND) & MF_CHECKED)
+ if ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
{
CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
TaskManagerSettings.AlwaysOnTop = FALSE;
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- optnmenu.h 10 Jan 2004 02:14:13 -0000 1.1
+++ optnmenu.h 30 Jul 2004 13:39:56 -0000 1.2
@@ -27,6 +27,8 @@
#ifndef __OPTNMENU_H
#define __OPTNMENU_H
+#define OPTIONS_MENU_INDEX 1
+
void TaskManager_OnOptionsAlwaysOnTop(void);
void TaskManager_OnOptionsMinimizeOnUse(void);
void TaskManager_OnOptionsHideWhenMinimized(void);
reactos/subsys/system/taskmgr
diff -u -r1.2 -r1.3
--- taskmgr.c 10 Feb 2004 00:36:46 -0000 1.2
+++ taskmgr.c 30 Jul 2004 13:39:56 -0000 1.3
@@ -84,7 +84,7 @@
SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS);
CloseHandle(hProcess);
- /* Now lets get the SE_DEBUG_NAME priviledge
+ /* Now lets get the SE_DEBUG_NAME privilege
* so that we can debug processes
*/
@@ -155,6 +155,9 @@
case ID_OPTIONS_SHOW16BITTASKS:
TaskManager_OnOptionsShow16BitTasks();
break;
+ case ID_RESTORE:
+ TaskManager_OnRestoreMainWindow();
+ break;
case ID_VIEW_LARGE:
ApplicationPage_OnViewLargeIcons();
break;
@@ -260,6 +263,48 @@
}
break;
+ case WM_ONTRAYICON:
+ switch(lParam)
+ {
+ case WM_RBUTTONDOWN:
+ {
+ POINT pt;
+ BOOL OnTop;
+ HMENU hMenu, hPopupMenu;
+
+ GetCursorPos(&pt);
+
+ OnTop = ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
+
+ hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_TRAY_POPUP));
+ hPopupMenu = GetSubMenu(hMenu, 0);
+
+ if(IsWindowVisible(hMainWnd))
+ {
+ DeleteMenu(hPopupMenu, ID_RESTORE, MF_BYCOMMAND);
+ }
+ else
+ {
+ SetMenuDefaultItem(hPopupMenu, ID_RESTORE, FALSE);
+ }
+
+ if(OnTop)
+ {
+ CheckMenuItem(hPopupMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND | MF_CHECKED);
+ }
+
+ SetForegroundWindow(hMainWnd);
+ TrackPopupMenuEx(hPopupMenu, 0, pt.x, pt.y, hMainWnd, NULL);
+
+ DestroyMenu(hMenu);
+ break;
+ }
+ case WM_LBUTTONDBLCLK:
+ TaskManager_OnRestoreMainWindow();
+ break;
+ }
+ break;
+
case WM_NOTIFY:
idctrl = (int)wParam;
pnmh = (LPNMHDR)lParam;
@@ -606,7 +651,13 @@
RECT rc;
if (nType == SIZE_MINIMIZED)
+ {
+ if(TaskManagerSettings.HideWhenMinimized)
+ {
+ ShowWindow(hMainWnd, SW_HIDE);
+ }
return;
+ }
nXDifference = cx - nOldWidth;
nYDifference = cy - nOldHeight;
@@ -777,6 +828,20 @@
RegCloseKey(hKey);
}
+void TaskManager_OnRestoreMainWindow(void)
+{
+ HMENU hMenu, hOptionsMenu;
+ BOOL OnTop;
+
+ hMenu = GetMenu(hMainWnd);
+ hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
+ OnTop = ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0);
+
+ OpenIcon(hMainWnd);
+ SetForegroundWindow(hMainWnd);
+ SetWindowPos(hMainWnd, (OnTop ? HWND_TOPMOST : HWND_TOP), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
+}
+
void TaskManager_OnEnterMenuLoop(HWND hWnd)
{
int nParts;
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- taskmgr.h 10 Jan 2004 02:14:13 -0000 1.1
+++ taskmgr.h 30 Jul 2004 13:39:56 -0000 1.2
@@ -135,6 +135,7 @@
void Draw3dRect2(HDC hDC, LPRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight);
void LoadSettings(void);
void SaveSettings(void);
+void TaskManager_OnRestoreMainWindow(void);
void TaskManager_OnEnterMenuLoop(HWND hWnd);
void TaskManager_OnExitMenuLoop(HWND hWnd);
void TaskManager_OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu);
reactos/subsys/system/taskmgr
diff -u -r1.2 -r1.3
--- trayicon.c 10 Feb 2004 00:36:46 -0000 1.2
+++ trayicon.c 30 Jul 2004 13:39:56 -0000 1.3
@@ -156,7 +156,7 @@
nid.hWnd = hMainWnd;
nid.uID = 0;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
- /* nid.uCallbackMessage = ??; */
+ nid.uCallbackMessage = WM_ONTRAYICON;
nid.hIcon = hIcon;
wsprintf(nid.szTip, _T("CPU Usage: %d%%"), PerfDataGetProcessorUsage());
@@ -179,7 +179,7 @@
nid.hWnd = hMainWnd;
nid.uID = 0;
nid.uFlags = 0;
- /* nid.uCallbackMessage = ??; */
+ nid.uCallbackMessage = WM_ONTRAYICON;
bRetVal = Shell_NotifyIcon(NIM_DELETE, &nid);
@@ -200,7 +200,7 @@
nid.hWnd = hMainWnd;
nid.uID = 0;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
- /* nid.uCallbackMessage = ??; */
+ nid.uCallbackMessage = WM_ONTRAYICON;
nid.hIcon = hIcon;
wsprintf(nid.szTip, _T("CPU Usage: %d%%"), PerfDataGetProcessorUsage());
reactos/subsys/system/taskmgr
diff -u -r1.1 -r1.2
--- trayicon.h 10 Jan 2004 02:14:13 -0000 1.1
+++ trayicon.h 30 Jul 2004 13:39:56 -0000 1.2
@@ -23,6 +23,8 @@
#ifndef __TRAYICON_H
#define __TRAYICON_H
+#define WM_ONTRAYICON WM_USER + 5
+
HICON TrayIcon_GetProcessorUsageIcon(void);
BOOL TrayIcon_ShellAddTrayIcon(void);
BOOL TrayIcon_ShellRemoveTrayIcon(void);
CVSspam 0.2.8