Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Using the FindMediaType function
Reading parameters of streams in AVI file
Retrieving names for the registered clipboard formats
Scanning the hierarchy of child windows down from the main VFP window
Using InternetSetFilePointer when resuming interrupted download from the Internet
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Writing to INI file
Drawing Windows predefined bitmaps using the LoadBitmap functions
How to assemble an array of strings and pass it to external function
How to enumerate sessions and processes on a specified terminal server
Exporting DLL icon resources as .ICO files
Passing data records between VFP applications via the Clipboard
Placing On-screen Alert on top of all windows
Starting a dialog box for connecting to network resources (mapping network drive)
Windows Shell Icons displayed and exported to ICO files (Vista)
Extended MessageBox Class
GDI+: sending image of FoxPro form to printer
Programmatically removing submenus from VFP main menu
Time in milliseconds represented as string (e.g. 1 hour 24 min 36 sec)
Creating the Save dialog box to specify the drive, directory, and name of a file to save
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
Retrieving the name of the network resource associated with a local device
Starting an external application in VFP using WinExec
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: 201  
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 (23.22.212.158)
3 sec.Function: 'PathBuildRoot'
Function group: 'Shell Lightweight Utility APIs -- Path Functions'
1.09 hrs.Function: 'DeleteFileTransacted'
 Function: 'GetDefaultPrinter'
12.2 hrs.Function: 'SetMonitorBrightness'
Function group: 'Monitor Configuration (Vista)'
 Example: 'Using the Semaphore object to allow only one instance of VFP application running'
1 day(s)Example: 'Extensible Storage Engine class library'
 Function: 'CloseHandle'
Function group: 'Handle and Object'
2 day(s)Function: 'LockFile'
 Function: 'DragQueryFile'
 Function: 'MAPIFreeBuffer'
Function group: 'Simple MAPI'
Google
Advertise here!