Using Win32 functions in Visual FoxPro Image Gallery
Keyboard Input
..msdn
ActivateKeyboardLayout
BlockInput
EnableWindow
GetActiveWindow
GetAsyncKeyState
GetFocus
GetKBCodePage
GetKeyboardLayout
GetKeyboardLayoutList
GetKeyboardLayoutName
GetKeyboardState
GetKeyNameText
GetKeyState
IsWindowEnabled
keybd_event
MapVirtualKey
RegisterHotKey
SetFocus
SetKeyboardState
ToAscii
UnregisterHotKey
VkKeyScan
Code examples:
Switching between keyboard layouts
Switching between keyboard layouts

User rating: 9.33/10 (3 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:
The form in this code sample displays input languages available for the current process and allows switching between them.



In VFP9, this form also tracks input language changes initiated by a hot key or via Windows Taskbar. A form must have the keyboard focus to immediately reflect a change in input language.





See also:

  • LanguageBar ActiveX control



  • Saving available locale records into a cursor
  • Retrieving national language settings
  • Capturing keyboard activity of another application using the Raw Input API
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 9.33/10 (3 votes)
    Rate this code sample:
    • ~
    4391 bytes  
    Created: 2002-02-08 21:32:59  
    Modified: 2011-03-24 10:34:21  
    Visits in 7 days: 81  
    Listed functions:
    ActivateKeyboardLayout
    CallWindowProc
    GetKeyboardLayout
    GetKeyboardLayoutList
    GetKeyboardLayoutName
    GetWindowLong
    Printer friendly API declarations
    My comment:
    The keyboard layout status, if any shown in the taskbar, reflects the layout selection made on the form.

    The name of the input locale identifier (keyboard layout) is a string composed of the hexadecimal value of the language identifier (low word) and a device identifier (high word).

    For example, English (United States) layout has a language identifier of 0x0409, so this layout is named "00000409". The variants of it (such as the Dvorak layout) are named "00010409", "00020409", and so on.

    The indentifiers in the list correspond to the current set of input locales used by the system. The LoadKeyboardLayout function activates selected input locale identifier.

    * * *
    List of Locale IDs, Input Locale, and Language Collection
    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:
    Rovshan | 2005-10-25 16:17:11
    Thank you for this site.
    Pavel | 2007-04-05 08:14:11
    Thanks!
    It's just what I looked for

    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 (107.20.7.65)
    37.87 min.Example: 'Starting an external application in VFP using WinExec'
    37.97 min.Example: 'Determining whether or not the system is connected to the Internet'
    1.67 hrs.Function: 'RtlGetCompressionWorkSpaceSize'
    3.64 hrs.Function: 'HeapWalk'
    Function group: 'Memory Management'
     Function: 'GetClassLong'
    3.96 hrs.Example: 'WAV file recorder'
     Example: 'Comparing dimensions of the VFP main window with _SCREEN properties'
     Example: 'Retrieving configuration information for the specified server (Win2000/XP)'
    4.07 hrs.Function: 'GlobalFree'
     Function: 'MessageBeep'
    Function group: 'Error Handling'
    Google
    Advertise here!