以下是我找到的方法,发送ctrl+a的,希望对你有帮助:<br>var <br> hwnd:thandle; <br>begin <br> hwnd:=findwindow(nil,'窗口标题');//如果知道类就用类名 <br> if hwnd<>0 then //找到窗口 <br> begin <br> setforegroundwindow(hwnd); //这句好象很关键<br> //按下 <br> keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), 0, 0); <br> keybd_event(ord('A'), MapVirtualKey(ord('A'), 0), 0, 0); <br> //释放 <br> keybd_event(ord('A'), MapVirtualKey(ord('A'), 0), KEYEVENTF_KEYUP, 0); <br> keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP, 0); <br> end; <br>end;