From a parent process, I created a custom windows station and desktop.
I then CreateProcess using that
new station/desktop. There are no problems launching a plain windows
app with this station/desktop.
(I tried some simple apps and notepad.exe) However a Winforms app
fails.
If I use the default station (Winsta0) but a custom desktop, the
Winforms app does work.
I would prefer using a custom windows station, but I'm close to
punting :(
Winforms fails this way...
System.TypeInitializationException: The type initializer for
"System.Drawing.SafeNativeMethods" threw an exception. --->
System.Runtime.InteropServices.ExternalException: Failed to create
system events window thread.
at Microsoft.Win32.SystemEvents.EnsureSystemEvents(Bo olean
requireHandle, Boolean throwOnRefusal)
at Microsoft.Win32.SystemEvents.InvokeOnEventsThread( Delegate
method)
at System.Drawing.SafeNativeMethods.Initialize()
at System.Drawing.SafeNativeMethods..cctor()
--- End of inner exception stack trace ---
at System.Drawing.SafeNativeMethods.CreateIconFromRes ourceEx(Byte*
pbIconBits, Int32 cbIconBits, Boolean fIcon, Int32 dwVersion, Int32
csDesired, Int32 cyDesired, Int32 flags)
at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
at System.Drawing.Icon..ctor(Type type, String resource)
at System.Windows.Forms.Form.get_DefaultIcon()
at System.Windows.Forms.Form.get_Icon()
at System.Windows.Forms.Form.UpdateWindowIcon(Boolean redrawFrame)
at System.Windows.Forms.Form.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Control.Show()
at com.tonic.tde.ui.TDE.Main(String[] args) in
c:\trunk\src\tonic\tde_client\cs\com\tonic\ui\tde. cs:line 525
The ExternalException's HRESULT is E_FAIL (which doesn't tell us
squat)
Has anyone seen this problem?