1. Win32 Mouse
How do you get the x and y position of the upper-left corner of the inside
box of a window? (the drawing area of a window) I can get the x and y for
the whole window, but i don't want that.
Mike Hurley
2. Re: Win32 Mouse
Mike Hurley wrote:
> How do you get the x and y position of the
> upper-left corner of the inside box of a window?
Assuming:
client area start = bottom of window - ( border + client size )
You already know how to get the size of the window. Use GetClientRect to get
the size of the client area (the part you can draw on). GetSystemMetrics
will give you the metrics for various parts of the window; use SM_CXFRAME
and SM_CYFRAME to get the border sizes. From that, you can derive the
location of the client area.
You could do it the other way, but then you'd have to add extra to account
for the menu.
I was just mulling this over the other night; I'm quite likely to Llama so
that the size specifies the client area, not the window size. This can be
calculated with the AdjustWindowRect procedure.
-- David Cuny
3. Re: Win32 Mouse
>>How do you get the x and y position of the upper-left corner of the inside
>>box of a window? (the drawing area of a window) I can get the x and y for
>>the whole window, but i don't want that.
Mike Hurley
This work area is called the CLIENT AREA the rest of the window is called
the NON-CLIENT AREA.
There are three coordinate systems ( screen, whole-window, client-area )
Maybe you can use ScreenToClient and ClientToScreen functions.
In the the CLIENT coordinate system the upper left corner is 0,0
I don't know if this helps you.
Bernie