开发者

Locate windows according to system screen size in win32 programming

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 help开发者_如何学编程ful to locate windows according to the system screen.


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()


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