exactly that, how do i get a processes/threads window handle if it has one? easily?!
exactly that, how do i get a processes/threads window handle if it has one? easily?!
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
Hey,
I wanted to do this too some time ago, from the process ID i got from spy++. Heres what i found.
[quote]
The OpenProcess function returns a handle to an existing process object.
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier
);
[\quote]
I coudnt get this to work though, but maybe you can? I think its the correct function for this but im not 100% sure. Please let me know if you get it working, another thing, dosnt the process id change everytime a program is restarted?
Hope tha thelps,
TNT
TNT
You Can Stop Me, But You Cant Stop Us All
> Getting window handle from processes ID
I believe the only way to do this is to enumerate through all the windows & compare associated process IDs.
>I think its the correct function for this but im not 100% sure.
nope unfortunatly...
>dosnt the process id change everytime a program is restarted?
i don't know but i would assume its based on the number of processes run or running.
>I believe the only way to do this is to enumerate through all the windows & compare associated process IDs.
i think your right so thats what i did...
but i got a new question for ya!
HOW IN THE **** IS THIS A ENDLESS LOOP!!!!!
if((RepCount < gMaxReps) || gMaxReps == 0)
{
PostMessage(AppDlg->ps[AppDlg->SelectedProcess].hwnd[0],WM_KEYDOWN,AppDlg->key[0],0);
PostMessage(AppDlg->ps[AppDlg->SelectedProcess].hwnd[0],WM_KEYUP,AppDlg->key[0],0); // this function is never reached!!!
messages are still processed by the app just nothing goes past the first call to PostMessage!!!! it just repeats the same damned lines endlessly!!!!!!! untill another message is needing to be processed! EVEN IN THE DEBUGGER IT IGNORES MY BREAKPOINTS!!!!!GGGGAAAAAAAAAHHHHH!!!!!!!
btw: thats me up there!
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.