When using the following class in a console application, and having at least one instance of Notepad running, GetWindowThreadProcessId correctly returns a non-z
You could also enable the option "Allow service to interact with desktop" and see if that works. Otherwise I would have to agree with onbugz comment above.