Go to the source code of this file.
◆ TrayIcon_GetProcessorUsageIcon()
HICON TrayIcon_GetProcessorUsageIcon |
( |
void |
| ) |
|
Definition at line 26 of file trayicon.c.
27{
36 int nLinesToDraw;
37 HBRUSH hBitmapBrush =
NULL;
39
40
41
42
44 if (!hScreenDC)
45 goto done;
46
47
48
49
52 goto done;
53
54
55
56
60 goto done;
61
63 if (!hBitmapBrush)
64 goto done;
65
66
67
68
69
71
72
73
74
76
77
78
79
80
81
82
83 nLinesToDraw = (ProcessorUsage + (ProcessorUsage / 10)) / 11;
85 rc.
top = 12 - nLinesToDraw;
88
89
90
91
92 if (nLinesToDraw)
94
95
96
97
98
101
103 iconInfo.
hbmMask = hBitmapMask;
105
107
108done:
109
110
111
112 if (hScreenDC)
116 if (hBitmapBrush)
120 if (hBitmapMask)
122
123
124
125
126 return hTrayIcon;
127}
ULONG PerfDataGetProcessorUsage(void)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
HDC WINAPI GetDC(_In_opt_ HWND)
#define MAKEINTRESOURCEW(i)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Referenced by TrayIcon_ShellAddTrayIcon(), and TrayIcon_ShellUpdateTrayIcon().
◆ TrayIcon_ShellAddTrayIcon()
Definition at line 129 of file trayicon.c.
130{
135
137
139
146
147
150
152
155
156 return bRetVal;
157}
#define IDS_MSG_TRAYICONCPUUSAGE
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
struct _NOTIFYICONDATAW NOTIFYICONDATAW
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
HICON TrayIcon_GetProcessorUsageIcon(void)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI DestroyIcon(_In_ HICON)
Referenced by OnCreate().
◆ TrayIcon_ShellRemoveTrayIcon()
BOOL TrayIcon_ShellRemoveTrayIcon |
( |
void |
| ) |
|
◆ TrayIcon_ShellUpdateTrayIcon()
BOOL TrayIcon_ShellUpdateTrayIcon |
( |
void |
| ) |
|