X xzywj Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #1 在窗体上放一BUTTON按钮,通过点击此按钮来执行CTRL+S或F6等等,如何实现,谢谢!在线等待。。。
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #2 procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f1;end;
procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f1;end;
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #3 procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f6;end;
procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f6;end;
X xzywj Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #4 de410不行,是buttonclick事件执行F6快捷键
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #5 procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f6; keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0); keybd_event('S', (BYTE)0, KEYEVENTF_KEYUP,0);end;
procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin key:=vk_f6; keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0); keybd_event('S', (BYTE)0, KEYEVENTF_KEYUP,0);end;
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #6 执行F6 procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_F6, MapVirtualKey(VK_CONTROL, 0), 0, 0);end;
执行F6 procedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_F6, MapVirtualKey(VK_CONTROL, 0), 0, 0);end;
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #7 执行CTRL+Sprocedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0); keybd_event('S', (BYTE)0, KEYEVENTF_KEYUP,0);end;
执行CTRL+Sprocedure TForm1.Button7KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL, 0), 0, 0); keybd_event('S', (BYTE)0, KEYEVENTF_KEYUP,0);end;
D de410 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #8 上面的错了执行CTRL+Sprocedure TForm1.Button1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_CONTROL,MapVirtualKey(VK_CONTROL,0),0,0); keybd_event(Byte('S'),0,KEYEVENTF_KEYUP,0);end;
上面的错了执行CTRL+Sprocedure TForm1.Button1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);begin keybd_event(VK_CONTROL,MapVirtualKey(VK_CONTROL,0),0,0); keybd_event(Byte('S'),0,KEYEVENTF_KEYUP,0);end;
X xzywj Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-15 #9 把keybd_event(Byte('S'),0,KEYEVENTF_KEYUP,0);改成keybd_event(Byte('S'),0,0,0);可以了,谢谢。另外ALT+S,怎么写,好像没有VK_ALT吗。
把keybd_event(Byte('S'),0,KEYEVENTF_KEYUP,0);改成keybd_event(Byte('S'),0,0,0);可以了,谢谢。另外ALT+S,怎么写,好像没有VK_ALT吗。