Author: gedmurphy
Date: Fri Aug 24 22:27:12 2007
New Revision: 28521
URL:
http://svn.reactos.org/svn/reactos?rev=28521&view=rev
Log:
Start the move towards a partial rewrite of servman
Too many changes for me to bother listing
Modified:
trunk/reactos/base/applications/mscutils/servman/control.c
trunk/reactos/base/applications/mscutils/servman/create.c
trunk/reactos/base/applications/mscutils/servman/export.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
trunk/reactos/base/applications/mscutils/servman/precomp.h
trunk/reactos/base/applications/mscutils/servman/progress.c
trunk/reactos/base/applications/mscutils/servman/propsheet.c
trunk/reactos/base/applications/mscutils/servman/query.c
trunk/reactos/base/applications/mscutils/servman/reg.c
trunk/reactos/base/applications/mscutils/servman/resource.h
trunk/reactos/base/applications/mscutils/servman/start.c
trunk/reactos/base/applications/mscutils/servman/stop.c
Modified: trunk/reactos/base/applications/mscutils/servman/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/control.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/control.c Fri Aug 24 22:27:12 2007
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/control
+ * FILE: base/applications/mscutils/servman/control
* PURPOSE: Stops, pauses and resumes a service
* COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
*
@@ -11,9 +11,9 @@
BOOL
Control(PMAIN_WND_INFO Info,
+ HWND hProgDlg,
DWORD Control)
{
- HWND hProgBar;
SC_HANDLE hSCManager;
SC_HANDLE hSc;
SERVICE_STATUS_PROCESS ServiceStatus;
@@ -28,19 +28,6 @@
LVM_GETITEM,
0,
(LPARAM)&item);
-
- /* set the progress bar range and step */
- hProgBar = GetDlgItem(Info->hProgDlg,
- IDC_SERVCON_PROGRESS);
- SendMessage(hProgBar,
- PBM_SETRANGE,
- 0,
- MAKELPARAM(0, PROGRESSRANGE));
-
- SendMessage(hProgBar,
- PBM_SETSTEP,
- (WPARAM)1,
- 0);
/* open handle to the SCM */
hSCManager = OpenSCManager(NULL,
@@ -100,11 +87,7 @@
else if (dwWaitTime > 5000)
dwWaitTime = 5000;
- /* increment the progress bar */
- SendMessage(hProgBar,
- PBM_STEPIT,
- 0,
- 0);
+ IncrementProgressBar(hProgDlg);
/* wait before checking status */
Sleep(dwWaitTime);
@@ -122,11 +105,7 @@
if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)
{
- /* The service is making progress. increment the progress bar */
- SendMessage(hProgBar,
- PBM_STEPIT,
- 0,
- 0);
+ IncrementProgressBar(hProgDlg);
dwStartTickCount = GetTickCount();
dwOldCheckPoint = ServiceStatus.dwCheckPoint;
}
@@ -144,10 +123,7 @@
if (ServiceStatus.dwCurrentState == Control)
{
- SendMessage(hProgBar,
- PBM_DELTAPOS,
- PROGRESSRANGE,
- 0);
+ CompleteProgressBar(hProgDlg);
Sleep(1000);
return TRUE;
}
Modified: trunk/reactos/base/applications/mscutils/servman/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/create.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/create.c Fri Aug 24 22:27:12 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/create.c
+ * FILE: base/applications/mscutils/servman/create.c
* PURPOSE: Create a new service
- * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
@@ -70,9 +70,9 @@
IDS_CREATE_SUCCESS,
Buf,
sizeof(Buf) / sizeof(TCHAR));
- DisplayString(Buf);
-
- CloseServiceHandle(hSCManager);
+ DisplayString(Buf);
+
+ CloseServiceHandle(hSCManager);
CloseServiceHandle(hSc);
return TRUE;
Modified: trunk/reactos/base/applications/mscutils/servman/export.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/export.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/export.c Fri Aug 24 22:27:12 2007
@@ -36,10 +36,10 @@
SaveServicesToFile(PMAIN_WND_INFO Info,
LPCTSTR pszFileName)
{
- HANDLE hFile;
- BOOL bSuccess = FALSE;
+ HANDLE hFile;
+ BOOL bSuccess = FALSE;
- hFile = CreateFile(pszFileName,
+ hFile = CreateFile(pszFileName,
GENERIC_WRITE,
0,
NULL,
@@ -47,21 +47,21 @@
FILE_ATTRIBUTE_NORMAL,
NULL);
- if(hFile != INVALID_HANDLE_VALUE)
- {
+ if(hFile != INVALID_HANDLE_VALUE)
+ {
TCHAR LVText[500];
TCHAR newl = _T('\n');
TCHAR tab = _T('\t');
- DWORD dwTextLength, dwWritten;
- INT NumListedServ = 0;
- INT i, k;
+ DWORD dwTextLength, dwWritten;
+ INT NumListedServ = 0;
+ INT i, k;
- NumListedServ = ListView_GetItemCount(Info->hListView);
+ NumListedServ = ListView_GetItemCount(Info->hListView);
- for (i=0; i < NumListedServ; i++)
- {
- for (k=0; k<5; k++)
- {
+ for (i=0; i < NumListedServ; i++)
+ {
+ for (k=0; k<5; k++)
+ {
dwTextLength = GetTextFromListView(Info,
LVText,
i,
@@ -80,46 +80,43 @@
&dwWritten,
NULL);
}
- }
- WriteFile(hFile,
+ }
+ WriteFile(hFile,
&newl,
sizeof(TCHAR),
&dwWritten,
NULL);
- }
+ }
- CloseHandle(hFile);
- bSuccess = TRUE;
- }
+ CloseHandle(hFile);
+ bSuccess = TRUE;
+ }
- return bSuccess;
+ return bSuccess;
}
VOID ExportFile(PMAIN_WND_INFO Info)
{
- OPENFILENAME ofn;
- TCHAR szFileName[MAX_PATH] = _T("");
+ OPENFILENAME ofn;
+ TCHAR szFileName[MAX_PATH] = _T("");
- ZeroMemory(&ofn, sizeof(ofn));
+ ZeroMemory(&ofn, sizeof(ofn));
- ofn.lStructSize = sizeof(OPENFILENAME);
- ofn.hwndOwner = Info->hMainWnd;
- ofn.lpstrFilter = _T("Text (Tab Delimited)(*.txt)\0*.txt\0Text (Comma
Delimited)(*.csv)\0*.csv\0");
- ofn.lpstrFile = szFileName;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrDefExt = _T("txt");
- ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = Info->hMainWnd;
+ ofn.lpstrFilter = _T("Text (Tab Delimited)(*.txt)\0*.txt\0Text (Comma
Delimited)(*.csv)\0*.csv\0");
+ ofn.lpstrFile = szFileName;
+ ofn.nMaxFile = MAX_PATH;
+ ofn.lpstrDefExt = _T("txt");
+ ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY |
OFN_OVERWRITEPROMPT;
- if(GetSaveFileName(&ofn))
- {
- if (SaveServicesToFile(Info, szFileName))
+ if(GetSaveFileName(&ofn))
+ {
+ if (SaveServicesToFile(Info, szFileName))
return;
- }
+ }
- if (CommDlgExtendedError() != CDERR_GENERALCODES)
+ if (CommDlgExtendedError() != CDERR_GENERALCODES)
MessageBox(NULL, _T("Export to file failed"), NULL, 0);
}
-
-
-
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 24 22:27:12
2007
@@ -208,8 +208,6 @@
IDS_TOOLTIP_STOP "Ñïèðàíå íà óñëóãàòà"
IDS_TOOLTIP_PAUSE "Çàäúðæàíå (ïàóçà) íà óñëóãàòà"
IDS_TOOLTIP_RESTART "Ïðåçàïóñê íà óñëóãàòà"
- IDS_TOOLTIP_HELP "Ïîìîù"
- IDS_TOOLTIP_EXIT "Èçõîä"
END
STRINGTABLE DISCARDABLE
@@ -226,30 +224,7 @@
/* IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: The option name includes the equal
sign.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n (default =
own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default = demand) \r\n
error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by /
(forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default =
LocalSystem)\r\n password= <password>\r\n" */
IDS_HELP_OPTIONS "ÍÀÑÒÐÎÉÊÈ ÇÀ ÑÚÇÄÀÂÀÍÅ:\r\nÇÀÁÅËÅÆÊÀ: Èìåíàòà íà íàñòðîéêèòå
âêëþ÷âàò çíàê çà ðàâåíñòâî.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n
(default = own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default
= demand) \r\n error= <normal|severe|critical|ignore>\r\n (default =
normal)\r\n group= <LoadOrderGroup>\r\n tag= <yes|no>\r\n depend=
<Dependencies(separated by / (forward slash))>\r\n obj=
<AccountName|ObjectName>\r\n (default = LocalSystem)\r\n password=
<password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -204,8 +204,6 @@
IDS_TOOLTIP_STOP "Dienst beenden"
IDS_TOOLTIP_PAUSE "Dienst anhalten"
IDS_TOOLTIP_RESTART "Dienst neu starten"
- IDS_TOOLTIP_HELP "Hilfe"
- IDS_TOOLTIP_EXIT "Beenden"
END
STRINGTABLE DISCARDABLE
@@ -221,30 +219,7 @@
BEGIN
IDS_HELP_OPTIONS "ERSTELLOPTIONEN:\r\nBEACHTEN SIE: Der Optionsname enthält das
Gleichheitszeichen.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n
(Standard = own)\r\n start= <boot|system|auto|demand|disabled>\r\n (Standard =
demand) \r\n error= <normal|severe|critical|ignore>\r\n (Standard =
normal)\r\n group= <LoadOrderGroup>\r\n tag= <yes|no>\r\n depend=
<Abhängigkeiten (getrennt durch / (Schrägstrich))>\r\n obj=
<KontoName|ObjektName>\r\n (Standard = LocalSystem)\r\n password=
<Passwort>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -204,8 +204,6 @@
IDS_TOOLTIP_STOP "Stop service"
IDS_TOOLTIP_PAUSE "Pause service"
IDS_TOOLTIP_RESTART "Restart service"
- IDS_TOOLTIP_HELP "Help"
- IDS_TOOLTIP_EXIT "Exit"
END
STRINGTABLE DISCARDABLE
@@ -221,30 +219,7 @@
BEGIN
IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: The option name includes the equal
sign.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n (default =
own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default = demand) \r\n
error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by /
(forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default =
LocalSystem)\r\n password= <password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -208,8 +208,6 @@
IDS_TOOLTIP_STOP "Arrêter le service"
IDS_TOOLTIP_PAUSE "Suspendre le service"
IDS_TOOLTIP_RESTART "Redémarrer le service"
- IDS_TOOLTIP_HELP "Aide"
- IDS_TOOLTIP_EXIT "Quitter"
END
STRINGTABLE DISCARDABLE
@@ -225,30 +223,7 @@
BEGIN
IDS_HELP_OPTIONS "OPTIONS DE CREATION:\r\nNOTE: le nom de l'option inclue le
signe =.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n (default =
own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default = demand) \r\n
error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by /
(forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default =
LocalSystem)\r\n password= <password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -204,8 +204,6 @@
IDS_TOOLTIP_STOP "Menghentikan layanan"
IDS_TOOLTIP_PAUSE "Mengistirahatkan layanan"
IDS_TOOLTIP_RESTART "Memulai lagi layanan"
- IDS_TOOLTIP_HELP "Bantuan"
- IDS_TOOLTIP_EXIT "Keluar"
END
STRINGTABLE DISCARDABLE
@@ -221,30 +219,7 @@
BEGIN
IDS_HELP_OPTIONS "OPSI BUAT:\r\nCATATAN: Nama opsi termasuk tanda sama dengan.\r\n
type= <own|share|interact|kernel|filesys|rec>\r\n (standar = own)\r\n start=
<boot|system|auto|demand|disabled>\r\n (standar = demand) \r\n error=
<normal|severe|critical|ignore>\r\n (standar = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(dipisahkan
oleh / (garis miring))>\r\n obj= <AccountName|ObjectName>\r\n (standar =
LocalSystem)\r\n password= <password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -204,8 +204,6 @@
IDS_TOOLTIP_STOP "Ferma servizio"
IDS_TOOLTIP_PAUSE "Pausa servizio"
IDS_TOOLTIP_RESTART "Riavvia servizio"
- IDS_TOOLTIP_HELP "Aiuto"
- IDS_TOOLTIP_EXIT "Esci"
END
STRINGTABLE DISCARDABLE
@@ -221,30 +219,7 @@
BEGIN
IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTA: Il nome dell'ozione comprende il
simbolo di uguale.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n
(default = own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default =
demand) \r\n error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n
group= <LoadOrderGroup>\r\n tag= <yes|no>\r\n depend=
<Dependencies(separated by / (forward slash))>\r\n obj=
<AccountName|ObjectName>\r\n (default = LocalSystem)\r\n password=
<password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -211,8 +211,6 @@
IDS_TOOLTIP_STOP "Zatrzymaj us³ugê"
IDS_TOOLTIP_PAUSE "Wstrzymaj us³ugê"
IDS_TOOLTIP_RESTART "Wznów us³ugê"
- IDS_TOOLTIP_HELP "Pomoc"
- IDS_TOOLTIP_EXIT "Zakoñcz"
END
STRINGTABLE DISCARDABLE
@@ -228,30 +226,7 @@
BEGIN
IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: Nazwa opcji zawiera znak równoci.\r\n
type= <own|share|interact|kernel|filesys|rec>\r\n (default = own)\r\n start=
<boot|system|auto|demand|disabled>\r\n (default = demand) \r\n error=
<normal|severe|critical|ignore>\r\n (default = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by /
(forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default =
LocalSystem)\r\n password= <password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12
2007
@@ -203,8 +203,6 @@
IDS_TOOLTIP_STOP "Îñòàíîâèòü ñëóæáó"
IDS_TOOLTIP_PAUSE "Ïðèîñòàíîâèòü ñëóæáó"
IDS_TOOLTIP_RESTART "Ïåðåçàïóñê ñëóæáû"
- IDS_TOOLTIP_HELP "Ñïðàâêà"
- IDS_TOOLTIP_EXIT "Âûõîä"
END
STRINGTABLE DISCARDABLE
@@ -220,31 +218,6 @@
BEGIN
IDS_HELP_OPTIONS "ÎÏÖÈÈ ÑÎÇÄÀÍÈß:\r\nÏðèìå÷àíèå: Èìÿ îïöèè âêëþ÷àåò çíàê
""ðàâíî"".\r\n type= <own|share|interact|kernel|filesys|rec>\r\n
(ïî óìîë÷àíèþ = own)\r\n start= <boot|system|auto|demand|disabled>\r\n
(ïî óìîë÷àíèþ = demand) \r\n error= <normal|severe|critical|ignore>\r\n (ïî
óìîë÷àíèþ = normal)\r\n group= <LoadOrderGroup>\r\n tag= <yes|no>\r\n depend=
<Dependencies(îòäåëÿåòñÿ / (íàêëîííàÿ ÷åðòà))>\r\n obj=
<AccountName|ObjectName>\r\n (ïî óìîë÷àíèþ = LocalSystem)\r\n password=
<password>\r\n"
END
-
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
/* Hints */
STRINGTABLE DISCARDABLE
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 24 22:27:12
2007
@@ -213,8 +213,6 @@
IDS_TOOLTIP_STOP "Stop service"
IDS_TOOLTIP_PAUSE "Pause service"
IDS_TOOLTIP_RESTART "Restart service"
- IDS_TOOLTIP_HELP "Help"
- IDS_TOOLTIP_EXIT "Exit"
END
STRINGTABLE DISCARDABLE
@@ -230,30 +228,7 @@
BEGIN
IDS_HELP_OPTIONS "CREATE OPTIONS:\r\nNOTE: The option name includes the equal
sign.\r\n type= <own|share|interact|kernel|filesys|rec>\r\n (default =
own)\r\n start= <boot|system|auto|demand|disabled>\r\n (default = demand) \r\n
error= <normal|severe|critical|ignore>\r\n (default = normal)\r\n group=
<LoadOrderGroup>\r\n tag= <yes|no>\r\n depend= <Dependencies(separated by /
(forward slash))>\r\n obj= <AccountName|ObjectName>\r\n (default =
LocalSystem)\r\n password= <password>\r\n"
END
-#define IDS_HINT_BLANK 20000
-#define IDS_HINT_EXPORT 20001
-#define IDS_HINT_EXIT 20002
-
-#define IDS_HINT_CONNECT 20011
-#define IDS_HINT_START 20012
-#define IDS_HINT_STOP 21013
-#define IDS_HINT_PAUSE 21014
-#define IDS_HINT_RESUME 20015
-#define IDS_HINT_RESTART 20016
-#define IDS_HINT_REFRESH 20017
-#define IDS_HINT_EDIT 20018
-#define IDS_HINT_CREATE 20019
-#define IDS_HINT_DELETE 20020
-#define IDS_HINT_PROP 20021
-
-#define IDS_HINT_LARGE 20030
-#define IDS_HINT_SMALL 20031
-#define IDS_HINT_LIST 20032
-#define IDS_HINT_DETAILS 20033
-#define IDS_HINT_CUST 20034
-
-#define IDS_HINT_HELP 20040
-#define IDS_HINT_ABOUT 20041
+
/* Hints */
STRINGTABLE DISCARDABLE
BEGIN
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 24 22:27:12 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/mainwnd.c
+ * FILE: base/applications/mscutils/servman/mainwnd.c
* PURPOSE: Main window message handler
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
@@ -33,12 +33,6 @@
{TBICON_STOP, ID_STOP, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /*
stop */
{TBICON_PAUSE, ID_PAUSE, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /*
pause */
{TBICON_RESTART, ID_RESTART, TBSTATE_INDETERMINATE, BTNS_BUTTON, {0}, 0, 0 }, /*
restart */
-
- {15, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0}, /*
separator */
-
- {TBICON_HELP, ID_HELP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /*
help */
- {TBICON_EXIT, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }, /*
exit */
-
};
@@ -281,7 +275,7 @@
0);
hImageList = InitImageList(IDB_PROP,
- IDB_EXIT,
+ IDB_RESTART,
16,
16);
if (hImageList == NULL)
@@ -585,22 +579,9 @@
{
if (Info->SelectedItem != NO_ITEM_SELECTED)
{
- PPROP_DLG_INFO PropSheet;
-
- PropSheet = (PROP_DLG_INFO*) HeapAlloc(ProcessHeap,
- HEAP_ZERO_MEMORY,
- sizeof(PROP_DLG_INFO));
- if (PropSheet != NULL)
- {
- Info->PropSheet = PropSheet;
- OpenPropSheet(Info);
- }
-
- HeapFree(ProcessHeap,
- 0,
- PropSheet);
-
- Info->PropSheet = NULL;
+ Info->bDlgOpen = TRUE;
+ OpenPropSheet(Info);
+ Info->bDlgOpen = FALSE;
}
}
break;
@@ -667,27 +648,29 @@
case ID_START:
{
- DoStart(Info);
+ if (DoStart(Info))
+ SetMenuAndButtonStates(Info);
}
break;
case ID_STOP:
{
- DoStop(Info);
+ if (DoStop(Info))
+ SetMenuAndButtonStates(Info);
}
break;
case ID_PAUSE:
{
- Control(Info,
- SERVICE_CONTROL_PAUSE);
+ //Control(Info,
+ // SERVICE_CONTROL_PAUSE);
}
break;
case ID_RESUME:
{
- Control(Info,
- SERVICE_CONTROL_CONTINUE );
+ //Control(Info,
+ // SERVICE_CONTROL_CONTINUE );
}
break;
@@ -847,60 +830,60 @@
}
break;
- case WM_SIZE:
- {
+ case WM_SIZE:
+ {
MainWndResize(Info,
LOWORD(lParam),
HIWORD(lParam));
- }
- break;
-
- case WM_NOTIFY:
+ }
+ break;
+
+ case WM_NOTIFY:
{
LPNMHDR pnmhdr = (LPNMHDR)lParam;
switch (pnmhdr->code)
{
- case NM_DBLCLK:
- {
- POINT pt;
- RECT rect;
-
- GetCursorPos(&pt);
- GetWindowRect(Info->hListView, &rect);
-
- if (PtInRect(&rect, pt))
- {
+ case NM_DBLCLK:
+ {
+ POINT pt;
+ RECT rect;
+
+ GetCursorPos(&pt);
+ GetWindowRect(Info->hListView, &rect);
+
+ if (PtInRect(&rect, pt))
+ {
SendMessage(hwnd,
WM_COMMAND,
//ID_PROP,
MAKEWPARAM((WORD)ID_PROP, (WORD)0),
0);
- }
+ }
//OpenPropSheet(Info);
- }
- break;
-
- case LVN_COLUMNCLICK:
- {
+ }
+ break;
+
+ case LVN_COLUMNCLICK:
+ {
LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
(void)ListView_SortItems(Info->hListView,
CompareFunc,
pnmv->iSubItem);
bSortAscending = !bSortAscending;
- }
+ }
break;
- case LVN_ITEMCHANGED:
- {
- LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
-
- ListViewSelectionChanged(Info, pnmv);
-
- }
- break;
+ case LVN_ITEMCHANGED:
+ {
+ LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
+
+ ListViewSelectionChanged(Info, pnmv);
+
+ }
+ break;
case TTN_GETDISPINFO:
{
@@ -949,15 +932,6 @@
case ID_RESTART:
lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_RESTART);
break;
-
- case ID_HELP:
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_HELP);
- break;
-
- case ID_EXIT:
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXIT);
- break;
-
}
}
break;
@@ -1031,19 +1005,19 @@
break;
}
- case WM_CLOSE:
- {
+ case WM_CLOSE:
+ {
/* Free service array */
HeapFree(ProcessHeap,
0,
Info->pServiceStatus);
DestroyMenu(Info->hShortcutMenu);
- DestroyWindow(hwnd);
- }
- break;
-
- case WM_DESTROY:
+ DestroyWindow(hwnd);
+ }
+ break;
+
+ case WM_DESTROY:
{
//DestroyMainWnd(Info);
@@ -1057,18 +1031,18 @@
/* Break the message queue loop */
PostQuitMessage(0);
}
- break;
-
- default:
- {
+ break;
+
+ default:
+ {
HandleDefaultMessage:
Ret = DefWindowProc(hwnd,
msg,
wParam,
lParam);
- }
- break;
+ }
+ break;
}
return Ret;
}
Modified: trunk/reactos/base/applications/mscutils/servman/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/precomp.h (original)
+++ trunk/reactos/base/applications/mscutils/servman/precomp.h Fri Aug 24 22:27:12 2007
@@ -13,29 +13,11 @@
#pragma warning(disable : 4100)
#endif
-#ifndef SB_SIMPLEID
-#define SB_SIMPLEID 0xFF
-#endif
-
#define NO_ITEM_SELECTED -1
#define MAX_KEY_LENGTH 256
-#define NUM_BUTTONS 14
+#define NUM_BUTTONS 11
#define PROGRESSRANGE 8
-
-typedef struct _PROP_DLG_INFO
-{
- HWND hwndGenDlg;
- HWND hwndDepDlg;
- LPTSTR lpServiceName;
- LPTSTR lpDisplayName;
- LPTSTR lpDescription;
- LPTSTR lpPathToExe;
- TCHAR szStartupType;
- TCHAR szServiceStatus[25];
- LPTSTR lpStartParams;
-
-} PROP_DLG_INFO, *PPROP_DLG_INFO;
typedef struct _MAIN_WND_INFO
{
@@ -43,22 +25,14 @@
HWND hListView;
HWND hStatus;
HWND hTool;
- HWND hProgDlg;
HMENU hShortcutMenu;
int nCmdShow;
- /* Stores the complete services array */
- ENUM_SERVICE_STATUS_PROCESS *pServiceStatus;
+ ENUM_SERVICE_STATUS_PROCESS *pServiceStatus; /* Stores the complete services array
*/
+ ENUM_SERVICE_STATUS_PROCESS *CurrentService; /* Stores the current selected service
*/
- /* Stores the current selected service */
- ENUM_SERVICE_STATUS_PROCESS *CurrentService;
-
- /* selection number in the list view */
- INT SelectedItem;
-
- struct _PROP_DLG_INFO *PropSheet;
-
- /* status flags */
+ INT SelectedItem;/* selection number in the list view */
+ BOOL bDlgOpen;
BOOL InMenuLoop;
} MAIN_WND_INFO, *PMAIN_WND_INFO;
@@ -92,7 +66,12 @@
BOOL DoStop(PMAIN_WND_INFO Info);
/* control */
-BOOL Control(PMAIN_WND_INFO Info, DWORD Control);
+BOOL Control(PMAIN_WND_INFO Info, HWND hProgDlg, DWORD Control);
+
+/* progress.c */
+HWND CreateProgressDialog(HWND hParent, LPTSTR lpServiceName);
+VOID IncrementProgressBar(HWND hProgDlg);
+VOID CompleteProgressBar(HWND hProgDlg);
/* query.c */
ENUM_SERVICE_STATUS_PROCESS* GetSelectedService(PMAIN_WND_INFO Info);
Modified: trunk/reactos/base/applications/mscutils/servman/progress.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/progress.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/progress.c Fri Aug 24 22:27:12 2007
@@ -1,20 +1,73 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/progress.c
+ * FILE: base/applications/mscutils/servman/progress.c
* PURPOSE: Progress dialog box message handler
- * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
#include "precomp.h"
-BOOL CALLBACK ProgressDialogProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
+VOID
+CompleteProgressBar(HWND hProgDlg)
+{
+ HWND hProgBar;
+
+ hProgBar = GetDlgItem(hProgDlg,
+ IDC_SERVCON_PROGRESS);
+
+ if (hProgBar)
+ {
+ SendMessage(hProgBar,
+ PBM_DELTAPOS,
+ PROGRESSRANGE,
+ 0);
+ }
+}
+
+VOID
+IncrementProgressBar(HWND hProgDlg)
+{
+ HWND hProgBar;
+
+ hProgBar = GetDlgItem(hProgDlg,
+ IDC_SERVCON_PROGRESS);
+
+ if (hProgBar)
+ {
+ SendMessage(hProgBar,
+ PBM_STEPIT,
+ 0,
+ 0);
+ }
+}
+
+BOOL CALLBACK
+ProgressDialogProc(HWND hDlg,
+ UINT Message,
+ WPARAM wParam,
+ LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
+ {
+ HWND hProgBar;
+ /* set the progress bar range and step */
+ hProgBar = GetDlgItem(hDlg,
+ IDC_SERVCON_PROGRESS);
+ SendMessage(hProgBar,
+ PBM_SETRANGE,
+ 0,
+ MAKELPARAM(0, PROGRESSRANGE));
+
+ SendMessage(hProgBar,
+ PBM_SETSTEP,
+ (WPARAM)1,
+ 0);
+ }
break;
case WM_COMMAND:
@@ -39,3 +92,42 @@
}
+HWND
+CreateProgressDialog(HWND hParent,
+ LPTSTR lpServiceName)
+{
+ HWND hProgDlg;
+ TCHAR ProgDlgBuf[100];
+
+ /* open the progress dialog */
+ hProgDlg = CreateDialog(hInstance,
+ MAKEINTRESOURCE(IDD_DLG_PROGRESS),
+ hParent,
+ (DLGPROC)ProgressDialogProc);
+ if (hProgDlg != NULL)
+ {
+ ShowWindow(hProgDlg,
+ SW_SHOW);
+
+ /* write the info to the progress dialog */
+ LoadString(hInstance,
+ IDS_PROGRESS_INFO_STOP,
+ ProgDlgBuf,
+ sizeof(ProgDlgBuf) / sizeof(TCHAR));
+
+ SendDlgItemMessage(hProgDlg,
+ IDC_SERVCON_INFO,
+ WM_SETTEXT,
+ 0,
+ (LPARAM)ProgDlgBuf);
+
+ /* write the service name to the progress dialog */
+ SendDlgItemMessage(hProgDlg,
+ IDC_SERVCON_NAME,
+ WM_SETTEXT,
+ 0,
+ (LPARAM)lpServiceName);
+ }
+
+ return hProgDlg;
+}
Modified: trunk/reactos/base/applications/mscutils/servman/propsheet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/propsheet.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/propsheet.c Fri Aug 24 22:27:12 2007
@@ -1,16 +1,17 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/propsheet.c
+ * FILE: base/applications/mscutils/servman/propsheet.c
* PURPOSE: Property dialog box message handler
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
#include "precomp.h"
static VOID
-SetButtonStates(PMAIN_WND_INFO Info)
+SetButtonStates(PMAIN_WND_INFO Info,
+ HWND hwndDlg)
{
HWND hButton;
DWORD Flags, State;
@@ -20,25 +21,25 @@
if (State == SERVICE_STOPPED)
{
- hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_START);
+ hButton = GetDlgItem(hwndDlg, IDC_START);
EnableWindow (hButton, TRUE);
}
if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
- hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_STOP);
+ hButton = GetDlgItem(hwndDlg, IDC_STOP);
EnableWindow (hButton, TRUE);
}
if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State ==
SERVICE_RUNNING) )
{
- hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_PAUSE);
+ hButton = GetDlgItem(hwndDlg, IDC_PAUSE);
EnableWindow (hButton, TRUE);
}
if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
- hButton = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_PAUSE);
+ hButton = GetDlgItem(hwndDlg, IDC_PAUSE);
EnableWindow (hButton, TRUE);
}
}
@@ -48,7 +49,8 @@
* values and sets it to value of the selected item
*/
static VOID
-SetStartupType(PMAIN_WND_INFO Info)
+SetStartupType(PMAIN_WND_INFO Info,
+ HWND hwndDlg)
{
HWND hList;
HKEY hKey;
@@ -70,7 +72,7 @@
KEY_READ,
&hKey);
- hList = GetDlgItem(Info->PropSheet->hwndGenDlg, IDC_START_TYPE);
+ hList = GetDlgItem(hwndDlg, IDC_START_TYPE);
LoadString(hInstance, IDS_SERVICES_AUTO, buf, sizeof(buf) / sizeof(TCHAR));
SendMessage(hList, CB_ADDSTRING, 0, (LPARAM)buf);
@@ -97,7 +99,6 @@
SendMessage(hList, CB_SETCURSEL, 1, 0);
else if (StartUp == 0x04)
SendMessage(hList, CB_SETCURSEL, 2, 0);
-
}
@@ -106,75 +107,90 @@
* the relevant service information
*/
static VOID
-GetDlgInfo(PMAIN_WND_INFO Info)
-{
+GetDlgInfo(PMAIN_WND_INFO Info,
+ HWND hwndDlg)
+{
+ LPTSTR lpDescription;
+ LPTSTR lpPathToExe;
+
/* set the service name */
- Info->PropSheet->lpServiceName = Info->CurrentService->lpServiceName;
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ SendDlgItemMessage(hwndDlg,
IDC_SERV_NAME,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->lpServiceName);
+ (LPARAM)Info->CurrentService->lpServiceName);
/* set the display name */
- Info->PropSheet->lpDisplayName = Info->CurrentService->lpDisplayName;
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ SendDlgItemMessage(hwndDlg,
IDC_DISP_NAME,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->lpDisplayName);
+ (LPARAM)Info->CurrentService->lpDisplayName);
/* set the description */
- if ((Info->PropSheet->lpDescription =
GetDescription(Info->CurrentService->lpServiceName)))
- {
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ if ((lpDescription = GetDescription(Info->CurrentService->lpServiceName)))
+ {
+ SendDlgItemMessage(hwndDlg,
IDC_DESCRIPTION,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->lpDescription);
+ (LPARAM)lpDescription);
+
+ HeapFree(ProcessHeap,
+ 0,
+ lpDescription);
+
+
}
/* set the executable path */
- if ((Info->PropSheet->lpPathToExe = GetExecutablePath(Info)))
- {
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ if ((lpPathToExe = GetExecutablePath(Info)))
+ {
+ SendDlgItemMessage(hwndDlg,
IDC_EXEPATH,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->lpPathToExe);
+ (LPARAM)lpPathToExe);
+
+ HeapFree(ProcessHeap,
+ 0,
+ lpPathToExe);
}
/* set startup type */
- SetStartupType(Info);
+ SetStartupType(Info, hwndDlg);
/* set service status */
if (Info->CurrentService->ServiceStatusProcess.dwCurrentState ==
SERVICE_RUNNING)
{
+ TCHAR szServiceStatus[32];
+
LoadString(hInstance,
IDS_SERVICES_STARTED,
- Info->PropSheet->szServiceStatus,
- sizeof(Info->PropSheet->szServiceStatus) / sizeof(TCHAR));
-
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ szServiceStatus,
+ _tcslen(szServiceStatus) + 1);
+
+ SendDlgItemMessage(hwndDlg,
IDC_SERV_STATUS,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->szServiceStatus);
+ (LPARAM)szServiceStatus);
}
else
{
+ TCHAR szServiceStatus[32];
+
LoadString(hInstance,
IDS_SERVICES_STOPPED,
- Info->PropSheet->szServiceStatus,
- sizeof(Info->PropSheet->szServiceStatus) / sizeof(TCHAR));
-
- SendDlgItemMessage(Info->PropSheet->hwndGenDlg,
+ szServiceStatus,
+ _tcslen(szServiceStatus) + 1);
+
+ SendDlgItemMessage(hwndDlg,
IDC_SERV_STATUS,
WM_SETTEXT,
0,
- (LPARAM)Info->PropSheet->szServiceStatus);
- }
-
+ (LPARAM)szServiceStatus);
+ }
}
@@ -207,13 +223,11 @@
Info = (PMAIN_WND_INFO)(((LPPROPSHEETPAGE)lParam)->lParam);
if (Info != NULL)
{
- Info->PropSheet->hwndGenDlg = hwndDlg;
-
SetWindowLongPtr(hwndDlg,
GWLP_USERDATA,
(LONG_PTR)Info);
- GetDlgInfo(Info);
- SetButtonStates(Info);
+ GetDlgInfo(Info, hwndDlg);
+ SetButtonStates(Info, hwndDlg);
}
}
break;
@@ -251,16 +265,6 @@
break;
case WM_DESTROY:
- if (Info->PropSheet->lpDescription)
- HeapFree(ProcessHeap,
- 0,
- Info->PropSheet->lpDescription);
-
- if (Info->PropSheet->lpPathToExe)
- HeapFree(ProcessHeap,
- 0,
- Info->PropSheet->lpPathToExe);
-
break;
case WM_NOTIFY:
@@ -290,8 +294,8 @@
static INT_PTR CALLBACK
DependanciesPageProc(HWND hwndDlg,
UINT uMsg,
- WPARAM wParam,
- LPARAM lParam)
+ WPARAM wParam,
+ LPARAM lParam)
{
PMAIN_WND_INFO Info;
@@ -311,8 +315,6 @@
Info = (PMAIN_WND_INFO)(((LPPROPSHEETPAGE)lParam)->lParam);
if (Info != NULL)
{
- Info->PropSheet->hwndDepDlg = hwndDlg;
-
SetWindowLongPtr(hwndDlg,
GWLP_USERDATA,
(LONG_PTR)Info);
@@ -377,8 +379,6 @@
}
-
-
static VOID
InitPropSheetPage(PROPSHEETPAGE *psp,
PMAIN_WND_INFO Info,
Modified: trunk/reactos/base/applications/mscutils/servman/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/query.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/query.c Fri Aug 24 22:27:12 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/query.c
+ * FILE: base/applications/mscutils/servman/query.c
* PURPOSE: Query service information
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
@@ -320,32 +320,36 @@
GetServiceList(PMAIN_WND_INFO Info)
{
SC_HANDLE ScHandle;
+ BOOL bGotServices = FALSE;
DWORD BytesNeeded = 0;
DWORD ResumeHandle = 0;
DWORD NumServices = 0;
- ScHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);
+ ScHandle = OpenSCManager(NULL,
+ NULL,
+ SC_MANAGER_ENUMERATE_SERVICE);
if (ScHandle != INVALID_HANDLE_VALUE)
{
- if (EnumServicesStatusEx(ScHandle,
- SC_ENUM_PROCESS_INFO,
- SERVICE_WIN32,
- SERVICE_STATE_ALL,
- (LPBYTE)Info->pServiceStatus,
- 0, &BytesNeeded,
- &NumServices,
- &ResumeHandle,
- 0) == FALSE)
+ if (!EnumServicesStatusEx(ScHandle,
+ SC_ENUM_PROCESS_INFO,
+ SERVICE_WIN32,
+ SERVICE_STATE_ALL,
+ (LPBYTE)Info->pServiceStatus,
+ 0,
+ &BytesNeeded,
+ &NumServices,
+ &ResumeHandle,
+ 0))
{
/* Call function again if required size was returned */
if (GetLastError() == ERROR_MORE_DATA)
{
/* reserve memory for service info array */
Info->pServiceStatus = (ENUM_SERVICE_STATUS_PROCESS *)
- HeapAlloc(ProcessHeap,
- 0,
- BytesNeeded);
+ HeapAlloc(ProcessHeap,
+ 0,
+ BytesNeeded);
if (Info->pServiceStatus == NULL)
return FALSE;
@@ -359,22 +363,23 @@
&BytesNeeded,
&NumServices,
&ResumeHandle,
- 0) == FALSE)
+ 0))
{
- HeapFree(ProcessHeap,
- 0,
- Info->pServiceStatus);
- return FALSE;
+ bGotServices = TRUE;
}
}
- else /* exit on failure */
- {
- return FALSE;
- }
}
}
- CloseServiceHandle(ScHandle);
+ if (ScHandle)
+ CloseServiceHandle(ScHandle);
+
+ if (!bGotServices)
+ {
+ HeapFree(ProcessHeap,
+ 0,
+ Info->pServiceStatus);
+ }
return NumServices;
}
Modified: trunk/reactos/base/applications/mscutils/servman/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/reg.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/reg.c Fri Aug 24 22:27:12 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/reg.c
+ * FILE: base/applications/mscutils/servman/reg.c
* PURPOSE: Query service information
- * COPYRIGHT: Copyright 2005 - 2007 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2006-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
Modified: trunk/reactos/base/applications/mscutils/servman/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/resource.h (original)
+++ trunk/reactos/base/applications/mscutils/servman/resource.h Fri Aug 24 22:27:12 2007
@@ -51,8 +51,6 @@
#define IDS_TOOLTIP_STOP 6006
#define IDS_TOOLTIP_PAUSE 6007
#define IDS_TOOLTIP_RESTART 6008
-#define IDS_TOOLTIP_HELP 6009
-#define IDS_TOOLTIP_EXIT 6010
#define IDS_SERVICES_STARTED 5000
#define IDS_SERVICES_STOPPED 5001
@@ -73,8 +71,6 @@
#define IDB_STOP 10006
#define IDB_PAUSE 10007
#define IDB_RESTART 10008
-#define IDB_HELP 10009
-#define IDB_EXIT 10010
/* toolbar buttons */
#define TBICON_PROP 0
@@ -86,8 +82,6 @@
#define TBICON_STOP 6
#define TBICON_PAUSE 7
#define TBICON_RESTART 8
-#define TBICON_HELP 9
-#define TBICON_EXIT 10
/* menu hints */
Modified: trunk/reactos/base/applications/mscutils/servman/start.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/start.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/start.c Fri Aug 24 22:27:12 2007
@@ -1,39 +1,24 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/start.c
+ * FILE: base/applications/mscutils/servman/start.c
* PURPOSE: Start a service
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2005-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
#include "precomp.h"
static BOOL
-DoStartService(PMAIN_WND_INFO Info)
+DoStartService(PMAIN_WND_INFO Info,
+ HWND hProgDlg)
{
- HWND hProgBar;
SC_HANDLE hSCManager;
SC_HANDLE hSc;
SERVICE_STATUS_PROCESS ServiceStatus;
DWORD BytesNeeded = 0;
INT ArgCount = 0;
DWORD dwStartTickCount, dwOldCheckPoint;
-
-
- /* set the progress bar range and step */
- hProgBar = GetDlgItem(Info->hProgDlg,
- IDC_SERVCON_PROGRESS);
-
- SendMessage(hProgBar,
- PBM_SETRANGE,
- 0,
- MAKELPARAM(0, PROGRESSRANGE));
-
- SendMessage(hProgBar,
- PBM_SETSTEP,
- (WPARAM)1,
- 0);
/* open handle to the SCM */
hSCManager = OpenSCManager(NULL,
@@ -92,8 +77,7 @@
else if ( dwWaitTime > 5000 )
dwWaitTime = 5000;
- /* increment the progress bar */
- SendMessage(hProgBar, PBM_STEPIT, 0, 0);
+ IncrementProgressBar(hProgDlg);
/* wait before checking status */
Sleep(ServiceStatus.dwWaitHint / 8);
@@ -112,7 +96,7 @@
if (ServiceStatus.dwCheckPoint > dwOldCheckPoint)
{
/* The service is making progress. increment the progress bar */
- SendMessage(hProgBar, PBM_STEPIT, 0, 0);
+ IncrementProgressBar(hProgDlg);
dwStartTickCount = GetTickCount();
dwOldCheckPoint = ServiceStatus.dwCheckPoint;
}
@@ -130,96 +114,34 @@
if (ServiceStatus.dwCurrentState == SERVICE_RUNNING)
{
- SendMessage(hProgBar,
- PBM_DELTAPOS,
- PROGRESSRANGE,
- 0);
+ CompleteProgressBar(hProgDlg);
Sleep(1000);
return TRUE;
}
else
return FALSE;
-
}
-
-
BOOL
DoStart(PMAIN_WND_INFO Info)
{
HWND hProgDlg;
- TCHAR ProgDlgBuf[100];
+ BOOL bRet = FALSE;
- /* open the progress dialog */
- hProgDlg = CreateDialog(hInstance,
- MAKEINTRESOURCE(IDD_DLG_PROGRESS),
- Info->hMainWnd,
- (DLGPROC)ProgressDialogProc);
- if (hProgDlg != NULL)
+ hProgDlg = CreateProgressDialog(Info->hMainWnd,
+ Info->CurrentService->lpServiceName);
+
+ if (hProgDlg)
{
- ShowWindow(hProgDlg,
- SW_SHOW);
+ bRet = DoStartService(Info,
+ hProgDlg);
- /* write the info to the progress dialog */
- LoadString(hInstance,
- IDS_PROGRESS_INFO_START,
- ProgDlgBuf,
- sizeof(ProgDlgBuf) / sizeof(TCHAR));
-
- SendDlgItemMessage(hProgDlg,
- IDC_SERVCON_INFO,
- WM_SETTEXT,
- 0,
- (LPARAM)ProgDlgBuf);
-
- /* write the service name to the progress dialog */
- SendDlgItemMessage(hProgDlg,
- IDC_SERVCON_NAME,
- WM_SETTEXT,
- 0,
- (LPARAM)Info->CurrentService->lpServiceName);
+ SendMessage(hProgDlg,
+ WM_DESTROY,
+ 0,
+ 0);
}
- /* start the service */
- if ( DoStartService(Info) )
- {
- LVITEM item;
- TCHAR szStatus[64];
- TCHAR buf[25];
-
- LoadString(hInstance,
- IDS_SERVICES_STARTED,
- szStatus,
- sizeof(szStatus) / sizeof(TCHAR));
- item.pszText = szStatus;
- item.iItem = Info->SelectedItem;
- item.iSubItem = 2;
- SendMessage(Info->hListView,
- LVM_SETITEMTEXT,
- item.iItem,
- (LPARAM) &item);
-
- /* change dialog status */
- if (Info->PropSheet != NULL)
- {
- LoadString(hInstance,
- IDS_SERVICES_STARTED,
- buf,
- sizeof(buf) / sizeof(TCHAR));
-
- SendDlgItemMessageW(Info->PropSheet->hwndGenDlg,
- IDC_SERV_STATUS,
- WM_SETTEXT,
- 0,
- (LPARAM)buf);
- }
- }
-
- SendMessage(hProgDlg,
- WM_DESTROY,
- 0,
- 0);
-
- return TRUE;
+ return bRet;
}
Modified: trunk/reactos/base/applications/mscutils/servman/stop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
==============================================================================
--- trunk/reactos/base/applications/mscutils/servman/stop.c (original)
+++ trunk/reactos/base/applications/mscutils/servman/stop.c Fri Aug 24 22:27:12 2007
@@ -1,9 +1,9 @@
/*
* PROJECT: ReactOS Services
* LICENSE: GPL - See COPYING in the top level directory
- * FILE: base/system/servman/stop.c
+ * FILE: base/applications/mscutils/servman/stop.c
* PURPOSE: Stops a service
- * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy(a)gmail.com>
+ * COPYRIGHT: Copyright 2005-2007 Ged Murphy <gedmurphy(a)reactos.org>
*
*/
@@ -11,68 +11,20 @@
BOOL DoStop(PMAIN_WND_INFO Info)
{
+ BOOL ret = FALSE;
HWND hProgDlg;
- TCHAR ProgDlgBuf[100];
- /* open the progress dialog */
- hProgDlg = CreateDialog(hInstance,
- MAKEINTRESOURCE(IDD_DLG_PROGRESS),
- Info->hMainWnd,
- (DLGPROC)ProgressDialogProc);
- if (hProgDlg != NULL)
+ hProgDlg = CreateProgressDialog(Info->hMainWnd,
+ Info->CurrentService->lpServiceName);
+
+ if (hProgDlg)
{
- ShowWindow(hProgDlg,
- SW_SHOW);
+ ret = Control(Info,
+ hProgDlg,
+ SERVICE_CONTROL_STOP);
- /* write the info to the progress dialog */
- LoadString(hInstance,
- IDS_PROGRESS_INFO_STOP,
- ProgDlgBuf,
- sizeof(ProgDlgBuf) / sizeof(TCHAR));
-
- SendDlgItemMessage(hProgDlg,
- IDC_SERVCON_INFO,
- WM_SETTEXT,
- 0,
- (LPARAM)ProgDlgBuf);
-
- /* write the service name to the progress dialog */
- SendDlgItemMessage(hProgDlg,
- IDC_SERVCON_NAME,
- WM_SETTEXT,
- 0,
- (LPARAM)Info->CurrentService->lpServiceName);
+ SendMessage(hProgDlg, WM_DESTROY, 0, 0);
}
- if ( Control(Info, SERVICE_CONTROL_STOP) )
- {
- LVITEM item;
- TCHAR buf[25];
-
- item.pszText = _T('\0');
- item.iItem = Info->SelectedItem;
- item.iSubItem = 2;
- SendMessage(Info->hListView,
- LVM_SETITEMTEXT,
- item.iItem,
- (LPARAM) &item);
-
- /* change dialog status */
- if (Info->PropSheet != NULL)
- {
- LoadString(hInstance,
- IDS_SERVICES_STOPPED,
- buf,
- sizeof(buf) / sizeof(TCHAR));
-
- SendDlgItemMessageW(Info->PropSheet->hwndGenDlg,
- IDC_SERV_STATUS, WM_SETTEXT,
- 0,
- (LPARAM)buf);
- }
- }
-
- SendMessage(hProgDlg, WM_DESTROY, 0, 0);
-
- return TRUE;
+ return ret;
}