winforms - PowerShell Form: Sometimes starts in the background -


i wrote little gui script use on daily basis. window starts in background behind other windows have opened. in case there no icon in task bar. phenomenon looks script not started. when minimize other windows can see script gui , after clicking icon on task bar appears.

here how defined powershell form:

[void] [system.reflection.assembly]::loadwithpartialname("system.windows.forms") [void] [system.reflection.assembly]::loadwithpartialname("system.drawing")  $window = new-object system.windows.forms.form $window.startposition = "centerscreen" $window.autosize = $false $window.minimizebox = $false $window.maximizebox = $false $window.formborderstyle = "fixedtoolwindow"  [...]  $window.showdialog() | out-null 

does know can ensure gui started on top?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -