G goodbobi Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-22 #1 已知一窗口句柄,如何给这个窗口发送一 Ctrl+C 的事件<br>这是发送F9的程序,那幺我如何发送一个组合件呢.<br>PostMessage(h, WM_KEYDOWN, VK_F9, 0);//发送F9键
已知一窗口句柄,如何给这个窗口发送一 Ctrl+C 的事件<br>这是发送F9的程序,那幺我如何发送一个组合件呢.<br>PostMessage(h, WM_KEYDOWN, VK_F9, 0);//发送F9键
B book523 Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-22 #2 PostMessage(h, WM_KEYDOWN, ^C, 0);
D dx2527 Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-23 #5 PWH:=findWindow('窗口名',nil);<br>PostMessage(PWH,WM_KEYDOWN,(VK_CONTROL and $3H),0);
M mevip Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-24 #7 <br>如果是给可以接收键盘的控件(如Edit)发消息,则Hwnd应该是该控件的句柄,而不是其所在的窗口
M mevip Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-25 #8 这样试试<br>PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, 0);//按下CTRL键<br>PostMessage(hWnd, WM_KEYDOWN, 67, 0);//按下C键<br>PostMessage(hWnd, WM_KEYUP, 67, 0);//松开C键<br>PostMessage(hWnd, WM_KEYUP, VK_CONTROL, 0);//松开CTRL键<br>如果不行,在每两条消息之间加个延时sleep(50);
这样试试<br>PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, 0);//按下CTRL键<br>PostMessage(hWnd, WM_KEYDOWN, 67, 0);//按下C键<br>PostMessage(hWnd, WM_KEYUP, 67, 0);//松开C键<br>PostMessage(hWnd, WM_KEYUP, VK_CONTROL, 0);//松开CTRL键<br>如果不行,在每两条消息之间加个延时sleep(50);
影 影 子 Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-25 #9 PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, 0);//按下CTRL键<br>PostMessage(hWnd, WM_KEYDOWN, 3, 0);//按下C键<br>PostMessage(hWnd, WM_KEYUP, 3, 0);//松开C键<br>PostMessage(hWnd, WM_KEYUP, VK_CONTROL, 0);//松开CTRL键
PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, 0);//按下CTRL键<br>PostMessage(hWnd, WM_KEYDOWN, 3, 0);//按下C键<br>PostMessage(hWnd, WM_KEYUP, 3, 0);//松开C键<br>PostMessage(hWnd, WM_KEYUP, VK_CONTROL, 0);//松开CTRL键
H hurryfq Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-08 #11 Bringwindowtotop(窗口句柄);<br> keybd_event(VK_CONTROL,0,0,0);<br> keybd_event(byte('C'),byte(Mapvirtualkey(byte('C'),0)),0,0);<br> keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);<br> keybd_event(byte('C'),byte(Mapvirtualkey(byte('C'),0)),KEYEVENTF_KEYUP,0);
Bringwindowtotop(窗口句柄);<br> keybd_event(VK_CONTROL,0,0,0);<br> keybd_event(byte('C'),byte(Mapvirtualkey(byte('C'),0)),0,0);<br> keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);<br> keybd_event(byte('C'),byte(Mapvirtualkey(byte('C'),0)),KEYEVENTF_KEYUP,0);
C cowind Unregistered / Unconfirmed GUEST, unregistred user! 2003-12-08 #12 最后一个什么意思~不太明白,我是新手,谁帮解释一下