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]  | 
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....
<December 2003>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

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