Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Winsock: sending email messages (SMTP, port 25)
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Enumerating data formats currently available on the clipboard
Custom FTP Class for Visual FoxPro application
Detecting changes in connections to removable drives (VFP9)
How to download a file from the FTP server using FtpGetFile
How to activate Windows Calculator
Splash Screen for the VFP application
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Custom HttpRequest class (WinINet)
Mapping and disconnecting network drives
Establishing connection using the SQLDriverConnect
Custom HttpRequest class (WinHTTP)
Using Font and Text functions
How to convert a bitmap file to monochrome format (1 bpp)
Displaying bitmap using the AlphaBlend function
Using EnumPrinters function to enumerate locally installed printers
Using WM_COPYDATA for interprocess communication (VFP9)
How to make a VFP form fading out when released (GDI+ version)
How to play AVI file on the _screen
Capturing keyboard activity of another application with the Raw Input API (VFP9)

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
In this code sample, VFP form registers for receiving the raw input from each and any keyboard type device connected to the computer. That includes keyboards, numeric keypads, keyboard wedge scanners and so on.

The testing is simple. Any text typed in another Windows application (like text editor, spreadsheet, browser) will be duplicated in an EditBox on the VFP form.

Note that this code sample requires VFP9 version of the BINDEVENT() function. The one that can handle Windows messages.

See also:
  • LanguageBar ActiveX control
  • Enumerating raw input devices attached to the system
  • Switching between keyboard layouts
  • Disabling mouse and keyboard input for the main VFP window
  • How to disable the Windows Clipboard
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    7162 bytes  
    Created: 2011-01-06 12:31:59  
    Modified: 2011-02-22 03:05:19  
    Visits in 7 days: 240  
    Listed functions:
    CallWindowProc
    GetKeyboardState
    GetLastError
    GetRawInputData
    GetWindowLong
    MapVirtualKey
    RegisterRawInputDevices
    ToAscii
    Printer friendly API declarations
    My comment:
    By default, no application receives raw input. For doing that, an application must register a device type it wants to get data from. When registered, an application receives the raw input through the WM_INPUT messages.

    User input comes not just from keyboard and mouse, but also from a joystick, a touch screen, a microphone, and other devices collectively known as Human Interface Devices (HIDs).

    Global keyboard and mouse hooks can produce similar results.

    In case of multiple input devices of same type, the Raw Input API has means to separate the input (i.g. keystrokes, mouse events) by source.

    * * *
    Curiously: initially I chose registering keystrokes on KeyUps. And switched to KeyDowns after finding that fast typed keystrokes sometimes get released not in the sequence of pressing.
    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 (54.234.180.187)
    5 sec.Example: 'Reading and setting the priority class values for the current process and thread'
    11.1 hrs.Function: 'GlobalLock'
    Function group: 'Memory Management'
     Function: 'GdipCreateBitmapFromHBITMAP'
    12.85 hrs.Function: 'GetStartupInfo'
    Function group: 'Process and Thread'
     Example: 'How to copy the image of a form to the Clipboard using Bitmap API functions'
    14.22 hrs.Example: 'How to create MD-5 and SHA-1 hash values from a string'
    Language: 'C++'
     Function: 'GdipCreateFontFamilyFromName'
    23.48 hrs.
    Function group: 'Windows Multimedia'
     Function: 'SetSearchPathMode'
    Function group: 'File Management'
    1 day(s)Example: 'Retrieving information about the main VFP window'
    Google
    Advertise here!