I have a WPF application with lots of native code and win32 windows. Program's Application's icon is defined in VS2015 project as ..\gui\rc\MyApp.ico. When I start program in XenApp Citrix:
The win32-dialog (steps 4-5) before mainwindow can be skipped resulting mainwindow to be opened after splash with Citrix taskbar icon. Steps are above only because while dialog is loading taskbar icon is Citrix.
MyApp.ico is 160x160 pixels with 32 bit depth.
When mainwindow is created during initialization its ShowInTaskbar is set to false. When it is ready it is set to true. This is done because we want to show other window(s) before mainwindow so unfinished mainwindow is somewhere outside the screen(s) and we don't want it to be accessible from taskbar.
EDIT: This does not happen if ShowInTaskbar is not set to false.
Not actually a generic solution for this problem, but it seems that my proposed simple way solves this particular issue with the OP's code.
Rather than setting the ShownInTaskbar
property, it is enough to initially set the Visibility
property of the main form to the Visibility.Hidden
value.
As soon as the window is ready, the Visibility
property can be set to the Visibility.Visible
value causing the window and its task bar button to be displayed (with the correct icons).