views:

351

answers:

3

Is it possible to change a console window's icon from .net? Without using win32 calls.

+5  A: 
chakrit
+1  A: 

I had the icon set in the project properties, as Chakrit suggested, but my problem was that I was running it from Visual Studio, which runs app.vshost.exe, not app.exe directly.

Since app.vshost.exe didn't have the icon it was appearing not to work, even though it was configured correctly.

If a moderator see this, please un-delete chakrit's very good post.

Eric Haskins
undeleted...
Marc Gravell
Actually, I didn't notice the "vshost" problem too til you mention it. :-) ... I just sort of remember that it worked that way.
chakrit
A: 

Generally, you cannot assign an icon to the window of the application when it is running from vshost. It will work correctly when it is running outside the IDE, with the condition that you set a custom icon in the Project Properties dialog.