using System;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
namespace Demo
{
[SuppressUnmanagedCodeSecurity]
internal static class UnsafeNativeMethods
{
#region Delegates
public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);
#endregion
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll", SetLastError = true)]
internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
internal static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr GetWindow(IntPtr hwnd, int wFlag);
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);
}
}