如题
代码如下
这段代码可以获取进程的句柄
但是通过GlobalLock函数却无法锁定内存首地址
请教原因
希望懂的人帮忙调试一下
感激不尽Local $wHndl = "", $WCCount = 0, $WList
Dim $pid,$MemAddress
$pid = ProcessExists("QQ.exe")
If $pid <> 0 Then
Do
Local $WList = WinList()
For $WLCount = 1 To $WList[0][0]
If WinGetProcess($WList[$WLCount][1]) = $pid Then
$wHndl = $WList[$WLCount][1]
ExitLoop
EndIf
Next
If $WCCount = 400 Then SetError(1)
Sleep(50)
$WCCount += 1
Until Not ($wHndl = "")
If $wHndl <> "" Then
MsgBox(0,"",$wHndl)
$AddLock=DllCall("kernel32.dll","int","GlobalLock","int","0x1F0FFF")
$Address=Call($AddLock,$wHndl)
MsgBox(0,"",hex($Address))
Else
MsgBox(0, "", "进程句柄获取失败")
EndIf
Else
MsgBox(0, "", "进程不存在!")
EndIf
|