Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
CryptoAPI: Collection of Providers class
Enumerating sessions established on a server
How to create a desktop shortcut (shell link)
How to display advanced Task Dialog (Vista)
How to generate GUID values
How to retrieve adapter information for the local computer (including MAC address)
How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)
Retrieving IP statistics for the computer
Winsock: creating a socket that is bound to a specific service provider
Converting twips to pixels and vice versa
Enumerating devices installed on the local machine
Finding out if the current user is the Guest account
How to run FoxPro application under different user name (impersonating user)
Passing data records between VFP applications via the Clipboard
Reading data from INI files
System and Local Time values
GDI+: Creating thumbnails to preview images in a directory
How to block the ALT+TAB shortcut (WinXP)
How to display the port-configuration dialog box for a port on the specified server
PocketPC: custom RAPI class for executing routines on remote Windows CE device
Quering a waveform-audio input device
A class that encrypts and decrypts files using Cryptography API Functions
Displaying all TCP connections for the local system
Pocket PC: custom RAPI class for operating with the Object Store Databases
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: 96  
    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-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 (50.16.36.153)
    3 sec.Function: 'waveInStart'
    23.63 min.Example: 'Dial the Net Automatically'
    23.68 min.Example: 'How to delete all print jobs for a printer'
    23.73 min.Example: 'Accessing examples contained in this reference from a VFP application'
    5.08 hrs.Function: 'GetActiveWindow'
    5.53 hrs.Article: 'Use Windows API calls to program the MessageBox dialog's timeout interval, button captions, and position. '
     Example: 'Winsock: connecting to a news server (NNTP, port 119)'
    6.55 hrs.Example: 'How to obtain Content-Type value for a file type from the System Registry'
     Function: 'GetClipboardData'
    6.77 hrs.Example: 'How to test file attributes (key method for FileExists and DirectoryExists routines)'
    Google
    Advertise here!