Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
Winsock: sending email messages (SMTP, port 25)
Custom FTP Class for Visual FoxPro application
Enumerating data formats currently available on the clipboard
Splash Screen for the VFP application
How to download a file from the FTP server using FtpGetFile
How to activate Windows Calculator
Custom HttpRequest class (WinHTTP)
Detecting changes in connections to removable drives (VFP9)
How to convert a bitmap file to monochrome format (1 bpp)
Using WM_COPYDATA for interprocess communication (VFP9)
Displaying bitmap using the AlphaBlend function
Establishing connection using the SQLDriverConnect
How to put a vertical text scrolling on the form (a movie cast)
Using Font and Text functions
Mapping and disconnecting network drives
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to make a VFP form fading out when released (GDI+ version)
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: 77  
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 (23.22.252.150)
4 sec.Example: 'Splash Screen for the VFP application'
3.49 hrs.Example: 'Enumerating the subkeys of a user-specific key'
3.5 hrs.Function: 'GdiFlush'
4.13 hrs.Example: 'Connecting a local device to a network resource'
 Function: 'ImageList_Remove'
Function group: 'Windows Controls'
11.02 hrs.Function: 'GdipCreateHICONFromBitmap'
 Example: 'Exporting DLL icon resources as .ICO files'
16.18 hrs.Example: 'Sending a standard message with one or more attached files using default email client'
16.19 hrs.Example: 'Obtaining window class name for the main VFP window'
17.23 hrs.Example: 'How to enumerate sessions and processes on a specified terminal server'
Google
Advertise here!