I use createprocess and open an application "A"(eg:calc.exe or notepad.exe). I then create another window and mirror the image of the window generated by "A". Any event on the mirror, i capture and send it to the application window "A".
I am using the below code snippet to do a part the above..
//create a process EG:calc.exe
BOOL bres = CreateProcess(NULL, (char *)"calc.exe", NULL,NULL,FALSE, NORMAL_PRIORITY_CLASS,NULL,NULL,&si,pi);
//get the window handle
EnumThreadWindows(piApp.dwThreadId, EnumProc, (LPARAM)&hWnd);
SetFocus(hWnd);
//send the message to the window
//i get the Mesg structure from another program(a mirror of the one i opened(eg calc.exe) and store it in a structure
bp = PostMessage(hWnd, reqMesg->EventName, reqMesg->wParam, reqMesg->lParam);
The problem i am facing is:
1. I am able to capture the events on the mirror window, but am not able to send it to the application window "A" effectively
2. In case of the application calc.exe, i am able to send the keyboard events correctly, but the mouse events do not sem to show.
3. When i open notepad.exe, both mouse n keyboard events do not work.
Could smbdy throw sm light on this problem, would appriciate it.
Thanks..
Preetham.
I am using the below code snippet to do a part the above..
//create a process EG:calc.exe
BOOL bres = CreateProcess(NULL, (char *)"calc.exe", NULL,NULL,FALSE, NORMAL_PRIORITY_CLASS,NULL,NULL,&si,pi);
//get the window handle
EnumThreadWindows(piApp.dwThreadId, EnumProc, (LPARAM)&hWnd);
SetFocus(hWnd);
//send the message to the window
//i get the Mesg structure from another program(a mirror of the one i opened(eg calc.exe) and store it in a structure
bp = PostMessage(hWnd, reqMesg->EventName, reqMesg->wParam, reqMesg->lParam);
The problem i am facing is:
1. I am able to capture the events on the mirror window, but am not able to send it to the application window "A" effectively
2. In case of the application calc.exe, i am able to send the keyboard events correctly, but the mouse events do not sem to show.
3. When i open notepad.exe, both mouse n keyboard events do not work.
Could smbdy throw sm light on this problem, would appriciate it.
Thanks..
Preetham.