In my program I need to open a file using an external application (Bentley MicroStation, if it’s important). I need application with the opened file to be invisible to user (I will perform some operations over it).
The way to open a file using Process seems fine except for one thing – tests over “example.txt” or “example.doc” show that even when ProcessStartInfo property WindowStyle is set to Minimized or Hidden nevertheless you see the application with opened file.
So, how can I open file without showing my operations to user? Of course, it is possible to hide the app window afterwards, but that’s not what I need…
Upd. I work with Bentley MicroStation XM edition. It has a splash screen that can be disabled.
The main problem: when starting MicroStation via Process and ProcessStartInfo with command line argument (name of file to open) and various settings like WindowsStyle (Hidden), UseShellExecute (false), CreateNoWindow (true) application window is present and visible. Simple test with win api WinExec with uCmdShow set to 0 (hidden) gives the same result.
Any solution for starting application in background mode is accepted. Thanks in advance.
It seems to me the most simple way to implement your requirements is to start new process on the other windows desktop. Default process pesktop is “WinSta0\Default”. With respect of CreateDesktop Function you can create new desktop for example with the name “MyDesktop” and then start proccess on the desktop.
Following code demonstrate the technique: