Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Retrieving list of available disk drives
CryptoAPI: Collection of Providers class
Dial the Net Automatically
Locking mouse and keyboard input for the VFP application
A procedure for setting file times
Configuring DEVMODE structure for a printer
Enumerating connections made to a shared resource for the local computer (WinNT only)
How to build UDP responder
Retrieveing information about the active window (even if it is not owned by the calling process)
Retrieving Printer Device Context using PrintDlg function
Retrieving Window Class information for the VFP window
Using the heap of the calling process to allocate memory blocks
Creating a clipping region from the path selected into the device context of a form
Enumerating network interfaces on the local computer
How to view system icons for the classes installed on the local machine
Pocket PC: Folder Viewer
Converting command-line string to a set of Unicode argument strings (WinNT only)
Enumerating the subkeys of a user-specific key
Obtaining OS memory performance information
Pocket PC: custom RAPI class for operating with the Object Store Databases
Using the Semaphore object to allow only one instance of VFP application running
Validating URLs using moniker functions
How to display a Task Dialog (Vista)
MapiSendMail class for Visual FoxPro application
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: 109  
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 (23.22.252.150)
1 sec.Example: 'FindText -- the hopeless and useless Common Dialog'
7.09 hrs.Example: 'How to display the Print property sheet'
7.21 hrs.Function: 'WNetEnumResource'
9.43 hrs.Function: 'WNetGetProviderName'
Function group: 'Windows Networking'
16.59 hrs.Example: 'Disabling mouse and keyboard input for the main VFP window (with the app still running)'
 Example: 'Splash Screen for the VFP application'
17.98 hrs.Function: 'AVIFileGetStream'
21.27 hrs.Example: 'How to put a horizontal text scrolling on the form (a news line)'
 Example: 'Extensible Storage Engine class library'
1 day(s)Example: 'Retrieving file information for the VFP executable running'
Google
Advertise here!