Maybe its sounds some "fool", but i have been trying to display a icon and i cant. What i do is the following (i dont know how to post "code" so i spect someone tell me how to do it). The code is in C:

HDC hdc;
HICON hIcon;

hdc = GetDC(hwnd);

hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MY_ICON));

SelectObject(hdc, hIcon);

BitBlt... and what it follow next.

Reading MSDN i think it dont says that you can "select" a icon in a DC or do i have to mess with DIBS and all that?? I have tryed LoadImage and its the same.
Posted on 2004-04-03 23:07:52 by Ateneo
Create a static control with the style SS_ICON and then load the icon and display it like this :

invoke SendMessage, , STM_SETICON, , 0

To draw an icon into a DC you use :

invoke DrawIcon, , 0, 0,

Or if you need more control :

invoke DrawIconEx, , 0, 0, , 16, 16, 0, 0, DI_NORMAL
Posted on 2004-04-03 23:20:53 by donkey
Donkey is right in this, your approach is correct for most GDI stuff, but for Icon's in particular there is far simpler API's to work with.

Posted on 2004-04-03 23:41:03 by NaN