How to get main process thead and it's main window handle? I'm getting the process from CreateToolhelp32Snapshot/ Process32First/ Process32Next and then OpenProcess
I don't know how to separate the "main" thread from others. You can walk the thread list, comparing each thread's processID with the processID of the process you're interested in. To obtain the list of windows associated with a thread, call EnumThreadWindows. The "main" window is the one that has no parent: call GetParent on every window handle and the one that returns 0 is the main window
Hi ! Get main thread.. handle: GetCurrentThread (pseudo handle) ID: GetCurrentThreadID regards, yoda
y0da: The CHEMI$T wants to get hold of the main thread in other process.