Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Get the power status of your laptop computer
Printing text on the client area of the main VFP window
The DetectAutoProxyUrl function identifies the auto-config script location
Adding printer to the list of supported printers for the specified server
How to download this reference`s archive through WinInet functions using InternetOpenUrl
How to view system icons for the classes installed on the local machine
Reading the state of mouse buttons within DO WHILE loop
Retrieveing information about the active window (even if it is not owned by the calling process)
Returning some basic information for the specified INF file
A procedure for setting file times
Copying strings through the global memory block
Obtaining I/O counts for the current process
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
Retrieving list of available disk drives
Using the GetTempFileName
Using vendor-neutral SQL constructs
Verifying a file using the Authenticode policy provider
Current keyboard type
Extracting the name and extension parts of a path string
Obtaining heap handles and enumerating memory blocks for the current VFP session (WinNT only)
Obtaining OS memory performance information
Removing FTP directory
Retrieving configuration information for the specified server (Win98/Me)
The window and its ancestors

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
Before you begin:
Call this code in three different ways to compare the results: (a) from the Command window; (b) from an open PRG editor; (c) from a form method.
 
DO decl
 
#DEFINE GA_PARENT     1
#DEFINE GA_ROOT       2
#DEFINE GA_ROOTOWNER  3
 
LOCAL hWindow
hWindow = GetFocus()
 
ACTI SCREEN
? "*** The window and its ancestors"
 
= _print ("Source window:", hWindow)
= _print ("Parent window (GetParent):", GetParent (hWindow))
= _print ("Parent window (GetAncestor):", GetAncestor (hWindow, GA_PARENT))
= _print ("Root window:", GetAncestor (hWindow, GA_ROOT))
= _print ("Owned root window:", GetAncestor (hWindow, GA_ROOTOWNER))
 
ACTI SCREEN
?
? "*** Some other important windows"
 
= _print ("VFP main window:", GetActiveWindow())
= _print ("Windows desktop:", GetDesktopWindow())
 
PROCEDURE  _print (lcMemo, hWindow)
    LOCAL lcWintext
    lcWintext = GetWinText(hWindow)
    ACTI SCREEN
    ? lcMemo, "|", hWindow, "|", lcWintext
 
FUNCTION  GetWinText(hWindow)
    LOCAL lnBufsize, lcBuffer
    lnBufsize = 1024
    lcBuffer = Repli(Chr(0), lnBufsize)
    lnBufsize = GetWindowText(hWindow, @lcBuffer, lnBufsize)
RETURN  Iif(lnBufsize=0, "", Left(lcBuffer,lnBufsize))
 
PROCEDURE  decl
    DECLARE INTEGER GetDesktopWindow IN user32
    DECLARE INTEGER GetActiveWindow IN user32
    DECLARE INTEGER GetFocus IN user32
 
    DECLARE INTEGER GetParent IN user32 INTEGER hwnd
    DECLARE INTEGER GetAncestor IN user32;
        INTEGER hwnd, INTEGER gaFlags
 
    DECLARE INTEGER GetWindowText IN user32;
        INTEGER hwnd, STRING @lpString, INTEGER cch
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1388 bytes  
Created: 2002-01-25 20:55:32  
Modified: 2002-01-25 20:57:35  
Visits in 7 days: 189  
Listed functions:
GetActiveWindow
GetAncestor
GetDesktopWindow
GetFocus
GetParent
GetWindowText
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.166.175)
4 sec.Function: 'listen'
Function group: 'Windows Sockets 2 (Winsock)'
19.4 min.Function: 'SendMessage'
19.45 min.Example: 'Mapping and disconnecting network drives'
1.69 hrs.Example: 'How to obtain Content-Type value for a file type from the System Registry'
1.7 hrs.Example: 'Accessing Adobe Reader 7.0 main menu from VFP application'
1.8 hrs.Example: 'Determining if an Active Network Connection is Available'
2.62 hrs.Example: 'Comparing file times'
 Links
Page 3
 Function: 'GetThreadPriority'
Function group: 'Process and Thread'
7.66 hrs.Function: 'WTSFreeMemory'
Function group: 'Terminal Services'
Google
Advertise here!