0

I've seen some posts explaining how to show the icon on File Explorer and Taskbar, and those do work for me. However, this way of doing it doesn't display the icon while the executable is running, neither in Visual Studio or outside it.

Trying to change this:

image

I've followed instructions on this post:

How to specify an application icon for C++ Visual Studio 2019?

I'm using VS 2022

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • You'll need to show the code for how you initialize your main window. Specifically, the RegisterClass or RegisterClassEx call you used. Do you have `.rc` file in your project? – selbie Mar 13 '22 at 20:56
  • Window icon is initially set when filling `WNDCLASSEX` structure prior to creating window class or later with `WM_SETICON` message. – user7860670 Mar 13 '22 at 21:34
  • Which C++ project are you using? MFC MDI , Dlg or others? – Minxin Yu - MSFT Mar 14 '22 at 06:57
  • Thanks for the reply, I added the icon to the window class and it worked perfectly. – supremezone Mar 15 '22 at 20:20
  • Hi ,glad to know you've found the solution to resolve this issue! Please consider answering it and accepting it as an answer to change its status to Answered. See [can I answer my own question..](https://stackoverflow.com/help/self-answer), Just a reminder :) – Minxin Yu - MSFT Mar 16 '22 at 02:26

0 Answers0