Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

Displaying an icon in a simple dialog with winapi

$
0
0
I made a dialog to have a customizable msgbox. (custom icon, custom caption on buttons).

This is how I try to display an icon on the dialog but it is not working. Can anyone help?

HICON hIcon = LoadIcon(NULL, IDI_QUESTION);
HWND hImageCtl = GetDlgItem(hDlg, IDC_STATIC);
::SendMessage(hImageCtl, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);

//SendDlgItemMessage(hDlg, IDC_STATIC, STM_SETICON, (WPARAM) hIcon, 0);

Viewing all articles
Browse latest Browse all 3042

Trending Articles