Quote Originally Posted by golanshahar
you can try doing something like this:

Code:
HWND h = ::GetTopWindow(0 );

while ( h )
{
         DWORD pid;
         DWORD dwTheardId = ::GetWindowThreadProcessId( h,&pid);


     HANDLE hProc = ::OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid);

         if ( hProc == /*your process handle*/ )
         {
        // here h is the handle to the window
            break;
         }
         h = ::GetNextWindow( h , GW_HWNDNEXT);
}
hope it will help

Cheers
DWORD pid;
DWORD dwTheardId = ::GetWindowThreadProcessId( h,&pid);


HANDLE hProc = ::OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid);
????

no no no.

Code:
if (pid == /*your process id*/)