Solved

PostMessage and its parameters

Posted on 2000-03-21
5
451 Views
Last Modified: 2013-11-20
How do i can set postmessage parameters, in order to be able to move for example, the mouse, how do i set the coordinates?

Thanks
0
Comment
Question by:emilioamo
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 2642075
To move the mouse cursor, use the SetCursorPos function.

POINT pt;
::GetCursorPos(&pt);

pt.x += 3;
pt.y += 7;

::SetCursorPos(pt.x, pt.y);
0
 

Author Comment

by:emilioamo
ID: 2644070
I'm trying to move the cursor, using postmessage function, and sending WM_MOUSEMOVE signal to windows.
0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 50 total points
ID: 2644825
If you want to set the x,y coords in the LPARAM then you can use the MAKELPARAM macro.

MAKELPARAM(low,high)  so for you this would be MAKELPARAM(x,y)

NOTE: x,y must be in screen coords
0
 
LVL 23

Expert Comment

by:chensu
ID: 2646273
pWnd->PostMessage(WM_MOUSEMOVE, 0, MAKELPARAM(x, y));

The x and y are coordinate relative to the upper-left corner of the client area of pWnd.
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2648224
oops chensu is right it is client area not screen (my mistake) :(
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WinWaitActive parameters 12 31
sameEnds challenge 3 107
modThree challenge 4 64
wordcount challenge 11 78
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now