using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; // Namespace for Import DLL
namespace HideSetupWindow
{
class Program
{
static void Main(string[] args)
{ // ####################
// | Find Window
// ####################
int hwnd = WinAPI.FindWindow(null, "FirstUXWnd");
Console.WriteLine("FindWindow API Result: " + hwnd.ToString());
// ####################
// | Hide Window : 0 = Hide, 1 = Show
// ####################
if (hwnd != 0) WinAPI.ShowWindow(hwnd, 0);
}
internal static class WinAPI
{ // ----------------------------------------------------------
// FindWindow : http://msdn.microsoft.com/en-us/library/ms633499.aspx
// ----------------------------------------------------------
[DllImport("user32.dll", SetLastError = true)] internal static extern int FindWindow(string lpClassName, string lpWindowName);
// ----------------------------------------------------------
// Show Window : http://msdn.microsoft.com/en-us/library/ms633548.aspx
// ----------------------------------------------------------
[DllImport("user32.dll", SetLastError = true)] internal static extern int ShowWindow(int hwnd, int nCmdShow);
}
// ####################
// NOTE: Any of the following will work...
// ####################
// ----------------------------------------------------------------
//int hwnd = WinAPI.FindWindow("FirstUXWndClass", null); //int hwnd = WinAPI.FindWindow("FirstUXWndClass", "FirstUXWnd"); //int hwnd = WinAPI.FindWindow(null, "FirstUXWnd");
// ----------------------------------------------------------------
}
}