Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to display advanced Task Dialog (Vista)
How to position the GETPRINTER() dialog
Printing text on the client area of the main VFP window
Retrieveing information about the active window (even if it is not owned by the calling process)
Validating URLs using moniker functions
Winsock: changing the byte ordering
Winsock: retrieving information from a host database for a given host name
Winsock: retrieving the host information corresponding to a network address
List of addresses in the AutoDial mapping database
Reading VFP settings from the Windows Registry
Retrieving graphic capabilities of default printer
Retrieving information about the specified icon
Winsock: how to retrieve the protocol information corresponding to a protocol name
Animating a transition of the VFP form (a wire-frame rectangle)
Drawing icons associated with the VFP main window
How to hide your program from the Close Program dialog (Win9* only)
How to read email messages using Simple MAPI
Obtaining MAC address through Address Resolution Protocol (ARP) request
Retrieving IP statistics for the computer
Smart Card Database Query Functions
The window and its ancestors
Finding parameters for the region specified
URL: converting unsafe characters and spaces into escape sequences
Clipping mouse cursor area
Finding parameters for the region specified

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
 
*| typedef struct _RGNDATA { 
*|     RGNDATAHEADER rdh; 
*|     char          Buffer[1]; 
*| } RGNDATA, *PRGNDATA; 
 
*| typedef struct _RGNDATAHEADER { 
*|     DWORD dwSize; 
*|     DWORD iType; 
*|     DWORD nCount; 
*|     DWORD nRgnSize; 
*|     RECT  rcBound; 
*| } RGNDATAHEADER, *PRGNDATAHEADER; 
 
*| typedef struct _RECT { 
*|   LONG left; 
*|   LONG top; 
*|   LONG right; 
*|   LONG bottom; 
*| } RECT, *PRECT; 
 
 
    * creating a region to test
    hRgn = CreateRectRgn (0, 0, 200, 100)
 
    dwCount = 200
    lpRgnData = Repli (Chr(0), dwCount)
 
    lnLength = GetRegionData (hRgn, dwCount, @lpRgnData)
    lpRgnData = LEFT (lpRgnData, lnLength)
 
    ? "Length of return buffer:", lnLength
    ?
 
    ? "*** RGNDATAHEADER Structure:"
    ? "dwSize:  ", buf2dword (SUBSTR(lpRgnData,  1,4))
    ? "iType:   ", buf2dword (SUBSTR(lpRgnData,  5,4))
    ? "nCount:  ", buf2dword (SUBSTR(lpRgnData,  9,4))
    ? "nRgnSize:", buf2dword (SUBSTR(lpRgnData, 13,4))
    ? "Rect:    ",;
        buf2dword (SUBSTR(lpRgnData, 17,4)),;
        buf2dword (SUBSTR(lpRgnData, 21,4)),;
        buf2dword (SUBSTR(lpRgnData, 25,4)),;
        buf2dword (SUBSTR(lpRgnData, 29,4))
 
    ?
    ? "*** RECT structures that make up the region"
    ? "Rect1:    ",;
        buf2dword (SUBSTR(lpRgnData, 33,4)),;
        buf2dword (SUBSTR(lpRgnData, 37,4)),;
        buf2dword (SUBSTR(lpRgnData, 41,4)),;
        buf2dword (SUBSTR(lpRgnData, 45,4))
 
    * there can be more RECT structures following
    * for a combination of regions
 
    ?
    ? "*** Region bounding rectangle:"
 
    lprc = SPACE(16)
    lnResult = GetRgnBox (hRgn, @lprc)
    ? "Type:", lnResult
    ? "Rectangle:    ",;
        buf2dword (SUBSTR(lprc,  1,4)),;
        buf2dword (SUBSTR(lprc,  5,4)),;
        buf2dword (SUBSTR(lprc,  9,4)),;
        buf2dword (SUBSTR(lprc, 13,4))
 
* 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 GetLastError IN kernel32
 
    DECLARE INTEGER GetRegionData IN gdi32;
        INTEGER hRgn,;
        INTEGER dwCount,;
        STRING @ lpRgnData
 
    DECLARE INTEGER CreateRectRgn IN gdi32; 
        INTEGER nLeftRect,; 
        INTEGER nTopRect,; 
        INTEGER nRightRect,; 
        INTEGER nBottomRect 
 
    DECLARE INTEGER GetRgnBox IN gdi32;
        INTEGER hrgn,;
        STRING @ lprc
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
2356 bytes  
Created: 2001-08-27 12:00:00  
Modified: 2001-09-28 16:45:36  
Visits in 7 days: 81  
Listed functions:
CreateRectRgn
GetLastError
GetRegionData
GetRgnBox
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.224.75.101)
4 sec.Example: 'Using GetBinaryType (WinNT only) to determine the type of an executable file'
1.05 hrs.Function: 'InternetAutodial'
 Function: 'AVIFileRelease'
 Example: 'Using the CopyFile'
2.56 hrs.Example: 'Custom GDI+ class'
3.09 hrs.Function: 'MAPISendMail'
Function group: 'Simple MAPI'
 Function: 'AVIFileInit'
Function group: 'Windows Multimedia'
 Function: 'GdipCreateHICONFromBitmap'
Function group: 'GDI+ Bitmap'
9.59 hrs.Example: 'Retrieving configuration information for the specified server (Win2000/XP)'
 Example: 'Who owns the Windows Clipboard'
Google
Advertise here!