I've got an app that downloads an .exe to a temporary folder and runs it with the System.Diagnostics.Process
class. So far I've run two different apps with it. One is a console app, the other is a full windows app. The windows app has its icon in the taskbar/titlebar, but the console app only has a generic application icon. If I navigate to the temp folder the console app does have its icon; and running it "by hand" (double-clicking in explorer) also gives it the correct icon.
What could be the cause of this?
Additional info: The ProcessStartInfo
class does not offer any flags concerning the icon. I'm running the process with UseShellExecute=true
and ErrorDialog=true
. Also, the windows app is started maximized but the console app is minimized (as specified by the WindowStyle
member of ProcessStartInfo
). Finally, the icon for the console app only includes a 32x32x4bpp icon, while the windows app has a large selection of different formats.
Added: I gave the downloaded app a proper icon. Still no go. :(
Added 2: Oh, right, Windows 7 x64.
Update: Just tried some more experiments. I created a new C++ (unmanaged, not .NET) application with just "press any key to continue" in it and gave it an icon. The icon shows up normally in explorer, and when I run it from explorer, the icon is in the window title bar.
However, when I start the application from Visual studio (via F5 or Ctrl-F5); or when I run the application via another .NET application and Process.Start()
- the icon doesn't appear. Why?