From 4732ef2b6acb39a31847889506b72db5807710e0 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Thu, 14 Sep 2006 19:09:56 +0000 Subject: [PATCH] start to overhaul sysdm.cpl and make it more like XP's, which is much more user friendly - completely rewrite the resource file to make it readable and logical - do the same with the resource.h file (I'll cry if anyone messes these 2 up, it's mega neat now ... ;p) - add the ReactOS logo to the first page (general tab) - move the licence to it's own dialog accessable from the general tab - rearrange the computer name and hardware pages - delete the user profile page and add it as a separate dialog accessable from the advanced page - add an error reporting button (as per XP) which opens a web browser directly to bugzilla. - loads of other little alterations. *note, I've dissabled language files until I've finished messing with the resources* svn path=/trunk/; revision=24121 --- reactos/dll/cpl/sysdm/advanced.c | 119 ++++++------ reactos/dll/cpl/sysdm/computer.c | 29 +-- reactos/dll/cpl/sysdm/en.rc | 268 +++++++++++++++------------- reactos/dll/cpl/sysdm/environment.c | 57 +++--- reactos/dll/cpl/sysdm/general.c | 216 ++++++++++++---------- reactos/dll/cpl/sysdm/hardware.c | 29 +-- reactos/dll/cpl/sysdm/licence.c | 81 +++++++++ reactos/dll/cpl/sysdm/precomp.h | 5 +- reactos/dll/cpl/sysdm/resource.h | 155 ++++++++-------- reactos/dll/cpl/sysdm/sysdm.c | 48 ++--- reactos/dll/cpl/sysdm/sysdm.rbuild | 5 + reactos/dll/cpl/sysdm/sysdm.rc | 19 +- reactos/dll/cpl/sysdm/userprofile.c | 67 ++++--- reactos/dll/cpl/sysdm/virtmem.c | 4 +- 14 files changed, 592 insertions(+), 510 deletions(-) create mode 100644 reactos/dll/cpl/sysdm/licence.c diff --git a/reactos/dll/cpl/sysdm/advanced.c b/reactos/dll/cpl/sysdm/advanced.c index 0ecaaebe93b..898c0890abb 100644 --- a/reactos/dll/cpl/sysdm/advanced.c +++ b/reactos/dll/cpl/sysdm/advanced.c @@ -1,66 +1,77 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/advanced.c + * PURPOSE: Memory, start-up and profiles settings + * COPYRIGHT: Copyright Thomas Weidenmueller + Copyright 2006 Ged Murphy * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/advanced.c - * PURPOSE: Memory, start-up and profiles settings - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ #include "precomp.h" +static TCHAR BugLink[] = _T("http://www.reactos.org/bugzilla"); + /* Property page dialog callback */ INT_PTR CALLBACK -AdvancedPageProc( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) +AdvancedPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) { - UNREFERENCED_PARAMETER(lParam); - switch (uMsg) - { - case WM_INITDIALOG: + UNREFERENCED_PARAMETER(lParam); + + switch (uMsg) + { + case WM_INITDIALOG: + break; + + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_PERFOR: + { + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_VIRTMEM), + hwndDlg, + (DLGPROC)VirtMemDlgProc); + } + break; + + case IDC_USERPROFILE: + { + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_USERPROFILE), + hwndDlg, + (DLGPROC)UserProfileDialogProc); + } + break; + + case IDC_ENVVAR: + { + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES), + hwndDlg, + (DLGPROC)EnvironmentDlgProc); + } + break; + + case IDC_ERRORREPORT: + { + ShellExecute(NULL, + _T("open"), + BugLink, + NULL, + NULL, + SW_SHOWNORMAL); + } + break; + + } + } break; - case WM_COMMAND: - switch(LOWORD(wParam)) - { - case IDC_PERFOR: - DialogBox(hApplet, - MAKEINTRESOURCE(IDD_VIRTMEM), - hwndDlg, - (DLGPROC) VirtMemDlgProc); - break; - - case IDC_ENVVAR: - DialogBox(hApplet, - MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES), - hwndDlg, - (DLGPROC) EnvironmentDlgProc); - break; - } - break; - - } - return FALSE; + } + return FALSE; } diff --git a/reactos/dll/cpl/sysdm/computer.c b/reactos/dll/cpl/sysdm/computer.c index 1e17de5a5b4..3ddbebc8d3f 100644 --- a/reactos/dll/cpl/sysdm/computer.c +++ b/reactos/dll/cpl/sysdm/computer.c @@ -1,29 +1,10 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/computer.c + * PURPOSE: Computer settings for networking + * COPYRIGHT: Copyright Thomas Weidenmueller * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/computer.c - * PURPOSE: Computer settings for networking - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ #include "precomp.h" diff --git a/reactos/dll/cpl/sysdm/en.rc b/reactos/dll/cpl/sysdm/en.rc index fe9378012ef..213750324c3 100644 --- a/reactos/dll/cpl/sysdm/en.rc +++ b/reactos/dll/cpl/sysdm/en.rc @@ -1,147 +1,165 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -RC_LICENSE RTDATA "resources/gpl.txt" - -IDD_PROPPAGEGENERAL DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +IDD_PROPPAGEGENERAL DIALOGEX 0, 0, 256, 218 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "General" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Operating System",-1,SYSTEM_COLUMN,LABELLINE(2),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT REACTOS_STR_PRODUCT_NAME,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(3),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT "Version "REACTOS_STR_PRODUCT_VERSION,-1,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(4),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - - LTEXT "Computer",-1,SYSTEM_COLUMN,LABELLINE(6),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT "",IDC_PROCESSORMANUFACTURER,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(7),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT "",IDC_PROCESSOR,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT "",IDC_PROCESSORSPEED,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(9),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - LTEXT "",IDC_SYSTEMMEMORY,SYSTEM_COLUMN+PROPSHEETPADDING(1),LABELLINE(10),PROPSHEETWIDTH-SYSTEM_COLUMN-PROPSHEETPADDING(1),8 - - EDITTEXT IDC_LICENSEMEMO,PROPSHEETPADDING(1),LABELLINE(13),PROPSHEETWIDTH-PROPSHEETPADDING(2),PROPSHEETHEIGHT-LABELLINE(13)-PROPSHEETPADDING(1),ES_LEFT|WS_TABSTOP|WS_BORDER|WS_VSCROLL|WS_HSCROLL|WS_GROUP|ES_MULTILINE|ES_READONLY + CONTROL "", IDC_ROSIMG, "Static", SS_OWNERDRAW, 4, 5, 248, 111 + LTEXT "System:", IDC_STATIC, 4, 132, 32, 9 +// LTEXT REACTOS_STR_PRODUCT_NAME, IDC_STATIC, 114, 29, 142, 8 +// LTEXT "Version " REACTOS_STR_PRODUCT_VERSION, IDC_STATIC, 114, 38, 142, 8 + LTEXT "Machine:", IDC_STATIC, 124, 132, 34, 9 + LTEXT "", IDC_PROCESSORMANUFACTURER, 130, 144, 118, 9 + LTEXT "", IDC_PROCESSOR, 130, 153, 118, 9 + LTEXT "", IDC_PROCESSORSPEED, 130, 162, 118, 9 + LTEXT "", IDC_SYSTEMMEMORY, 130, 171, 118, 9 + PUSHBUTTON "View licence...", IDC_LICENCE, 78, 199, 78, 13 END -IDD_PROPPAGECOMPUTER DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT +IDD_PROPPAGECOMPUTER DIALOGEX 0, 0, 256, 218 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Network Identification" +CAPTION "Computer Name" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(1),LABELLINE(1)-5, ICONSIZE, ICONSIZE, SS_ICON - LTEXT "ReactOS uses the following information to identify your computer on the network.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1)-5,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - LTEXT "Full computer name:",-1,PROPSHEETPADDING(1),LABELLINE(4)-4,PROPSHEETPADDING(17),LABELLINE(4)-4 - LTEXT "(Default)",IDC_COMPUTERNAME,PROPSHEETPADDING(17),LABELLINE(4)-5,60,LABELLINE(4)-5 - LTEXT "Workgroup:",IDC_WORKGROUPDOMAIN,PROPSHEETPADDING(1),LABELLINE(6)-6,PROPSHEETPADDING(17),LABELLINE(6)-6 - LTEXT "(empty)",IDC_WORKGROUPDOMAIN_NAME,PROPSHEETPADDING(17),LABELLINE(6)-6,60,LABELLINE(6)-6 - LTEXT "To use the Network Identfication Wizard to join a domain and create a local user, click Network ID.",-1,PROPSHEETPADDING(1),LABELLINE(7)+5,PROPSHEETWIDTH-PROPSHEETPADDING(12)-ICONSIZE,LABELLINE(8)+5 - PUSHBUTTON "&Network ID...",IDC_NETWORK_ID,175,LABELLINE(7)+5,70,LABELLINE(1)+4 - LTEXT "To rename this computer or join a domain, click Properties.",-1,PROPSHEETPADDING(1),LABELLINE(11)+2,PROPSHEETWIDTH-PROPSHEETPADDING(12)-ICONSIZE,LABELLINE(12)+2 - PUSHBUTTON "&Properties...",IDC_NETWORK_PROPERTY,175,LABELLINE(11)+2,70,LABELLINE(1)+4 + ICON IDI_DEVMGR, IDC_ICON1, 4, 3, 26, 24, SS_ICON + LTEXT "ReactOS uses the following information to identify your computer on the network.", IDC_STATIC, 40, 5, 204, 20 + LTEXT "Computer Description:", IDC_STATIC, 6, 40, 70, 9 + EDITTEXT IDC_COMPDESC, 98, 38, 146, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP + LTEXT "Full computer name:", IDC_STATIC, 6, 68, 64, 9 + LTEXT "(Default)", IDC_COMPUTERNAME, 98, 68, 144, 11 + LTEXT "Workgroup:", IDC_WORKGROUPDOMAIN, 6, 84, 64, 9 + LTEXT "(empty)", IDC_WORKGROUPDOMAIN_NAME, 98, 84, 144, 9 + LTEXT "To use the Network Identfication Wizard to join a domain and create a local user, click Network ID.", IDC_STATIC, 6, 108, 172, 24 + PUSHBUTTON "&Network ID...", IDC_NETWORK_ID, 190, 114, 58, 15 + LTEXT "To rename this computer or join a domain, click Properties.", IDC_STATIC, 6, 149, 170, 17 + PUSHBUTTON "&Change...",IDC_NETWORK_PROPERTY, 190, 149, 58, 15 + LTEXT "Note: Only Administrators can change the identification of this computer", IDC_STATIC, 6, 179, 230, 9 END -IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT + +IDD_PROPPAGEHARDWARE DIALOGEX 0, 0, 256, 218 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Hardware" FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - GROUPBOX "Hardware Wizard",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) - LTEXT "The Hardware wizard helps you install, uninstall, repair, unplug, eject, and configure your hardware.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON - PUSHBUTTON "&Hardware Wizard...",IDC_HARDWARE_WIZARD,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(5)+2,PROPSHEETPADDING(15),14 - - GROUPBOX "Device Manager",-1,PROPSHEETPADDING(1),LABELLINE(8)+5,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(7)+2 - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-3,ICONSIZE, ICONSIZE, SS_ICON - LTEXT "The Device Manager lists all the hardware devices installed on your computer. Use the Device Manager to change the properties of any device.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-3,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - - PUSHBUTTON "&Device Manager...",IDC_HARDWARE_DEVICE_MANAGER,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(13)+2,PROPSHEETPADDING(15),14 - - GROUPBOX "Hardware Profiles",-1,PROPSHEETPADDING(1),LABELLINE(16)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(18)-5, ICONSIZE, ICONSIZE, SS_ICON - LTEXT "Hardware profiles provide a way for you to set up and store different hardware configurations.",0,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(18)-5,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - PUSHBUTTON "Hard&ware Profiles...",IDC_HARDWARE_PROFILE,PROPSHEETWIDTH-PROPSHEETPADDING(17),LABELLINE(20)+2,PROPSHEETPADDING(15),14 -END - -IDD_PROPPAGEUSERPROFILE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "User Profiles" -FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(1),LABELLINE(1), ICONSIZE, ICONSIZE, SS_ICON - LTEXT "User profiles contain desktop settings and other information related to your login. A different profile can be created on each computer you use, or you can select a roaming profile that is the same on every computer you use.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(4) - LTEXT "Profiles stored on this computer:",-1,PROPSHEETPADDING(1),LABELLINE(6),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(1) - CONTROL "",IDC_USERPROFILE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|WS_BORDER|WS_TABSTOP,PROPSHEETPADDING(1),LABELLINE(8),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(11),WS_EX_CLIENTEDGE - - PUSHBUTTON "Delete",IDC_USERPROFILE_DELETE,PROPSHEETPADDING(1),LABELLINE(20),60,LABELLINE(1)+2 - PUSHBUTTON "Change Type...",IDC_USERPROFILE_CHANGE,(PROPSHEETWIDTH/2)-30,LABELLINE(20),60,LABELLINE(1)+2 - PUSHBUTTON "Copy To...",IDC_USERPROFILE_COPY,PROPSHEETWIDTH-PROPSHEETPADDING(1)-60,LABELLINE(20),60,LABELLINE(1)+2 + GROUPBOX "Device Manager", IDC_STATIC, 6, 7, 244, 61 + ICON IDI_DEVMGR, IDC_ICON1, 12, 18, 23, 21, SS_ICON + LTEXT "The Device Manager lists all the hardware devices installed on your computer. Use the Device Manager to change the properties of any device.", IDC_STATIC, 42, 18, 204, 24 + PUSHBUTTON "&Device Manager...", IDC_HARDWARE_DEVICE_MANAGER, 154, 48, 90, 15 + + GROUPBOX "Hardware Wizard", IDC_STATIC, 6, 79, 244, 61 + ICON IDI_DEVMGR, IDC_ICON1, 12, 90, 23, 21, SS_ICON + LTEXT "The Hardware wizard helps you install, uninstall, repair, unplug, eject, and configure your hardware.", IDC_STATIC, 42, 90, 204, 24 + PUSHBUTTON "&Hardware Wizard...", IDC_HARDWARE_WIZARD, 154, 120, 90, 15 + + GROUPBOX "Hardware Profiles", IDC_STATIC, 6, 149, 244, 61 + ICON IDI_DEVMGR, IDC_ICON1, 12, 160, 23, 21, SS_ICON + LTEXT "Hardware profiles provide a way for you to set up and store different hardware configurations.", IDC_STATIC, 42, 160, 204, 24 + PUSHBUTTON "Hard&ware Profiles...", IDC_HARDWARE_PROFILE, 154, 190, 90, 15 END -IDD_PROPPAGEADVANCED DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT + +IDD_PROPPAGEADVANCED DIALOGEX 0, 0, 256, 218 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Advanced" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "Performance",-1,PROPSHEETPADDING(1),LABELLINE(1),PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(2), ICONSIZE, ICONSIZE, SS_ICON - LTEXT "Performance options control how applications use memory, which affects the speed of your computer.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(2),PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - PUSHBUTTON "&Performance Options...",IDC_PERFOR,PROPSHEETWIDTH-PROPSHEETPADDING(20),LABELLINE(5)+2,PROPSHEETPADDING(18),14 - GROUPBOX "Environment Variables",-1,PROPSHEETPADDING(1),LABELLINE(8)+2,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(10)-5, ICONSIZE, ICONSIZE, SS_ICON - LTEXT "Environment variables tell your computer where to find certain types of information.",-1,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(10)-5,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - PUSHBUTTON "&Environment Variables...",IDC_ENVVAR,PROPSHEETWIDTH-PROPSHEETPADDING(20),LABELLINE(12)+2,PROPSHEETPADDING(18),14 - GROUPBOX "&Startup and Recovery",-1,PROPSHEETPADDING(1),LABELLINE(15)+3,PROPSHEETWIDTH-PROPSHEETPADDING(2),LABELLINE(6)+PROPSHEETPADDING(1) - ICON IDI_DEVMGR, IDC_ICON1, PROPSHEETPADDING(2),LABELLINE(17)-5, ICONSIZE, ICONSIZE, SS_ICON - LTEXT "Startup and recovery options tell your computer how to start and what to do if an error causes your computer to stop.",0,PROPSHEETPADDING(4)+ICONSIZE,LABELLINE(17)-5,PROPSHEETWIDTH-PROPSHEETPADDING(6)-ICONSIZE,LABELLINE(3) - PUSHBUTTON "&Startup and Recovery...",IDC_STAREC,PROPSHEETWIDTH-PROPSHEETPADDING(20),LABELLINE(19)+2,PROPSHEETPADDING(18),14 + LTEXT "You must be logged on as an administrator to make most of these changes.", IDC_STATIC, 12, 5, 236, 8 + GROUPBOX "Performance", IDC_STATIC, 6, 18, 244, 50 + LTEXT "Performance options control how applications use memory, which affects the speed of your computer.", IDC_STATIC, 16, 29, 210, 17 + PUSHBUTTON "Settings", IDC_PERFOR, 194, 48, 50, 15 + + GROUPBOX "User Profiles", IDC_STATIC, 6,75,244,48 + LTEXT "Desktop settings related to your logon", IDC_STATIC, 16, 88, 210, 20 + PUSHBUTTON "Settings", IDC_USERPROFILE, 194, 103, 50, 15 + + GROUPBOX "Startup and Recovery", IDC_STATIC, 6, 131, 244, 52 + LTEXT "Startup and recovery options tell your computer how to start and what to do if an error causes your computer to stop.", IDC_STATIC, 16, 144, 210, 19 + PUSHBUTTON "Settings", IDC_STAREC, 194, 162, 50, 15 + + PUSHBUTTON "Environment Variables", IDC_ENVVAR, 84, 192, 80, 15 + PUSHBUTTON "Error Reporting", IDC_ERRORREPORT, 170, 192, 80, 15 +END + + +IDD_USERPROFILE DIALOGEX 0, 0, 256, 218 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "User Profiles" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + ICON IDI_DEVMGR, IDC_ICON1, 6, 11, 16, 16, SS_ICON + LTEXT "User profiles contain desktop settings and other information related to your login. A different profile can be created on each computer you use, or you can select a roaming profile that is the same on every computer you use.", + IDC_STATIC, 40, 11, 204, 35 + LTEXT "Profiles stored on this computer:", IDC_STATIC, 16, 51, 204, 9 + CONTROL "", IDC_USERPROFILE_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, + 6, 66, 244, 85, WS_EX_CLIENTEDGE + PUSHBUTTON "Change Type...", IDC_USERPROFILE_CHANGE, 134, 156, 62, 13 + + LTEXT "To create new user accounts, open ", IDC_STATIC, 10, 175, 116, 9 + // FIXME: needs custom control writing + // CONTROL "", IDC_CUST_LINK, "LinkCtlProc", WS_CHILD | VS_VISIBLE | WS_TABSTOP, 127, 175, 60, 9 + LTEXT "in Control Panel.", IDC_STATIC, 184, 175, 64, 9 + + PUSHBUTTON "OK", IDOK, 134, 197, 54, 13 + PUSHBUTTON "Cancel", IDCANCEL, 196, 197, 54, 13 END IDD_VIRTMEM DIALOGEX 6, 6, 223, 248 -STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Virtual Memory" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - CONTROL "",IDC_PAGEFILELIST,"ListBox",0x50010141,10,16,204,52,0x00000200 - LTEXT "Drive [Volume Label]", -1, 12, 5, 96, 9 - LTEXT "Paging File Size (MB)", -1, 114, 5, 100, 9 - CONTROL "Paging file size for selected drive",IDC_DRIVEGROUP,"Button",0x50000007,10,70,204,104 - LTEXT "", IDC_DRIVE, 20, 84, 100, 9 - LTEXT "", IDC_SPACEAVAIL, 20, 94, 112, 8 - CONTROL "Custom size",IDC_CUSTOM,"Button",0x50010009,20,105,54,9 - CONTROL "",IDC_INITIALSIZE,"Edit",0x50010000,100,114,44,13,0x00000200 - CONTROL "",IDC_MAXSIZE,"Edit",0x50010000,100,129,44,13,0x00000200 - LTEXT "Initial size (MB):", -1 ,22,118,54,9 - LTEXT "Maximum size (MB):", -1 ,22,131,64,9 - CONTROL "System managed size",IDC_SYSMANSIZE,"Button",0x50010009,20,145,88,9 - CONTROL "No paging file",IDC_NOPAGEFILE,"Button",0x50010009,20,158,78,9 - PUSHBUTTON "Set",IDC_SET, 158, 155, 50, 13 - CONTROL "Total paging file size for all drives", IDC_TOTALGROUP, "Button", 0x50000007, 10, 179, 204, 46 - PUSHBUTTON "OK", IDOK, 114, 232, 48, 13 - PUSHBUTTON "Cancel", IDCANCEL, 168, 232, 48, 13 - LTEXT "", IDC_MINIMUM, 18, 200, 100, 9 - LTEXT "", IDC_RECOMMENDED, 18, 200, 100, 9 - LTEXT "", IDC_CURRENT, 18, 200, 100, 9 + LTEXT "Drive [Volume Label] Paging File Size (MB)", -1, 12, 5, 96, 9 + CONTROL "", IDC_PAGEFILELIST, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP, + 10, 16, 204, 52, WS_EX_CLIENTEDGE + + GROUPBOX "Paging file size for selected drive", IDC_DRIVEGROUP, 10, 70, 204, 104 + LTEXT "", IDC_DRIVE, 20, 244, 100, 9 + LTEXT "", IDC_SPACEAVAIL, 20, 94, 112, 8 + LTEXT "Initial size (MB):", -1, 22, 118, 54, 9 + LTEXT "Maximum size (MB):", -1, 22, 131, 64, 9 + CONTROL "Custom size", IDC_CUSTOM, "Button", BS_AUTORADIOBUTTON, 20, 105, 54, 9 + CONTROL "System managed size", IDC_SYSMANSIZE, "Button", BS_AUTORADIOBUTTON, 20, 145, 88, 9 + CONTROL "No paging file", IDC_NOPAGEFILE, "Button", BS_AUTORADIOBUTTON, 20, 158, 78,9 + EDITTEXT IDC_INITIALSIZE, 100, 114, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE + EDITTEXT IDC_MAXSIZE, 100, 129, 44, 13, NOT WS_BORDER, WS_EX_CLIENTEDGE + PUSHBUTTON "Set", IDC_SET, 158, 155, 50, 13 + + GROUPBOX "Total paging file size for all drives", IDC_TOTALGROUP, 10, 179, 204, 46 + LTEXT "", IDC_MINIMUM, 18, 200, 100, 9 + LTEXT "", IDC_RECOMMENDED, 18, 200, 100, 9 + LTEXT "", IDC_CURRENT, 18, 200, 100, 9 + + PUSHBUTTON "OK", IDOK, 114, 232, 48, 13 + PUSHBUTTON "Cancel", IDCANCEL, 168, 232, 48, 13 END + IDD_ENVIRONMENT_VARIABLES DIALOGEX 6, 18, 252, 245 STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Environment Variables" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "User variables",-1,7,12,238,100 - LTEXT "&Variables:",-1,14,24,224,8 - CONTROL "",IDC_USER_VARIABLE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|LVS_NOSORTHEADER|WS_VSCROLL|WS_HSCROLL|WS_TABSTOP,14,35,224,48,WS_EX_CLIENTEDGE - PUSHBUTTON "&New...",IDC_USER_VARIABLE_NEW,80,90,50,14 - PUSHBUTTON "&Edit...",IDC_USER_VARIABLE_EDIT,134,90,50,14 - PUSHBUTTON "&Delete",IDC_USER_VARIABLE_DELETE,188,90,50,14 - - GROUPBOX "System variables",-1,7,116,238,100 - LTEXT "V&ariables:",-1,14,128,224,8 - CONTROL "",IDC_SYSTEM_VARIABLE_LIST,"SysListView32",LVS_REPORT|LVS_SINGLESEL|LVS_SHOWSELALWAYS|LVS_SORTASCENDING|LVS_NOSORTHEADER|WS_VSCROLL|WS_HSCROLL|WS_TABSTOP,14,139,224,48,WS_EX_CLIENTEDGE - PUSHBUTTON "Ne&w...",IDC_SYSTEM_VARIABLE_NEW,80,194,50,14 - PUSHBUTTON "Ed&it...",IDC_SYSTEM_VARIABLE_EDIT,134,194,50,14 - PUSHBUTTON "De&lete",IDC_SYSTEM_VARIABLE_DELETE,188,194,50,14 - - DEFPUSHBUTTON "OK",IDOK,141,224,50,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,195,224,50,14 + GROUPBOX "User variables", IDC_STATIC, 7, 12, 238, 100 + LTEXT "&Variables:", IDC_STATIC, 14, 24, 224, 8 + CONTROL "", IDC_USER_VARIABLE_LIST, "SysListView32", + LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOSORTHEADER | + WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 14, 35, 224, 48, WS_EX_CLIENTEDGE + PUSHBUTTON "&New...", IDC_USER_VARIABLE_NEW, 80, 90, 50, 14 + PUSHBUTTON "&Edit...", IDC_USER_VARIABLE_EDIT, 134, 90, 50, 14 + PUSHBUTTON "&Delete", IDC_USER_VARIABLE_DELETE, 188, 90, 50, 14 + GROUPBOX "System variables", IDC_STATIC, 7, 116, 238, 100 + LTEXT "V&ariables:", IDC_STATIC, 14, 128, 224, 8 + CONTROL "", IDC_SYSTEM_VARIABLE_LIST, "SysListView32", + LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | LVS_NOSORTHEADER | + WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 14, 139, 224, 48, WS_EX_CLIENTEDGE + PUSHBUTTON "Ne&w...", IDC_SYSTEM_VARIABLE_NEW, 80, 194, 50, 14 + PUSHBUTTON "Ed&it...", IDC_SYSTEM_VARIABLE_EDIT, 134, 194, 50, 14 + PUSHBUTTON "De&lete", IDC_SYSTEM_VARIABLE_DELETE, 188, 194, 50, 14 + PUSHBUTTON "OK", IDOK, 141, 224, 50, 14, WS_GROUP + PUSHBUTTON "Cancel", IDCANCEL, 195, 224, 50, 14 END @@ -150,23 +168,31 @@ STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_S CAPTION "Edit Variable" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Variable &Name:",-1,7,14,50,8 - EDITTEXT IDC_VARIABLE_NAME,75,12,145,12,ES_AUTOHSCROLL - LTEXT "Variable &Value:",-1,7,32,50,8 - EDITTEXT IDC_VARIABLE_VALUE,75,30,145,12,ES_AUTOHSCROLL - - DEFPUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,170,50,50,14 + LTEXT "Variable &Name:", IDC_STATIC, 7, 14, 50, 8 + EDITTEXT IDC_VARIABLE_NAME, 75, 12, 145, 12, ES_AUTOHSCROLL + LTEXT "Variable &Value:", IDC_STATIC, 7, 32, 50, 8 + EDITTEXT IDC_VARIABLE_VALUE, 75, 30, 145, 12, ES_AUTOHSCROLL + PUSHBUTTON "OK",IDOK,116,50,50,14,WS_GROUP + PUSHBUTTON "Cancel",IDCANCEL,170,50,50,14 +END + + +IDD_LICENCE DIALOGEX 6, 6, 267, 142 +CAPTION "Licence" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +STYLE WS_BORDER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +BEGIN + EDITTEXT IDC_LICENCEEDIT, 0, 0, 268, 142, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE END STRINGTABLE DISCARDABLE BEGIN - IDS_CPLSYSTEMNAME "System" - IDS_CPLSYSTEMDESCRIPTION "See information about your computer and change various system and hardware settings." - IDS_DRIVE "Drive: %s" - IDS_SPACE "Space available: %s" - IDS_MIN "Minimum allowed: %s" - IDS_REC "Recommended: %s" - IDS_CUR "Currently allocated: %s" + IDS_CPLSYSTEMNAME "System" + IDS_CPLSYSTEMDESCRIPTION "See information about your computer and change various system and hardware settings." + IDS_DRIVE "Drive: %s" + IDS_SPACE "Space available: %s" + IDS_MIN "Minimum allowed: %s" + IDS_REC "Recommended: %s" + IDS_CUR "Currently allocated: %s" END diff --git a/reactos/dll/cpl/sysdm/environment.c b/reactos/dll/cpl/sysdm/environment.c index e7ba4a5f0f0..3b5b6104b4f 100644 --- a/reactos/dll/cpl/sysdm/environment.c +++ b/reactos/dll/cpl/sysdm/environment.c @@ -1,27 +1,10 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/environment.c + * PURPOSE: Environment variable settings + * COPYRIGHT: Copyright Eric Kohl * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/sysdm/environment.c - * PURPOSE: Environment variable settings - * PROGRAMMER: Eric Kohl */ #include "precomp.h" @@ -38,9 +21,9 @@ typedef struct _VARIABLE_DATA INT_PTR CALLBACK EditVariableDlgProc(HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam) + UINT uMsg, + WPARAM wParam, + LPARAM lParam) { PVARIABLE_DATA VarData; DWORD dwNameLength; @@ -51,7 +34,7 @@ EditVariableDlgProc(HWND hwndDlg, switch (uMsg) { case WM_INITDIALOG: - SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)lParam); + SetWindowLongPtr(hwndDlg, GWL_USERDATA, (LONG_PTR)lParam); VarData = (PVARIABLE_DATA)lParam; if (VarData->lpName != NULL) @@ -489,15 +472,15 @@ SetAllVars(HWND hwndDlg, lvi.iItem = iItem; /* Open or create the key */ - if (RegCreateKeyEx((iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER), - (iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") : _T("Environment")), - 0, - NULL, + if (RegCreateKeyEx((iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER), + (iDlgItem == IDC_SYSTEM_VARIABLE_LIST ? _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment") : _T("Environment")), + 0, + NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE | KEY_READ, - NULL, - &hk, - NULL)) + KEY_WRITE | KEY_READ, + NULL, + &hk, + NULL)) { return; } @@ -518,9 +501,9 @@ SetAllVars(HWND hwndDlg, 0, Type, (LPBYTE) VarData->lpRawValue, - (DWORD) (_tcsclen(VarData->lpRawValue)* sizeof(TCHAR))+1)) + (DWORD) (_tcslen(VarData->lpRawValue)* sizeof(TCHAR))+1)) // was _tcsclen. lstrlen? { - RegCloseKey(hk); + RegCloseKey(hk); return; } } @@ -596,7 +579,7 @@ EnvironmentDlgProc(HWND hwndDlg, if (phdr->idFrom == IDC_USER_VARIABLE_LIST || phdr->idFrom == IDC_SYSTEM_VARIABLE_LIST) { - OnEditVariable(hwndDlg, phdr->idFrom); + OnEditVariable(hwndDlg, (INT)phdr->idFrom); return TRUE; } } diff --git a/reactos/dll/cpl/sysdm/general.c b/reactos/dll/cpl/sysdm/general.c index b0dffe56510..c2357575bc5 100644 --- a/reactos/dll/cpl/sysdm/general.c +++ b/reactos/dll/cpl/sysdm/general.c @@ -1,132 +1,152 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/general.c + * PURPOSE: General System Information + * COPYRIGHT: Copyright Thomas Weidenmueller + * Copyright 2006 Ged Murphy * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/general.c - * PURPOSE: General System Information - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ + #include "precomp.h" +typedef struct _IMGINFO +{ + HBITMAP hBitmap; + INT cxSource; + INT cySource; +} IMGINFO, *PIMGINFO; + + void ShowLastWin32Error(HWND hWndOwner) { LPTSTR lpMsg; DWORD LastError; - + LastError = GetLastError(); - - if((LastError == 0) || !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, NULL, LastError, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(LPTSTR)&lpMsg, 0, - NULL)) + + if((LastError == 0) || + !FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + LastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&lpMsg, + 0, + NULL)) { return; } - + MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR); - + LocalFree((LPVOID)lpMsg); } -typedef struct + +static VOID +InitImageInfo(PIMGINFO ImgInfo) { - HWND hDlg; -} OSITINFO, *POSITINFO; + BITMAP bitmap; + + ZeroMemory(ImgInfo, sizeof(*ImgInfo)); + + ImgInfo->hBitmap = LoadImage(hApplet, + MAKEINTRESOURCE(IDB_ROSBMP), + IMAGE_BITMAP, + 0, + 0, + LR_DEFAULTCOLOR); + + if (ImgInfo->hBitmap != NULL) + { + GetObject(ImgInfo->hBitmap, sizeof(BITMAP), &bitmap); + + ImgInfo->cxSource = bitmap.bmWidth; + ImgInfo->cySource = bitmap.bmHeight; + } +} + DWORD WINAPI -ObtainSystemInformationThread(POSITINFO posit) +GetSystemInformation(HWND hwnd) { - HRSRC hResInfo; - HGLOBAL hResMem; - WCHAR *LicenseText; - - /* wait a bit */ - Sleep(100); - - /* load license from resource */ - if(!(hResInfo = FindResource(hApplet, MAKEINTRESOURCE(RC_LICENSE), - MAKEINTRESOURCE(RTDATA))) || - !(hResMem = LoadResource(hApplet, hResInfo)) || - !(LicenseText = LockResource(hResMem))) - { - ShowLastWin32Error(posit->hDlg); - goto LoadSystemInfo; - } - /* insert the license into the edit control (unicode!) */ - SetDlgItemText(posit->hDlg, IDC_LICENSEMEMO, LicenseText); - SendDlgItemMessage(posit->hDlg, IDC_LICENSEMEMO, EM_SETSEL, 0, 0); - - LoadSystemInfo: - /* FIXME */ - /*free:*/ - HeapFree(GetProcessHeap(), 0, posit); - + UNREFERENCED_PARAMETER(hwnd); + return 0; } + /* Property page dialog callback */ INT_PTR CALLBACK -GeneralPageProc( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam -) +GeneralPageProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) { - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); + static IMGINFO ImgInfo; - switch(uMsg) - { - case WM_INITDIALOG: + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + + switch(uMsg) { - HANDLE Thread; - DWORD ThreadId; - POSITINFO posit; - - posit = (POSITINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(OSITINFO)); - if(!posit) - { - ShowLastWin32Error(hwndDlg); - return FALSE; - } - posit->hDlg = hwndDlg; - Thread = CreateThread(NULL, - 0, - (LPTHREAD_START_ROUTINE)ObtainSystemInformationThread, - (PVOID)posit, - 0, - &ThreadId); - if(Thread) - { - CloseHandle(Thread); - return FALSE; - } - - break; + case WM_INITDIALOG: + { + InitImageInfo(&ImgInfo); + GetSystemInformation(hwndDlg); + } + break; + + case WM_COMMAND: + { + if (LOWORD(wParam) == IDC_LICENCE) + { + DialogBox(hApplet, + MAKEINTRESOURCE(IDD_LICENCE), + hwndDlg, + LicenceDialogProc); + + return TRUE; + } + } + break; + + case WM_DRAWITEM: + { + LPDRAWITEMSTRUCT lpDrawItem; + lpDrawItem = (LPDRAWITEMSTRUCT) lParam; + if(lpDrawItem->CtlID == IDC_ROSIMG) + { + HDC hdcMem; + LONG left; + + /* position image in centre of dialog */ + left = (lpDrawItem->rcItem.right - ImgInfo.cxSource) / 2; + + hdcMem = CreateCompatibleDC(lpDrawItem->hDC); + if (hdcMem != NULL) + { + SelectObject(hdcMem, ImgInfo.hBitmap); + BitBlt(lpDrawItem->hDC, + left, + lpDrawItem->rcItem.top, + lpDrawItem->rcItem.right - lpDrawItem->rcItem.left, + lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top, + hdcMem, + 0, + 0, + SRCCOPY); + DeleteDC(hdcMem); + } + } + return TRUE; + } + } - } - return FALSE; + + return FALSE; } diff --git a/reactos/dll/cpl/sysdm/hardware.c b/reactos/dll/cpl/sysdm/hardware.c index 14a24ad5959..6f98c2dc8c7 100644 --- a/reactos/dll/cpl/sysdm/hardware.c +++ b/reactos/dll/cpl/sysdm/hardware.c @@ -1,29 +1,10 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/hardware.c + * PURPOSE: Hardware devices + * COPYRIGHT: Copyright Thomas Weidenmueller * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/hardware.c - * PURPOSE: Hardware devices - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ #include "precomp.h" diff --git a/reactos/dll/cpl/sysdm/licence.c b/reactos/dll/cpl/sysdm/licence.c new file mode 100644 index 00000000000..733cd01fa7e --- /dev/null +++ b/reactos/dll/cpl/sysdm/licence.c @@ -0,0 +1,81 @@ +/* + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/general.c + * PURPOSE: Licence dialog box message handler + * COPYRIGHT: Copyright 2006 Ged Murphy + * + */ + +#include "precomp.h" + + +INT_PTR CALLBACK +LicenceDialogProc(HWND hDlg, + UINT message, + WPARAM wParam, + LPARAM lParam) +{ + HRSRC hResInfo; + HGLOBAL hResMem; + WCHAR *LicenseText; + static HICON hIcon; + + UNREFERENCED_PARAMETER(lParam); + + switch (message) + { + case WM_INITDIALOG: + { + hIcon = LoadImage(hApplet, + MAKEINTRESOURCE(IDI_CPLSYSTEM), + IMAGE_ICON, + 16, + 16, + 0); + + SendMessage(hDlg, + WM_SETICON, + ICON_SMALL, + (LPARAM)hIcon); + + /* load license from resource */ + if(!(hResInfo = FindResource(hApplet, + MAKEINTRESOURCE(RC_LICENSE), + MAKEINTRESOURCE(RTDATA))) || + !(hResMem = LoadResource(hApplet, hResInfo)) || + !(LicenseText = LockResource(hResMem))) + { + ShowLastWin32Error(hDlg); + break; + } + + /* insert the license into the edit control (unicode!) */ + SetDlgItemText(hDlg, + IDC_LICENCEEDIT, + LicenseText); + + SendDlgItemMessage(hDlg, + IDC_LICENCEEDIT, + EM_SETSEL, + -1, + 0); + + return TRUE; + } + + case WM_COMMAND: + { + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + DestroyIcon(hIcon); + EndDialog(hDlg, + LOWORD(wParam)); + return TRUE; + } + } + break; + } + + return FALSE; +} diff --git a/reactos/dll/cpl/sysdm/precomp.h b/reactos/dll/cpl/sysdm/precomp.h index bb4622063fa..973d264883b 100644 --- a/reactos/dll/cpl/sysdm/precomp.h +++ b/reactos/dll/cpl/sysdm/precomp.h @@ -24,14 +24,17 @@ extern HINSTANCE hApplet; void ShowLastWin32Error(HWND hWndOwner); +/* prop sheet pages */ INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK ComputerPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK AdvancedPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK UserProfilePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +/* dialogs */ +INT_PTR CALLBACK UserProfileDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK EnvironmentDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK VirtMemDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK LicenceDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); typedef struct _PAGEFILE { diff --git a/reactos/dll/cpl/sysdm/resource.h b/reactos/dll/cpl/sysdm/resource.h index 94546509913..f2fe0364116 100644 --- a/reactos/dll/cpl/sysdm/resource.h +++ b/reactos/dll/cpl/sysdm/resource.h @@ -1,93 +1,106 @@ #ifndef __CPL_RESOURCE_H #define __CPL_RESOURCE_H -/* metrics */ -#define PROPSHEETWIDTH 256 -#define PROPSHEETHEIGHT 218 -#define PROPSHEETPADDING(x) (x+x+x+x+x+x) -#define SYSTEM_COLUMN PROPSHEETPADDING(18) -#define LABELLINE(x) (x+x+x+2+x+x+x+x+x+x) -#define ICONSIZE 16 +#define IDC_STATIC -1 -/* ids */ -#define RC_LICENSE 101 -#define RTDATA 300 +#define IDI_CPLSYSTEM 50 +#define IDI_DEVMGR 51 +#define IDC_ICON1 52 +#define IDB_ROSBMP 53 -#define IDI_CPLSYSTEM 100 -#define IDI_DEVMGR 101 +#define IDS_CPLSYSTEMNAME 60 +#define IDS_CPLSYSTEMDESCRIPTION 61 + +/* propsheet - general */ #define IDD_PROPPAGEGENERAL 100 -#define IDD_PROPPAGECOMPUTER 101 -#define IDD_PROPPAGEHARDWARE 102 -#define IDD_PROPPAGEUSERPROFILE 103 -#define IDD_PROPPAGEADVANCED 104 +#define IDC_PROCESSORMANUFACTURER 101 +#define IDC_PROCESSOR 102 +#define IDC_PROCESSORSPEED 103 +#define IDC_SYSTEMMEMORY 104 +#define IDC_LICENCE 105 +#define IDC_ROSIMG 106 -#define IDS_CPLSYSTEMNAME 1001 -#define IDS_CPLSYSTEMDESCRIPTION 2001 -#define IDS_DRIVE 3000 -#define IDS_SPACE 3001 -#define IDS_MIN 3002 -#define IDS_REC 3003 -#define IDS_CUR 3004 - -/* controls */ -#define IDC_LICENSEMEMO 101 -#define IDC_PROCESSORMANUFACTURER 102 -#define IDC_PROCESSOR 103 -#define IDC_PROCESSORSPEED 104 -#define IDC_SYSTEMMEMORY 105 -#define IDC_DEVMGR 106 -#define IDC_ENVVAR 107 -#define IDC_STAREC 108 -#define IDC_PERFOR 109 -#define IDC_ICON1 201 +/* propsheet - computer name */ +#define IDD_PROPPAGECOMPUTER 200 +#define IDC_COMPDESC 201 #define IDC_COMPUTERNAME 202 #define IDC_WORKGROUPDOMAIN_NAME 203 #define IDC_WORKGROUPDOMAIN 204 #define IDC_NETWORK_ID 205 #define IDC_NETWORK_PROPERTY 206 + + +/* propsheet - hardware */ +#define IDD_PROPPAGEHARDWARE 300 #define IDC_HARDWARE_WIZARD 207 -#define IDC_HARDWARE_PROFILE 210 -#define IDC_HARDWARE_DRIVER_SIGN 211 -#define IDC_HARDWARE_DEVICE_MANAGER 212 +#define IDC_HARDWARE_PROFILE 209 +#define IDC_HARDWARE_DRIVER_SIGN 210 +#define IDC_HARDWARE_DEVICE_MANAGER 211 -#define IDC_USERPROFILE_LIST 213 -#define IDC_USERPROFILE_DELETE 214 -#define IDC_USERPROFILE_CHANGE 215 -#define IDC_USERPROFILE_COPY 216 -#define IDD_ENVIRONMENT_VARIABLES 105 -#define IDC_USER_VARIABLE_LIST 220 -#define IDC_USER_VARIABLE_NEW 221 -#define IDC_USER_VARIABLE_EDIT 222 -#define IDC_USER_VARIABLE_DELETE 223 -#define IDC_SYSTEM_VARIABLE_LIST 224 -#define IDC_SYSTEM_VARIABLE_NEW 225 -#define IDC_SYSTEM_VARIABLE_EDIT 226 -#define IDC_SYSTEM_VARIABLE_DELETE 227 +/* propsheet - advanced */ +#define IDD_PROPPAGEADVANCED 400 +#define IDC_ENVVAR 401 +#define IDC_STAREC 402 +#define IDC_PERFOR 403 +#define IDC_USERPROFILE 404 +#define IDC_ERRORREPORT 405 + + +/* user profiles */ +#define IDD_USERPROFILE 500 +#define IDC_USERPROFILE_LIST 501 +#define IDC_USERPROFILE_CHANGE 503 +#define IDC_CUST_LINK 504 + + +/* environment variables */ +#define IDD_ENVIRONMENT_VARIABLES 600 +#define IDC_USER_VARIABLE_LIST 601 +#define IDC_USER_VARIABLE_NEW 602 +#define IDC_USER_VARIABLE_EDIT 603 +#define IDC_USER_VARIABLE_DELETE 604 +#define IDC_SYSTEM_VARIABLE_LIST 605 +#define IDC_SYSTEM_VARIABLE_NEW 606 +#define IDC_SYSTEM_VARIABLE_EDIT 607 +#define IDC_SYSTEM_VARIABLE_DELETE 608 + + +/* edit environment variables */ +#define IDD_EDIT_VARIABLE 700 +#define IDC_VARIABLE_NAME 701 +#define IDC_VARIABLE_VALUE 702 -#define IDD_EDIT_VARIABLE 106 -#define IDC_VARIABLE_NAME 230 -#define IDC_VARIABLE_VALUE 231 /* Virtual memory */ -#define IDD_VIRTMEM 107 -#define IDC_PAGEFILELIST 240 -#define IDC_DRIVEGROUP 241 -#define IDC_DRIVE 242 -#define IDC_SPACEAVAIL 243 -#define IDC_CUSTOM 244 -#define IDC_INITIALSIZE 245 -#define IDC_MAXSIZE 246 -#define IDC_SYSMANSIZE 247 -#define IDC_NOPAGEFILE 248 -#define IDC_SET 249 -#define IDC_TOTALGROUP 250 -#define IDC_MINIMUM 251 -#define IDC_RECOMMENDED 252 -#define IDC_CURRENT 253 +#define IDD_VIRTMEM 900 +#define IDC_PAGEFILELIST 901 +#define IDC_DRIVEGROUP 902 +#define IDC_DRIVE 903 +#define IDC_SPACEAVAIL 904 +#define IDC_CUSTOM 905 +#define IDC_INITIALSIZE 906 +#define IDC_MAXSIZE 907 +#define IDC_SYSMANSIZE 908 +#define IDC_NOPAGEFILE 909 +#define IDC_SET 910 +#define IDC_TOTALGROUP 911 +#define IDC_MINIMUM 912 +#define IDC_RECOMMENDED 913 +#define IDC_CURRENT 914 +#define IDS_DRIVE 920 +#define IDS_SPACE 921 +#define IDS_MIN 922 +#define IDS_REC 923 +#define IDS_CUR 924 + +/* licence */ +#define IDD_LICENCE 1000 +#define IDC_LICENCEEDIT 1001 +#define RC_LICENSE 1002 +#define RTDATA 1003 + #endif /* __CPL_RESOURCE_H */ - -/* EOF */ diff --git a/reactos/dll/cpl/sysdm/sysdm.c b/reactos/dll/cpl/sysdm/sysdm.c index 11c4263caf0..99aa816c2c7 100644 --- a/reactos/dll/cpl/sysdm/sysdm.c +++ b/reactos/dll/cpl/sysdm/sysdm.c @@ -1,40 +1,19 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/sysdm.c + * PURPOSE: dll entry file + * COPYRIGHT: Copyright Thomas Weidenmueller * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/sysdm.c - * PURPOSE: ReactOS System Control Panel - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ #include "precomp.h" -#define NUM_APPLETS (1) - LONG CALLBACK SystemApplet(VOID); HINSTANCE hApplet = 0; /* Applets */ -APPLET Applets[NUM_APPLETS] = +APPLET Applets[NUM_APPLETS] = { {IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet} }; @@ -76,7 +55,7 @@ PropSheetProc( return FALSE; } break; - + case PSCB_INITIALIZED: break; } @@ -88,12 +67,12 @@ PropSheetProc( LONG CALLBACK SystemApplet(VOID) { - PROPSHEETPAGE psp[5]; + PROPSHEETPAGE psp[4]; PROPSHEETHEADER psh; TCHAR Caption[1024]; - + LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); - + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; /* | PSH_USECALLBACK */ @@ -105,13 +84,12 @@ SystemApplet(VOID) psh.nStartPage = 0; psh.ppsp = psp; psh.pfnCallback = NULL; /* PropSheetProc; */ - + InitPropSheetPage(&psp[0], IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc); InitPropSheetPage(&psp[1], IDD_PROPPAGECOMPUTER, (DLGPROC) ComputerPageProc); InitPropSheetPage(&psp[2], IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc); - InitPropSheetPage(&psp[3], IDD_PROPPAGEUSERPROFILE, (DLGPROC) UserProfilePageProc); - InitPropSheetPage(&psp[4], IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc); - + InitPropSheetPage(&psp[3], IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc); + return (LONG)(PropertySheet(&psh) != -1); } diff --git a/reactos/dll/cpl/sysdm/sysdm.rbuild b/reactos/dll/cpl/sysdm/sysdm.rbuild index c5c5d2eeec1..4d9e6bf4b33 100644 --- a/reactos/dll/cpl/sysdm/sysdm.rbuild +++ b/reactos/dll/cpl/sysdm/sysdm.rbuild @@ -7,18 +7,23 @@ 0x600 0x501 + 0x501 kernel32 advapi32 user32 + gdi32 comctl32 netapi32 ntdll msvcrt + msimg32 + shell32 advanced.c computer.c environment.c general.c hardware.c + licence.c sysdm.c userprofile.c virtmem.c diff --git a/reactos/dll/cpl/sysdm/sysdm.rc b/reactos/dll/cpl/sysdm/sysdm.rc index eafe173d936..cfc514d2711 100644 --- a/reactos/dll/cpl/sysdm/sysdm.rc +++ b/reactos/dll/cpl/sysdm/sysdm.rc @@ -1,20 +1,24 @@ -#include "resource.h" -#include "windows.h" - +#include #include +#include "resource.h" LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #define REACTOS_VERSION_DLL -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS System Applet\0" -#define REACTOS_STR_INTERNAL_NAME "sysdm\0" -#define REACTOS_STR_ORIGINAL_FILENAME "sysdm.cpl\0" -#include +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS System Applet\0" +#define REACTOS_STR_INTERNAL_NAME "sysdm\0" +#define REACTOS_STR_ORIGINAL_FILENAME "sysdm.cpl\0" +//#include IDI_CPLSYSTEM ICON "resources/applet.ico" IDI_DEVMGR ICON "resources/devmgr.ico" +IDB_ROSBMP BITMAP "resources/rosbitmap.bmp" + +RC_LICENSE RTDATA "resources/gpl.txt" + #include "en.rc" +/* #include "cz.rc" #include "de.rc" #include "dk.rc" @@ -26,3 +30,4 @@ IDI_DEVMGR ICON "resources/devmgr.ico" #include "hu.rc" #include "ru.rc" #include "uk.rc" +*/ diff --git a/reactos/dll/cpl/sysdm/userprofile.c b/reactos/dll/cpl/sysdm/userprofile.c index 91b6d4bedde..656431437b6 100644 --- a/reactos/dll/cpl/sysdm/userprofile.c +++ b/reactos/dll/cpl/sysdm/userprofile.c @@ -1,49 +1,42 @@ /* - * ReactOS - * Copyright (C) 2004 ReactOS Team + * PROJECT: ReactOS System Control Panel Applet + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/cpl/sysdm/userprofile.c + * PURPOSE: Computer settings for networking + * COPYRIGHT: Copyright Thomas Weidenmueller + * Copyright 2006 Ged Murphy * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * PROJECT: ReactOS System Control Panel - * FILE: lib/cpl/system/computer.c - * PURPOSE: Computer settings for networking - * PROGRAMMER: Thomas Weidenmueller (w3seek@users.sourceforge.net) - * UPDATE HISTORY: - * 03-04-2004 Created */ #include "precomp.h" /* Property page dialog callback */ INT_PTR CALLBACK -UserProfilePageProc( - HWND hwndDlg, - UINT uMsg, - WPARAM wParam, - LPARAM lParam -) +UserProfileDialogProc(HWND hwndDlg, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) { - UNREFERENCED_PARAMETER(lParam); - UNREFERENCED_PARAMETER(wParam); - UNREFERENCED_PARAMETER(hwndDlg); - switch(uMsg) - { - case WM_INITDIALOG: - break; //GetUserName + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + UNREFERENCED_PARAMETER(hwndDlg); + switch(uMsg) + { + case WM_INITDIALOG: + { + } + break; //GetUserName + + case WM_COMMAND: + { + if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) + { + EndDialog(hwndDlg, + LOWORD(wParam)); + return TRUE; + } + } + break; } return FALSE; } diff --git a/reactos/dll/cpl/sysdm/virtmem.c b/reactos/dll/cpl/sysdm/virtmem.c index 0c1c055b112..ac6acda2f3c 100644 --- a/reactos/dll/cpl/sysdm/virtmem.c +++ b/reactos/dll/cpl/sysdm/virtmem.c @@ -138,7 +138,7 @@ ParseMemSettings(PVIRTMEM pVirtMem) Item.mask = LVIF_TEXT; Item.iItem = ListView_GetItemCount(pVirtMem->hListView); Item.pszText = szDrive; - Item.iItem = ListView_InsertItem(pVirtMem->hListView, &Item); + ListView_InsertItem(pVirtMem->hListView, &Item); /* set a volume label if there is one */ if (GetVolumeInformation(DrivePtr, @@ -367,6 +367,8 @@ OnSelChange(PVIRTMEM pVirtMem, TCHAR szCustVals[255]; INT Index; + UNREFERENCED_PARAMETER(pnmv); + Index = (INT)SendDlgItemMessage(pVirtMem->hSelf, IDC_PAGEFILELIST, LB_GETCURSEL,