请教,模拟键盘按下的问题(100分)

  • 主题发起人 主题发起人 stuwei
  • 开始时间 开始时间
S

stuwei

Unregistered / Unconfirmed
GUEST, unregistred user!
使MEMO滚动到最后一行,也就是模拟一个Ctrl+end键<br>SendMessage(Mem_file-&gt;Handle,WM_KEYDOWN,VK_CONTROL,0);<br>SendMessage(Mem_file-&gt;Handle,WM_KEYDOWN,VK_NEXT,0);<br>为什么不行?应该怎样?
 
刚好我的程序里也用到<br>不用模拟Ctrl+end的<br>&nbsp; SendMessage(HintMemo.Handle, EM_SETSEL, 0, 0);<br>&nbsp; SendMessage(HintMemo.Handle, EM_SCROLLCARET, 0, 0);<br>
 
combobox1.SetFocus;<br>&nbsp; //keybd_event( VK_Control, MapVirtualKey(VK_Control, 0 ), 0 , 0 ); &nbsp; &nbsp; //Control key down<br>&nbsp; keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0 ),KEYEVENTF_EXTENDEDKEY, 0 ); &nbsp; &nbsp; // Alt down<br>&nbsp; keybd_event( VK_Down, MapVirtualKey(VK_Down, 0 ),KEYEVENTF_EXTENDEDKEY, 0 ); &nbsp; &nbsp; // down arrow key down<br>&nbsp; //keybd_event( VK_Control, MapVirtualKey(VK_Control, 0 ), KEYEVENTF_KEYUP , 0 ); &nbsp;//Control arrow key up<br>&nbsp; keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0 ), KEYEVENTF_KEYUP , 0 ); &nbsp;//Alt key up<br>&nbsp; keybd_event( VK_Down, MapVirtualKey(VK_Down, 0 ), KEYEVENTF_KEYUP , 0 ); &nbsp;//Down key up<br>以上模拟了一个用程序打开组合框的情况。有的时候用得着。<br>
 
碧血剑的方法好像不行噢<br>谁能解决下
 
不好意思,错了,应该是<br>postmessage(hintmemo.handle, WM_VSCROLL, SB_PageDOWN, 0);<br>
 
后退
顶部