Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Press windows key twice from within VFP using API?
Message
 
 
To
05/12/2005 11:48:48
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01074949
Message ID:
01074975
Views:
11
You're welcome.

>Perfect Sergey, thanks! I actually came to the same conclusion in testing. I came up with wait window "" TIMEOUT 2 which seemed to work, but inkey(.1) is definitely better! Once, again, thanks!
>
>Tracy
>
>>Try to add some delay between them
>>keybd_event(VK_LWIN,0x5B,0,0)
>>keybd_event(VK_LWIN,0x5B,KEYEVENTF_KEYUP,0)
>>=INKEY(.1)
>>keybd_event(VK_LWIN,0x5B,0,0)
>>keybd_event(VK_LWIN,0x5B,KEYEVENTF_KEYUP,0)
>>
>>
>>>OK, this example works to press the left windows key once (the startmenu is displayed) but it fails to release it and press press it the 2nd time for some reason (or doesn't appear to because the startmenu remains displayed):
>>>
>>>#DEFINE VK_LWIN                 0x5B           && 0x5B and 91 both do not work
>>>#DEFINE VK_RWIN                 0x5C
>>>#DEFINE KEYEVENTF_KEYUP         0x2
>>>
>>>DECLARE keybd_event IN Win32API ;
>>>  SHORT bVk, SHORT bScan, INTEGER dwFlags, INTEGER deExtraInfo
>>>keybd_event(VK_LWIN,0x5B,0,0)
>>>keybd_event(VK_LWIN,0x5B,KEYEVENTF_KEYUP,0)
>>>keybd_event(VK_LWIN,0x5B,0,0)
>>>keybd_event(VK_LWIN,0x5B,KEYEVENTF_KEYUP,0)
>>>
>>>CLEAR DLLS keybd_event
>>>RETURN
>>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform