Click here to Skip to main content
15,887,464 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Avoiding "auto-select" in editable combobox Pin
Code-o-mat26-Feb-10 2:42
Code-o-mat26-Feb-10 2:42 
QuestionCPU Usage & Mem Usage Pin
john563225-Feb-10 23:35
john563225-Feb-10 23:35 
AnswerRe: CPU Usage & Mem Usage Pin
«_Superman_»26-Feb-10 0:56
professional«_Superman_»26-Feb-10 0:56 
AnswerRe: CPU Usage & Mem Usage Pin
Rajesh R Subramanian26-Feb-10 1:29
professionalRajesh R Subramanian26-Feb-10 1:29 
QuestionMouse Event Pin
john563225-Feb-10 20:49
john563225-Feb-10 20:49 
AnswerRe: Mouse Event Pin
KarstenK25-Feb-10 21:10
mveKarstenK25-Feb-10 21:10 
AnswerRe: Mouse Event Pin
«_Superman_»25-Feb-10 21:16
professional«_Superman_»25-Feb-10 21:16 
AnswerRe: Mouse Event Pin
wangningyu26-Feb-10 21:07
wangningyu26-Feb-10 21:07 
1、keyboard event:

keybd_event(VK_CONTROL,0,0,0);
keybd_event(VK_MENU, 0, 0, 0);  
keybd_event('S', 0, 0, 0);   
 
keybd_event('S', 0, KEYEVENTF_KEYUP, 0);   
keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);  


::PostMessage(hWnd,WM_KEYDOWN,VK_CONTROL,0);
::PostMessage(hWnd,WM_KEYDOWN,VK_MENU,0);
::PostMessage(hWnd,WM_KEYDOWN,'1',0);

::PostMessage(hWnd,WM_KEYUP,'1',0);
::PostMessage(hWnd,WM_KEYUP,VK_MENU,0);
::PostMessage(hWnd,WM_KEYUP,VK_CONTROL,0);



2、mouse event:
CString gameCaption="XXXXX";
HWND	hWnd=::FindWindow(NULL,gameCaption);
DWORD	dwPid;
RECT	rect;
POINT	ptOld;

::GetWindowThreadProcessId(hWnd,&dwPid);
::GetWindowRect(hWnd,&rect);

::GetCursorPos(&ptOld);
::SetCursorPos(80,150);

mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

SetCursorPos(rect.left +200,rect.top +150);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);


CString gameCaption="XXXXX";
HWND	hWnd=::FindWindow(NULL,gameCaption);

::PostMessage(hWnd,WM_MOUSEMOVE, MK_LBUTTON, MAKELONG(80,130));
::PostMessage(hWnd,WM_LBUTTONDOWN,MK_LBUTTON,MAKELPARAM(80,130));   
::PostMessage(hWnd,WM_LBUTTONUP,MK_LBUTTON,MAKELPARAM(80,130));
Sleep(10);



more Information,please click here.
http://blog.csdn.net/wangningyu/archive/2009/12/13/4994295.aspx
QuestionCompressed image movement is too slow Pin
Game-point25-Feb-10 19:25
Game-point25-Feb-10 19:25 
AnswerRe: Compressed image movement is too slow Pin
Stuart Dootson25-Feb-10 20:43
professionalStuart Dootson25-Feb-10 20:43 
GeneralRe: Compressed image movement is too slow Pin
Game-point25-Feb-10 21:41
Game-point25-Feb-10 21:41 
GeneralRe: Compressed image movement is too slow Pin
Stuart Dootson25-Feb-10 21:44
professionalStuart Dootson25-Feb-10 21:44 
GeneralRe: Compressed image movement is too slow Pin
Game-point25-Feb-10 22:18
Game-point25-Feb-10 22:18 
QuestionHow to Get List of Function Pin
Anubhava Dimri25-Feb-10 17:32
Anubhava Dimri25-Feb-10 17:32 
AnswerRe: How to Get List of Function Pin
Cool_Dev25-Feb-10 18:02
Cool_Dev25-Feb-10 18:02 
AnswerRe: How to Get List of Function Pin
Joshua Tully25-Feb-10 18:02
Joshua Tully25-Feb-10 18:02 
QuestionDuplicatreHande question Pin
ForNow25-Feb-10 15:32
ForNow25-Feb-10 15:32 
AnswerRe: DuplicatreHande question Pin
Gwenio25-Feb-10 16:08
Gwenio25-Feb-10 16:08 
QuestionExporting a struct from a DLL Pin
masnu25-Feb-10 9:57
masnu25-Feb-10 9:57 
AnswerRe: Exporting a struct from a DLL Pin
Richard MacCutchan25-Feb-10 10:26
mveRichard MacCutchan25-Feb-10 10:26 
AnswerRe: Exporting a struct from a DLL Pin
Avi Berger25-Feb-10 10:36
Avi Berger25-Feb-10 10:36 
QuestionQuestion on Dialog & ComboBox Pin
Software200725-Feb-10 8:08
Software200725-Feb-10 8:08 
AnswerRe: Question on Dialog & ComboBox Pin
Maximilien25-Feb-10 8:13
Maximilien25-Feb-10 8:13 
GeneralRe: Question on Dialog & ComboBox Pin
Software200725-Feb-10 8:18
Software200725-Feb-10 8:18 
QuestionRe: Question on Dialog & ComboBox Pin
David Crow25-Feb-10 17:10
David Crow25-Feb-10 17:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.