Click here to Skip to main content
12,510,824 members (51,848 online)

C / C++ / MFC

 
GeneralRe: Best Approach to process KeyStrokes in Rich Edit Pin
ForNow28-May-12 18:25
memberForNow28-May-12 18:25 
Questionquality metrics for edge detection Pin
Mamatha Eswaraiah24-May-12 7:26
memberMamatha Eswaraiah24-May-12 7:26 
QuestionIs SetCursorPos() Calling MouseMove ? Pin
yogeshs24-May-12 2:34
memberyogeshs24-May-12 2:34 
AnswerRe: Is SetCursorPos() Calling MouseMove ? Pin
TomasRiker224-May-12 10:53
memberTomasRiker224-May-12 10:53 
AnswerRe: Is SetCursorPos() Calling MouseMove ? Pin
«_Superman_»24-May-12 16:18
member«_Superman_»24-May-12 16:18 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
yogeshs24-May-12 19:56
memberyogeshs24-May-12 19:56 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
«_Superman_»24-May-12 20:12
member«_Superman_»24-May-12 20:12 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
yogeshs24-May-12 20:40
memberyogeshs24-May-12 20:40 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
yogeshs24-May-12 21:19
memberyogeshs24-May-12 21:19 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
«_Superman_»24-May-12 21:42
member«_Superman_»24-May-12 21:42 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
yogeshs24-May-12 23:52
memberyogeshs24-May-12 23:52 
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
«_Superman_»25-May-12 0:00
member«_Superman_»25-May-12 0:00 
GeneralRe: Is SetCursorPos() Calling MouseMove ? [Working] Pin
yogeshs25-May-12 2:55
memberyogeshs25-May-12 2:55 
AnswerRe: Is SetCursorPos() Calling MouseMove ? Pin
Randor 25-May-12 1:25
member Randor 25-May-12 1:25 
Hi,

Rather than using SetCursorPos you could use the SendInput function[^]. This would allow you to set some 'extra info' for marking simulated user input.

For example:

BOOL setcursorposition(long x, long y)
{
	INPUT input = {0};
	input.type = INPUT_MOUSE;
	input.mi.dx = ((x - GetSystemMetrics(SM_XVIRTUALSCREEN)) * 65535) / (GetSystemMetrics(SM_CXVIRTUALSCREEN)-1);
	input.mi.dy = ((y - GetSystemMetrics(SM_YVIRTUALSCREEN)) * 65535) / (GetSystemMetrics(SM_CYVIRTUALSCREEN)-1);
	input.mi.dwFlags = MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
	input.mi.dwExtraInfo = 0xC0DEDBAD;
	return SendInput(1, &input, sizeof(input));
}
 
void YourClass::OnMouseMove(UINT nFlags, CPoint point)
{
	if(0xC0DEDBAD != GetMessageExtraInfo())
	{
		//You would ignore the simulated input and do your processing here
	}
	YourBaseClass::OnMouseMove(nFlags, point);
}

Don't forget to convert client coordinates to screen before calling setcursorposition.

