获得句柄

来源:百度知道 编辑:UC知道 时间:2024/06/27 10:18:15
如何获取桌面上任意一个程序的句柄[知道程序的名称或标题]
或者是鼠标点下后 获得该窗口的句柄也行


FindWindow Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
获得句柄
如知道进程ID 用OpenProcess
Public Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long