CWnd *pWnd=CWnd::FindWindow(NULL, "计算器");//获取目的窗口对象
pWnd->SetForegroundWindow();//将窗口提前
keybd_event(18,0,0,0);
keybd_event(72,0,0,0);
keybd_event(72,0,KEYEVENTF_KEYUP,0);
keybd_event(18,0,KEYEVENTF_KEYUP,0);
按键键值:
http://www.cnblogs.com/nemolog/archive/2005/10/30/265035.html