Best Wishes,
-David Delaune
GeneralRe: Is SetCursorPos() Calling MouseMove ? Pin
JohnCz27-May-12 8:31
memberJohnCz27-May-12 8:31 
Questionneed your help,to all programmers!!! Pin
ambreen115324-May-12 0:54
memberambreen115324-May-12 0:54 
AnswerRe: need your help,to all programmers!!! Pin
Chris Losinger24-May-12 1:24
memberChris Losinger24-May-12 1:24 
AnswerRe: need your help,to all programmers!!! Pin
enhzflep24-May-12 1:27
memberenhzflep24-May-12 1:27 
GeneralRe: need your help,to all programmers!!! Pin
ambreen115324-May-12 1:32
memberambreen115324-May-12 1:32 
GeneralRe: need your help,to all programmers!!! Pin
enhzflep24-May-12 1:38
memberenhzflep24-May-12 1:38 
AnswerRe: need your help,to all programmers!!! Pin
CPallini24-May-12 2:06
mvpCPallini24-May-12 2:06 
GeneralRe: need your help,to all programmers!!! Pin
Aescleal24-May-12 2:22
memberAescleal24-May-12 2:22 
GeneralRe: need your help,to all programmers!!! Pin
CPallini24-May-12 3:51
mvpCPallini24-May-12 3:51 
GeneralRe: need your help,to all programmers!!! Pin
Erudite_Eric24-May-12 4:36
memberErudite_Eric24-May-12 4:36 
GeneralRe: need your help,to all programmers!!! Pin
Aescleal24-May-12 6:45
memberAescleal24-May-12 6:45 
AnswerRe: need your help,to all programmers!!! Pin
Erudite_Eric24-May-12 4:37
memberErudite_Eric24-May-12 4:37 
AnswerRe: need your help,to all programmers!!! Pin
Albert Holguin24-May-12 5:15
memberAlbert Holguin24-May-12 5:15 
AnswerRe: need your help,to all programmers!!! Pin
jschell24-May-12 8:33
memberjschell24-May-12 8:33 
AnswerRe: need your help,to all programmers!!! Pin
Vaclav_Sal24-May-12 22:45
memberVaclav_Sal24-May-12 22:45 
AnswerUnicorns and Rainbows Pin
jkirkerx25-May-12 8:49
memberjkirkerx25-May-12 8:49 
Question[SOLVED]: Error Returning CArray Pin
Overloaded_Name23-May-12 21:30
memberOverloaded_Name23-May-12 21:30 
AnswerRe: Error Returning CArray Pin
CPallini23-May-12 21:52
mvpCPallini23-May-12 21:52 
GeneralRe: Error Returning CArray Pin
Overloaded_Name23-May-12 22:45
memberOverloaded_Name23-May-12 22:45 
QuestionRe: Error Returning CArray Pin
CPallini23-May-12 22:47
mvpCPallini23-May-12 22:47 
AnswerRe: Error Returning CArray Pin
Overloaded_Name23-May-12 22:56
memberOverloaded_Name23-May-12 22:56 
GeneralRe: Error Returning CArray Pin
CPallini23-May-12 23:02
mvpCPallini23-May-12 23:02 
QuestionReadFile bytes read not equla to bytes requested Pin
evs_bud23-May-12 21:27
memberevs_bud23-May-12 21:27 
AnswerRe: ReadFile bytes read not equla to bytes requested Pin
CPallini23-May-12 21:37
mvpCPallini23-May-12 21:37 
QuestionCreate an incoming connection RAS server with C++ Pin
Member 800297323-May-12 12:56
memberMember 800297323-May-12 12:56 
AnswerRe: Create an incoming connection RAS server with C++ Pin
Erudite_Eric23-May-12 22:09
memberErudite_Eric23-May-12 22:09 
GeneralRe: Create an incoming connection RAS server with C++ Pin
Member 800297324-May-12 5:55
memberMember 800297324-May-12 5:55 
QuestionCTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_Sal23-May-12 6:08
memberVaclav_Sal23-May-12 6:08 
AnswerRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 6:47
memberAescleal23-May-12 6:47 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_Sal23-May-12 7:42
memberVaclav_Sal23-May-12 7:42 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_Sal23-May-12 10:29
memberVaclav_Sal23-May-12 10:29 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 23:46
memberAescleal23-May-12 23:46 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Aescleal23-May-12 23:57
memberAescleal23-May-12 23:57 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_Sal24-May-12 3:39
memberVaclav_Sal24-May-12 3:39 
GeneralRe: CTabCtrl and CRuntimeClass - is there a better way? Pin
Vaclav_Sal24-May-12 7:31
memberVaclav_Sal24-May-12 7:31 
Questionnew and free Pin
pix_programmer23-May-12 0:23
memberpix_programmer23-May-12 0:23 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 30 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid