Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PostMessage and its parameters

Posted on 2000-03-21
5
Medium Priority
?
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 150 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 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