Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Winsock: sending email messages (SMTP, port 25)
How to display the Properties dialog box for a file (ShellExecuteEx)
Disk in drive A:
Detecting changes in connections to removable drives (VFP9)
Using Font and Text functions
How to download a file from the FTP server using FtpGetFile
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to play AVI file on the _screen
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using EnumPrinters function to enumerate locally installed printers
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Splash Screen for the VFP application
Subclassing CommandButton control to create BackColor property
Creating irregularly shaped FoxPro form using transparency color key
Vertical Label control
Converting Unicode data from the Clipboard to a character string using a given code page
Creating a console window for Visual FoxPro application
Enumerating network resources
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: 289  
    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.231.49)
    55.95 min.Example: 'Opening access to the Microsoft Internet functions for the application'
    56.02 min.Example: 'Using Common Controls: the Header Control'
    1.63 hrs.Example: 'Running a regular FoxPro form while main VFP window is minimized'
     Function: 'CeWriteRecordProps'
    Function group: 'Remote Application Programming (RAPI)'
    3.65 hrs.Example: 'Storing screen shot of a form to enhanced metafile (*.emf)'
    3.76 hrs.Example: 'Reading list of folders and files on FTP server'
     Example: 'Detecting changes in connections to removable drives (VFP9)'
    6.58 hrs.Example: 'Creating the Save dialog box to specify the drive, directory, and name of a file to save'
     Example: 'URL: splitting into its component parts'
    10.07 hrs.Function: 'VkKeyScan'
    Function group: 'Keyboard Input'
    Google
    Advertise here!