GetCursorPos Function

Posted on 2006-04-08
Medium Priority
Last Modified: 2012-06-27
Dear Guys.

I want to capture the MouseMove and WM_LBUTTONUP Messages in WindowsCE platform, inside these messages I used the GetCursorPos function to get the mouse cursor function, the main problem that this function always returns 0, which means that the function is failed, when I used the GetLast Error, I find that the error code is 120, when I look for the this code in MSDN, MSDN tells me that this error means "This function is not valid on this platform. ", Now I need to get the position of the mouse cursor using another function, So how I can I do that in Windows CE ?

Thank you in advance.
Question by:MAnkeer
LVL 48

Expert Comment

ID: 16406354
Both WM_LBUTTONUP and WM_MOUSEMOVE messages contain cursor coordinate in lParam parameter:

The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.

Author Comment

ID: 16406387
Thank you.

But I want to get the Stylus coordinates when it out of my window.

Thank you.
LVL 15

Accepted Solution

lakshman_ce earned 2000 total points
ID: 16417324
1. Try updating your platform and see if that works.

2. If you are programming for PocketPC, There is no cursor on the Pocket PC therefore you won't get valid
information on that platform.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

749 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