Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to print a bitmap file
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Printing Image File, programmatically set print page orientation to landscape
How to display Windows On-Screen Keyboard
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Using EnumPrinters function to enumerate locally installed printers
How to convert a bitmap file to monochrome format (1 bpp)
Custom HttpRequest class (WinHTTP)
The window and its ancestors
Drawing Windows predefined bitmaps using the LoadBitmap functions
How to download a file from the FTP server using FtpGetFile
Custom FTP Class for Visual FoxPro application
Mapping and disconnecting network drives
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Displaying the associated icons and descriptions for files and folders
How to activate Windows Calculator
Sending email messages with Simple MAPI
Displaying icons in the system tray (VFP9)
Obtaining the bounding rectangle for the specified device context

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
DO decl
#DEFINE DCB_RESET       1
#DEFINE DCB_ACCUMULATE  2
#DEFINE DCB_ENABLE      4
#DEFINE DCB_DISABLE     8
#DEFINE DCB_SET       BitOr(DCB_RESET, DCB_ACCUMULATE)
 
LOCAL hWindow, hDC, lcRect, lnResult
 
* retrieving the device context for the main VFP window
hWindow = GetActiveWindow()
hDC = GetWindowDC(hWindow)
 
* allocating a buffer for the RECT structure
lcRect = Repli(Chr(0), 16) && 4 DWORDs
 
* obtaining the current accumulated bounding rectangle 
* for the device context
lnResult = GetBoundsRect (hDC, @lcRect, 0)
 
DO CASE
CASE lnResult = 0
    ? "The specified device context handle is invalid"
CASE lnResult = DCB_DISABLE
    ? "Boundary accumulation is off"
CASE lnResult = DCB_ENABLE
    ? "Boundary accumulation is on"
CASE lnResult = DCB_RESET
    ? "The bounding rectangle is empty"
CASE lnResult = DCB_SET
* The bounding rectangle is not empty
    ? "The bounding rectangle:",;
        buf2dword(SUBSTR(lcRect,  1,4)),;
        buf2dword(SUBSTR(lcRect,  5,4)),;
        buf2dword(SUBSTR(lcRect,  9,4)),;
        buf2dword(SUBSTR(lcRect, 13,4))
ENDCASE
 
= ReleaseDC(hWindow, hDC)
* end of main
 
FUNCTION  buf2dword (lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
    Asc(SUBSTR(lcBuffer, 2,1)) * 256 +;
    Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +;
    Asc(SUBSTR(lcBuffer, 4,1)) * 16777216
 
PROCEDURE  decl
    DECLARE INTEGER GetActiveWindow IN user32
    DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd
    DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
 
    DECLARE INTEGER GetBoundsRect IN gdi32;
        INTEGER hdc, STRING @lprcBounds, INTEGER flags
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1580 bytes  
Created: 2001-12-31 17:58:17  
Modified: 2001-12-31 17:58:35  
Visits in 7 days: 134  
Listed functions:
GetActiveWindow
GetBoundsRect
GetWindowDC
ReleaseDC
Printer friendly API declarations
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Google
Advertise here!