Reputation: 19087
When you use a CTaskDialog
you can set the footer icon, which is 16 x 16. I would like to do something similar on my own dialog:
At the moment my own dialog has a static resource at the bottom.
I know that I can load the information icon like this:
HICON hInfo = LoadStandardIcon(IDI_INFORMATION);
Upvotes: 2
Views: 500
Reputation: 50778
If you (hopefully) don't need to support Windows XP, you can use LoadIconWithScaleDown
For example:
HICON hicon;
HRESULT hr = LoadIconWithScaleDown(NULL, (PCWSTR)IDI_INFORMATION,
GetSystemMetrics(SM_CXICON) / 2, GetSystemMetrics(SM_CYICON) / 2, &hicon);
...
This gives you the additional benefit of loading the modern version of the icons instead of the old ugly ones. See also this SO article.
Upvotes: 3
Reputation: 1346
You could do it by using Picture Control
, and position it whenever you want. And as code you could do:
CStatic myicon;
myicon.Attach(GetDlgItem(ID_STATIC_ICON));
myicon.SetIcon(static_cast<HICON>(::LoadImage(nullptr, MAKEINTRESOURCE(IDI_MYICON), IMAGE_ICON, 16, 16, 0)));
I didn't test the code, but should work.
Upvotes: 2