Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
GDI+: Storing content of the Clipboard to a bitmap file
How to display the Print property sheet
Drawing a rectangle using Windows regular edges and borders
How to make application automatically close all documents it opened
Winsock: connecting to a news server (NNTP, port 119)
A client for testing non-blocking Winsock server
Class for sound recording
How to read email messages using Simple MAPI
Moving shortcut to a specified position on the Windows Desktop
Opening the Page Setup dialog box to specify the attributes of a printed page
Starting a dialog box for connecting to network resources (mapping network drive)
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Getting a bit more than the _CLIPTEXT offers
How to disable the Windows Clipboard (VFP9)
How to display picture stored in enhanced-format metafile (*.emf)
How to prevent users from accessing the Windows Desktop and from switching to other applications
Reading the structure of VFP main menu
Sending a standard message with one or more attached files using default email client
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
OS version and revision
Using Common Controls: the Header Control
Converting command-line string to a set of Unicode argument strings (WinNT only)
Displaying bitmap using the AlphaBlend function
How to copy the image of a form to the Clipboard using Bitmap API functions
Drawing a window caption using the DrawCaption routine

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 DC_ACTIVE    1
#DEFINE DC_SMALLCAP  2
#DEFINE DC_ICON      4
#DEFINE DC_TEXT      8
#DEFINE DC_INBUTTON 16
#DEFINE DC_GRADIENT 32
 
LOCAL hWindowSrc, hWindowTrg, hDC
 
* the caption of this window is to be drawn
* actually you can supply a handle for any other window
hWindowSrc = GetActiveWindow()
 
* the target device context - to draw the caption on
hWindowTrg = GetFocus()
hDC = GetWindowDC(hWindowTrg)
 
* drawing the caption of the source window
* each time with different options
 
= DrawCaption(hWindowTrg, hDC,;
    GetRect(100, 200, 400, 220), DC_ICON+DC_TEXT)
 
= DrawCaption(hWindowTrg, hDC,;
    GetRect(100, 222, 400, 242), DC_ACTIVE+DC_ICON+DC_TEXT)
 
* releasing the target device context
= ReleaseDC(hWindowTrg, hDC)
* end of main
 
FUNCTION  GetRect (lnLeft, lnTop, lnRight, lnBottom)
* returns the RECT structure (four DWORDs) filled with the values
RETURN num2dword(lnLeft) + num2dword(lnTop) +;
    num2dword(lnRight) + num2dword(lnBottom)
 
FUNCTION  num2dword (lnValue) 
#DEFINE m0       256
#DEFINE m1     65536
#DEFINE m2  16777216
    LOCAL b0, b1, b2, b3
    b3 = Int(lnValue/m2)
    b2 = Int((lnValue - b3 * m2)/m1)
    b1 = Int((lnValue - b3*m2 - b2*m1)/m0)
    b0 = Mod(lnValue, m0)
RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3)
 
PROCEDURE  decl
    DECLARE INTEGER GetActiveWindow IN user32
    DECLARE INTEGER GetFocus IN user32
    DECLARE INTEGER GetWindowDC IN user32 INTEGER hwnd
    DECLARE INTEGER ReleaseDC IN user32 INTEGER hwnd, INTEGER hdc
 
    DECLARE INTEGER DrawCaption IN user32;
        INTEGER hwnd, INTEGER hdc,;
        STRING lprc, INTEGER uFlags
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1606 bytes  
Created: 2001-12-31 18:03:13  
Modified: 2001-12-31 18:03:58  
Visits in 7 days: 139  
Listed functions:
DrawCaption
GetActiveWindow
GetFocus
GetWindowDC
ReleaseDC
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 (50.16.108.167)
3 sec.Example: 'Using FrameRgn for displaying system colors'
7 sec.Function: 'CreateMD5SSOHash'
1.19 hrs.Example: 'GDI+: reading and writing metadata in JPEG and TIFF files'
 Function: 'ImageList_Add'
Function group: 'Windows Controls'
2.82 hrs.
Function group: 'HTTP Functions (WinHTTP)'
 Example: 'How to create MD-5 and SHA-1 hash values from a string'
3.36 hrs.Function: 'JetDetachDatabase'
Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
 Function: 'BitBlt'
 Example: 'Adding and deleting User Accounts'
6.96 hrs.Example: 'Retrieving top-child window for the VFP form'
Google
Advertise here!