GetWindowThreadProcessId() Can't get process id due to remove second param
rogeecn opened this issue · 1 comments
rogeecn commented
in this function
func (hWnd HWND) GetWindowThreadProcessId() uint32 {
ret, _, _ := syscall.Syscall(proc.GetWindowThreadProcessId.Addr(), 2,
uintptr(hWnd), 0, 0)
return uint32(ret)
}
after changed to
func (hWnd HWND) GetWindowThreadProcessId() (uint32,uint32) {
var processId uint32
ret, _, _ := syscall.Syscall(proc.GetWindowThreadProcessId.Addr(), 2,
uintptr(hWnd), uintptr(unsafe.Pointer(&processId)), 0)
return uint32(ret), processId
}
i got the right processID
rodrigocfd commented
You are correct. This function returns both the thread and process IDs. I misread the documentation.