Author: gedmurphy
Date: Fri Aug 31 13:27:11 2007
New Revision: 28692
URL:
http://svn.reactos.org/svn/reactos?rev=28692&view=rev
Log:
only enable the delete and create service buttons for administrators
Modified:
trunk/reactos/base/applications/mscutils/servman/about.c
trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc
trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc
trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc
trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc
trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc
trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc
trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc
trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc
trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc
trunk/reactos/base/applications/mscutils/servman/mainwnd.c
Modified: trunk/reactos/base/applications/mscutils/servman/about.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/about.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/about.c Fri Aug 31 13:27:11 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/about.c
+ * FILE: base/applications/mscutils/servman/about.c
* PURPOSE: About dialog box message handler
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2005-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
@@ -20,28 +20,33 @@
{
case WM_INITDIALOG:
- hIcon = (HICON) LoadImage(hInstance,
- MAKEINTRESOURCE(IDI_SM_ICON),
- IMAGE_ICON,
- 16,
- 16,
- 0);
-
- SendMessage(hDlg,
- WM_SETICON,
- ICON_SMALL,
- (LPARAM)hIcon);
+ hIcon = (HICON)LoadImage(hInstance,
+ MAKEINTRESOURCE(IDI_SM_ICON),
+ IMAGE_ICON,
+ 16,
+ 16,
+ 0);
+ if (hIcon)
+ {
+ SendMessage(hDlg,
+ WM_SETICON,
+ ICON_SMALL,
+ (LPARAM)hIcon);
+ DestroyIcon(hIcon);
+ }
hLicenseEditWnd = GetDlgItem(hDlg,
IDC_LICENSE_EDIT);
+ if (hLicenseEditWnd)
+ {
+ LoadString(hInstance,
+ IDS_LICENSE,
+ strLicense,
+ sizeof(strLicense) / sizeof(TCHAR));
- LoadString(hInstance,
- IDS_LICENSE,
- strLicense,
- sizeof(strLicense) / sizeof(TCHAR));
-
- SetWindowText(hLicenseEditWnd,
- strLicense);
+ SetWindowText(hLicenseEditWnd,
+ strLicense);
+ }
return TRUE;
@@ -49,7 +54,6 @@
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{
- DestroyIcon(hIcon);
EndDialog(hDlg,
LOWORD(wParam));
return TRUE;
Modified: trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/bg-BG.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Îïðåñíÿâàíå", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Îáðàáîòêà...", ID_EDIT, GRAYED
- MENUITEM "Ñúçäàâàíå...", ID_CREATE
+ MENUITEM "Ñúçäàâàíå...", ID_CREATE, GRAYED
MENUITEM "Èçòðèâàíå...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Ñâîéñòâà...", ID_PROP, GRAYED
@@ -68,7 +68,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Service Manager v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Service Manager v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Close", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/de-DE.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Aktualisieren", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Bearbeiten...", ID_EDIT, GRAYED
- MENUITEM "Erstellen...", ID_CREATE
+ MENUITEM "Erstellen...", ID_CREATE, GRAYED
MENUITEM "Löschen...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Eigenschaften...", ID_PROP, GRAYED
@@ -68,7 +68,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Dienst-Manager v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Dienst-Manager v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Schließen", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/en-US.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Refresh", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Edit...", ID_EDIT, GRAYED
- MENUITEM "Create...", ID_CREATE
+ MENUITEM "Create...", ID_CREATE, GRAYED
MENUITEM "Delete...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Properties...", ID_PROP, GRAYED
@@ -68,7 +68,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Service Manager v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Service Manager v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Close", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/fr-FR.rc Fri Aug 31 13:27:11
2007
@@ -22,7 +22,7 @@
MENUITEM "Rafraîchir", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Éditer...", ID_EDIT, GRAYED
- MENUITEM "Créer...", ID_CREATE
+ MENUITEM "Créer...", ID_CREATE, GRAYED
MENUITEM "Supprimer...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Propriétés...", ID_PROP, GRAYED
@@ -69,7 +69,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Gestionnaire de services v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Gestionnaire de services v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Fermer", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/id-ID.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Segarkan", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Edit...", ID_EDIT, GRAYED
- MENUITEM "Buat...", ID_CREATE
+ MENUITEM "Buat...", ID_CREATE, GRAYED
MENUITEM "Hapus...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Properti...", ID_PROP, GRAYED
@@ -68,7 +68,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Manajer Layanan v0.5.1\nHak Cipta (C) 2005-2007\noleh Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Manajer Layanan v0.8\nHak Cipta (C) 2005-2007\noleh Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Tutup", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/it-IT.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Aggiorna", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Modifica...", ID_EDIT, GRAYED
- MENUITEM "Crea...", ID_CREATE
+ MENUITEM "Crea...", ID_CREATE, GRAYED
MENUITEM "Cancella...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Proprietà...", ID_PROP, GRAYED
@@ -68,7 +68,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Gestione Servizi v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)gmail.com)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Gestione Servizi v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)gmail.com)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Chiudi", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/pl-PL.rc Fri Aug 31 13:27:11
2007
@@ -28,7 +28,7 @@
MENUITEM "Odwie¿", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Edycja...", ID_EDIT, GRAYED
- MENUITEM "Utwórz...", ID_CREATE
+ MENUITEM "Utwórz...", ID_CREATE, GRAYED
MENUITEM "Usuñ...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "W³aciwoci...", ID_PROP, GRAYED
@@ -75,7 +75,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Service Manager v0.5.1\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Service Manager v0.8\nCopyright (C) 2005-2007\nby Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "Zamknij", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/ru-RU.rc Fri Aug 31 13:27:11
2007
@@ -21,7 +21,7 @@
MENUITEM "Îáíîâèòü", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "Èçìåíèòü...", ID_EDIT, GRAYED
- MENUITEM "Ñîçäàòü...", ID_CREATE
+ MENUITEM "Ñîçäàòü...", ID_CREATE, GRAYED
MENUITEM "Óäàëèòü...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "Ñâîéñòâà...", ID_PROP, GRAYED
@@ -67,7 +67,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Ìåíåäæåð ñëóæá v0.5\nCopyright (C) 2005-2007\nîò Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 30
+ LTEXT "Ìåíåäæåð ñëóæá v0.8\nCopyright (C) 2005-2007\nîò Ged Murphy
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 30
PUSHBUTTON "Çàêðûòü", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc (original)
+++ trunk/reactos/base/applications/mscutils/servman/lang/th-TH.rc Fri Aug 31 13:27:11
2007
@@ -30,7 +30,7 @@
MENUITEM "¿×鹿Ù", ID_REFRESH
MENUITEM SEPARATOR
MENUITEM "á¡éä¢...", ID_EDIT, GRAYED
- MENUITEM "ÊÃéÒ§...", ID_CREATE
+ MENUITEM "ÊÃéÒ§...", ID_CREATE, GRAYED
MENUITEM "ź...", ID_DELETE, GRAYED
MENUITEM SEPARATOR
MENUITEM "¤Ø³ÊÁºÑµÔ...", ID_PROP, GRAYED
@@ -77,7 +77,7 @@
FONT 8, "MS Shell Dlg",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "â»Ãá¡ÃÁ¡ÒúÃÔ¡ÒèѴ¡Òà ÃØè¹ 0.5.1\nÅÔ¢ÊÔ·¸Ôì (C) 2005-2007\nâ´Â à¡é´
àÁÍÃì¿Õè (gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
+ LTEXT "â»Ãá¡ÃÁ¡ÒúÃÔ¡ÒèѴ¡Òà ÃØè¹ 0.8\nÅÔ¢ÊÔ·¸Ôì (C) 2005-2007\nâ´Â à¡é´ àÁÍÃì¿Õè
(gedmurphy(a)reactos.org)"quot;, IDC_STATIC, 48, 7, 130, 26
PUSHBUTTON "»Ô´", IDOK, 75, 162, 44, 15
ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30
EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
ES_READONLY | ES_MULTILINE
Modified: trunk/reactos/base/applications/mscutils/servman/mainwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/mainwnd.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/mainwnd.c Fri Aug 31 13:27:11 2007
@@ -24,7 +24,7 @@
/* Note: First item for a seperator is its width in pixels */
{15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /*
separator */
- {TBICON_CREATE, ID_CREATE, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /*
create */
+ {TBICON_CREATE, ID_CREATE, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 },
/* create */
{TBICON_DELETE, ID_DELETE, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /*
delete */
{15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /*
separator */
@@ -172,10 +172,13 @@
if (Info->SelectedItem != NO_ITEM_SELECTED)
{
/* allow user to delete service */
- SendMessage(Info->hTool, TB_SETSTATE, ID_DELETE,
- (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
- EnableMenuItem(hMainMenu, ID_DELETE, MF_ENABLED);
- EnableMenuItem(Info->hShortcutMenu, ID_DELETE, MF_ENABLED);
+ if (Info->bIsUserAnAdmin)
+ {
+ SendMessage(Info->hTool, TB_SETSTATE, ID_DELETE,
+ (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
+ EnableMenuItem(hMainMenu, ID_DELETE, MF_ENABLED);
+ EnableMenuItem(Info->hShortcutMenu, ID_DELETE, MF_ENABLED);
+ }
Flags = Info->pCurrentService->ServiceStatusProcess.dwControlsAccepted;
State = Info->pCurrentService->ServiceStatusProcess.dwCurrentState;
@@ -350,6 +353,24 @@
0);
Info->bIsUserAnAdmin = IsUserAnAdmin();
+ if (Info->bIsUserAnAdmin)
+ {
+ HMENU hMainMenu = GetMenu(Info->hMainWnd);
+
+ SendMessage(Info->hTool,
+ TB_SETSTATE,
+ ID_CREATE,
+ (LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
+ if (hMainMenu)
+ {
+ EnableMenuItem(hMainMenu,
+ ID_CREATE,
+ MF_ENABLED);
+ }
+ EnableMenuItem(Info->hShortcutMenu,
+ ID_CREATE,
+ MF_ENABLED);
+ }
return TRUE;
}