mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
[SERVMAN]
- Allow params to be passed through the progress dialog - PAss the start params svn path=/trunk/; revision=67099
This commit is contained in:
parent
16cf1d284d
commit
d73995a7ce
|
@ -475,7 +475,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
|||
RunActionWithProgress(Info->hMainWnd,
|
||||
Info->pCurrentService->lpServiceName,
|
||||
Info->pCurrentService->lpDisplayName,
|
||||
ACTION_START);
|
||||
ACTION_START,
|
||||
NULL); //FIXME: Add start params
|
||||
|
||||
UpdateServiceStatus(Info->pCurrentService);
|
||||
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
|
||||
|
@ -489,7 +490,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
|||
RunActionWithProgress(Info->hMainWnd,
|
||||
Info->pCurrentService->lpServiceName,
|
||||
Info->pCurrentService->lpDisplayName,
|
||||
ACTION_STOP);
|
||||
ACTION_STOP,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(Info->pCurrentService);
|
||||
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
|
||||
|
@ -502,7 +504,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
|||
RunActionWithProgress(Info->hMainWnd,
|
||||
Info->pCurrentService->lpServiceName,
|
||||
Info->pCurrentService->lpDisplayName,
|
||||
ACTION_PAUSE);
|
||||
ACTION_PAUSE,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(Info->pCurrentService);
|
||||
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
|
||||
|
@ -514,7 +517,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
|||
RunActionWithProgress(Info->hMainWnd,
|
||||
Info->pCurrentService->lpServiceName,
|
||||
Info->pCurrentService->lpDisplayName,
|
||||
ACTION_RESUME);
|
||||
ACTION_RESUME,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(Info->pCurrentService);
|
||||
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
|
||||
|
@ -526,7 +530,8 @@ MainWndCommand(PMAIN_WND_INFO Info,
|
|||
RunActionWithProgress(Info->hMainWnd,
|
||||
Info->pCurrentService->lpServiceName,
|
||||
Info->pCurrentService->lpDisplayName,
|
||||
ACTION_RESTART);
|
||||
ACTION_RESTART,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(Info->pCurrentService);
|
||||
ChangeListViewText(Info, Info->pCurrentService, LVSTATUS);
|
||||
|
|
|
@ -104,7 +104,7 @@ BOOL DoControlService(LPWSTR ServiceName, HWND hProgress, DWORD Control);
|
|||
|
||||
/* progress.c */
|
||||
#define DEFAULT_STEP 0
|
||||
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action);
|
||||
BOOL RunActionWithProgress(HWND hParent, LPWSTR ServiceName, LPWSTR DisplayName, UINT Action, PVOID Param);
|
||||
VOID IncrementProgressBar(HANDLE hProgress, UINT NewPos);
|
||||
VOID CompleteProgressBar(HANDLE hProgress);
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ typedef struct _PROGRESS_DATA
|
|||
ULONG Action;
|
||||
BOOL StopDepends;
|
||||
LPWSTR ServiceList;
|
||||
PVOID Param;
|
||||
|
||||
} PROGRESS_DATA, *PPROGRESS_DATA;
|
||||
|
||||
|
@ -75,7 +76,7 @@ unsigned int __stdcall ActionThread(void* Param)
|
|||
/* Start the service */
|
||||
if (DoStartService(ProgressData->ServiceName,
|
||||
ProgressData->hProgress,
|
||||
NULL))
|
||||
ProgressData->Param))
|
||||
{
|
||||
/* We're done, slide the progress bar up to the top */
|
||||
CompleteProgressBar(ProgressData->hProgress);
|
||||
|
@ -322,7 +323,8 @@ BOOL
|
|||
RunActionWithProgress(HWND hParent,
|
||||
LPWSTR ServiceName,
|
||||
LPWSTR DisplayName,
|
||||
UINT Action)
|
||||
UINT Action,
|
||||
PVOID Param)
|
||||
{
|
||||
PROGRESS_DATA ProgressData;
|
||||
LPWSTR ServiceList;
|
||||
|
@ -357,6 +359,7 @@ RunActionWithProgress(HWND hParent,
|
|||
ProgressData.Action = Action;
|
||||
ProgressData.StopDepends = StopDepends;
|
||||
ProgressData.ServiceList = ServiceList;
|
||||
ProgressData.Param = Param;
|
||||
|
||||
Result = DialogBoxParamW(hInstance,
|
||||
MAKEINTRESOURCEW(IDD_DLG_PROGRESS),
|
||||
|
|
|
@ -247,26 +247,6 @@ SaveDlgInfo(PSERVICEPROPSHEET dlgInfo,
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
OnStart(HWND hwndDlg,
|
||||
PSERVICEPROPSHEET dlgInfo)
|
||||
{
|
||||
WCHAR szStartParams[256];
|
||||
LPWSTR lpStartParams = NULL;
|
||||
|
||||
if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
|
||||
lpStartParams = szStartParams;
|
||||
|
||||
//if (DoStart(dlgInfo->Info, lpStartParams))
|
||||
{
|
||||
UpdateServiceStatus(dlgInfo->pService);
|
||||
ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
|
||||
SetButtonStates(dlgInfo, hwndDlg);
|
||||
SetServiceStatusText(dlgInfo, hwndDlg);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* General Property dialog callback.
|
||||
* Controls messages to the General dialog
|
||||
|
@ -312,22 +292,32 @@ GeneralPageProc(HWND hwndDlg,
|
|||
break;
|
||||
|
||||
case IDC_START:
|
||||
{
|
||||
WCHAR szStartParams[256];
|
||||
LPWSTR lpStartParams = NULL;
|
||||
|
||||
if (GetDlgItemText(hwndDlg, IDC_START_PARAM, szStartParams, 256) > 0)
|
||||
lpStartParams = szStartParams;
|
||||
|
||||
RunActionWithProgress(hwndDlg,
|
||||
dlgInfo->pService->lpServiceName,
|
||||
dlgInfo->pService->lpDisplayName,
|
||||
ACTION_START);
|
||||
ACTION_START,
|
||||
lpStartParams);
|
||||
|
||||
UpdateServiceStatus(dlgInfo->pService);
|
||||
ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
|
||||
SetButtonStates(dlgInfo, hwndDlg);
|
||||
SetServiceStatusText(dlgInfo, hwndDlg);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_STOP:
|
||||
RunActionWithProgress(hwndDlg,
|
||||
dlgInfo->pService->lpServiceName,
|
||||
dlgInfo->pService->lpDisplayName,
|
||||
ACTION_STOP);
|
||||
ACTION_STOP,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(dlgInfo->pService);
|
||||
ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
|
||||
|
@ -339,7 +329,8 @@ GeneralPageProc(HWND hwndDlg,
|
|||
RunActionWithProgress(hwndDlg,
|
||||
dlgInfo->pService->lpServiceName,
|
||||
dlgInfo->pService->lpDisplayName,
|
||||
ACTION_PAUSE);
|
||||
ACTION_PAUSE,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(dlgInfo->pService);
|
||||
ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
|
||||
|
@ -351,7 +342,8 @@ GeneralPageProc(HWND hwndDlg,
|
|||
RunActionWithProgress(hwndDlg,
|
||||
dlgInfo->pService->lpServiceName,
|
||||
dlgInfo->pService->lpDisplayName,
|
||||
ACTION_RESUME);
|
||||
ACTION_RESUME,
|
||||
NULL);
|
||||
|
||||
UpdateServiceStatus(dlgInfo->pService);
|
||||
ChangeListViewText(dlgInfo->Info, dlgInfo->pService, LVSTATUS);
|
||||
|
@ -370,8 +362,8 @@ GeneralPageProc(HWND hwndDlg,
|
|||
SendMessage(hName, EM_SETREADONLY, FALSE, 0);
|
||||
SendMessage(hDesc, EM_SETREADONLY, FALSE, 0);
|
||||
SendMessage(hExePath, EM_SETREADONLY, FALSE, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_START_PARAM:
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
|
|
Loading…
Reference in a new issue