狐 狐狸精 Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-12 #1 比如Windows下,需要按下CTRL键才能通过拖放操作来Copy,现在我不想按任何键就想实现 Copy操作。如何实现虚拟按下CTRL键??? 很急很急,高分求助[][]
D Del_Sun Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-12 #2 Sendmessage(Control.Handle, WM_KEYDOWN, vk_Ctrl, 0, 0)
Z zhangkan Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-12 #3 Ctrl-c keybd_event(VK_Ctrl,0,0,0); keybd_event(char('C'), MapVirtualKey(char('C'), 0), 0, 0); keybd_event(char('C'), MapVirtualKey(char('C'), 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Ctrl,0,KEYEVENTF_KEYUP,0); Ctrl-V keybd_event(VK_Ctrl,0,0,0); keybd_event(char('V'), MapVirtualKey(char('V'), 0), 0, 0); keybd_event(char('V'), MapVirtualKey(char('V'), 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Ctrl,0,KEYEVENTF_KEYUP,0); 试试吧。
Ctrl-c keybd_event(VK_Ctrl,0,0,0); keybd_event(char('C'), MapVirtualKey(char('C'), 0), 0, 0); keybd_event(char('C'), MapVirtualKey(char('C'), 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Ctrl,0,KEYEVENTF_KEYUP,0); Ctrl-V keybd_event(VK_Ctrl,0,0,0); keybd_event(char('V'), MapVirtualKey(char('V'), 0), 0, 0); keybd_event(char('V'), MapVirtualKey(char('V'), 0), KEYEVENTF_KEYUP, 0); keybd_event(VK_Ctrl,0,KEYEVENTF_KEYUP,0); 试试吧。
狐 狐狸精 Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-12 #4 要求是通过鼠标实现Copy操作,键盘没有操作,需要虚拟按下CTRL键。
C CCF_Liber Unregistered / Unconfirmed GUEST, unregistred user! 2002-06-12 #5 keybd_event(VK_CONTROL,0,0,0);-----------虚拟按下 keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);--放开