7 using System.Threading;
8 using System.Runtime.Serialization;
29 private extern bool PostMessage (
int hWnd,
int uMsg,
int wParam,
int lParam) ;
38 private extern bool SetForegroundWindow (IntPtr handle) ;
48 private extern bool ShowWindow (IntPtr hWnd, SHOW_WINDOW nCmdShow) ;
59 private extern int GetWindowPlacement (IntPtr hwnd, ref WINDOWPLACEMENT lpwndpl) ;
65 private struct WINDOWPLACEMENT
75 public POINTAPI ptMinPosition;
76 public POINTAPI ptMaxPosition;
77 public RECT rcNormalPosition;
84 private struct POINTAPI
107 private const WM_APP = &H8000;
114 private const WM_SYSCOMMAND = &H112;
121 private const SC_CLOSE = &HF060&;
127 private enum SHOW_WINDOW
132 SW_SHOWMINIMIZED = 2,
133 SW_SHOWMAXIMIZED = 3,
135 SW_SHOWNOACTIVATE = 4,
138 SW_SHOWMINNOACTIVE = 7,
142 SW_FORCEMINIMIZE = 11,
153 private extern int GetWindowTextLength (
int hwnd) ;
164 private extern int GetWindowText (
int hwnd,
string lpString,
int cch) ;
184 private extern int EnumWindows (EnumWindowsCallBack lpEnumFunc,
int lParam) ;
simple class with Windows API functions
Auto int GetWindowThreadProcessId(int hwnd, ref int lpdwProcessId)
Retrieves the identifier of the thread that created the specified window