Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
GDI+: printing vertical text on VFP reports via generated images (VFP8)
The DetectAutoProxyUrl function identifies the auto-config script location
Enumerating the subkeys for a given registry key
Finding out if the current user is the Guest account
How to control Adobe Reader 9.0 (SDI mode) from VFP application
How to view system icons for the classes installed on the local machine
Retrieving IP statistics for the computer
Using FrameRgn for displaying system colors
Using the DeleteFile
Winsock: creating a socket that is bound to a specific service provider
Opening the Page Setup dialog box to specify the attributes of a printed page
Retrieving the name and type of all available RAS-capable devices
Writing entries to custom Event Log
Validating URLs using moniker functions
Extracting the name and extension parts of a path string
Removing FTP directory
Scanning the hierarchy of child windows down from the main VFP window
Using an Event Object. Part B: running an application responding to events
Using custom Simple MapiSendMail class
Accessing LSA Policy object (Local Security Authority)
Converting an integer value to a hexadecimal string
How to extract frames from AVI files
How to get Special Folders paths
Memory usage info for current VFP session (WinNT only)
Using Font and Text functions

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 TRANSPARENT  1
#DEFINE OPAQUE       2
 
#DEFINE TA_LEFT      0
#DEFINE TA_CENTER    6
#DEFINE TA_RIGHT     2
 
    PRIVATE hWindow, hDC
    hWindow = GetActiveWindow()
    hDC = GetWindowDC(hWindow)
 
    = SetBkMode (hDC, TRANSPARENT)
 
    DO PrintText WITH Rgb(192,  0,  0), 600, 100, 0, 0
    DO PrintText WITH Rgb(  0,192,  0), 600, 120, 6, 1
    DO PrintText WITH Rgb(  0,  0,192), 600, 140, 2, 2
    DO PrintText WITH Rgb(192,  0,192), 600, 160, 2, 3
    DO PrintText WITH Rgb(192,192,  0), 600, 180, 0, 1
    DO PrintText WITH Rgb(  0,192,192), 600, 200, 6, 0
 
    = ReleaseDC(hWindow, hDC)
 
PROCEDURE PrintText (lnColor, lnX, lnY, lnAlign, lnInterChar)
    LOCAL lcText, lcFont, lnBufsize
 
    lcFont = SPACE(250)
    lnBufsize = GetTextFace(hDC, Len(lcFont), @lcFont)
    lcFont = LEFT(lcFont, lnBufsize)
 
    = SetTextAlign (hDC, lnALign)
    = SetTextCharacterExtra (hDC, lnInterChar)
    = SetTextColor (hDC, lnColor)
 
    lcText = "Font: " + lcFont + ", color: " + LTRIM(STR(GetTextColor(hDC))) +;
        ", align: " + LTRIM(STR(GetTextAlign(hDC))) +;
        ", interchar: " + LTRIM(STR(GetTextCharacterExtra(hDC)))
 
    = TextOut (hDC, lnX, lnY, lcText, Len(lcText))
 
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 GetTextAlign IN gdi32 INTEGER hdc
    DECLARE INTEGER SetTextAlign IN gdi32 INTEGER hdc, INTEGER fMode
    DECLARE INTEGER SetTextCharacterExtra IN gdi32 INTEGER hdc, INTEGER nCharExtra
    DECLARE INTEGER GetTextCharacterExtra IN gdi32 INTEGER hdc
    DECLARE INTEGER GetTextColor IN gdi32 INTEGER hdc
    DECLARE INTEGER SetTextColor IN gdi32 INTEGER hdc, INTEGER crColor
    DECLARE INTEGER SetBkMode IN gdi32 INTEGER hdc, INTEGER iBkMode
 
    DECLARE INTEGER TextOut IN gdi32;
        INTEGER hdc, INTEGER x, INTEGER y,;
        STRING lpString, INTEGER nCount
 
    DECLARE INTEGER GetTextFace IN gdi32;
        INTEGER hdc, INTEGER nCount, STRING @lpFaceName
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1997 bytes  
Created: 2002-04-20 14:58:41  
Modified: 2002-04-20 14:58:54  
Visits in 7 days: 235  
Listed functions:
GetActiveWindow
GetTextAlign
GetTextCharacterExtra
GetTextColor
GetTextFace
GetWindowDC
ReleaseDC
SetBkMode
SetTextAlign
SetTextCharacterExtra
SetTextColor
TextOut
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 (107.22.127.92)
4 sec.Example: 'Setting properties of the window: caption and user-defined value'
2.79 hrs.Example: 'How to ping a remote site using ICMP API calls'
 Example: 'Using File Mapping for enumerating files opened by Visual FoxPro'
3.73 hrs.Function: 'GetFileTitle'
Function group: 'Common Dialog Box'
6.25 hrs.Function: 'HeapUnlock'
 Example: 'Storing screen shot of a form to enhanced metafile (*.emf)'
8.58 hrs.Function: 'OpenPrinter'
9.62 hrs.
 Example: 'Obtaining names and positions for shortcuts located on the Windows Desktop'
14.3 hrs.Example: 'Displaying the associated icons and descriptions for files and folders'
Google
Advertise here!