torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Wednesday, December 10, 2003
What's wrong with the Process.StartInfo?

If you read the MSDN docs about Process.StartInfo you would assume: nothing is wrong, excellent in controlling the startup of a new process. But how about this line of code:

if(Process.GetCurrentProcess().StartInfo.WindowStyle == ProcessWindowStyle.Minimized) {
  ... // do special things here
}

It will never evaluate to true! The reason is simple: the StartInfo is not populated with the settings of the current running process. So if the documentation states: "Gets or sets the properties to pass to the Start method of the Process" it does not mean: the current process. As long as we have to live with DOT.NET 1.1 the only workaround is to interop with the common API function GetStartupInfo() and corrsponding parameter structure to get the infos we want. But I really like the code above, the more intuitive and managed way. Any MS folks listening?

Technorati tags:  | 
Wednesday, December 10, 2003 9:06:45 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
Saturday, September 22, 2007 7:44:02 PM (W. Europe Daylight Time, UTC+02:00)
Most popular soft for youtube video.
Comments are closed.
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
Site supporters
On this page....
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll

newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Join WebHost4Life.com