CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: IDR_MAINFRAME

  1. #1
    Guest

    IDR_MAINFRAME

    I have a dialog which opens a new resizing-dialog. No big deal, except the new dialog has the windows logo as the icon in the upper left hand corner... how can i change that?

    Thanks



  2. #2
    Guest

    Re: IDR_MAINFRAME

    Go into the Icon folder of your Resource Editor, click on IDR_MAINFRAME, create custom 16x16 and 32x32 icons, and rebuild your program. That should do it.


  3. #3
    Guest

    Re: IDR_MAINFRAME

    The Icon is OK in the Main Dialog it is the windows logo when i DoModal() on a new dialog that is set for Resizable.

    Thanks


  4. #4
    Guest

    Re: IDR_MAINFRAME

    If you just want to remove the icon, then uncheck the "System Menu" option in the Resource editor properties.

    Alternatively, if you need the system menu and/or want an icon, add a member variable to your dialog class:

    HICON m_hIcon;

    Set this member variable in the dialog constructor:
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);

    Add a WM_INITDIALOG handler and include the following code:
    // Set the icon for this dialog. The framework does this automatically
    // when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon

    Note:
    I found this out by copying the code automatically generated for the main dialog of a dialog based application.

    Derek.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured