Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
GDI+: rotating images using matrix transformations
Using shared memory to exchange data between two FoxPro applications
Adding supplementary data to AVI files
GDI+: creating scaled copy of image file
GDI+: retrieving list of available image encoders and image decoders
Obtaining a handle to the desktop associated with the calling thread
Retrieving various system metrics
Using FrameRgn for displaying system colors
Using the CreateFile
Enumerating MIDI output devices
How to display picture stored in enhanced-format metafile (*.emf)
Obtaining OS memory performance information
Testing MS Internet Explorer version installed
Winsock: how to retrieve the protocol information corresponding to a protocol name
Clipping mouse cursor area
FindText -- the hopeless and useless Common Dialog
How to view icons stored in executable files (Icon Viewer) - II
Simple Window Viewer
Creating a unique filename based on existing filename
Dial the Net Automatically
Reading and setting explicit Application User Model ID for the current process (Win7)
Retrieving list of supported paper names (for example, Letter or Legal) for a given printer
Using the DeleteFile
Displaying Windows shell folders in TreeView control with Visual FoxPro FLL
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: 70  
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.
Last Topics Visited (54.234.180.187)
3 sec.Example: 'Extensible Storage Engine class library'
7 sec.Example: 'Creating the Open dialog box to specify the drive, directory, and name of a file to open'
3.21 hrs.Function: 'GlobalSize'
 Example: 'How to retrieve information about a cache entry (Internet Explorer)'
5.17 hrs.Function: 'FreeEnvironmentStrings'
Function group: 'Process and Thread'
5.54 hrs.Function: 'GdipGetPageScale'
 Function: 'waveInPrepareHeader'
Function group: 'Windows Multimedia'
6.17 hrs.
Function group: 'Security'
 Function: 'VirtualAllocEx'
Function group: 'Memory Management'
13.62 hrs.Function: 'SHEnumKeyEx'
Google
Advertise here!