Modified: trunk/reactos/base/system/servman/En.rc
Modified: trunk/reactos/base/system/servman/export.c
Modified: trunk/reactos/base/system/servman/propsheet.c
Modified: trunk/reactos/base/system/servman/query.c
Modified: trunk/reactos/base/system/servman/resource.h
Modified: trunk/reactos/base/system/servman/servman.c
--- trunk/reactos/base/system/servman/En.rc 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/En.rc 2006-02-01 19:41:17 UTC (rev 70)
@@ -2,54 +2,59 @@
BEGIN
POPUP "&File"
BEGIN
- MENUITEM "E&xit",ID_EXIT
+ MENUITEM "E&xit", ID_EXIT
END
POPUP "Action"
BEGIN
- MENUITEM "Start",ID_START
- MENUITEM "Stop",ID_STOP
- MENUITEM "Pause",ID_PAUSE
- MENUITEM "Resume",ID_RESUME
- MENUITEM "Restart",ID_RESTART
+ MENUITEM "Start", ID_START, GRAYED
+ MENUITEM "Stop", ID_STOP, GRAYED
+ MENUITEM "Pause", ID_PAUSE, GRAYED
+ MENUITEM "Resume", ID_RESUME, GRAYED
+ MENUITEM "Restart", ID_RESTART, GRAYED
MENUITEM SEPARATOR
- MENUITEM "Refresh",ID_REFRESH
+ MENUITEM "Refresh", ID_REFRESH
MENUITEM SEPARATOR
- MENUITEM "Properties",ID_PROP
+ MENUITEM "Properties", ID_PROP, GRAYED
END
POPUP "View"
BEGIN
- MENUITEM "Customize",ID_VIEW_CUSTOMIZE
+ MENUITEM "Large Icons", ID_VIEW_LARGE
+ MENUITEM "Small Icons", ID_VIEW_SMALL
+ MENUITEM "List", ID_VIEW_LIST
+ MENUITEM "Details", ID_VIEW_DETAILS
+ MENUITEM SEPARATOR
+ MENUITEM "Customize", ID_VIEW_CUSTOMIZE, GRAYED
END
POPUP "Help"
BEGIN
- MENUITEM "About",ID_ABOUT
+ MENUITEM "About", ID_ABOUT
END
END
IDR_POPUP MENU
BEGIN
POPUP "popup"
BEGIN
- MENUITEM "Start",ID_START
- MENUITEM "Stop",ID_STOP
- MENUITEM "Pause",ID_PAUSE
- MENUITEM "Resume",ID_RESUME
- MENUITEM "Restart",ID_RESTART
+ MENUITEM "Start", ID_START, GRAYED
+ MENUITEM "Stop", ID_STOP, GRAYED
+ MENUITEM "Pause", ID_PAUSE, GRAYED
+ MENUITEM "Resume", ID_RESUME, GRAYED
+ MENUITEM "Restart", ID_RESTART, GRAYED
MENUITEM SEPARATOR
POPUP "All tasks"
BEGIN
- MENUITEM "Start",ID_START
- MENUITEM "Stop",ID_STOP
- MENUITEM "Pause",ID_PAUSE
- MENUITEM "Resume",ID_RESUME
- MENUITEM "Restart",ID_RESTART
- MENUITEM "Refresh",ID_REFRESH
+ MENUITEM "Start", ID_START, GRAYED
+ MENUITEM "Stop", ID_STOP, GRAYED
+ MENUITEM "Pause", ID_PAUSE, GRAYED
+ MENUITEM "Resume", ID_RESUME, GRAYED
+ MENUITEM "Restart", ID_RESTART, GRAYED
+ MENUITEM "Refresh", ID_REFRESH, GRAYED
END
MENUITEM SEPARATOR
- MENUITEM "Refresh",ID_REFRESH
+ MENUITEM "Refresh", ID_REFRESH
MENUITEM SEPARATOR
- MENUITEM "Properties",ID_PROP
+ MENUITEM "Properties", ID_PROP
MENUITEM SEPARATOR
- MENUITEM "Help",ID_HELP
+ MENUITEM "Help", ID_HELP
END
END
@@ -58,7 +63,7 @@
FONT 8,"Tahoma",0,0
STYLE WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
BEGIN
- LTEXT "Service Manager v0.1\nCopyright (C) 2006\nby Ged Murphy (gedmurphy@gmail.com)", IDC_STATIC, 48, 7, 130, 26
+ LTEXT "Service Manager v0.3\nCopyright (C) 2005-2006\nby Ged Murphy (gedmurphy@gmail.com)", 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
@@ -74,10 +79,10 @@
EDITTEXT IDC_DESCRIPTION, 70, 46, 176, 24, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_MULTILINE | ES_READONLY
EDITTEXT IDC_EXEPATH, 6, 86, 240, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_READONLY
CONTROL "",IDC_START_TYPE,"ComboBox",0x50010003,70,107,176,11
- PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15
- PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15
- PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15
- PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15
+ PUSHBUTTON "Start", IDC_START, 6, 155, 54, 15, WS_DISABLED
+ PUSHBUTTON "Stop", IDC_STOP, 68, 155, 54, 15, WS_DISABLED
+ PUSHBUTTON "Pause", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED
+ PUSHBUTTON "Resume", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED
LTEXT "Service name:", IDC_STATIC, 4, 11, 53, 11
LTEXT "Display name:", IDC_STATIC, 4, 29, 53, 11
LTEXT "Description:", IDC_STATIC, 4, 51, 53, 11
--- trunk/reactos/base/system/servman/export.c 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/export.c 2006-02-01 19:41:17 UTC (rev 70)
@@ -87,7 +87,8 @@
return;
}
- MessageBox(NULL, _T("Export to file failed"), NULL, 0);
+ if (CommDlgExtendedError() != CDERR_GENERALCODES)
+ MessageBox(NULL, _T("Export to file failed"), NULL, 0);
}
--- trunk/reactos/base/system/servman/propsheet.c 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/propsheet.c 2006-02-01 19:41:17 UTC (rev 70)
@@ -29,6 +29,43 @@
+VOID SetButtonStates()
+{
+ HWND hButton;
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
+ DWORD Flags, State;
+
+ /* get pointer to selected service */
+ Service = GetSelectedService();
+
+ Flags = Service->ServiceStatusProcess.dwControlsAccepted;
+ State = Service->ServiceStatusProcess.dwCurrentState;
+
+ if (State == SERVICE_STOPPED)
+ {
+ hButton = GetDlgItem(hwndGenDlg, IDC_START);
+ EnableWindow (hButton, TRUE);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
+ {
+ hButton = GetDlgItem(hwndGenDlg, IDC_STOP);
+ EnableWindow (hButton, TRUE);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) )
+ {
+ hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE);
+ EnableWindow (hButton, TRUE);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
+ {
+ hButton = GetDlgItem(hwndGenDlg, IDC_PAUSE);
+ EnableWindow (hButton, TRUE);
+ }
+}
+
/*
* Fills the 'startup type' combo box with possible
* values and sets it to value of the selected item
@@ -163,43 +200,60 @@
{
case WM_INITDIALOG:
GetDlgInfo();
+ SetButtonStates();
+ break;
- break;
-
case WM_COMMAND:
switch(LOWORD(wParam))
{
+ case IDC_START_TYPE:
+ /* Enable the 'Apply' button */
+ //PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ break;
+
case IDC_START:
SendMessage(hMainWnd, WM_COMMAND, ID_START, 0);
- break;
+ break;
case IDC_STOP:
SendMessage(hMainWnd, WM_COMMAND, ID_STOP, 0);
- break;
+ break;
case IDC_PAUSE:
SendMessage(hMainWnd, WM_COMMAND, ID_PAUSE, 0);
- break;
+ break;
case IDC_RESUME:
SendMessage(hMainWnd, WM_COMMAND, ID_RESUME, 0);
- break;
+ break;
+
+ case IDC_START_PARAM:
+ /* Enable the 'Apply' button */
+ //PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ break;
+
}
break;
case WM_DESTROY:
- break;
+ break;
case WM_NOTIFY:
{
LPNMHDR lpnm = (LPNMHDR)lParam;
switch (lpnm->code)
+ {
+ case MCN_SELECT:
+ /* Enable the 'Apply' button */
+ PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ break;
- default:
+ default:
break;
+ }
}
- break;
+ break;
}
return FALSE;
--- trunk/reactos/base/system/servman/query.c 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/query.c 2006-02-01 19:41:17 UTC (rev 70)
@@ -414,206 +414,3 @@
return NumServices;
}
-
-
-
-
-
-
-
-
-
-
-
-/*
- //WORD wCodePage;
- //WORD wLangID;
- //SC_HANDLE hService;
- //DWORD dwHandle, dwLen;
- //UINT BufLen;
- //TCHAR* lpData;
- //TCHAR* lpBuffer;
- //TCHAR szStrFileInfo[80];
- //TCHAR FileName[MAX_PATH];
- //LPVOID pvData;
-
- //LPSERVICE_FAILURE_ACTIONS pServiceFailureActions = NULL;
- //LPQUERY_SERVICE_CONFIG pServiceConfig = NULL;
-
- BytesNeeded = 0;
- hService = OpenService(ScHandle,
- pServiceStatus[Index].lpServiceName,
- SC_MANAGER_CONNECT);
- if (hService != INVALID_HANDLE_VALUE)
- {
- / * check if service is required by the system* /
- if (!QueryServiceConfig2(hService,
- SERVICE_CONFIG_FAILURE_ACTIONS,
- (LPBYTE)pServiceFailureActions,
- 0,
- &BytesNeeded))
- {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- {
- pServiceFailureActions = (LPSERVICE_FAILURE_ACTIONS)
- HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
- if (pServiceFailureActions == NULL)
- return FALSE;
-
- if (!QueryServiceConfig2(hService,
- SERVICE_CONFIG_FAILURE_ACTIONS,
- (LPBYTE)pServiceFailureActions,
- BytesNeeded,
- &BytesNeeded))
- {
- HeapFree(GetProcessHeap(), 0, pServiceFailureActions);
- return FALSE;
- }
- }
- else / * exit on failure * /
- {
- return FALSE;
- }
- }
- if (pServiceFailureActions->cActions)
- {
- if (pServiceFailureActions->lpsaActions[0].Type == SC_ACTION_REBOOT)
- {
- LoadString(hInstance, IDS_SERVICES_YES, szStatus, 128);
- item.pszText = szStatus;
- item.iSubItem = 1;
- SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
- }
- }
-
- if (pServiceFailureActions != NULL)
- {
- HeapFree(GetProcessHeap(), 0, pServiceFailureActions);
- pServiceFailureActions = NULL;
- }
-
- / * get vendor of service binary * /
- BytesNeeded = 0;
- if (!QueryServiceConfig(hService, pServiceConfig, 0, &BytesNeeded))
- {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- {
- pServiceConfig = (LPQUERY_SERVICE_CONFIG)
- HeapAlloc(GetProcessHeap(), 0, BytesNeeded);
- if (pServiceConfig == NULL)
- return FALSE;
-
- if (!QueryServiceConfig(hService,
- pServiceConfig,
- BytesNeeded,
- &BytesNeeded))
- {
- HeapFree(GetProcessHeap(), 0, pServiceConfig);
- return FALSE;
- }
- }
- else / * exit on failure * /
- {
- return FALSE;
- }
- }
-
- memset(&FileName, 0, MAX_PATH);
- if (_tcscspn(pServiceConfig->lpBinaryPathName, _T("\"")))
- {
- _tcsncpy(FileName, pServiceConfig->lpBinaryPathName,
- _tcscspn(pServiceConfig->lpBinaryPathName, _T(" ")) );
- }
- else
- {
- _tcscpy(FileName, pServiceConfig->lpBinaryPathName);
- }
-
- HeapFree(GetProcessHeap(), 0, pServiceConfig);
- pServiceConfig = NULL;
-
- dwLen = GetFileVersionInfoSize(FileName, &dwHandle);
- if (dwLen)
- {
- lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);
- if (lpData == NULL)
- return FALSE;
-
- if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) {
- HeapFree(GetProcessHeap(), 0, lpData);
- return FALSE;
- }
-
- if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), &pvData, (PUINT) &BufLen))
- {
- wCodePage = LOWORD(*(DWORD*) pvData);
- wLangID = HIWORD(*(DWORD*) pvData);
- wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"), wCodePage, wLangID);
- }
-
- if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen)) {
- item.pszText = lpBuffer;
- item.iSubItem = 2;
- SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
- }
- HeapFree(GetProcessHeap(), 0, lpData);
- }
- else
- {
- LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128);
- item.pszText = szStatus;
- item.iSubItem = 2;
- SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
- }
- CloseServiceHandle(hService);
- }
-
-
-
-
-
-
-
- HeapFree(GetProcessHeap(), 0, pServiceConfig);
- pServiceConfig = NULL;
-
- dwLen = GetFileVersionInfoSize(FileName, &dwHandle);
- if (dwLen)
- {
- lpData = (TCHAR*) HeapAlloc(GetProcessHeap(), 0, dwLen);
- if (lpData == NULL)
- return FALSE;
-
- if (!GetFileVersionInfo (FileName, dwHandle, dwLen, lpData)) {
- HeapFree(GetProcessHeap(), 0, lpData);
- return FALSE;
- }
-
- if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"),
- &pvData, (PUINT) &BufLen))
- {
- wCodePage = LOWORD(*(DWORD*) pvData);
- wLangID = HIWORD(*(DWORD*) pvData);
- wsprintf(szStrFileInfo, _T("StringFileInfo\\%04X%04X\\CompanyName"),
- wCodePage, wLangID);
- }
-
- if (VerQueryValue (lpData, szStrFileInfo, (LPVOID) &lpBuffer, (PUINT) &BufLen))
- {
- item.pszText = lpBuffer;
- item.iSubItem = 2;
- SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
- }
- HeapFree(GetProcessHeap(), 0, lpData);
- }
- else
- {
- LoadString(hInstance, IDS_SERVICES_UNKNOWN, szStatus, 128);
- item.pszText = szStatus;
- item.iSubItem = 2;
- SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
- }
-
-
-*/
-
--- trunk/reactos/base/system/servman/resource.h 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/resource.h 2006-02-01 19:41:17 UTC (rev 70)
@@ -24,6 +24,10 @@
#define IDR_MAINMENU 102
#define IDR_POPUP 103
#define ID_VIEW_CUSTOMIZE 4021
+#define ID_VIEW_LARGE 4022
+#define ID_VIEW_SMALL 4023
+#define ID_VIEW_LIST 4024
+#define ID_VIEW_DETAILS 4025
#define ID_ABOUT 4031
/* List view columns */
--- trunk/reactos/base/system/servman/servman.c 2006-01-31 22:41:45 UTC (rev 69)
+++ trunk/reactos/base/system/servman/servman.c 2006-02-01 19:41:17 UTC (rev 70)
@@ -18,7 +18,7 @@
HWND hTool;
HWND hProgDlg;
HMENU hShortcutMenu;
-INT SelectedItem;
+INT SelectedItem = -1;
extern HWND hwndGenDlg;
@@ -28,7 +28,77 @@
return SelectedItem;
}
+VOID SetView(DWORD View)
+{
+ DWORD Style = GetWindowLong(hListView, GWL_STYLE);
+ if ((Style & LVS_TYPEMASK) != View)
+ SetWindowLong(hListView, GWL_STYLE, (Style & ~LVS_TYPEMASK) | View);
+}
+
+
+VOID SetMenuAndButtonStates()
+{
+ HMENU hMainMenu;
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
+ DWORD Flags, State;
+
+ /* get handle to menu */
+ hMainMenu = GetMenu(hMainWnd);
+
+ /* set all to greyed */
+ EnableMenuItem(hMainMenu, ID_START, MF_GRAYED);
+ EnableMenuItem(hMainMenu, ID_STOP, MF_GRAYED);
+ EnableMenuItem(hMainMenu, ID_PAUSE, MF_GRAYED);
+ EnableMenuItem(hMainMenu, ID_RESUME, MF_GRAYED);
+ EnableMenuItem(hMainMenu, ID_RESTART, MF_GRAYED);
+
+ EnableMenuItem(hShortcutMenu, ID_START, MF_GRAYED);
+ EnableMenuItem(hShortcutMenu, ID_STOP, MF_GRAYED);
+ EnableMenuItem(hShortcutMenu, ID_PAUSE, MF_GRAYED);
+ EnableMenuItem(hShortcutMenu, ID_RESUME, MF_GRAYED);
+ EnableMenuItem(hShortcutMenu, ID_RESTART, MF_GRAYED);
+
+ //EnableWindow(hTool, FALSE);
+
+ if (GetSelectedItem() != -1)
+ {
+ /* get pointer to selected service */
+ Service = GetSelectedService();
+
+ Flags = Service->ServiceStatusProcess.dwControlsAccepted;
+ State = Service->ServiceStatusProcess.dwCurrentState;
+
+ if (State == SERVICE_STOPPED)
+ {
+ EnableMenuItem(hMainMenu, ID_START, MF_ENABLED);
+ EnableMenuItem(hShortcutMenu, ID_START, MF_ENABLED);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
+ {
+ EnableMenuItem(hMainMenu, ID_STOP, MF_ENABLED);
+ EnableMenuItem(hShortcutMenu, ID_STOP, MF_ENABLED);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_PAUSE_CONTINUE) && (State == SERVICE_RUNNING) )
+ {
+ EnableMenuItem(hMainMenu, ID_PAUSE, MF_ENABLED);
+ EnableMenuItem(hShortcutMenu, ID_PAUSE, MF_ENABLED);
+ }
+
+ if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
+ {
+ EnableMenuItem(hMainMenu, ID_RESTART, MF_ENABLED);
+ EnableMenuItem(hShortcutMenu, ID_RESTART, MF_ENABLED);
+ }
+ }
+ else
+ EnableMenuItem(hMainMenu, ID_PROP, MF_GRAYED);
+
+}
+
+
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
@@ -83,6 +153,7 @@
MessageBox(hwnd, _T("Could not create tool bar."), _T("Error"), MB_OK | MB_ICONERROR);
/* Send the TB_BUTTONSTRUCTSIZE message, which is required for backward compatibility */
+
SendMessage(hTool, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
/* Add custom images */
@@ -249,9 +320,28 @@
case LVN_ITEMCHANGED:
{
LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
+ HMENU hMainMenu;
+ /* get handle to menu */
+ hMainMenu = GetMenu(hMainWnd);
+
+ /* activate properties menu item, if not already */
+ if (GetMenuState(hMainMenu, ID_PROP, MF_BYCOMMAND) != MF_ENABLED)
+ EnableMenuItem(hMainMenu, ID_PROP, MF_ENABLED);
+
+ /* globally set selected service */
SelectedItem = pnmv->iItem;
+ /* alter options for the service */
+ SetMenuAndButtonStates();
+
+ /* get pointer to selected service */
+ Service = GetSelectedService();
+
+ /* set current selected service in the status bar */
+ SendMessage(hStatus, SB_SETTEXT, 1, (LPARAM)Service->lpDisplayName);
+
}
break;
@@ -334,12 +424,21 @@
switch(LOWORD(wParam))
{
case ID_PROP:
- OpenPropSheet(hwnd);
+ if (GetSelectedItem() != -1)
+ OpenPropSheet(hwnd);
break;
case ID_REFRESH:
RefreshServiceList();
+ SelectedItem = -1;
+
+ /* disable menus and buttons */
+ SetMenuAndButtonStates();
+
+ /* clear the service in the status bar */
+ SendMessage(hStatus, SB_SETTEXT, 1, _T('\0'));
+
break;
case ID_EXPORT:
@@ -356,7 +455,9 @@
case ID_START:
{
-
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
+ TCHAR ProgDlgBuf[100];
+
/* open the progress dialog */
hProgDlg = CreateDialog(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_DLG_PROGRESS),
@@ -364,9 +465,6 @@
(DLGPROC)ProgressDialogProc);
if (hProgDlg != NULL)
{
- ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
- TCHAR ProgDlgBuf[100];
-
ShowWindow(hProgDlg, SW_SHOW);
/* write the info to the progress dialog */
@@ -385,11 +483,10 @@
if ( DoStartService(hProgDlg) )
{
-
LVITEM item;
TCHAR szStatus[64];
TCHAR buf[25];
-
+
LoadString(hInstance, IDS_SERVICES_STARTED, szStatus,
sizeof(szStatus) / sizeof(TCHAR));
item.pszText = szStatus;
@@ -414,6 +511,9 @@
case ID_STOP:
{
+ ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
+ TCHAR ProgDlgBuf[100];
+
/* open the progress dialog */
hProgDlg = CreateDialog(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_DLG_PROGRESS),
@@ -421,9 +521,6 @@
(DLGPROC)ProgressDialogProc);
if (hProgDlg != NULL)
{
- ENUM_SERVICE_STATUS_PROCESS *Service = NULL;
- TCHAR ProgDlgBuf[100];
-
ShowWindow(hProgDlg, SW_SHOW);
/* write the info to the progress dialog */
@@ -442,11 +539,10 @@
if( Control(hProgDlg, SERVICE_CONTROL_STOP) )
{
-
LVITEM item;
TCHAR buf[25];
- item.pszText = '\0';
+ item.pszText = _T('\0');
item.iItem = GetSelectedItem();
item.iSubItem = 2;
SendMessage(hListView, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item);
@@ -488,6 +584,22 @@
PostMessage(hwnd, WM_CLOSE, 0, 0);
break;
+ case ID_VIEW_LARGE:
+ SetView(LVS_ICON);
+ break;
+
+ case ID_VIEW_SMALL:
+ SetView(LVS_SMALLICON);
+ break;
+
+ case ID_VIEW_LIST:
+ SetView(LVS_LIST);
+ break;
+
+ case ID_VIEW_DETAILS:
+ SetView(LVS_REPORT);
+ break;
+
case ID_VIEW_CUSTOMIZE:
break;
@@ -496,7 +608,7 @@
MAKEINTRESOURCE(IDD_ABOUTBOX),
hMainWnd,
(DLGPROC)AboutDialogProc);
- break;
+ break;
}
break;