Can anybody explain why this Icon is not showing?
these are the entries in the .rc file: IDI_ICON1 ICON DISCARDABLE "C:\\Programme\\Dev-Cpp\\Icons\\icon1.ico"
IDM_HELPABOUT DIALOG DISCARDABLE 0, 0, 150, 150 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "About" FONT 10, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,50,130,50,10 ICON "IDI_ICON1",IDC_STATIC,15,15,32,32 END
In the header:
#define IDI_ICON1 100
And I call it like this:
case IDM_HELPABOUT: DialogBox(hInst, (LPCTSTR)IDM_HELPABOUT, hwnd, (DLGPROC)AboutProc); break;
Anybody an idea?? Any help is greatly appreciated . .
On WM_INITDIALOG do: SendMessage(hwndDialog,WM_SETICON,(WPARAM)ICON_SMALL,(LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1)));
Works for me. rpeter
Yes, that works . . but the icon I'm trying to display is in the middle of the dialog, not in the top left corner . . Thanks, anyway
Oh, I don't think you can put an icon there so easily. I think you need some painting. Never tried that. rpeter
Log in to post a comment.
Can anybody explain why this Icon is not showing?
these are the entries in the .rc file:
IDI_ICON1 ICON DISCARDABLE "C:\\Programme\\Dev-Cpp\\Icons\\icon1.ico"
IDM_HELPABOUT DIALOG DISCARDABLE 0, 0, 150, 150
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
CAPTION "About"
FONT 10, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,50,130,50,10
ICON "IDI_ICON1",IDC_STATIC,15,15,32,32
END
In the header:
#define IDI_ICON1 100
And I call it like this:
case IDM_HELPABOUT:
DialogBox(hInst, (LPCTSTR)IDM_HELPABOUT, hwnd, (DLGPROC)AboutProc);
break;
Anybody an idea?? Any help is greatly appreciated . .
On WM_INITDIALOG do:
SendMessage(hwndDialog,WM_SETICON,(WPARAM)ICON_SMALL,(LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1)));
Works for me.
rpeter
Yes, that works . . but the icon I'm trying to display is in the middle of the dialog, not in the top left corner . .
Thanks, anyway
Oh, I don't think you can put an icon there so easily. I think you need some painting. Never tried that.
rpeter