FOXTOOLS.FLL Calls to GetDC, GetDeviceCaps and ReleaseDCLast reviewed: April 29, 1996Article ID: Q96539 |
The information in this article applies to:
SUMMARYThe code below demonstrates how to use the FOXTOOLS.FLL library commands to call the following Microsoft Windows application programming interface (API) functions:
GetDC() GetDeviceCaps() ReleaseDC() MORE INFORMATIONThe program first loads the FOXTOOLS.FLL library that is supplied with FoxPro for Windows and creates some variables. It then retrieves the handle to the display device and calls the GetDeviceCaps() function. Next, it displays the width and height of the physical display in millimeters in two consecutive windows that can be seen by clicking the left mouse button. Finally, it releases the handle to the device context and the library.
set library to sys(2004)+"foxtools.fll" additive * create variables to pass index to GetDeviceCaps() * these values are found in the WINDOWS.H file HORZSIZE = 4 VERTSIZE = 6 * get the handle to the device context gethdc = RegFN("GetDC","I","I") hdc = CallFN(gethdc,0) * get the screen size in millimeters getsize = RegFN("GetDeviceCaps","II","I") Hsize = CallFN(getsize,hdc,HORZSIZE) Vsize = CallFN(getsize,hdc,VERTSIZE) * display the results in two windows wait window "Width is: " + alltrim(str(Hsize)) + " mm" wait window "Height is: " + alltrim(str(Vsize)) + " mm" * release the handle to the device context releasehdc = RegFN("ReleaseDC","II","I") = CallFN(releasehdc,0,hdc) release library sys(2004)+"foxtools.fll" REFERENCESMicrosoft Windows Software Development Kit, "Programmer's Reference, Volume 2: Functions," pages 350-354, 785 FOXTOOLS.WRI located in the C:\FOXPROW\GOODIES\FOXTOOLS subdirectory WINDOWS.H located in the C:\C700\INCLUDE subdirectory
|
Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a 2.50b 2.60
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |