GetCursorPos Function

Posted on 2006-04-08
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

    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

    Thank you.

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

    Thank you.
    LVL 15

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    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++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 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

    8 Experts available now in Live!

    Get 1:1 Help Now