GUI/Maximum window dimensions

From Rosetta Code
< GUI
Revision as of 01:41, 23 November 2010 by rosettacode>Markhobley (Initial draft and incomplete)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Task
GUI/Maximum window dimensions
You are encouraged to solve this task according to the task description, using any language you may know.

The task is to determine the maximum height and width of a window that can fit on the screen without rolling. This is effectively the screen size in pixels minus any adjustments for window decorations and menubars.

Visual Basic

<lang vb> TYPE syswindowstru

 screenheight AS INTEGER
 screenwidth AS INTEGER
 maxheight AS INTEGER
 maxwidth AS INTEGER

END TYPE

DIM syswindow AS syswindowstru

' Determine the height and width of the screen

syswindow.screenwidth = Screen.Width / Screen.TwipsPerPixelX syswindow.screenheight Screen.Height / Screen.TwipsPerPixelY

' Make adjustments for window decorations and menubars

</lang>