2004-01-10 02:14:13 +00:00
|
|
|
/*
|
|
|
|
* ReactOS Task Manager
|
|
|
|
*
|
2010-08-08 03:41:33 +00:00
|
|
|
* optnmenu.c
|
2004-01-10 02:14:13 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2009-10-27 10:34:16 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-01-10 02:14:13 +00:00
|
|
|
*/
|
2005-05-08 04:07:56 +00:00
|
|
|
|
2004-01-10 02:14:13 +00:00
|
|
|
/*
|
|
|
|
* options.c
|
|
|
|
*
|
|
|
|
* Menu item handlers for the options menu.
|
|
|
|
*/
|
|
|
|
|
2005-10-19 14:18:29 +00:00
|
|
|
#include <precomp.h>
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
void TaskManager_OnOptionsAlwaysOnTop(void)
|
|
|
|
{
|
2007-10-31 23:26:27 +00:00
|
|
|
HMENU hMenu;
|
|
|
|
HMENU hOptionsMenu;
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
hMenu = GetMenu(hMainWnd);
|
|
|
|
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check or uncheck the always on top menu item
|
|
|
|
* and update main window.
|
|
|
|
*/
|
2009-05-09 12:18:13 +00:00
|
|
|
if ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
|
2004-01-10 02:14:13 +00:00
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
|
|
|
|
TaskManagerSettings.AlwaysOnTop = FALSE;
|
|
|
|
SetWindowPos(hMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_CHECKED);
|
|
|
|
TaskManagerSettings.AlwaysOnTop = TRUE;
|
|
|
|
SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TaskManager_OnOptionsMinimizeOnUse(void)
|
|
|
|
{
|
2007-10-31 23:26:27 +00:00
|
|
|
HMENU hMenu;
|
|
|
|
HMENU hOptionsMenu;
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
hMenu = GetMenu(hMainWnd);
|
|
|
|
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check or uncheck the minimize on use menu item.
|
|
|
|
*/
|
|
|
|
if (GetMenuState(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND) & MF_CHECKED)
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_UNCHECKED);
|
|
|
|
TaskManagerSettings.MinimizeOnUse = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED);
|
|
|
|
TaskManagerSettings.MinimizeOnUse = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TaskManager_OnOptionsHideWhenMinimized(void)
|
|
|
|
{
|
2007-10-31 23:26:27 +00:00
|
|
|
HMENU hMenu;
|
|
|
|
HMENU hOptionsMenu;
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
hMenu = GetMenu(hMainWnd);
|
|
|
|
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check or uncheck the hide when minimized menu item.
|
|
|
|
*/
|
|
|
|
if (GetMenuState(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND) & MF_CHECKED)
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_UNCHECKED);
|
|
|
|
TaskManagerSettings.HideWhenMinimized = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED);
|
|
|
|
TaskManagerSettings.HideWhenMinimized = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TaskManager_OnOptionsShow16BitTasks(void)
|
|
|
|
{
|
2007-10-31 23:26:27 +00:00
|
|
|
HMENU hMenu;
|
|
|
|
HMENU hOptionsMenu;
|
2004-01-10 02:14:13 +00:00
|
|
|
|
|
|
|
hMenu = GetMenu(hMainWnd);
|
|
|
|
hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* FIXME: Currently this is useless because the
|
2010-08-08 03:41:33 +00:00
|
|
|
* current implementation doesn't list the 16-bit
|
2004-01-10 02:14:13 +00:00
|
|
|
* processes. I believe that would require querying
|
|
|
|
* each ntvdm.exe process for it's children.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check or uncheck the show 16-bit tasks menu item
|
|
|
|
*/
|
|
|
|
if (GetMenuState(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND) & MF_CHECKED)
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_UNCHECKED);
|
|
|
|
TaskManagerSettings.Show16BitTasks = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
|
|
|
|
TaskManagerSettings.Show16BitTasks = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Refresh the list of processes.
|
|
|
|
*/
|
|
|
|
RefreshProcessPage();
|
|
|
|
}
|