GUI/Maximum window dimensions: Difference between revisions
< GUI
Content added Content deleted
(Initial draft and incomplete) |
m (→Visual Basic: format/semantic magic) |
||
Line 3: | Line 3: | ||
screen size in pixels minus any adjustments for window decorations and menubars. |
screen size in pixels minus any adjustments for window decorations and menubars. |
||
== Visual Basic == |
== {{header|Visual Basic}} == |
||
<lang vb> |
<lang vb>TYPE syswindowstru |
||
TYPE syswindowstru |
|||
screenheight AS INTEGER |
screenheight AS INTEGER |
||
screenwidth AS INTEGER |
screenwidth AS INTEGER |
||
Line 20: | Line 19: | ||
syswindow.screenheight Screen.Height / Screen.TwipsPerPixelY |
syswindow.screenheight Screen.Height / Screen.TwipsPerPixelY |
||
' Make adjustments for window decorations and menubars |
' Make adjustments for window decorations and menubars</lang> |
||
</lang> |
Revision as of 09:36, 23 November 2010
GUI/Maximum window dimensions
You are encouraged to solve this task according to the task description, using any language you may know.
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>