Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Locking mouse and keyboard input for the VFP application
Displaying the main Dial-Up Networking dialog box
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Loading a string resource from an executable file
Pocket PC: base class
Retrieving the priority class for the current process
Retrieving window and menu help context identifiers
StrDup returns a pointer to the duplicate of a source VFP string
Changing file attributes
Transparent Menu Class (requires VFP9)
How to set Creation Date/Time for a folder (WinNT)
Retrieving information specific to the current Time Zone
Retrieving the User Datagram Protocol (UDP) listener table
Dial the Net Automatically
GDI+: custom Slider control
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Drawing Windows predefined bitmaps using the LoadBitmap functions
Retrieving names for the registered clipboard formats
Adding supplementary data to AVI files
Confining Windows calculator inside the VFP main window
Initiating Inet connection using a modem
Reading parameters of streams in AVI file
Clipping mouse cursor area
Converting twips to pixels and vice versa
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: 137  
    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.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    2 sec.
    Function group: 'String'
    4 sec.Function: 'InternetCloseHandle'
    6 sec.
    Function group: 'Virtual Hard Disk (Win7)'
    7 sec.Function: 'GetShortPathName'
    Function group: 'File Management'
    9 sec.Gallery
    11 sec.All Functions
    13 sec.
    15 sec.Function: 'CreateFile'
    Function group: 'File Management'
    17 sec.Function: 'GdipGetPropertyIdList'
    Function group: 'GDI+ Image'
    18 sec.Login
    Advertise here!