Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
An alternative way of setting Form.Closable to False
Comparing file times
GDI+: converting image file to another graphics format
How to save registry key including its subkeys and values to a file
Obtaining the bounding rectangle for the specified device context
Retrieving the rectangle area where the mouse cursor is confined
Returning some basic information for the specified INF file
Closing Windows
Creating hash values for the list of names
Current directory of the application
Retrieving the name of the primary domain controller (PDC) and join status information (NT/2000/XP)
Simple MAPI: how to pick an email recipient from Outlook Express address book
Using LoadLibrary
Winsock: retrieving information from a host database for a given host name
CryptoAPI: retrieving list of providers
Enumerating MIDI output devices
Enumerating Processes -- Win9*
How to generate UUID values
Saving available locale records into a cursor
Using an Event Object. Part A: running an application that creates an Event object
Running a regular FoxPro form while main VFP window is minimized
Using the CopyFile
Winsock: how to retrieve a service information corresponding to a service name
List of addresses in the AutoDial mapping database
Printing text on the client area of the main VFP window

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
 
hwnd = GetActiveWindow()
hDC = GetDC (hwnd)
 
lpString = "Printing text with TextOut"
= TextOut (hDC, 50,80, lpString, Len(lpString)) && 
 
= ReleaseDC (hwnd, hDC)
 
PROCEDURE  decl
    DECLARE INTEGER GetDC IN user32 INTEGER hwnd
 
    DECLARE INTEGER ReleaseDC IN user32;
        INTEGER hwnd, INTEGER hdc 
 
    DECLARE INTEGER GetActiveWindow IN user32
 
    DECLARE INTEGER TextOut IN gdi32;
        INTEGER hdc,;
        INTEGER x,;
        INTEGER y,;
        STRING  lpString,;
        INTEGER nCount
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
490 bytes  
Created: 2001-07-12 12:00:00  
Modified: 2001-09-28 16:45:14  
Visits in 7 days: 87  
Listed functions:
GetActiveWindow
GetDC
ReleaseDC
TextOut
Printer friendly API declarations
My comment:
This does not work - no client area is available.

Always use GetWindowDC to access a device context, which can be used for printing and drawing on VFP windows.
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.234.42.16)
14.4 min.Example: 'How to put a horizontal text scrolling on the form (a news line)'
14.45 min.Example: 'Retrieving window and menu help context identifiers'
8 hrs.Function: 'CeRegEnumValue'
8.01 hrs.Example: 'Returning some basic information for the specified INF file'
16.15 hrs.
Function group: 'Multiple Display Monitors'
17.4 hrs.Function: 'GetUrlCacheEntryInfo'
Function group: 'Internet Functions (WinInet)'
 Function: 'TerminateProcess'
21 hrs.Function: 'GetSystemMenu'
Function group: 'Menu'
 Function: 'GetClientRect'
Function group: 'Window'
 Function: 'ReleaseDC'
Google
Advertise here!