Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Custom GDI+ class
Obtaining names and positions for shortcuts located on the Windows Desktop
Printing Image File, programmatically set print page orientation to landscape
GDI+: Implementing image scrolling with inertia
Pocket PC: custom RAPI class for operating with files and folders on mobile device
How to play AVI file on the _screen
Displaying icons in the system tray (VFP9)
How to load a user profile
Displaying dimmed window behind VFP top-level form
Browsing Windows Known Folders (Special Folders)
GDI+: reading and writing metadata in JPEG and TIFF files
Moving shortcut to a specified position on the Windows Desktop
Custom FTP Class for Visual FoxPro application
Compressing and decompressing files with Windows API Runtime Library routines
GDI+: Creating thumbnails to preview images in a directory
Custom HttpRequest class (WinHTTP)
How to change display settings: screen resolution, screen refresh rate
How to put a horizontal text scrolling on the form (a news line, marquee)
Storing content of the Clipboard to a bitmap file
Detecting changes in connections to removable drives (VFP9)
Disconnecting USB Mass Storage Device programmatically
Monitoring clipboard content changes (VFP9)
Splash Screen for the VFP application
How to put a vertical text scrolling on the form (a movie cast)
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
    ENDFOR
    
    ? 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)
        ENDFOR
        WAIT CLEAR
        ? Chr(9) + "- cursor created at " + TTOC (datetime())
    RETURN
    

    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: 70  
    Listed functions:
    EnableWindow
    GetActiveWindow
    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  
    FreeTranslation.com 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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.158.212.93)
    12 sec.Function: 'GdipGetPropertyItemSize'
    23 sec.Function: 'midiOutGetDevCaps'
    35 sec.Function: 'IsNetworkAlive'
    47 sec.Function: 'GetClipboardViewer'
    57 sec.Function: 'WinVerifyTrust'
    1.15 min.Function: 'FlushFileBuffers'
    1.33 min.Function: 'DocumentProperties'
    1.52 min.Function: 'waveOutPrepareHeader'
    1.7 min.Function: 'AVIFileInfo'
    1.87 min.
    Function group: 'Handle and Object'
    Google
    Advertise here!