Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Void

The small icon doesn't show in taskbar?

This topic is 6910 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If you are using MFC in a funny way (which most of us do for game programming) or not using MFC at all, you need to set some of these yourself. The large icon is set by the call to AfxRegisterWndClass, but you can set the small one with:

SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);

The boolean specifies if you are setting the BIG icon (TRUE) or the SMALL icon (FALSE)

Share this post


Link to post
Share on other sites
Advertisement
I'm using win32 and no it still doesn't show up even if I explicitly send a WM_SETICON message (which should be the SetIcon equiv).

Does it require registry entries or what?

Share this post


Link to post
Share on other sites

I would like to know the answer to this one if there is a reasonable solution.

My understanding of the big and small icons is so that your application conforms to the windows display.

Windows actually selects which icon to display depending on the context of which it is viewed.

For instance, the big icon (32x32) is displayed in the task bar, while the small icon (16x16) is displayed when you view your .exe in explorer. If the small icon is not available, then the big icon is scaled to size.

-mordell

Share this post


Link to post
Share on other sites
I was under the same impression too but Starcraft is minimized, the spaceship icon shows beside its class name in the taskbar. Mine doesn;t, although the icon is displayed in the file executable when I choose view large/small icon.

Every active program has an icon besides the class name in the taskbar, except mine? What else do I set to set besides the icon while registering the class?

Share this post


Link to post
Share on other sites

Ahhh....apologies!

I was under the impression you wanted your small icon to appear in the task bar, not that you didn't see your icon at all in the task bar!

I guess make sure that when you are building your WNDCLASSEX data you verify that LoadIcon succeeds.

Also, in the case of dialogs, you can set the icon like so:

SendMessage(hwndDlg, WM_SETICON, ICON_BIG,
(LPARAM)LoadIcon(hApp, MAKEINTRESOURCE(IDI_ICON)));


hmm..I was toying around with getting the small icon to appear in the caption and the task bar and this seems to work:

wcex.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_WIN32), IMAGE_ICON, 16, 16, 0);

The icon IDI_WIN32 contains both a 32x32 and a 16x16 icon, LoadImage apparently loaded the correct icon based on the size params I passed in.

Afraid thats not a whole lot of help with your problem, tho. Maybe if you post your window registration code..?

-mordell

Share this post


Link to post
Share on other sites
Thanks but I have found the answer.

You need to set the CS_SYSMENU flag when u register the class or the icon will never show. I guess MFC does that behind the scenes but too bad I'm not using it.

but in doing so I seem to find a disturbing fact about dx. Will post more of it once I tested my findings.

Share this post


Link to post
Share on other sites

Void,

Where did you find information about CS_SYSMENU? What does it do?

I have never used it. The only style flags I have ever used when registering a class is CS_HREDRAW | CS_VREDRAW and occasionally CS_OWNDC...thats about it.

The only reason I mention it is because I do not use MFC, and my apps have always had an icon in the taskbar or caption. The only thing I do is set the icon params of the WNDCLASSEX structure prior to RegisterClassEx.

ack! I just thought of something! Do you mean WS_SYSMENU, a style flag used in the call to CreateWindowEx? That could be it then, I typically use the WS_OVERLAPPEDWINDOW style, which includes WS_SYSMENU. That could explain it.

-mordell

Share this post


Link to post
Share on other sites
Hi,

I was under the impression the taskbar would show the small icon besides the class name when u set the wndclass icon member but it seems not to?

Anyone knows how to do it?

Share this post


Link to post
Share on other sites
Yes.. sorry about it.

it is WS_SYSMENU, not CS_SYSMENU...

An very annoying undocumented feature.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!