reactos/base/applications/taskmgr/taskmgr.h
Joachim Henze f49cead384 [0.4.7][TASKMGR] Mainly Graph-stuff backports 2023-10-31
This backports the following commits:
0.4.15-dev-6770-g ddd1d19b3f [TASKMGR] Get rid of cplusplus extern c (#5808)
partially 0.4.15-dev-6120-g 6e77747b30 [TASKMGR] Simplify tray icon code
0.4.15-dev-6114-g 9a6c85f68a [TASKMGR] Fix PerfDataDeallocCommandLineCache, part of CORE-18014 (unresolved still)
0.4.15-dev-6113-g 7989e3f26c [TASKMGR] GraphCtrl_Dispose: Delete hdcGraph first, part of CORE-18014 (unresolved still)
0.4.15-dev-6112-g dc14a9f6e0 [TASKMGR] GraphCtrl: Use DeleteDC instead of DeleteObject to delete inst->hdcGraph, part of CORE-18014 (unresolved still)
partially 0.4.15-dev-4994-g 15a0f7adb0 picked a tiny part from PR4657 (I picked only the refactoring to switch-statement, no functional changes. Especially NOT the formatting changes which would require the additional winnls.h-include)
0.4.15-dev-3737-g f8faa0b660 [TASKMGR] Fix a heap corruption bug (#4311), just an addendum to PR4141 which is picked with this backport as well. Older branches were never affected.
partially 0.4.15-dev-3514-g 1c82bf0324 [TASKMGR] Avoid freezing in getting icons, from (PR4180) CORE17894. I picked only the 1000ms->100ms part and the stripping of WM_QUERYDRAGICON call. Therefore I don't consider CORE17894 as fully covered.
0.4.15-dev-3486-g 545e1190f2 [TASKMGR] Avoid hangs as much as possible (#4166) CORE17894
partially 0.4.15-dev-3483-g 403222dd4f [TASKMGR] Preserve graphs history on resizes (#4141). I left aside the structs type renaming and OOM-Handling upon graph creation. Picked all the logical changes though.
0.4.15-dev-3269-g 0ed04e3640 [TASKMGR] Make performance graph grid scroll (#3581)
0.4.15-dev-3268-g a4ab9a1e19 [TASKMGR] Formatting only (#3581). Covers the last bits of that PR.

Main motivation was getting the toggling of ShowKernelTimes in the Performance tab
switch on and off in realtime without introducing gaps in the graph.
It also makes the grid scroll together with the data, like on Windows.

Most other parts I picked solely for their binary-shrinking effect.
I decided to strip the ID_HELP_TOPICS from the rc files, as this was not implemented,
and I would never port that back later. So it is one less non-functional-button in the older branches.
I favored memset() over Zeromemory() in this usermode-app everywhere, and favored for (;;) over while(1).

Binary size shrinks slightly on all branches:

master taskmgr.exe RosBEWin2.2.2 GCC8.4.0dbg             696.832 (0.4.15-dev-6820-gb3194e3)
0.4.14 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  549.888 -> 548.864
0.4.13 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  542.720 -> 542.208
0.4.12 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  545.792 -> 543.232
0.4.11 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  545.792 -> 543.232
0.4.10 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  532.480 -> 530.432
0.4. 9 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  532.480 -> 530.432
0.4. 8 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  532.480 -> 530.432
0.4. 7 taskmgr.exe RosBEWin2.1.6 GCC4.7.2dbg  531.456 -> 529.408

       taskmgr.exe MS XPSP3 german                                           140.800 Bytes
0.4.14 taskmgr.exe RosBEWin2.1.6 MSVC2010SP1rls I18N=de-DE  110.080 Bytes -> 109.056 Bytes (my current taskmgr of choice)
0.4. 8 taskmgr.exe RosBEWin2.1.6 MSVC2010SP1rls I18N=en-US  108.032 Bytes -> 105.984 Bytes
0.4. 7 taskmgr.exe RosBEWin2.1.6 MSVC2010SP1rls I18N=en-US  107.520 Bytes -> 105.472 Bytes
2023-10-31 21:09:58 +01:00

79 lines
2.2 KiB
C

/*
* PROJECT: ReactOS Task Manager
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* COPYRIGHT: 1999-2001 Brian Palmer <brianp@reactos.org>
*/
#pragma once
#include "resource.h"
#define RUN_APPS_PAGE
#define RUN_PROC_PAGE
#define RUN_PERF_PAGE
#define STATUS_WINDOW 2001
#define STATUS_SIZE1 85
#define STATUS_SIZE2 190
#define STATUS_SIZE3 400
typedef struct
{
/* Window size & position settings */
BOOL Maximized;
int Left;
int Top;
int Right;
int Bottom;
/* Tab settings */
int ActiveTabPage;
/* Options menu settings */
BOOL AlwaysOnTop;
BOOL MinimizeOnUse;
BOOL HideWhenMinimized;
BOOL Show16BitTasks;
// 0 - Paused, 1 - High, 2 - Normal, 4 - Low
DWORD UpdateSpeed;
/* Applications page settings */
DWORD ViewMode;
/* Processes page settings */
BOOL ShowProcessesFromAllUsers;
BOOL Columns[COLUMN_NMAX];
int ColumnOrderArray[COLUMN_NMAX];
int ColumnSizeArray[COLUMN_NMAX];
int SortColumn;
BOOL SortAscending;
/* Performance page settings */
BOOL CPUHistory_OneGraphPerCPU;
BOOL ShowKernelTimes;
} TASKMANAGER_SETTINGS, *LPTASKMANAGER_SETTINGS;
extern HINSTANCE hInst; /* current instance */
extern HWND hMainWnd; /* Main Window */
extern HWND hStatusWnd; /* Status Bar Window */
extern HWND hTabWnd; /* Tab Control Window */
extern int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
extern int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
extern int nOldWidth; /* Holds the previous client area width */
extern int nOldHeight; /* Holds the previous client area height */
extern TASKMANAGER_SETTINGS TaskManagerSettings;
INT_PTR CALLBACK TaskManagerWndProc(HWND, UINT, WPARAM, LPARAM);
BOOL OnCreate(HWND hWnd);
void OnSize(WPARAM nType, int cx, int cy);
void OnMove(WPARAM nType, int cx, int cy);
void FillSolidRect(HDC hDC, LPCRECT lpRect, COLORREF clr);
void LoadSettings(void);
void SaveSettings(void);
void TaskManager_OnRestoreMainWindow(void);
void TaskManager_OnViewUpdateSpeed(DWORD);
void TaskManager_OnTabWndSelChange(void);
VOID ShowWin32Error(DWORD dwError);
LPTSTR GetLastErrorText(LPTSTR lpszBuf, DWORD dwSize);
DWORD EndLocalThread(HANDLE *hThread, DWORD dwThread);