HOWTO: Determine the Size of the Desktop AreaLast reviewed: July 14, 1997Article ID: Q154823 |
The information in this article applies to:
SUMMARYIt is often useful to determine the size and position of the display area taking the system tray into account. There are at least two methods to obtain this information: One requires the use of an OCX, while another makes a call to the Win32 API. This article demonstrates the step-by-step approaches to both of these methods.
MORE INFORMATION
Method 1NOTE: The SYSINFO.OCX control is in the \VB4\TOOLS\SYSINFO folder of the Visual Basic CD-ROM. It does not ship with the diskette version, and it is not automatically installed by Visual Basic Setup. Copy SYSINFO.OCX to the \WINDOWS\SYSTEM folder, and register it with REGOCX32.EXE. Use the SYSINFO.OCX control in your project. It has a number of useful properties, four of which disclose the size and position of the desktop area in twips. Follow the steps below:
Method 2The SystemParametersInfo function has many uses, including the ability to determine the size and position of the desktop. Follow the steps below:
REFERENCESSYSINFO.HLP in the \TOOLS\SYSINFO directory on the Visual Basic 4.0 CD-ROM. Win32 SDK on the MSDN Visual Basic starter kit. This can be installed by running SETUP.EXE from the MSDN directory on the Visual Basic 4.0 CD-ROM. For more information, please see the following articles on the Microsoft Knowledge Base:
ARTICLE-ID: Q113702 TITLE : How to Control the Placement of Desktop Windows ARTICLE-ID: Q97142 TITLE : How to Use SystemParametersInfo API for Control Panel Settings |
Keywords : APrgOther vb432 vb4win kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |