Skip to main content
gamedev.net
🔒 Locked

Icons

Started by NightZero Jan 22, 2003 at 12:31 PM 2 replies 400+ views
Original Post
NightZero
NightZero
Hi, I can''t get those small icons in the windows caption to work! I have tried to make 16*16 pixel icons but, Visual Studio converts them to 32*32, by adding transparent background. Ihe icons look fine in for example file explorer, but i cont get them into that darn window caption! WNDCLASSEX wc; wc.cbClsExtra=0; wc.cbSize=sizeof(WNDCLASSEX); wc.cbWndExtra=0; wc.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH); wc.hCursor=LoadCursor(NULL,IDC_ARROW); wc.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_BIG)); wc.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_SMALL)); wc.hInstance=hInstance; wc.lpfnWndProc=WndProc; wc.lpszClassName="wc"; wc.lpszMenuName=0; wc.nostyle=CS_HREDRAW|CS_VREDRAW; Even if i use the big icon in wc.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_SMALL)); it should be stretched?! But I always get the default icon. The application .EXE icon works fine! Regards, Mattias
LessBread
LessBread
Try passing the prog hinstance to LoadIcon instead of NULL.

HICON LoadIcon(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpIconName // name string or resource identifier
);

HINSTANCE hInstance,

"Handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded."





"Beautiful maiden," answered Candide, "when a man is in love, is jealous, and has been flogged by the Inquisition, he becomes lost to all reflection."
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.