ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

optnmenu.c
Go to the documentation of this file.
00001 /*
00002  *  ReactOS Task Manager
00003  *
00004  *  optnmenu.c
00005  *
00006  *  Copyright (C) 1999 - 2001  Brian Palmer  <brianp@reactos.org>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  */
00022 
00023 /*
00024  * options.c
00025  *
00026  * Menu item handlers for the options menu.
00027  */
00028 
00029 #include <precomp.h>
00030 
00031 void TaskManager_OnOptionsAlwaysOnTop(void)
00032 {
00033     HMENU  hMenu;
00034     HMENU  hOptionsMenu;
00035 
00036     hMenu = GetMenu(hMainWnd);
00037     hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
00038 
00039     /*
00040      * Check or uncheck the always on top menu item
00041      * and update main window.
00042      */
00043     if ((GetWindowLongPtrW(hMainWnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0)
00044     {
00045         CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_UNCHECKED);
00046         TaskManagerSettings.AlwaysOnTop = FALSE;
00047         SetWindowPos(hMainWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
00048     }
00049     else
00050     {
00051         CheckMenuItem(hOptionsMenu, ID_OPTIONS_ALWAYSONTOP, MF_BYCOMMAND|MF_CHECKED);
00052         TaskManagerSettings.AlwaysOnTop = TRUE;
00053         SetWindowPos(hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
00054     }
00055 }
00056 
00057 void TaskManager_OnOptionsMinimizeOnUse(void)
00058 {
00059     HMENU  hMenu;
00060     HMENU  hOptionsMenu;
00061 
00062     hMenu = GetMenu(hMainWnd);
00063     hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
00064 
00065     /*
00066      * Check or uncheck the minimize on use menu item.
00067      */
00068     if (GetMenuState(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND) & MF_CHECKED)
00069     {
00070         CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_UNCHECKED);
00071         TaskManagerSettings.MinimizeOnUse = FALSE;
00072     }
00073     else
00074     {
00075         CheckMenuItem(hOptionsMenu, ID_OPTIONS_MINIMIZEONUSE, MF_BYCOMMAND|MF_CHECKED);
00076         TaskManagerSettings.MinimizeOnUse = TRUE;
00077     }
00078 }
00079 
00080 void TaskManager_OnOptionsHideWhenMinimized(void)
00081 {
00082     HMENU  hMenu;
00083     HMENU  hOptionsMenu;
00084 
00085     hMenu = GetMenu(hMainWnd);
00086     hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
00087 
00088     /*
00089      * Check or uncheck the hide when minimized menu item.
00090      */
00091     if (GetMenuState(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND) & MF_CHECKED)
00092     {
00093         CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_UNCHECKED);
00094         TaskManagerSettings.HideWhenMinimized = FALSE;
00095     }
00096     else
00097     {
00098         CheckMenuItem(hOptionsMenu, ID_OPTIONS_HIDEWHENMINIMIZED, MF_BYCOMMAND|MF_CHECKED);
00099         TaskManagerSettings.HideWhenMinimized = TRUE;
00100     }
00101 }
00102 
00103 void TaskManager_OnOptionsShow16BitTasks(void)
00104 {
00105     HMENU  hMenu;
00106     HMENU  hOptionsMenu;
00107 
00108     hMenu = GetMenu(hMainWnd);
00109     hOptionsMenu = GetSubMenu(hMenu, OPTIONS_MENU_INDEX);
00110 
00111     /*
00112      * FIXME: Currently this is useless because the
00113      * current implementation doesn't list the 16-bit
00114      * processes. I believe that would require querying
00115      * each ntvdm.exe process for it's children.
00116      */
00117 
00118     /*
00119      * Check or uncheck the show 16-bit tasks menu item
00120      */
00121     if (GetMenuState(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND) & MF_CHECKED)
00122     {
00123         CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_UNCHECKED);
00124         TaskManagerSettings.Show16BitTasks = FALSE;
00125     }
00126     else
00127     {
00128         CheckMenuItem(hOptionsMenu, ID_OPTIONS_SHOW16BITTASKS, MF_BYCOMMAND|MF_CHECKED);
00129         TaskManagerSettings.Show16BitTasks = TRUE;
00130     }
00131 
00132     /*
00133      * Refresh the list of processes.
00134      */
00135     RefreshProcessPage();
00136 }

Generated on Mon May 28 2012 04:17:32 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.