using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApp1
{
class Program
{
[DllImport("user32.dll", EntryPoint = "FindWindowEx")]
private static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
static void Main(string[] args)
{
IntPtr maindHwnd = FindWindowEx((IntPtr)0, (IntPtr)0,"窗体Class","窗体标题 也可以是null"); //获得句柄
}
}
}
具体参数就不写了,到处都能搜到,做个笔记
标签:IntPtr,string,C#,System,窗体,FindWindowEx,using From: https://www.cnblogs.com/toumingbai/p/16735785.html