Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Opening access to the Microsoft Internet functions for the application
PocketPC: creating directories and files
Reading keys in the specified section of the Win.ini file
Terminating VFP application using the FatalAppExit
Creating hash values for the list of names
Displaying the main Dial-Up Networking dialog box
Initiating Inet connection using a modem
Retrieving the System Time adjustment
Searching for the specified file using the SearchPath
How to fill a buffer with random bytes using Cryptography API Functions
How to test file attributes (key method for FileExists and DirectoryExists routines)
Enumerating connections made to a shared resource for the local computer (WinNT only)
Enumerating ODBC drivers available on the local computer
Using the CopyFile
Using the GetLogicalDriveStrings
Dynamic strings implemented through VFP Custom class
GDI+: converting text strings to images and saving in a graphics file
GDI+: Using Scale and Shear transformations
An alternative way of setting Form.Closable to False
How to intercept window messages sent to VFP form
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
Retrieving geometrical parameters of the system desktop window
Testing Transparent Menu Class with top-level form (requires VFP9)
Using the Semaphore object
Obtaining window class name for 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 declare
 
LOCAL hWindow
hWindow = GetActiveWindow()
 
? "GetActiveWindow():", hWindow
? "Window Class:", GetWindowClass(hWindow)
? "Window Caption:", GetWindowCaption(hWindow)
?
? "_vfp.hWnd:", _vfp.hWnd
? "_screen.hWnd:", _screen.hWnd
? "_SCREEN.Caption:", _screen.Caption
 
FUNCTION GetWindowClass(lnWindow)
    LOCAL lnLength, lcText
 
    lcText = SPACE(250)
    lnLength = RealGetWindowClass(lnWindow,;
        @lcText, Len(lcText))
 
RETURN IIF(lnLength > 0,;
    Left(lcText, lnLength), "#empty#")
 
FUNCTION GetWindowCaption(lnWindow)
    LOCAL lnLength, lcText
 
    lcText = SPACE(250)
    lnLength = GetWindowText(lnWindow,;
        @lcText, Len(lcText))
 
RETURN IIF(lnLength > 0,;
    Left(lcText, lnLength), "#empty#")
 
PROCEDURE declare
    DECLARE INTEGER GetActiveWindow IN user32
 
    DECLARE INTEGER RealGetWindowClass IN user32;
        INTEGER hWindow, STRING @ pszType,;
        INTEGER cchType
 
    DECLARE INTEGER GetWindowText IN user32;
        INTEGER hWindow,;
        STRING @lpString, INTEGER cch
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
994 bytes  
Created: 2001-07-18 12:00:00  
Modified: 2010-08-05 09:57:43  
Visits in 7 days: 36  
Listed functions:
GetActiveWindow
GetWindowText
RealGetWindowClass
Printer friendly API declarations
My comment:
Compare the results when:
- running this code using DO in the Command Window;
- running from an open Program Edit window using Ctrl+E
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.26.172)
1.3 hrs.Example: 'DiskFreeSpace class'
 Example: 'Displaying standard progress dialog box when copying files'
 Example: 'Clipping mouse cursor area'
Google
Advertise here!