本文整理汇总了C++中CConfig::GetOffIconPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfig::GetOffIconPath方法的具体用法?C++ CConfig::GetOffIconPath怎么用?C++ CConfig::GetOffIconPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfig
的用法示例。
在下文中一共展示了CConfig::GetOffIconPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitInstance
// Initialize the window and tray icon
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
// prepare for XP style controls
InitCommonControls();
// store instance handle and create dialog
hInst = hInstance;
hDlg = CreateDialog(
hInstance,
MAKEINTRESOURCE(IDD_DLG_DIALOG),
NULL,
(DLGPROC)DlgProc);
if (!hDlg)
{
return FALSE;
}
IntializeNotificationData();
const CPath * imagePath = config.GetOffIconPath();
UINT flags = LR_LOADFROMFILE;
HICON icon = (HICON)LoadImage(
NULL,
*imagePath,
IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
flags);
niData.hIcon = icon;
Shell_NotifyIcon(NIM_ADD, &niData);
DestroyIcon(icon);
niData.hIcon = NULL;
StartProcess();
return TRUE;
}
示例2: ShowNotificationData
void ShowNotificationData(bool on)
{
NOTIFYICONDATA nid;
ZeroMemory(&nid, sizeof(nid));
const CPath * imagePath = on ? config.GetOnIconPath() : config.GetOffIconPath();
UINT flags = LR_MONOCHROME;
flags |= LR_LOADFROMFILE;
HICON icon = (HICON)LoadImage(
NULL,
*imagePath,
IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
flags);
nid.hIcon = icon;
nid.uID = niData.uID;
nid.hWnd = niData.hWnd;
nid.uFlags = NIF_ICON;
Shell_NotifyIcon(NIM_MODIFY, &nid);
DestroyIcon(icon);
}
示例3: OnInitDialog
BOOL OnInitDialog(HWND hWnd)
{
const CPath *imagePath = config.GetOffIconPath();
HMENU hMenu = GetSystemMenu(hWnd, FALSE);
if (hMenu)
{
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(hMenu, MF_STRING, IDM_ABOUT, _T("About"));
}
HICON hIcon = (HICON)LoadImage(
NULL,
*imagePath,
IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
LR_LOADFROMFILE);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
DestroyIcon(hIcon);
return TRUE;
}