/*
* ReactOS Task Manager
*
- * TaskMgr.c : Defines the entry point for the application.
+ * taskmgr.c : Defines the entry point for the application.
*
* Copyright (C) 1999 - 2001 Brian Palmer <brianp@reactos.org>
* 2005 Klemens Friedl <frik85@reactos.at>
case WM_MENUSELECT:
TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam);
break;
+ case WM_SYSCOLORCHANGE:
+ /* Forward WM_SYSCOLORCHANGE to common controls */
+ SendMessage(hApplicationPageListCtrl, WM_SYSCOLORCHANGE, 0, 0);
+ SendMessage(hProcessPageListCtrl, WM_SYSCOLORCHANGE, 0, 0);
+ SendMessage(hProcessPageHeaderCtrl, WM_SYSCOLORCHANGE, 0, 0);
+ break;
}
return 0;
void SaveSettings(void)
{
HKEY hKey;
- WCHAR szSubKey1[] = L"Software";
- WCHAR szSubKey2[] = L"Software\\ReactOS";
- WCHAR szSubKey3[] = L"Software\\ReactOS\\TaskManager";
+ WCHAR szSubKey[] = L"Software\\ReactOS\\TaskManager";
/* Open (or create) the key */
- hKey = NULL;
- RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey1, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
- RegCloseKey(hKey);
- hKey = NULL;
- RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
- RegCloseKey(hKey);
- hKey = NULL;
- if (RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey3, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
+ if (RegCreateKeyExW(HKEY_CURRENT_USER, szSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
return;
/* Save the settings */
RegSetValueExW(hKey, L"Preferences", 0, REG_BINARY, (LPBYTE)&TaskManagerSettings, sizeof(TASKMANAGER_SETTINGS));
SetUpdateSpeed(hMainWnd);
}
-void TaskManager_OnViewRefresh(void)
-{
- PostMessageW(hMainWnd, WM_TIMER, 0, 0);
-}
-
void TaskManager_OnTabWndSelChange(void)
{
int i;
}
return lpszBuf;
}
+
+DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread)
+{
+ DWORD dwExitCodeThread = 0;
+
+ if (*hThread != NULL) {
+ PostThreadMessage(dwThread,WM_QUIT,0,0);
+ for (;;) {
+ MSG msg;
+
+ if (WAIT_OBJECT_0 == WaitForSingleObject(*hThread, 500))
+ break;
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ GetExitCodeThread(*hThread, &dwExitCodeThread);
+ CloseHandle(*hThread);
+ *hThread = NULL;
+ }
+ return dwExitCodeThread;
+}
+