mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +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:
|
||||
{
|
||||
hIcon = (HICON) LoadImage(hInstance,
|
||||
MAKEINTRESOURCE(IDI_SM_ICON),
|
||||
IMAGE_ICON,
|
||||
16,
|
||||
16,
|
||||
0);
|
||||
hIcon = (HICON)LoadImage(hInstance,
|
||||
MAKEINTRESOURCE(IDI_SM_ICON),
|
||||
IMAGE_ICON,
|
||||
16,
|
||||
16,
|
||||
0);
|
||||
if (hIcon)
|
||||
{
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
DestroyIcon(hIcon);
|
||||
}
|
||||
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -340,10 +344,10 @@ CreateDialogProc(HWND hDlg,
|
|||
{
|
||||
PCREATE_DATA Data;
|
||||
|
||||
Data = (PCREATE_DATA) HeapAlloc(ProcessHeap,
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(CREATE_DATA));
|
||||
if (Data != NULL)
|
||||
Data = (PCREATE_DATA)HeapAlloc(ProcessHeap,
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(CREATE_DATA));
|
||||
if (Data)
|
||||
{
|
||||
Data->hSelf = hDlg;
|
||||
|
||||
|
@ -362,7 +366,6 @@ CreateDialogProc(HWND hDlg,
|
|||
FreeMemory(Data);
|
||||
}
|
||||
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
@ -370,7 +373,6 @@ CreateDialogProc(HWND hDlg,
|
|||
|
||||
case IDCANCEL:
|
||||
{
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
|
|
@ -119,8 +119,11 @@ DeleteDialogProc(HWND hDlg,
|
|||
case IDOK:
|
||||
{
|
||||
if (DoDeleteService(Info, hDlg))
|
||||
{
|
||||
(void)ListView_DeleteItem(Info->hListView,
|
||||
Info->SelectedItem);
|
||||
UpdateServiceCount(Info);
|
||||
}
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
|
|
@ -231,8 +231,6 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
|||
ENUM_SERVICE_STATUS_PROCESS *pService;
|
||||
LPTSTR lpDescription;
|
||||
LVITEM lvItem;
|
||||
LPTSTR lpNumServices;
|
||||
TCHAR szNumServices[32];
|
||||
TCHAR szStatus[64];
|
||||
DWORD NumServices;
|
||||
DWORD Index;
|
||||
|
@ -241,8 +239,6 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
|||
|
||||
if (GetServiceList(Info, &NumServices))
|
||||
{
|
||||
INT NumListedServ = 0;
|
||||
|
||||
for (Index = 0; Index < NumServices; Index++)
|
||||
{
|
||||
LPQUERY_SERVICE_CONFIG pServiceConfig;
|
||||
|
@ -334,26 +330,7 @@ RefreshServiceList(PMAIN_WND_INFO Info)
|
|||
}
|
||||
}
|
||||
|
||||
if (AllocAndLoadString(&lpNumServices,
|
||||
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);
|
||||
}
|
||||
UpdateServiceCount(Info);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
|
|
|
@ -60,6 +60,7 @@ typedef struct _MENU_HINT
|
|||
UINT HintId;
|
||||
} MENU_HINT, *PMENU_HINT;
|
||||
|
||||
VOID UpdateServiceCount(PMAIN_WND_INFO Info);
|
||||
VOID ChangeListViewText(PMAIN_WND_INFO Info, ENUM_SERVICE_STATUS_PROCESS* pService, UINT Column);
|
||||
BOOL InitMainWindowImpl(VOID);
|
||||
VOID UninitMainWindowImpl(VOID);
|
||||
|
|
Loading…
Reference in a new issue