forked from a232319779/hideTrayIcon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhide.h
More file actions
63 lines (56 loc) · 1.44 KB
/
Copy pathhide.h
File metadata and controls
63 lines (56 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Create time : 2016.12.20
Author : ddvv
Function :
@1 : void SetTrayIconStatus(LPCWSTR lpwszIcon, BOOL bShow = FALSE);
设置托盘图标的状态(隐藏/显示)
*/
#define TB_GETBUTTON (WM_USER + 23)
#define TB_BUTTONCOUNT (WM_USER + 24)
// 64位对应的结构体
typedef struct _TRAYDATA64 {
PVOID64 hWnd; //HWND 64位 8字节
UINT uID;
UINT uCallbackMessage;
DWORD Reserved1[2];
PVOID64 hIcon; //HICON 64位 8字节
DWORD Reserved2[4];
TCHAR szExePath[MAX_PATH];
TCHAR szTip[128];
} TRAYDATA64;
typedef struct _TBBUTTON64 {
int iBitmap;
int idCommand;
BYTE fsState;
BYTE fsStyle;
BYTE bReserved[6]; // padding for alignment
DWORD_PTR dwData;
INT_PTR iString;
} TBBUTTON64;
// 32对应的结构体
typedef struct _TRAYDATA32 {
HWND hWnd;
UINT uID;
UINT uCallbackMessage;
DWORD Reserved1[2];
HICON hIcon;
DWORD Reserved2[3];
TCHAR szExePath[MAX_PATH];
TCHAR szTip[128];
} TRAYDATA32;
typedef struct _TBBUTTON32 {
int iBitmap;
int idCommand;
BYTE fsState;
BYTE fsStyle;
BYTE bReserved[2]; // padding for alignment
DWORD_PTR dwData;
INT_PTR iString;
} TBBUTTON32;
/*
param :
@lpwszIcon : 需要被隐藏的图标对应的可执行文件名
@bSHow : FALSE代表隐藏,TRUE代表显示
*/
void SetTrayIconStatus(LPCWSTR lpwszIcon, BOOL bShow = FALSE);
void SetHide(HWND hWnd, LPCWSTR lpwszIcon, BOOL bShow);