/// Return Type: BOOL->int
///param0: HWND->HWND__*
///param1: LPARAM->LONG_PTR->int
[System.Runtime.InteropServices.UnmanagedFunctionPointer
public delegate int WNDENUMPROC(System.IntPtr param0, ref System.IntPtr param1);
//在向导生成的定义中增加ref
/// Return Type: BOOL->int
///lpEnumFunc: WNDENUMPROC
///lParam: LPARAM->LONG_PTR->int
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "EnumWindows")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
public static extern bool EnumWindows(WNDENUMPROC lpEnumFunc, ref int lParam);
//在向导生成的定义中增加ref
int find(System.IntPtr param0,
{
}
private void button3_Click(object sender, EventArgs e)
{
本文介绍了一个使用C#实现的窗口枚举技术示例,通过枚举所有顶级窗口并获取其标题来查找特定窗口句柄的方法。该技术利用了WNDENUMPROC委托及user32.dll中的EnumWindows函数。
8043

被折叠的 条评论
为什么被折叠?



