Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mirror Application and capture events...

Status
Not open for further replies.

tokool

Programmer
Nov 6, 2001
40
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top