2 using System.Collections.Generic;
5 using System.Runtime.InteropServices;
6 using System.Diagnostics;
15 [DllImport(
"user32.dll")]
16 public static extern IntPtr
SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
18 [DllImport(
"user32.dll")]
19 public static extern IntPtr
FindWindow(
string lpClassName,
string lpWindowName);
21 [DllImport(
"user32.dll")]
24 [DllImport(
"user32.dll")]
28 public static extern IntPtr
GetSystemMenu(IntPtr hWnd, [MarshalAs(UnmanagedType.Bool)] Boolean revert);
34 public static extern int RemoveMenu(IntPtr hMenu,
int index,
int flags);
37 public static extern int MoveWindow(IntPtr hWnd,
int x,
int y,
int cx,
int cy, [MarshalAs(UnmanagedType.Bool)] Boolean repaint);
40 [
return: MarshalAs(UnmanagedType.Bool)]
44 public static extern int ShowWindow(
int hWnd,
int nCmdShow);
46 [DllImport(
"user32.dll", CharSet = CharSet.Auto)]
47 public static extern int GetWindowText(
int hWnd, StringBuilder lpString,
int nMaxCount);
49 [DllImport(
"user32.dll", CharSet = CharSet.Auto)]
55 private delegate
bool CallBackPtr(
int hwnd,
int lParam);
58 public static List<int>
Handles =
new List<int>();
60 [DllImport(
"user32.dll")]
61 private static extern int EnumWindows(CallBackPtr callPtr,
int lPar);
63 public static bool Report(
int hwnd,
int lParam)
static int GetWindowTextLength(int hWnd)
static IntPtr FindWindow(string lpClassName, string lpWindowName)
static int GetMenuItemCount(IntPtr hMenu)
static int ShowWindow(int hWnd, int nCmdShow)
delegate bool CallBackPtr(int hwnd, int lParam)
static IntPtr GetDesktopWindow()
static int RemoveMenu(IntPtr hMenu, int index, int flags)
static List< int > Handles
static int EnumWindows(CallBackPtr callPtr, int lPar)
static bool GetWindowRect(IntPtr hWnd, out Rect lpRect)
static int GetWindowText(int hWnd, StringBuilder lpString, int nMaxCount)
static IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent)
static bool Report(int hwnd, int lParam)
static bool LockWindowUpdate(IntPtr hwndLock)
static IntPtr GetSystemMenu(IntPtr hWnd, [MarshalAs(UnmanagedType.Bool)] Boolean revert)
static int MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, [MarshalAs(UnmanagedType.Bool)] Boolean repaint)