Solved

PostMessage and its parameters

Posted on 2000-03-21
5
468 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

623 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