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 6:44:02 PM (W. Europe Standard Time, UTC+01: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!
On this page....
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll
[Feed] Dare Obasanjo
Dare Obasanjo aka Carnage4Life
[Feed] Clemens Vasters
[Feed] Omar Shahine
[Feed] Tom Mertens

newtelligence dasBlog 2.1.8102.813

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

WOT Notar

Join WebHost4Life.com