2using System.Runtime.InteropServices;
9 [DllImport(
"user32.dll")]
12 [DllImport(
"user32.dll", SetLastError =
true)]
15 [DllImport(
"user32.dll")]
18 [DllImport(
"user32.dll", CharSet = CharSet.Auto, SetLastError =
true)]
19 private static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName,
int nMaxCount);
23 StringBuilder stringBuilder =
new StringBuilder(256);
25 return stringBuilder.ToString(0, className);
28 [DllImport(
"user32.dll", CharSet = CharSet.Auto, SetLastError =
true)]
31 [DllImport(
"user32.dll", CharSet = CharSet.Unicode, SetLastError =
true)]
32 private static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString,
int nMaxCount);
37 StringBuilder stringBuilder =
new StringBuilder(num);
39 return stringBuilder.ToString(0, windowText);
static bool GetWindowRect(IntPtr hwnd, out RECT lpRect)
static int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount)
static string GetWindowText(IntPtr hWnd)
static string GetClassName(IntPtr hWnd)
static int GetWindowTextLength(IntPtr hWnd)
static bool IsWindowVisible(IntPtr hWnd)
static bool EnumThreadWindows(uint dwThreadId, EnumThreadDelegate lpfn, IntPtr lParam)
static int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount)
delegate bool EnumThreadDelegate(IntPtr Hwnd, IntPtr lParam)