ReactOS  0.4.12-dev-14-gd0c8636
optnmenu.c
Go to the documentation of this file.
1 /*
2  * ReactOS Task Manager
3  *
4  * optnmenu.c
5  *
6  * Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
7  *
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.
12  *
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.
17  *
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /*
24  * options.c
25  *
26  * Menu item handlers for the options menu.
27  */
28 
29 #include "precomp.h"
30 
32 {
33  HMENU hMenu;
34  HMENU hOptionsMenu;
35 
36  hMenu = GetMenu(hMainWnd);
37  hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
38 
39  /*
40  * Check or uncheck the always on top menu item
41  * and update main window.
42  */
44  {
48  }
49  else
50  {
54  }
55 }
56 
58 {
59  HMENU hMenu;
60  HMENU hOptionsMenu;
61 
62  hMenu = GetMenu(hMainWnd);
63  hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
64 
65  /*
66  * Check or uncheck the minimize on use menu item.
67  */
69  {
72  }
73  else
74  {
75  CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED);
77  }
78 }
79 
81 {
82  HMENU hMenu;
83  HMENU hOptionsMenu;
84 
85  hMenu = GetMenu(hMainWnd);
86  hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
87 
88  /*
89  * Check or uncheck the hide when minimized menu item.
90  */
92  {
95  }
96  else
97  {
98  CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED);
100  }
101 }
102 
104 {
105  HMENU hMenu;
106  HMENU hOptionsMenu;
107 
108  hMenu = GetMenu(hMainWnd);
109  hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
110 
111  /*
112  * FIXME: Currently this is useless because the
113  * current implementation doesn't list the 16-bit
114  * processes. I believe that would require querying
115  * each ntvdm.exe process for it's children.
116  */
117 
118  /*
119  * Check or uncheck the show 16-bit tasks menu item
120  */
122  {
125  }
126  else
127  {
128  CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
130  }
131 
132  /*
133  * Refresh the list of processes.
134  */
136 }
#define TRUE
Definition: types.h:120
#define ID_OPTIONS_HIDEWHENMINIMIZED
Definition: resource.h:140
#define MF_BYCOMMAND
Definition: winuser.h:202
#define ID_OPTIONS_ALWAYSONTOP
Definition: resource.h:138
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL HideWhenMinimized
Definition: taskmgr.h:68
#define GWL_EXSTYLE
Definition: winuser.h:845
#define HWND_TOPMOST
Definition: winuser.h:1194
#define ID_OPTIONS_SHOW16BITTASKS
Definition: resource.h:158
void RefreshProcessPage(void)
Definition: procpage.c:411
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define ID_OPTIONS_MINIMIZEONUSE
Definition: resource.h:139
#define MF_CHECKED
Definition: winuser.h:132
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define OPTIONS_MENU_INDEX
Definition: optnmenu.h:29
HWND hMainWnd
Definition: magnifier.c:33
#define WS_EX_TOPMOST
Definition: pedump.c:647
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define MF_UNCHECKED
Definition: winuser.h:204
#define SWP_NOSIZE
Definition: winuser.h:1230
void TaskManager_OnOptionsAlwaysOnTop(void)
Definition: optnmenu.c:31
void TaskManager_OnOptionsShow16BitTasks(void)
Definition: optnmenu.c:103
TASKMANAGER_SETTINGS TaskManagerSettings
Definition: taskmgr.c:52
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define HWND_NOTOPMOST
Definition: winuser.h:1192
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
void TaskManager_OnOptionsMinimizeOnUse(void)
Definition: optnmenu.c:57
void TaskManager_OnOptionsHideWhenMinimized(void)
Definition: optnmenu.c:80