CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    14

    Change the icon of a dialog

    How to change the icon of a dialog in program. I used SetIcon, SetWindowLong,
    but there is no effect.


  2. #2
    Join Date
    May 1999
    Posts
    42

    Re: Change the icon of a dialog

    Dialogs within apps typically don't have icons. Are you referring to an icon you have placed on your dialog?


  3. #3
    Guest

    Re: Change the icon of a dialog

    SetIcon works when called from within the dialog (e.g. I added a button on the dialog, and the handler changes the icon).

    HICON m_hIcon; //in the CMyDialog header file

    void CMyDialog::OnSetIconButton()
    {
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MODALTYPE);
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon
    }

    Derek


  4. #4
    Guest

    Re: Change the icon of a dialog

    By the way, IDR_MODALTYPE is just the id of the icon that came for free with the app, as my app was called "Modal". Substitute the id of your alternative icon.

    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