mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:12:58 +00:00
[TASKMGR] Completely reformat perfpage.c, perfpage.h, procpage.h and trayicon.c
- Rename also these stupidly long "hPerformancePageBlablabla" variables. - Remove unnecessary global variables in procpage.c/h.
This commit is contained in:
parent
da7dcec6a0
commit
7b53126375
5 changed files with 300 additions and 315 deletions
|
@ -10,28 +10,24 @@
|
|||
|
||||
HICON TrayIcon_GetProcessorUsageIcon(void)
|
||||
{
|
||||
HICON hTrayIcon = NULL;
|
||||
HDC hScreenDC = NULL;
|
||||
HDC hDC = NULL;
|
||||
HBITMAP hBitmap = NULL;
|
||||
HBITMAP hOldBitmap = NULL;
|
||||
HBITMAP hBitmapMask = NULL;
|
||||
ICONINFO iconInfo;
|
||||
ULONG ProcessorUsage;
|
||||
int nLinesToDraw;
|
||||
HBRUSH hBitmapBrush = NULL;
|
||||
RECT rc;
|
||||
HICON hTrayIcon = NULL;
|
||||
HDC hScreenDC = NULL;
|
||||
HDC hDC = NULL;
|
||||
HBITMAP hBitmap = NULL;
|
||||
HBITMAP hOldBitmap = NULL;
|
||||
HBITMAP hBitmapMask = NULL;
|
||||
ICONINFO iconInfo;
|
||||
ULONG ProcessorUsage;
|
||||
int nLinesToDraw;
|
||||
HBRUSH hBitmapBrush = NULL;
|
||||
RECT rc;
|
||||
|
||||
/*
|
||||
* Get a handle to the screen DC
|
||||
*/
|
||||
/* Get a handle to the screen DC */
|
||||
hScreenDC = GetDC(NULL);
|
||||
if (!hScreenDC)
|
||||
goto done;
|
||||
|
||||
/*
|
||||
* Create our own DC from it
|
||||
*/
|
||||
/* Create our own DC from it */
|
||||
hDC = CreateCompatibleDC(hScreenDC);
|
||||
if (!hDC)
|
||||
goto done;
|
||||
|
@ -52,7 +48,7 @@ HICON TrayIcon_GetProcessorUsageIcon(void)
|
|||
* Select the bitmap into our device context
|
||||
* so we can draw on it.
|
||||
*/
|
||||
hOldBitmap = (HBITMAP) SelectObject(hDC, hBitmap);
|
||||
hOldBitmap = SelectObject(hDC, hBitmap);
|
||||
|
||||
/*
|
||||
* Get the cpu usage
|
||||
|
@ -71,9 +67,7 @@ HICON TrayIcon_GetProcessorUsageIcon(void)
|
|||
rc.right = 13;
|
||||
rc.bottom = 13;
|
||||
|
||||
/*
|
||||
* Now draw the cpu usage
|
||||
*/
|
||||
/* Now draw the cpu usage */
|
||||
if (nLinesToDraw)
|
||||
FillRect(hDC, &rc, hBitmapBrush);
|
||||
|
||||
|
@ -105,9 +99,7 @@ done:
|
|||
if (hBitmapMask)
|
||||
DeleteObject(hBitmapMask);
|
||||
|
||||
/*
|
||||
* Return the newly created tray icon (if successful)
|
||||
*/
|
||||
/* Return the newly created tray icon (if successful) */
|
||||
return hTrayIcon;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue