Go4Expert (http://www.go4expert.com/)
-   Win32 (http://www.go4expert.com/forums/win32/)
-   -   Windows coordinate (http://www.go4expert.com/forums/windows-coordinate-t15005/)

Windows coordinate

How will i know the window coordinate in MFC .I meant i want to know (x1,y1) & (x2,y2) value

 xpi0t0s 6Nov2008 22:48

Re: Windows coordinate

When you create a window you specify its size and position.
Alternatively there's GetWindowRect in the WinAPI.

Re: Windows coordinate

I want to know centre point of the window.How can i find it

 xpi0t0s 11Nov2008 04:00

Re: Windows coordinate

If you've already got x1,y1 and x2,y2, suppose x1=y1=100 and x2=y2=200. What would the centre point be? How would you work that out as an equation using just x1,y1,x2,y2?

Re: Windows coordinate

Forget x1,y1,x2,y2

I have created one window i want to know the centre point my screen .

 xpi0t0s 11Nov2008 14:40

Re: Windows coordinate

It's impossible to forget x1~y2. There are no WinAPI functions that return the centre point of windows (or screens - do not confuse these terms otherwise your question becomes ambiguous. There is a definite difference between a window and a screen). The reason is that you can easily calculate that from the screen size and position, i.e. x1~y2.

 neo_vi 11Nov2008 15:12

Re: Windows coordinate

u can get a software for measuring the screen size exactly. u can try that. It will give u the size in pixels.

 All times are GMT +5.5. The time now is 14:34.