views:

68

answers:

2

Hello

I have creating one window using "CreateWindow".But is there any api which can give system screen height and width of the system. So that it will very helpful to locate windows according to the system screen.

Thanks & Regards, KamalBhr.

+1  A: 

The GetDesktopWindow() function will give you a handle to the desktop window. You can then query this for it's size using GetWindowRect()

Edit: Note that this will give you the size of the primary display. To handle multiple monitors you will need to use GetMonitorInfo()

Alex Deem
+1  A: 

To get the size of the workarea on the primary monitor, the call to make is SystemParametersInfo with SPI_GETWORKAREA.

Alternativly you can pass CW_USEDEFAULT (-1) as the x-co-ordinate and windows will pick a position for the window for you.

Chris Becke