I am injecting a .NET SpyLib in the target address space using remote invocation. I need to send a message to that window's thread which created that remote process via GetWindowThreadProcessId
.
I am working on Windows 7. Unfortunately it returns 0 most of the time. Sometimes it gives the appropriate thread id (after restarting Windows).
Why am I getting this strange behavior with GetWindowThreadProcessId
?