mruff
asked on
Sending a keystroke to the active window as if typed at the keyboard.
I want to send a keystroke to another app. (16.bit, old)
i've tried:
CWnd* pDoptT;
pDoptT = GetNextWindow(GW_HWNDNEXT) ;
do
{
CString strWindowTitle;
pDoptT->GetWindowText(strW indowTitle );
if(strWindowTitle.Find("Ap p to receive key") !=-1)
{
//found the app i want to send keystrokes
::SetForegroundWindow(pDop tT->m_hWnd );
::SendMessage(pDoptT->m_hW nd,WM_KEYD OWN, (WPARAM) iVirtKeyCode, (LPARAM) 0);
}
pDoptT = DoptT->GetNextWindow(GW_HW NDNEXT);
}while(pDoptT != NULL);
somehow the other app does not react, any other solutions?
thanx martin
i've tried:
CWnd* pDoptT;
pDoptT = GetNextWindow(GW_HWNDNEXT)
do
{
CString strWindowTitle;
pDoptT->GetWindowText(strW
if(strWindowTitle.Find("Ap
{
//found the app i want to send keystrokes
::SetForegroundWindow(pDop
::SendMessage(pDoptT->m_hW
}
pDoptT = DoptT->GetNextWindow(GW_HW
}while(pDoptT != NULL);
somehow the other app does not react, any other solutions?
thanx martin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.