mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:03:29 +00:00
update the visual service count when a service is deleted
svn path=/trunk/; revision=28671
This commit is contained in:
parent
5bdb637cb7
commit
1fc9170197
5 changed files with 52 additions and 40 deletions
|
@ -318,17 +318,21 @@ CreateDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
hIcon = (HICON) LoadImage(hInstance,
|
hIcon = (HICON)LoadImage(hInstance,
|
||||||
MAKEINTRESOURCE(IDI_SM_ICON),
|
MAKEINTRESOURCE(IDI_SM_ICON),
|
||||||
IMAGE_ICON,
|
IMAGE_ICON,
|
||||||
16,
|
16,
|
||||||
16,
|
16,
|
||||||
0);
|
0);
|
||||||
|
if (hIcon)
|
||||||
|
{
|
||||||
SendMessage(hDlg,
|
SendMessage(hDlg,
|
||||||
WM_SETICON,
|
WM_SETICON,
|
||||||
ICON_SMALL,
|
ICON_SMALL,
|
||||||
(LPARAM)hIcon);
|
(LPARAM)hIcon);
|
||||||
|
DestroyIcon(hIcon);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,10 +344,10 @@ CreateDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
PCREATE_DATA Data;
|
PCREATE_DATA Data;
|
||||||
|
|
||||||
Data = (PCREATE_DATA) HeapAlloc(ProcessHeap,
|
Data = (PCREATE_DATA)HeapAlloc(ProcessHeap,
|
||||||
HEAP_ZERO_MEMORY,
|
HEAP_ZERO_MEMORY,
|
||||||
sizeof(CREATE_DATA));
|
sizeof(CREATE_DATA));
|
||||||
if (Data != NULL)
|
if (Data)
|
||||||
{
|
{
|
||||||
Data->hSelf = hDlg;
|
Data->hSelf = hDlg;
|
||||||
|
|
||||||
|
@ -362,7 +366,6 @@ CreateDialogProc(HWND hDlg,
|
||||||
FreeMemory(Data);
|
FreeMemory(Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyIcon(hIcon);
|
|
||||||
EndDialog(hDlg,
|
EndDialog(hDlg,
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -370,7 +373,6 @@ CreateDialogProc(HWND hDlg,
|
||||||
|
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
{
|
{
|
||||||
DestroyIcon(hIcon);
|
|
||||||
EndDialog(hDlg,
|
EndDialog(hDlg,
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -119,8 +119,11 @@ DeleteDialogProc(HWND hDlg,
|
||||||
case IDOK:
|
case IDOK:
|
||||||
{
|
{
|
||||||
if (DoDeleteService(Info, hDlg))
|
if (DoDeleteService(Info, hDlg))
|
||||||
|
{
|
||||||
(void)ListView_DeleteItem(Info->hListView,
|
(void)ListView_DeleteItem(Info->hListView,
|
||||||
Info->SelectedItem);
|
Info->SelectedItem);
|
||||||
|
UpdateServiceCount(Info);
|
||||||
|
}
|
||||||
EndDialog(hDlg,
|
EndDialog(hDlg,
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -231,8 +231,6 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
||||||
ENUM_SERVICE_STATUS_PROCESS *pService;
|
ENUM_SERVICE_STATUS_PROCESS *pService;
|
||||||
LPTSTR lpDescription;
|
LPTSTR lpDescription;
|
||||||
LVITEM lvItem;
|
LVITEM lvItem;
|
||||||
LPTSTR lpNumServices;
|
|
||||||
TCHAR szNumServices[32];
|
|
||||||
TCHAR szStatus[64];
|
TCHAR szStatus[64];
|
||||||
DWORD NumServices;
|
DWORD NumServices;
|
||||||
DWORD Index;
|
DWORD Index;
|
||||||
|
@ -241,8 +239,6 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
||||||
|
|
||||||
if (GetServiceList(Info, &NumServices))
|
if (GetServiceList(Info, &NumServices))
|
||||||
{
|
{
|
||||||
INT NumListedServ = 0;
|
|
||||||
|
|
||||||
for (Index = 0; Index < NumServices; Index++)
|
for (Index = 0; Index < NumServices; Index++)
|
||||||
{
|
{
|
||||||
LPQUERY_SERVICE_CONFIG pServiceConfig;
|
LPQUERY_SERVICE_CONFIG pServiceConfig;
|
||||||
|
@ -334,26 +330,7 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AllocAndLoadString(&lpNumServices,
|
UpdateServiceCount(Info);
|
||||||
hInstance,
|
|
||||||
IDS_NUM_SERVICES))
|
|
||||||
{
|
|
||||||
NumListedServ = ListView_GetItemCount(Info->hListView);
|
|
||||||
|
|
||||||
_sntprintf(szNumServices,
|
|
||||||
31,
|
|
||||||
lpNumServices,
|
|
||||||
NumListedServ);
|
|
||||||
|
|
||||||
SendMessage(Info->hStatus,
|
|
||||||
SB_SETTEXT,
|
|
||||||
0,
|
|
||||||
(LPARAM)szNumServices);
|
|
||||||
|
|
||||||
HeapFree(ProcessHeap,
|
|
||||||
0,
|
|
||||||
lpNumServices);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* turn redraw flag on. It's turned off initially via the LBS_NOREDRAW flag */
|
/* turn redraw flag on. It's turned off initially via the LBS_NOREDRAW flag */
|
||||||
|
|
|
@ -121,6 +121,35 @@ UpdateMainStatusBar(PMAIN_WND_INFO Info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
UpdateServiceCount(PMAIN_WND_INFO Info)
|
||||||
|
{
|
||||||
|
LPTSTR lpNumServices;
|
||||||
|
|
||||||
|
if (AllocAndLoadString(&lpNumServices,
|
||||||
|
hInstance,
|
||||||
|
IDS_NUM_SERVICES))
|
||||||
|
{
|
||||||
|
TCHAR szNumServices[32];
|
||||||
|
|
||||||
|
INT NumListedServ = ListView_GetItemCount(Info->hListView);
|
||||||
|
|
||||||
|
_sntprintf(szNumServices,
|
||||||
|
31,
|
||||||
|
lpNumServices,
|
||||||
|
NumListedServ);
|
||||||
|
|
||||||
|
SendMessage(Info->hStatus,
|
||||||
|
SB_SETTEXT,
|
||||||
|
0,
|
||||||
|
(LPARAM)szNumServices);
|
||||||
|
|
||||||
|
HeapFree(ProcessHeap,
|
||||||
|
0,
|
||||||
|
lpNumServices);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
|
VOID SetMenuAndButtonStates(PMAIN_WND_INFO Info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ typedef struct _MENU_HINT
|
||||||
UINT HintId;
|
UINT HintId;
|
||||||
} MENU_HINT, *PMENU_HINT;
|
} MENU_HINT, *PMENU_HINT;
|
||||||
|
|
||||||
|
VOID UpdateServiceCount(PMAIN_WND_INFO Info);
|
||||||
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
|
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
|
||||||
BOOL InitMainWindowImpl(VOID);
|
BOOL InitMainWindowImpl(VOID);
|
||||||
VOID UninitMainWindowImpl(VOID);
|
VOID UninitMainWindowImpl(VOID);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue