Using Win32 functions in Visual FoxPro Image Gallery
Device Context
..msdn
ChangeDisplaySettings
CreateCompatibleDC
CreateDC
DeleteDC
DeleteObject
EnumDisplayDevices
EnumDisplaySettings
GetDC
GetDeviceCaps
GetObject
GetObjectType
ReleaseDC
SelectObject
Code examples:
Converting twips to pixels and vice versa
Creating a window using CreateWindowEx function
Drawing standard Windows icons
Form Magnifier
GDI+ fun: roach-infested desktop
GDI+: Color Transparency
GDI+: Creating thumbnails to preview images in a directory
GDI+: Scrolling through large image using the mouse
How to make a VFP form fading out when released (GDI version)
How to view icons stored in executable files (Icon Viewer)
How to view icons stored in executable files (Icon Viewer) - II
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Placing On-screen Alert on top of all windows
Printing text on the client area of the main VFP window
Retrieving graphic capabilities of your display
Using GetNearestColor
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: 96  
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.126.92)
14.09 hrs.Function: 'CloseWindow'
Function group: 'Window'
 Example: 'Pocket PC: custom RAPI class for operating with files and folders on mobile device'
 Article: 'ApiViewer for Visual FoxPro '
18.15 hrs.Example: 'How to generate GUID values'
 Example: 'Enumerating ODBC Data Sources available on the local computer'
1 day(s)Example: 'Testing Transparent Menu Class with top-level form (requires VFP9)'
 Example: 'Comparing file times'
2 day(s)Function: 'GetCurrentHwProfile'
 Example: 'Comparing dimensions of the VFP main window with _SCREEN properties'
 Function: 'DeleteService'
Function group: 'Service'
Google
Advertise here!