In this post the basics for finding and hiding a window will be shown in Visual Studio 2008 (C#). As previously mentioned in Snazzy OSD status with BGInfo, hiding the Windows 7 Setup window will be demonstrated.
Creating and Compiling
First, create a simple Console Application under the C# tree.
Next, copy and paste the code sample below.
Finally, compile the application.
Tips & Tricks
Use the code sample below to hide an instance of Notepad. Two points worth mentioning:
- The Class Name for Notepad windows is “Notepad”; all Notepad windows will share this common class name.
- The Text or Window Name for Notepad windows may vary for each window; for example, a new instance of Notepad will usually contain the window text “Untitled – Notepad”
Parameter 1 is the Class Name. Parameter 2 is the Window Name. Searching on either (or both) parameter is possible:
In parting, a very accommodating utility for learning and working with this type of window manipulation is Winspector.
This blog post was originally created by Michael Schmidt.