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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * Menu item handlers for the options menu.
29 #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
40 #define OPTIONS_MENU_INDEX 1
42 void TaskManager_OnOptionsAlwaysOnTop(void)
47 hMenu
= GetMenu(hMainWnd
);
48 hOptionsMenu
= GetSubMenu(hMenu
, OPTIONS_MENU_INDEX
);
51 * Check or uncheck the always on top menu item
52 * and update main window.
54 if (GetMenuState(hOptionsMenu
, ID_OPTIONS_ALWAYSONTOP
, MF_BYCOMMAND
) & MF_CHECKED
)
56 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_ALWAYSONTOP
, MF_BYCOMMAND
|MF_UNCHECKED
);
57 TaskManagerSettings
.AlwaysOnTop
= FALSE
;
58 SetWindowPos(hMainWnd
, HWND_NOTOPMOST
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
62 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_ALWAYSONTOP
, MF_BYCOMMAND
|MF_CHECKED
);
63 TaskManagerSettings
.AlwaysOnTop
= TRUE
;
64 SetWindowPos(hMainWnd
, HWND_TOPMOST
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
68 void TaskManager_OnOptionsMinimizeOnUse(void)
73 hMenu
= GetMenu(hMainWnd
);
74 hOptionsMenu
= GetSubMenu(hMenu
, OPTIONS_MENU_INDEX
);
77 * Check or uncheck the minimize on use menu item.
79 if (GetMenuState(hOptionsMenu
, ID_OPTIONS_MINIMIZEONUSE
, MF_BYCOMMAND
) & MF_CHECKED
)
81 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_MINIMIZEONUSE
, MF_BYCOMMAND
|MF_UNCHECKED
);
82 TaskManagerSettings
.MinimizeOnUse
= FALSE
;
86 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_MINIMIZEONUSE
, MF_BYCOMMAND
|MF_CHECKED
);
87 TaskManagerSettings
.MinimizeOnUse
= TRUE
;
91 void TaskManager_OnOptionsHideWhenMinimized(void)
96 hMenu
= GetMenu(hMainWnd
);
97 hOptionsMenu
= GetSubMenu(hMenu
, OPTIONS_MENU_INDEX
);
100 * Check or uncheck the hide when minimized menu item.
102 if (GetMenuState(hOptionsMenu
, ID_OPTIONS_HIDEWHENMINIMIZED
, MF_BYCOMMAND
) & MF_CHECKED
)
104 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_HIDEWHENMINIMIZED
, MF_BYCOMMAND
|MF_UNCHECKED
);
105 TaskManagerSettings
.HideWhenMinimized
= FALSE
;
109 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_HIDEWHENMINIMIZED
, MF_BYCOMMAND
|MF_CHECKED
);
110 TaskManagerSettings
.HideWhenMinimized
= TRUE
;
114 void TaskManager_OnOptionsShow16BitTasks(void)
119 hMenu
= GetMenu(hMainWnd
);
120 hOptionsMenu
= GetSubMenu(hMenu
, OPTIONS_MENU_INDEX
);
123 * FIXME: Currently this is useless because the
124 * current implementation doesn't list the 16-bit
125 * processes. I believe that would require querying
126 * each ntvdm.exe process for it's children.
130 * Check or uncheck the show 16-bit tasks menu item
132 if (GetMenuState(hOptionsMenu
, ID_OPTIONS_SHOW16BITTASKS
, MF_BYCOMMAND
) & MF_CHECKED
)
134 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_SHOW16BITTASKS
, MF_BYCOMMAND
|MF_UNCHECKED
);
135 TaskManagerSettings
.Show16BitTasks
= FALSE
;
139 CheckMenuItem(hOptionsMenu
, ID_OPTIONS_SHOW16BITTASKS
, MF_BYCOMMAND
|MF_CHECKED
);
140 TaskManagerSettings
.Show16BitTasks
= TRUE
;
144 * Refresh the list of processes.
146 RefreshProcessPage();