Using Win32 functions in Visual FoxPro Image Gallery
Painting and Drawing
..msdn
DrawAnimatedRects
DrawCaption
DrawEdge
DrawFrameControl
GdiFlush
GdiGetBatchLimit
GdiSetBatchLimit
GetBkMode
GetBoundsRect
GetWindowDC
GetWindowRgnBox
LockWindowUpdate
PaintDesktop
SetBkColor
SetBkMode
SetWindowRgn
WindowFromDC
Code examples:
Obtaining the bounding rectangle for the specified device context
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: 62  
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 (50.19.155.235)
2.65 hrs.Example: 'GDI+: rotating images using matrix transformations'
5.74 hrs.Example: 'Creating irregularly shaped FoxPro form using transparency color key'
7.9 hrs.Function: 'NetScheduleJobDel'
Function group: 'Network Management'
 Example: 'Obtaining addresses for the adapters on the local computer (Win XP/2003/Vista)'
8.02 hrs.Function: 'OpenProcess'
Function group: 'Process and Thread'
9.11 hrs.Example: 'Pocket PC: custom RAPI class for operating with the Object Store Databases'
12.11 hrs.Example: 'Sending email messages with Simple MAPI'
 Function: 'CeOpenDatabase'
23.94 hrs.Example: 'How to generate UUID values'
 Function: 'CopyFileTransacted'
Google
Advertise here!