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:
How to activate Windows Calculator
keybd_event
    Add comment     W32 Constants      Translate this page
Synthesizes a keystroke.
Code examples:
How to activate Windows Calculator
Declaration:
VOID keybd_event(
    BYTE bVk,
    BYTE bScan,
    DWORD dwFlags,
    PTR dwExtraInfo
);
FoxPro declaration:
DECLARE keybd_event IN user32;
    SHORT bVk,;
    SHORT bScan,;
    INTEGER dwFlags,;
    INTEGER dwExtraInfo
Parameters:
bVk
[in] Specifies a virtual-key code. The code must be a value in the range 1 to 254. For a complete list, see Virtual-Key Codes.

bScan
This parameter is not used.

dwFlags
[in] Specifies various aspects of function operation.

dwExtraInfo
[in] Specifies an additional value associated with the key stroke.
Return value:
This function has no return value.
Usage:
* the following code  opens the Windows Start Menu
* by sending (emulating) CTRL+ESC sequence

#DEFINE KEYEVENTF_KEYUP 2
#DEFINE KEYVALUE_CTRL 17
#DEFINE KEYVALUE_ESC 27

* key gets down
= keybd_event(KEYVALUE_CTRL, 0, 0, 0)
= keybd_event(KEYVALUE_ESC, 0, 0, 0)
DOEVENTS

* key gets up
= keybd_event(KEYVALUE_CTRL, 0, KEYEVENTF_KEYUP, 0)
= keybd_event(KEYVALUE_ESC, 0, KEYEVENTF_KEYUP, 0)
DOEVENTS
My comment:
The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver"s interrupt handler calls the keybd_event function.

List of Virtual Key Codes.
Word Index links for the keybd_event :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2006-06-28 16:30:40
Modified: 2007-06-18 14:11:26
Visited in last 7 days: 24
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.225.20.73)
13 sec.Function: 'ShowHTMLDialog'
27 sec.Function: 'GlobalSize'
39 sec.
Function group: 'Multilingual User Interface'
51 sec.Function: 'GetModuleHandle'
1.1 min.Function: 'InitCommonControlsEx'
1.35 min.Function: 'NetApiBufferSize'
1.57 min.Function: 'PathIsDirectory'
1.78 min.Function: 'OpenVirtualDisk'
1.98 min.Function: 'GetSecurityDescriptorOwner'
2.18 min.Function: 'FindNextChangeNotification'
Google
Advertise here!