There are plenty of API for window/thread/process handling. Spy++ is a very good tool (comes with Microsoft Visual Studio). The
Microsoft Developer Network is the ultimate Windows resource.
Beyond that is going to require some digging, and I do not know Delphi. And I won't get specific due to the questionable purposes.