MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / addTaskBarIcons

Function addTaskBarIcons

src/iscguard/iscguard.cpp:1042–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040
1041
1042static void addTaskBarIcons(HINSTANCE hInstance, HWND hWnd, BOOL& bInTaskBar)
1043{
1044 if (!service_flag)
1045 {
1046 HICON hIcon = (HICON) LoadImage(hInstance, MAKEINTRESOURCE(IDI_IBGUARD),
1047 IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
1048
1049 NOTIFYICONDATA nid;
1050 nid.cbSize = sizeof(NOTIFYICONDATA);
1051 nid.hWnd = hWnd;
1052 nid.uID = IDI_IBGUARD;
1053 nid.uFlags = NIF_TIP | NIF_ICON | NIF_MESSAGE;
1054 nid.uCallbackMessage = ON_NOTIFYICON;
1055 nid.hIcon = hIcon;
1056 lstrcpy(nid.szTip, GUARDIAN_APP_LABEL);
1057
1058 // This will be true if we are using the explorer interface
1059 bInTaskBar = Shell_NotifyIcon(NIM_ADD, &nid);
1060
1061 if (hIcon)
1062 DestroyIcon(hIcon);
1063
1064 // This will be true if we are using the program manager interface
1065 if (!bInTaskBar)
1066 {
1067 char szMsgString[256];
1068 HMENU hSysMenu = GetSystemMenu(hWnd, FALSE);
1069 DeleteMenu(hSysMenu, SC_RESTORE, MF_BYCOMMAND);
1070 AppendMenu(hSysMenu, MF_SEPARATOR, 0, NULL);
1071 LoadString(hInstance, IDS_SVRPROPERTIES, szMsgString, 256);
1072 AppendMenu(hSysMenu, MF_STRING, IDM_SVRPROPERTIES, szMsgString);
1073 LoadString(hInstance, IDS_SHUTDOWN, szMsgString, 256);
1074 AppendMenu(hSysMenu, MF_STRING, IDM_SHUTDOWN, szMsgString);
1075 LoadString(hInstance, IDS_PROPERTIES, szMsgString, 256);
1076 AppendMenu(hSysMenu, MF_STRING, IDM_PROPERTIES, szMsgString);
1077 DestroyMenu(hSysMenu);
1078 }
1079 }
1080}
1081
1082
1083static void write_log(int log_action, const char* buff)

Callers 1

WindowFuncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected