CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Changing the Small and Big icons of a window using LoadImage... How to?

    Quote Originally Posted by Arianax View Post
    No improvement.
    Could you post (attach to your post) your icon file?
    Victor Nijegorodov

  2. #17
    Join Date
    May 2019
    Posts
    53

    Re: Changing the Small and Big icons of a window using LoadImage... How to?

    Quote Originally Posted by VictorN View Post
    Could you post (attach to your post) your icon file?
    I was thinking the same thing... it must be the .ico file...

    I have made this file simply by saving a 16x16 .bmp with MSPAINT as a 256color bitmap with the file extension .ico:

    I get the error message 'invalid file' when I try to upload a .ico file to this site... Maybe I have created it incorrectly..?

    Visual Studio 2017 interprets the file as a BMP if I attach it to the Resource Editor (something I don't want to do since I prefer LoadImage() to LoadIcon()).
    Last edited by Arianax; June 4th, 2019 at 10:35 AM.

  3. #18
    Join Date
    May 2019
    Posts
    53

    Re: Changing the Small and Big icons of a window using LoadImage... How to?

    IT WORKS!!!

    It turned out that I needed to convert the standard 24-Bit BMP file into a .ico file using a specialized Icon Converter piece of software.

    The only strange thing is:

    I still receive the error messages when I do error checking, but the icon appears correctly when the Window is created during Debug mode.

    So the following code works effectively:

    Code:
    HICON hIconSm = (HICON)LoadImage(NULL, L"Icon.ico", ICON_IMAGE, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
    Many thanks for all your assistance Victor...

  4. #19
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Changing the Small and Big icons of a window using LoadImage... How to?

    Quote Originally Posted by Arianax View Post
    I still receive the error messages when I do error checking, but the icon appears correctly when the Window is created during Debug mode.

    So the following code works effectively:

    Code:
    HICON hIconSm = (HICON)LoadImage(NULL, L"Icon.ico", ICON_IMAGE, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
    Again: what error message and how did you check it?
    Victor Nijegorodov

Page 2 of 2 FirstFirst 12

Tags for this Thread

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