Menu

Icon from .rc not showing . . .

2002-12-10
2012-09-26
  • Nobody/Anonymous

    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 . .

     
    • Nobody/Anonymous

      On WM_INITDIALOG do:
      SendMessage(hwndDialog,WM_SETICON,(WPARAM)ICON_SMALL,(LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_ICON1)));

      Works for me.
      rpeter

       
    • Nobody/Anonymous

      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

       
    • Nobody/Anonymous

      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.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.