I would like to send keys to the system to press the windows keys twice from
within VFP. This should be able to be done using something similiar to:


DEFINE VK_LWIN = 0 && H5B ?
DEFINE KEYEVENTF_KEYUP = 2097152 && H2

DECLARE keybd_event IN Win32API ;
SHORT bVk, SHORT bScan, INTEGER dwFlags, INTEGER deExtraInfo
keybd_event(VK_LWIN,0,KEYEVENTF_KEYUP,0)
keybd_event(VK_LWIN,0,KEYEVENTF_KEYUP,0)Has anyone done this before? Am I on
the right track? I know VK_LWIN should be H5B (well, I'm pretty sure
anyway).

TIA,
Tracy

Re: Press Windows Key twice from within VFP using API by Tracy

Tracy
Mon Dec 05 10:32:22 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C5F98F.8F01B320
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Any idea why the below code returns "Function name missing )."


#DEFINE VK_LWIN =3D 0x5B && 0x5B and 91 both do not work
#DEFINE VK_RWIN =3D 0x5C
#DEFINE KEYEVENTF_KEYUP 2

DECLARE keybd_event IN Win32API ;
SHORT bVk, SHORT bScan, INTEGER dwFlags, INTEGER deExtraInfo
=3Dkeybd_event(VK_LWIN,0,0,0)
=3Dkeybd_event(VK_LWIN,0,KEYEVENTF_KEYUP,0)

CLEAR DLLS keybd_event
RETURN

------=_NextPart_000_000A_01C5F98F.8F01B320
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P><FONT face=3DArial size=3D2>Any idea why the below code returns =
"Function name=20
missing )."<BR></FONT><FONT face=3DArial size=3D2></FONT></P>
<P><FONT size=3D2><FONT face=3D"Courier New">#<SPAN =
class=3Dvfpreserved>DEFINE</SPAN>=20
VK_LWIN =3D <SPAN=20
class=3Dvfpliteral>0x5B</SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;=20
<SPAN class=3Dvfpcomment>&amp;&amp; 0x5B and 91 both do not =
work</SPAN><BR>#<SPAN=20
class=3Dvfpreserved>DEFINE</SPAN> VK_RWIN =3D <SPAN=20
class=3Dvfpliteral>0x5C</SPAN><BR>#<SPAN =
class=3Dvfpreserved>DEFINE</SPAN>=20
KEYEVENTF_KEYUP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN=20
class=3Dvfpliteral>2</SPAN><BR><BR><SPAN =
class=3Dvfpreserved>DECLARE</SPAN>=20
keybd_event <SPAN class=3Dvfpreserved>IN</SPAN> Win32API ;<BR>&nbsp; =
SHORT bVk,=20
SHORT bScan, <SPAN class=3Dvfpreserved>INTEGER</SPAN> dwFlags, <SPAN=20
class=3Dvfpreserved>INTEGER</SPAN> =
deExtraInfo<BR>=3Dkeybd_event(VK_LWIN,<SPAN=20
class=3Dvfpliteral>0</SPAN>,<SPAN class=3Dvfpliteral>0</SPAN>,<SPAN=20
class=3Dvfpliteral>0</SPAN>)<BR>=3Dkeybd_event(VK_LWIN,<SPAN=20
class=3Dvfpliteral>0</SPAN>,KEYEVENTF_KEYUP,<SPAN=20
class=3Dvfpliteral>0</SPAN>)<BR><BR><SPAN =
class=3Dvfpreserved>CLEAR</SPAN> <SPAN=20
class=3Dvfpreserved>DLLS</SPAN> keybd_event<BR><SPAN=20
class=3Dvfpreserved>RETURN</SPAN></SPAN></FONT></P></FONT></DIV></BODY></=
HTML>

------=_NextPart_000_000A_01C5F98F.8F01B320--


Re: Press Windows Key twice from within VFP using API by Tracy

Tracy
Mon Dec 05 11:02:55 CST 2005

This works:

#DEFINE VK_LWIN 0x5B
#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)
=INKEY(.3)
keybd_event(VK_LWIN,0x5B,0,0)
keybd_event(VK_LWIN,0x5B,KEYEVENTF_KEYUP,0)
CLEAR DLLS keybd_event



Re: Press Windows Key twice from within VFP using API by Tracy

Tracy
Mon Dec 05 11:07:24 CST 2005

This is a multi-part message in MIME format.

------=_NextPart_000_0017_01C5F994.739F4160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Disregard, see other reply - got it working. :o)
------=_NextPart_000_0017_01C5F994.739F4160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Disregard, see other&nbsp;reply - got =
it working.=20
:o)</FONT></DIV></BODY></HTML>

------=_NextPart_000_0017_01C5F994.739F4160--