0
点赞
收藏
分享

微信扫一扫

[AHK]用Scite运行ahk脚本,脚本中输出Scite的进程编号


获取父进程的pid


GetParentPID()
{
	hScriptProc := DllCall("GetCurrentProcess", "ptr")
	
	VarSetCapacity(pbi, sizeof_pbi := 6*A_PtrSize)
	if DllCall("ntdll\NtQueryInformationProcess", "ptr", hScriptProc, "uint", 0, "ptr", &pbi, "uint", sizeof_pbi, "ptr", 0, "uint") ; 0=ProcessBasicInformation
		throw Exception("NtQueryInformationProcess()", 0, rc " - " w " - " sizeof_pbi) ; Short msg since so rare.
	
	return NumGet(pbi, 5*A_PtrSize)
}
MsgBox % GetParentPID()




举报

相关推荐

0 条评论