Advertisement

Dialog Boxes and Icons

Started by February 02, 2001 05:48 PM
2 comments, last by dark chrono4 23 years, 11 months ago
How are you supposed to setup the mini icon that displays in the left corner of the title bar? Now I''m using the WNDCLASSEX structure and assigning hIconSm to load an 16x16 icon from my resource script. But when I run the program all I get is the wavy Windows logo. I''ve tried both DialogBox and CreateDialog and I get the same results for both. Is it even possible to give a dialog a small icon? "I can''t work like this! Where are my fuzzy dice?"
"I can't work like this! Where are my fuzzy dice?"
I think you need to call RegisterClassEx to get little icons, pass IDI_SMALL (or whatever your small icon resource constant is) as the szIconSm parameter

    ATOM RegisterMyWindow(LPCTSTR szWindowClass, LPCTSTR szMenu, LPCTSTR szIcon, LPCTSTR szIconSm){	WNDCLASSEX wcex;	wcex.cbSize = sizeof(WNDCLASSEX); 	wcex.style         = CS_HREDRAW | CS_VREDRAW;	wcex.lpfnWndProc   = (WNDPROC)WndProc;	wcex.cbClsExtra    = 0;	wcex.cbWndExtra    = 0;	wcex.hInstance     = m_hInstance;	wcex.hIcon         = LoadIcon(m_hInstance, (LPCTSTR)szIcon);	wcex.hCursor       = LoadCursor(NULL, IDC_ARROW);	wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);	wcex.lpszMenuName  = (LPCSTR)szMenu;	wcex.lpszClassName = szWindowClass;	wcex.hIconSm		 = LoadIcon(wcex.hInstance, (LPCTSTR)szIconSm);	return RegisterClassEx(&wcex);}    


Magmai Kai Holmlor
- The disgruntled & disillusioned


Edited by - Magmai Kai Holmlor on February 3, 2001 10:16:25 AM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
This is what I got:
wndclass.hIconSm = LoadIcon(hInstance, MAKEINTRESOURC(IDI_ICON));

This will give me a small icon next the filename if I look at it in a Open dialog box. But I still get the wavy logo on the title bar, is there anything else I can do?


"I can''t work like this! Where are my fuzzy dice?"
"I can't work like this! Where are my fuzzy dice?"
Using RegisterClass() in combination with DialogBox() or CreateDialog() ? I think that''s of no use.

If you''re using a dialogbox, try and fiddle with it in the resource editor, and you will get it right! "Thin" is better than "Dialog Frame".

If you''re using a window with CreateWindow(), try WS_OVERLAPPEDWINDOW in the CreateWindow() function.

It shouldn''t be that hard, but you''re probably missing that single thing you just forgot...

This topic is closed to new replies.

Advertisement