6 * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 * Menu item handlers for the options menu.
29 #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
40 void TaskManager_OnOptionsAlwaysOnTop(void)
45 hMenu = GetMenu(hMainWnd);
46 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
49 * Check or uncheck the always on top menu item
50 * and update main window.
52 if ((GetWindowLong(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
54 CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
55 TaskManagerSettings.AlwaysOnTop = FALSE;
56 SetWindowPos(hMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
60 CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_CHECKED);
61 TaskManagerSettings.AlwaysOnTop = TRUE;
62 SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
66 void TaskManager_OnOptionsMinimizeOnUse(void)
71 hMenu = GetMenu(hMainWnd);
72 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
75 * Check or uncheck the minimize on use menu item.
77 if (GetMenuState(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND) & MF_CHECKED)
79 CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_UNCHECKED);
80 TaskManagerSettings.MinimizeOnUse = FALSE;
84 CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED);
85 TaskManagerSettings.MinimizeOnUse = TRUE;
89 void TaskManager_OnOptionsHideWhenMinimized(void)
94 hMenu = GetMenu(hMainWnd);
95 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
98 * Check or uncheck the hide when minimized menu item.
100 if (GetMenuState(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND) & MF_CHECKED)
102 CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_UNCHECKED);
103 TaskManagerSettings.HideWhenMinimized = FALSE;
107 CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED);
108 TaskManagerSettings.HideWhenMinimized = TRUE;
112 void TaskManager_OnOptionsShow16BitTasks(void)
117 hMenu = GetMenu(hMainWnd);
118 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
121 * FIXME: Currently this is useless because the
122 * current implementation doesn't list the 16-bit
123 * processes. I believe that would require querying
124 * each ntvdm.exe process for it's children.
128 * Check or uncheck the show 16-bit tasks menu item
130 if (GetMenuState(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND) & MF_CHECKED)
132 CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_UNCHECKED);
133 TaskManagerSettings.Show16BitTasks = FALSE;
137 CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
138 TaskManagerSettings.Show16BitTasks = TRUE;
142 * Refresh the list of processes.
144 RefreshProcessPage();