kernelbase: Reimplement SetLocaleInfoW().
[wine.git] / programs / taskmgr / optnmenu.c
blobabbcd4980e627157d87c3520493187dd94c9adb5
1 /*
2 * ReactOS Task Manager
4 * optnmenu.c
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
23 #include <stdio.h>
24 #include <stdlib.h>
26 #include <windows.h>
27 #include <commctrl.h>
29 #include "taskmgr.h"
31 void TaskManager_OnOptionsAlwaysOnTop(void)
33 HMENU hMenu;
34 HMENU hOptionsMenu;
36 hMenu = GetMenu(hMainWnd);
37 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
40 * Check or uncheck the always on top menu item
41 * and update main window.
43 if ((GetWindowLongW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
45 CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
46 TaskManagerSettings.AlwaysOnTop = FALSE;
47 SetWindowPos(hMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
49 else
51 CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_CHECKED);
52 TaskManagerSettings.AlwaysOnTop = TRUE;
53 SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
57 void TaskManager_OnOptionsMinimizeOnUse(void)
59 HMENU hMenu;
60 HMENU hOptionsMenu;
62 hMenu = GetMenu(hMainWnd);
63 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
66 * Check or uncheck the minimize on use menu item.
68 if (GetMenuState(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND) & MF_CHECKED)
70 CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_UNCHECKED);
71 TaskManagerSettings.MinimizeOnUse = FALSE;
73 else
75 CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED);
76 TaskManagerSettings.MinimizeOnUse = TRUE;
80 void TaskManager_OnOptionsHideWhenMinimized(void)
82 HMENU hMenu;
83 HMENU hOptionsMenu;
85 hMenu = GetMenu(hMainWnd);
86 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
89 * Check or uncheck the hide when minimized menu item.
91 if (GetMenuState(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND) & MF_CHECKED)
93 CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_UNCHECKED);
94 TaskManagerSettings.HideWhenMinimized = FALSE;
96 else
98 CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED);
99 TaskManagerSettings.HideWhenMinimized = TRUE;
103 void TaskManager_OnOptionsShow16BitTasks(void)
105 HMENU hMenu;
106 HMENU hOptionsMenu;
108 hMenu = GetMenu(hMainWnd);
109 hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
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 its children.
119 * Check or uncheck the show 16-bit tasks menu item
121 if (GetMenuState(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND) & MF_CHECKED)
123 CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_UNCHECKED);
124 TaskManagerSettings.Show16BitTasks = FALSE;
126 else
128 CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
129 TaskManagerSettings.Show16BitTasks = TRUE;
133 * Refresh the list of processes.
135 RefreshProcessPage();