remove unneeded loop check

svn path=/trunk/; revision=20996
This commit is contained in:
Ged Murphy 2006-01-22 23:42:45 +00:00
parent 088390e90c
commit 7109a359ec
3 changed files with 7 additions and 8 deletions

View file

@ -22,7 +22,6 @@ BOOL Control(HWND hProgDlg, DWORD Control)
SERVICE_STATUS Status;
LVITEM item;
DWORD BytesNeeded = 0;
DWORD Loop = 5; //FIXME: testing value. needs better control
DWORD dwStartTickCount, dwOldCheckPoint;
item.mask = LVIF_PARAM;
@ -34,7 +33,7 @@ BOOL Control(HWND hProgDlg, DWORD Control)
/* set the progress bar range and step */
hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS);
SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop));
SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE));
SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0);
/* open handle to the SCM */
@ -79,7 +78,7 @@ BOOL Control(HWND hProgDlg, DWORD Control)
/* loop whilst service is not running */
/* FIXME: needs more control adding. 'Loop' is temparary */
while (ServiceStatus.dwCurrentState != Control || !Loop)
while (ServiceStatus.dwCurrentState != Control)
{
DWORD dwWaitTime;
@ -129,7 +128,7 @@ BOOL Control(HWND hProgDlg, DWORD Control)
if (ServiceStatus.dwCurrentState == Control)
{
SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0);
SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0);
Sleep(1000);
return TRUE;
}

View file

@ -11,6 +11,7 @@
#define MAX_KEY_LENGTH 256
#define NUM_BUTTONS 13
#define PROGRESSRANGE 8
BOOL RefreshServiceList(VOID);

View file

@ -21,7 +21,6 @@ BOOL DoStartService(HWND hProgDlg)
ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
DWORD BytesNeeded = 0;
INT ArgCount = 0;
DWORD Loop = 5; //FIXME: testing value. needs better control
DWORD dwStartTickCount, dwOldCheckPoint;
/* copy pointer to selected service */
@ -29,7 +28,7 @@ BOOL DoStartService(HWND hProgDlg)
/* set the progress bar range and step */
hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS);
SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop));
SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE));
SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0);
/* open handle to the SCM */
@ -72,7 +71,7 @@ BOOL DoStartService(HWND hProgDlg)
/* loop whilst service is not running */
/* FIXME: needs more control adding. 'Loop' is temparary */
while (ServiceStatus.dwCurrentState != SERVICE_RUNNING || !Loop)
while (ServiceStatus.dwCurrentState != SERVICE_RUNNING)
{
DWORD dwWaitTime;
@ -122,7 +121,7 @@ BOOL DoStartService(HWND hProgDlg)
if (ServiceStatus.dwCurrentState == SERVICE_RUNNING)
{
SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0);
SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0);
Sleep(1000);
return TRUE;
}