Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Splash Screen for the VFP application
How to put a vertical text scrolling on the form (a movie cast)
How to make a VFP form fading out when released (GDI version)
Subclassing CommandButton control to create BackColor property
Creating the Open dialog box to specify the drive, directory, and name of a file to open
Obtaining names and positions for shortcuts located on the Windows Desktop
Displaying system dialog that selects a folder
Moving shortcut to a specified position on the Windows Desktop
Custom FTP Class for Visual FoxPro application
Enumerating devices installed on the local machine
How to detect if additional monitor is connected and active
Vertical Label control
Drawing icons associated with the VFP main window
Storing content of the Clipboard to a bitmap file
Printing text with the Escape function
Displaying dimmed window behind VFP top-level form
How to put a horizontal text scrolling on the form (a news line, marquee)
GDI+: Implementing image scrolling with inertia
How to ping a remote site using ICMP API calls
Bitmap Class for Visual FoxPro application
Testing Clipboard functions: emptying the clipboard
Using shared memory to exchange data between applications (processes)
WAV file player
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: 125  
    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-2017 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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    11 sec.Function: 'GetTcpStatistics'
    19 sec.Function: 'ScreenToClient'
    29 sec.Function: 'GetComputerName'
    38 sec.Function: 'MAPISendMail'
    48 sec.Function: 'GetVolumeInformation'
    58 sec.Function: 'HeapCompact'
    1.12 min.Function: 'JetRetrieveColumn'
    1.27 min.Function: 'InternetAutodial'
    1.45 min.Function: 'AVIStreamGetFrame'
    1.62 min.
    Function group: 'Window Class'
    Advertise here!