Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
How to change display settings: screen resolution, screen refresh rate
GDI+: Implementing image scrolling with inertia
Obtaining names and positions for shortcuts located on the Windows Desktop
Vertical Label control
Displaying dimmed window behind VFP top-level form
Enumerating devices installed on the local machine
Printing Image File, programmatically set print page orientation to landscape
How to generate GUID values
Monitoring clipboard content changes (VFP9)
Storing content of the Clipboard to a bitmap file
Adding a background image to VFP report (VFP9, ReportListener)
Compressing and decompressing files with Windows API Runtime Library routines
Splash Screen for the VFP application
Disconnecting USB Mass Storage Device programmatically
How to load a user profile
Subclassing CommandButton control to create BackColor property
Browsing Windows Known Folders (Special Folders)
How to control Adobe Reader 9.0 (SDI mode) from VFP application
Semi-transparent Form
Generating random cryptographic keys
How to put a horizontal text scrolling on the form (a news line, marquee)
Detecting changes in connections to removable drives (VFP9)
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
Locking mouse and keyboard input for the VFP application

User rating: 10/10 (1 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:
See also:
  • Capturing keyboard activity of another application using the Raw Input API
  • DECLARE INTEGER GetActiveWindow IN user32 
    DECLARE INTEGER EnableWindow IN user32;
     INTEGER hwnd,;
     INTEGER fEnable
    * get handle of main VFP window
    hwnd = GetActiveWindow()
    ? EnableWindow (hwnd, 0)
    ? "*** Input blocked - the main VFP window only"
    FOR ii=1 TO 10
        DO proc1
    ? EnableWindow (hwnd, 1)
    ? "*** Input unblocked"
    PROCEDURE  proc1
        LOCAL ii
        WAIT WINDOW NOWAIT "Creating cursor..."
        CREATE CURSOR cs (id N(6), dt D)
        FOR ii=1 TO 10000
            INSERT INTO cs VALUES (ii, date()-ii)
        WAIT CLEAR
        ? Chr(9) + "- cursor created at " + TTOC (datetime())

    User rating: 10/10 (1 votes)
    Rate this code sample:
    • ~
    605 bytes  
    Created: 2001-08-02 12:00:00  
    Modified: 2011-01-06 16:30:23  
    Visits in 7 days: 44  
    Listed functions:
    Printer friendly API declarations
    My comment:
    In this example user input is locked for VFP application only. This function works differently then the BlockInput does. The latter locks the window for all processes not just for the active process and thread.

    With EnableWindow you can effectively lock a VFP application. But it is more like "you lock the door and throw away the key". To unlock it use the Task Manager, or beforehand submit the instructions to some other application along with the corresponding HWND.

    Applied to windowed controls this function can enable or disable them.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.

    Copyright 2001-2018 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.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    24 sec.Function: 'GetTcpStatistics'
    49 sec.Function: 'SetLayeredWindowAttributes'
    1.17 min.Function: 'GdipScaleMatrix'
    1.6 min.Function: 'GetKeyboardLayoutList'
    1.97 min.Function: 'RealGetWindowClass'
    2.47 min.Function: 'ws_select'
    2.98 min.Function: 'PathIsDirectory'
    3.58 min.Function: 'DrawEdge'
    4.17 min.Function: 'JetGetColumnInfo'
    4.77 min.
    Function group: 'Coordinate Space and Transformation'
    Advertise here!