请问中间哪里错了 没次1打开程序 马上非法超做 Private Function dnc(lpADDress As Long) As String
' 声明一些需要的变量
Dim hwnd As Long ' 储存 FindWindow 函数返回的句柄
Dim pid As Long ' 储存进程标识符( Process Id )
Dim pHandle As Long ' 储存进程句柄
hwnd = FindWindow(vbNullString, "Bbs")If hwnd <> 0 Then Label1.Caption = "程序已运行"
' 取得进程标识符
GetWindowThreadProcessId hwnd, pid
' 使用进程标识符取得进程句柄
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
' 在内存地址中读取数据
ReadProcessMemory pHandle, lpADDress, ByVal VarPtr(dnc), 4, 0&
' 关闭进程句柄
CloseHandle hProcess
End Function