--- trunk/reactos/base/system/servman/servman.c 2006-01-30 22:42:02 UTC (rev 60)
+++ trunk/reactos/base/system/servman/servman.c 2006-01-30 22:50:50 UTC (rev 61)
@@ -356,37 +356,40 @@
case ID_START:
{
- if ( DoStartService(hProgDlg) )
+
+ /* open the progress dialog */
+ hProgDlg = CreateDialog(GetModuleHandle(NULL),
+ MAKEINTRESOURCE(IDD_DLG_PROGRESS),
+ hMainWnd,
+ (DLGPROC)ProgressDialogProc);
+ if (hProgDlg != NULL)
{
ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
- LVITEM item;
- TCHAR szStatus[64];
- TCHAR buf[25];
TCHAR ProgDlgBuf[100];
- /* open the progress dialog */
- hProgDlg = CreateDialog(GetModuleHandle(NULL),
- MAKEINTRESOURCE(IDD_DLG_PROGRESS),
- hMainWnd,
- (DLGPROC)ProgressDialogProc);
- if (hProgDlg != NULL)
- {
- ShowWindow(hProgDlg, SW_SHOW);
+ ShowWindow(hProgDlg, SW_SHOW);
- /* 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 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);
- /* get pointer to selected service */
- Service = GetSelectedService();
+ /* get pointer to selected service */
+ Service = GetSelectedService();
- /* write the service name to the progress dialog */
- SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0,
- (LPARAM)Service->lpServiceName);
- }
+ /* write the service name to the progress dialog */
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0,
+ (LPARAM)Service->lpServiceName);
+ }
+ if ( DoStartService(hProgDlg) )
+ {
+
+ LVITEM item;
+ TCHAR szStatus[64];
+ TCHAR buf[25];
+
LoadString(hInstance, IDS_SERVICES_STARTED, szStatus,
sizeof(szStatus) / sizeof(TCHAR));
item.pszText = szStatus;
@@ -411,36 +414,37 @@
case ID_STOP:
{
- if( Control(hProgDlg, SERVICE_CONTROL_STOP) )
+ /* open the progress dialog */
+ hProgDlg = CreateDialog(GetModuleHandle(NULL),
+ MAKEINTRESOURCE(IDD_DLG_PROGRESS),
+ hMainWnd,
+ (DLGPROC)ProgressDialogProc);
+ if (hProgDlg != NULL)
{
ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
- LVITEM item;
- TCHAR buf[25];
TCHAR ProgDlgBuf[100];
- /* open the progress dialog */
- hProgDlg = CreateDialog(GetModuleHandle(NULL),
- MAKEINTRESOURCE(IDD_DLG_PROGRESS),
- hMainWnd,
- (DLGPROC)ProgressDialogProc);
- if (hProgDlg != NULL)
- {
- ShowWindow(hProgDlg, SW_SHOW);
+ 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 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);
- /* get pointer to selected service */
- Service = GetSelectedService();
+ /* get pointer to selected service */
+ Service = GetSelectedService();
- /* write the service name to the progress dialog */
- SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0,
- (LPARAM)Service->lpServiceName);
- }
+ /* write the service name to the progress dialog */
+ SendDlgItemMessage(hProgDlg, IDC_SERVCON_NAME, WM_SETTEXT, 0,
+ (LPARAM)Service->lpServiceName);
+ }
+ if( Control(hProgDlg, SERVICE_CONTROL_STOP) )
+ {
+
+ LVITEM item;
+ TCHAR buf[25];
item.pszText = '\0';
item.iItem = GetSelectedItem();