keybd_event(VK_MENU, 0, 0, 0);// press alt
可以百度下具体用法,这个用来模拟键盘事件,很方便。不过不用了一定要让键弹起来啊,否则就相当于一直按着了。
keybd_event(VK_MENU, 0, 2, 0); //release alt