Hey All,

another problem :) I am trying to write code that on hitting a button will open and program, a "ok" window appears when program is open so I want the code to keystroke RETURN. I am using MSVC 6 MFC. I have gotten (painfuly) to the stage where I hit the button and the program opens and the "ok" window appears but my keystroke operation to hit the RETURN button doesnt seem to be working, here is the code:

HANDLE hEvent;
void CLinkerProgramDlg::OnSim() 
	// TODO: Add your control notification handler code here

    "\EvolveTraffic.exe","","", SW_SHOW );

hEvent = CreateEvent(NULL,FALSE,FALSE,"EvolveTraffic");

keybd_event(VK_RETURN,0x1c,0 , 0); // Press Enter
keybd_event(VK_RETURN,0x9c,KEYEVENTF_KEYUP,0); // Release Enter


has anyone any idea where I am going wrong. Thanks again for all the help.


Have it sorted, using:


works :)


This question has already been answered. Start a new discussion instead.