Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
How to display Windows On-Screen Keyboard
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to print a bitmap file
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Custom HttpRequest class (WinHTTP)
Printing Image File, programmatically set print page orientation to landscape
Creating the Save dialog box to specify the drive, directory, and name of a file to save
How to convert a bitmap file to monochrome format (1 bpp)
The window and its ancestors
Mapping and disconnecting network drives
How to download a file from the FTP server using FtpGetFile
Displaying icons in the system tray (VFP9)
Using EnumPrinters function to enumerate locally installed printers
Custom FTP Class for Visual FoxPro application
Displaying the associated icons and descriptions for files and folders
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
How to activate Windows Calculator
Drawing Windows predefined bitmaps using the LoadBitmap functions
Sending email messages with Simple MAPI
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: 41  
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 (184.73.7.143)
56.65 min.Example: 'Using InternetSetFilePointer when resuming interrupted download from the Internet'
56.7 min.Function: 'GetMenuItemCount'
56.75 min.Function: 'CeRapiInit'
Function group: 'Remote Application Programming (RAPI)'
2 hrs.Example: 'Closing Windows'
2.45 hrs.Function: 'SetClipboardViewer'
Function group: 'Clipboard'
4.46 hrs.Example: 'GDI+: Creating thumbnails to preview images in a directory'
 Function: 'GdipRotateMatrix'
5.02 hrs.
5.03 hrs.Example: 'Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)'
6.26 hrs.Function: 'GetLongPathName'
Function group: 'File Management'
Google
Advertise here!