模拟按键的代码, 注意运行的时候不要按键.
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "keybd_event")]
static extern void keybd_event(int a, int b, int c, int d);
private void Form3_DoubleClick(object sender, EventArgs e)
{
keybd_event(17, 0, 0, 0);
keybd_event(18, 0, 0, 0);
keybd_event('L', 0, 0, 0);
keybd_event('L', 0, 2, 0);
keybd_event(18, 0, 2, 0);
keybd_event(17, 0, 2, 0);
}
[
本帖最后由 makebest 于 2010-9-16 09:13 编辑 ]