2010. március 1., hétfő

Hogyan kapd meg egy windows handle értéket egy process-hez.

1)
HAVE: Process ID, NEED: Process handle
Solution: OpenProcess()

2)
HAVE: Process handle, NEED: Process ID
Solution: GetProcessId()

3)
HAVE: Window handle, NEED: Process ID
Solution: GetWindowThreadProcessId()

4)
HAVE: Window handle, NEED: Process handle
Solution: Use 3) and then 1)

5)
HAVE: Process ID, NEED: Window handle
Solution: EnumWindows(), then in the callback function do 3) and check if it matches your process ID.

6)
HAVE: Process handle, NEED: Window handle
Solution: 2) and then 5)

Nincsenek megjegyzések:

Megjegyzés küldése