Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why CreateNoWindow? [closed]

Tags:

c#

.net

.NET's Process class has a property CreateNoWindow.

ProcessStartInfo.CreateNoWindow Property

Gets or sets a value indicating whether to start the process in a new window.

To me, that seems a queer choice of name for the property. The default is CreateNoWindow = false, a momentarily-confusing double negative.

Is there a reason the property is named as it is? Why not CreateWindow (with the opposite meaning)? Is there a rule that boolean properties must default to false?

like image 493
Colonel Panic Avatar asked Jul 08 '13 08:07

Colonel Panic


1 Answers

I'd guess that it is simply a very literal reflection of the underlying Win32 process creation flag named CREATE_NO_WINDOW.

Only the author of the .net class can explain why the choice was made to reflect the Win32 convention onto the .net class. It could easily have been done the other way. If I had to guess, I'd suggest that the choice was made to make it very clear that the property maps directly onto CREATE_NO_WINDOW.

like image 178
David Heffernan Avatar answered Sep 25 '22 10:09

David Heffernan