Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:09:27+00:00 2026-05-26T15:09:27+00:00

In Win32 do the co-ordinates returned by GET_X_PARAM and GET_Y_PARAM calls start from 0

  • 0

In Win32 do the co-ordinates returned by GET_X_PARAM and GET_Y_PARAM calls start from 0 or from 1?
If I have a screen with resolution 640X480 then what values do I get? Are they from 0 to 639 and 0 to 479? Or 1 to 640 and 1 to 480?

extern "C" LRESULT CALLBACK WindowProc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)  
{  
      Switch(message)  
      {  
            case WM_MOUSEMOVE:              
                  iXPosition = GET_X_LPARAM(lParam);   
                  iYPosition = GET_Y_LPARAM(lParam);  
      }  
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:09:28+00:00Added an answer on May 26, 2026 at 3:09 pm

    For WM_MOUSEMOVE, the coordinates are relative to the window’s client area, not the screen – see MSDN. Given that, the points start at 0,0 for the top-left corner of the window’s client area.

    Also note that if you do use an API that returns screen-based mouse coordinates, like GetCursorPos, you can get negative values back on a multi-monitor system: 0,0 is the top-left of the primary monitor, which could have a secondary monitor set above or to the left of it; so the actual desktop could ‘start’ at a negative or other non-0,0 value. (GetSystemMetrics(SM_XVIRTUALSCREEN) will return the left edge, for example.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a firefox extension that needs to get the exact screen co-ordinates of
we have a C++ Win32 DLL that reads data from Excel. The application uses
The Win32 TreeView control does not have a built-in message/macro to get its (scrollable)
In a Win32 C++ application, we start a message loop that fetches messages from
I develop a Win32 C++ cgi app for windows and linux and start from
i have created a win32 window it work fine but im tryin to get
win32 windows application and want to capture full screen and remove the border of
In Win32, is there any way to get a unique cpu cycle count or
What win32 calls can be used to detect key press events globally (not just
In win32, how do I setup a callback mechanism for RichEdit I have not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.