mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[TASKMGR]: Disable the "End process" button if no item is selected.
Part 1 of a patch by Edijs. CORE-5655 #comment procpage.c fix committed. svn path=/trunk/; revision=65676
This commit is contained in:
parent
55e82d6d2b
commit
0e707a8c26
1 changed files with 31 additions and 5 deletions
|
@ -33,12 +33,13 @@ typedef struct
|
|||
ULONG ProcessId;
|
||||
} PROCESS_PAGE_LIST_ITEM, *LPPROCESS_PAGE_LIST_ITEM;
|
||||
|
||||
HWND hProcessPage; /* Process List Property Page */
|
||||
HWND hProcessPage; /* Process List Property Page */
|
||||
|
||||
HWND hProcessPageListCtrl; /* Process ListCtrl Window */
|
||||
HWND hProcessPageListCtrl; /* Process ListCtrl Window */
|
||||
HWND hProcessPageHeaderCtrl; /* Process Header Control */
|
||||
HWND hProcessPageEndProcessButton; /* Process End Process button */
|
||||
HWND hProcessPageEndProcessButton; /* Process End Process button */
|
||||
HWND hProcessPageShowAllProcessesButton;/* Process Show All Processes checkbox */
|
||||
BOOL bProcessPageSelectionMade = FALSE; /* Is item in ListCtrl selected */
|
||||
|
||||
static int nProcessPageWidth;
|
||||
static int nProcessPageHeight;
|
||||
|
@ -102,6 +103,15 @@ DWORD GetSelectedProcessId(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ProcessPageUpdate(void)
|
||||
{
|
||||
/* Enable or disable the "End Process" button */
|
||||
if (ListView_GetSelectedCount(hProcessPageListCtrl))
|
||||
EnableWindow(hProcessPageEndProcessButton, TRUE);
|
||||
else
|
||||
EnableWindow(hProcessPageEndProcessButton, FALSE);
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK
|
||||
ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -147,6 +157,10 @@ ProcessPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
/* Start our refresh thread */
|
||||
hProcessThread = CreateThread(NULL, 0, ProcessPageRefreshThread, NULL, 0, &dwProcessThread);
|
||||
#endif
|
||||
|
||||
/* Refresh controls */
|
||||
ProcessPageUpdate();
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_DESTROY:
|
||||
|
@ -230,11 +244,9 @@ void ProcessPageOnNotify(WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
switch (pnmh->code)
|
||||
{
|
||||
#if 0
|
||||
case LVN_ITEMCHANGED:
|
||||
ProcessPageUpdate();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case LVN_GETDISPINFO:
|
||||
|
||||
|
@ -466,6 +478,20 @@ void UpdateProcesses()
|
|||
}
|
||||
|
||||
SendMessage(hProcessPageListCtrl, WM_SETREDRAW, TRUE, 0);
|
||||
|
||||
/* Select first item if any */
|
||||
if ((ListView_GetNextItem(hProcessPageListCtrl, -1, LVNI_SELECTED | LVNI_FOCUSED) == -1) &&
|
||||
(ListView_GetItemCount(hProcessPageListCtrl) > 0) && !bProcessPageSelectionMade)
|
||||
{
|
||||
ListView_SetItemState(hProcessPageListCtrl, 0, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
|
||||
bProcessPageSelectionMade = TRUE;
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
bProcessPageSelectionMade = FALSE;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
BOOL ProcessRunning(ULONG ProcessId)
|
||||
|
|
Loading…
Reference in a new issue