Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11784 > unrolled thread

Sample for SendInput() ?

Started byGerhard Bunzel <g.bunzel@domonet.de>
First post2018-07-30 13:38 +0200
Last post2018-08-02 09:00 +0200
Articles 9 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Sample for SendInput() ? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-07-30 13:38 +0200
    Re: Sample for SendInput() ? "Jamal" <nospam@example.com> - 2018-07-30 12:56 -0400
      Re: Sample for SendInput() ? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-07-31 11:57 +0200
    Re: Sample for SendInput() ? Karl Wochele <kw@ecos-system.invalid> - 2018-07-31 07:33 +0200
      Re: Sample for SendInput() ? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-07-31 12:04 +0200
    Re: Sample for SendInput() ? "Karl-Heinz" <invalid@invalid.invalid> - 2018-07-31 15:59 +0200
    Re: Sample for SendInput() ? "Karl-Heinz" <invalid@invalid.invalid> - 2018-07-31 16:11 +0200
      Re: Sample for SendInput() ? "Jamal" <noooospam@example.com> - 2018-07-31 15:00 -0400
      Re: Sample for SendInput() ? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-08-02 09:00 +0200

#11784 — Sample for SendInput() ?

FromGerhard Bunzel <g.bunzel@domonet.de>
Date2018-07-30 13:38 +0200
SubjectSample for SendInput() ?
Message-ID<pjmtau$dk5$1@news-1.m-online.net>
Hello,

for a phone dial by our app, we have to do a keyboard simulation.
Therefor I found the WIN32 function SendInput(). Has somebody a sample 
with VO to do this?

Thanks in advance.

Best regards

Gerhard Bunzel

[toc] | [next] | [standalone]


#11785

From"Jamal" <nospam@example.com>
Date2018-07-30 12:56 -0400
Message-ID<pjnfv2$752$1@gioia.aioe.org>
In reply to#11784
Hi Gerhard,

If you are familiar with C#, you can create a COM component using 
InputSimulator NUGet package which then you can call from VO. I only tested 
it under C#.

Reference: 
https://ourcodeworld.com/articles/read/520/simulating-keypress-in-the-right-way-using-inputsimulator-with-csharp-in-winforms

HTH,
Jamal



Jamal

"Gerhard Bunzel"  wrote in message news:pjmtau$dk5$1@news-1.m-online.net...

Hello,

for a phone dial by our app, we have to do a keyboard simulation.
Therefor I found the WIN32 function SendInput(). Has somebody a sample
with VO to do this?

Thanks in advance.

Best regards

Gerhard Bunzel 

[toc] | [prev] | [next] | [standalone]


#11787

FromGerhard Bunzel <g.bunzel@domonet.de>
Date2018-07-31 11:57 +0200
Message-ID<pjpbq2$h2j$1@news-1.m-online.net>
In reply to#11785
Hi Jamal,

thanks for your info.

SendInput() is available as WIN32-API without .NET and C#.
So i prefer a solution without .NET.

Thanks

Best regards

Gerhard


Am 30.07.2018 um 18:56 schrieb Jamal:
> Hi Gerhard,
> 
> If you are familiar with C#, you can create a COM component using 
> InputSimulator NUGet package which then you can call from VO. I only 
> tested it under C#.
> 
> Reference: 
> https://ourcodeworld.com/articles/read/520/simulating-keypress-in-the-right-way-using-inputsimulator-with-csharp-in-winforms 
> 
> 
> HTH,
> Jamal
> 
> 
> 
> Jamal
> 
> "Gerhard Bunzel"  wrote in message news:pjmtau$dk5$1@news-1.m-online.net...
> 
> Hello,
> 
> for a phone dial by our app, we have to do a keyboard simulation.
> Therefor I found the WIN32 function SendInput(). Has somebody a sample
> with VO to do this?
> 
> Thanks in advance.
> 
> Best regards
> 
> Gerhard Bunzel

[toc] | [prev] | [next] | [standalone]


#11786

FromKarl Wochele <kw@ecos-system.invalid>
Date2018-07-31 07:33 +0200
Message-ID<pjosb3$5ea$1@solani.org>
In reply to#11784
Hi Gerhard,

we use this function:

FUNCTION KeyBoard_Event(nKey)
LOCAL aKeys	AS ARRAY
LOCAL n		AS DWORD

IF IsArray(nKey)
	aKeys := nKey
ELSE
	aKeys := {nKey}
ENDIF

FOR n := 1 UPTO ALen(aKeys)
	keybd_event(aKeys[n],0,0,0)
NEXT n
FOR n := ALen(aKeys) DOWNTO 1
	keybd_event(aKeys[n],0,KEYEVENTF_KEYUP,0)
NEXT n


/*
// Simulating a Alt+Tab keystroke
keybd_event(VK_MENU,0xb8,0 , 0); //Alt Press
keybd_event(VK_TAB,0x8f,0 , 0); // Tab Press
keybd_event(VK_TAB,0x8f, KEYEVENTF_KEYUP,0); // Tab Release
keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0); // Alt Release

// Simulating a Ctrl+A keystroke
keybd_event(VK_CONTROL,0x9d,0 , 0); // Ctrl Press
keybd_event(VkKeyScan(‘A’),0x9e,0 , 0); // ‘A’ Press
keybd_event(VkKeyScan(‘A’),0x9e, KEYEVENTF_KEYUP,0); // ‘A’ Release
keybd_event(VK_CONTROL,0x9d,KEYEVENTF_KEYUP,0); // Ctrl Release
*/

RETURN NIL


HTH
Karl

Am 30.07.2018 um 13:38 schrieb Gerhard Bunzel:
> Hello,
> 
> for a phone dial by our app, we have to do a keyboard simulation.
> Therefor I found the WIN32 function SendInput(). Has somebody a sample 
> with VO to do this?
> 
> Thanks in advance.
> 
> Best regards
> 
> Gerhard Bunzel

[toc] | [prev] | [next] | [standalone]


#11788

FromGerhard Bunzel <g.bunzel@domonet.de>
Date2018-07-31 12:04 +0200
Message-ID<pjpc6g$h8o$1@news-1.m-online.net>
In reply to#11786
Hi Karl,

thanks for your answer.

I know that funktion Keybd_event() and it is very easy to use.

That info is from Microsoft Dev Center about keybd_event()
Note: This function has been superseded. Use SendInput instead.

So I look for a solution with SendInput().

Thanks

Best regards

Gerhard


Am 31.07.2018 um 07:33 schrieb Karl Wochele:
> Hi Gerhard,
> 
> we use this function:
> 
> FUNCTION KeyBoard_Event(nKey)
> LOCAL aKeys    AS ARRAY
> LOCAL n        AS DWORD
> 
> IF IsArray(nKey)
>      aKeys := nKey
> ELSE
>      aKeys := {nKey}
> ENDIF
> 
> FOR n := 1 UPTO ALen(aKeys)
>      keybd_event(aKeys[n],0,0,0)
> NEXT n
> FOR n := ALen(aKeys) DOWNTO 1
>      keybd_event(aKeys[n],0,KEYEVENTF_KEYUP,0)
> NEXT n
> 
> 
> /*
> // Simulating a Alt+Tab keystroke
> keybd_event(VK_MENU,0xb8,0 , 0); //Alt Press
> keybd_event(VK_TAB,0x8f,0 , 0); // Tab Press
> keybd_event(VK_TAB,0x8f, KEYEVENTF_KEYUP,0); // Tab Release
> keybd_event(VK_MENU,0xb8,KEYEVENTF_KEYUP,0); // Alt Release
> 
> // Simulating a Ctrl+A keystroke
> keybd_event(VK_CONTROL,0x9d,0 , 0); // Ctrl Press
> keybd_event(VkKeyScan(‘A’),0x9e,0 , 0); // ‘A’ Press
> keybd_event(VkKeyScan(‘A’),0x9e, KEYEVENTF_KEYUP,0); // ‘A’ Release
> keybd_event(VK_CONTROL,0x9d,KEYEVENTF_KEYUP,0); // Ctrl Release
> */
> 
> RETURN NIL
> 
> 
> HTH
> Karl
> 
> Am 30.07.2018 um 13:38 schrieb Gerhard Bunzel:
>> Hello,
>>
>> for a phone dial by our app, we have to do a keyboard simulation.
>> Therefor I found the WIN32 function SendInput(). Has somebody a sample 
>> with VO to do this?
>>
>> Thanks in advance.
>>
>> Best regards
>>
>> Gerhard Bunzel

[toc] | [prev] | [next] | [standalone]


#11789

From"Karl-Heinz" <invalid@invalid.invalid>
Date2018-07-31 15:59 +0200
Message-ID<fsb8buFoqt2U1@mid.individual.net>
In reply to#11784
Hi Gerhard,

> for a phone dial by our app, we have to do a keyboard simulation.
> Therefor I found the WIN32 function SendInput(). Has somebody a sample 
> with VO to do this?

it seems that it´s neccesarry to create a UNION. Here´s what i did so far:

UNION _UnionSendInput
   MEMBER mi IS _WINMOUSEINPUT
   MEMBER ki IS _winKEYBDINPUT
   MEMBER hi IS _winHARDWAREINPUT

STRUCTURE _winINPUT
  MEMBER type AS DWORD
  MEMBER Input IS _UnionSendInput  //  <-------

/*
  MEMBER mi IS  _WINMOUSEINPUT
  MEMBER ki IS _winKEYBDINPUT
  MEMBER hi IS _winHARDWAREINPUT
*/

STRUCTURE _winHARDWAREINPUT
   MEMBER uMsg AS DWORD
   MEMBER wParamL AS WORD
   MEMBER wParamH AS WORD

STRUCTURE  _winKEYBDINPUT
   MEMBER wVk AS WORD
   MEMBER wScan AS WORD
   MEMBER dwFlags AS DWORD
   MEMBER time AS DWORD
   MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR  ???

STRUCTURE _WINMOUSEINPUT
    MEMBER dx AS LONG
    MEMBER dy AS LONG
    MEMBER mouseData AS DWORD
    MEMBER dwFlags AS DWORD
    MEMBER time AS DWORD
    MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR ????

DEFINE INPUT_MOUSE := 0 // The event IS a mouse event. Use the mi STRUCTURE 
OF the UNION.
DEFINE INPUT_KEYBOARD := 1  // The event IS a keyboard event. Use the ki 
STRUCTURE OF the UNION.
DEFINE INPUT_HARDWARE := 2   // The event is a hardware event. Use the hi 
structure of the union.


_DLL FUNCTION SendInput ( nInputs AS DWORD , pInputs AS _winINPUT  , cbSize 
AS INT ) AS DWORD PASCAL:User32.SendInput

-----------------------------------

about the dwExtraInfo member i´m not sure if it´s correct, but at least this 
sample works for me. It opens here a Submenu via

<Alt> + L. Without using the UNION SendInPut() fails with the errorcode 
87 -> ERROR_INVALID_PARAMETER

----------------------

FUNCTION TestKeyboardSendInPut() AS VOID
LOCAL ip IS _winINPUT
LOCAL dwError AS DWORD


    ip.type := INPUT_KEYBOARD
    ip.Input.ki.wScan := 0
    ip.Input.ki.time := 0
    ip.Input.ki.dwExtraInfo := 0

    //  -----------------------

    // Press "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := 0  // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Press "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ))
    ip.Input.ki.dwFlags := 0 // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

     // Release the "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ) )
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Release the "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    IF SendInput(1, @ip, _SIZEOF( _winINPUT)) == 0

       dwError := GetLastError()

    MsgInfo ( NTrim ( dwError )  + crlf + ErrString ( dwError ) )

    ENDIF

//


    RETURN



regards
Karl-Heinz


[toc] | [prev] | [next] | [standalone]


#11790

From"Karl-Heinz" <invalid@invalid.invalid>
Date2018-07-31 16:11 +0200
Message-ID<fsb90iFovieU1@mid.individual.net>
In reply to#11784
Hi Gerhard,

> for a phone dial by our app, we have to do a keyboard simulation.
> Therefor I found the WIN32 function SendInput(). Has somebody a sample
> with VO to do this?

it seems that it´s neccesarry to create a UNION. Here´s what i did so far:

UNION _UnionSendInput
   MEMBER mi IS _WINMOUSEINPUT
   MEMBER ki IS _winKEYBDINPUT
   MEMBER hi IS _winHARDWAREINPUT

STRUCTURE _winINPUT
  MEMBER type AS DWORD
  MEMBER Input IS _UnionSendInput  //  <-------

/*
  MEMBER mi IS  _WINMOUSEINPUT
  MEMBER ki IS _winKEYBDINPUT
  MEMBER hi IS _winHARDWAREINPUT
*/

STRUCTURE _winHARDWAREINPUT
   MEMBER uMsg AS DWORD
   MEMBER wParamL AS WORD
   MEMBER wParamH AS WORD

STRUCTURE  _winKEYBDINPUT
   MEMBER wVk AS WORD
   MEMBER wScan AS WORD
   MEMBER dwFlags AS DWORD
   MEMBER time AS DWORD
   MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR  ???

STRUCTURE _WINMOUSEINPUT
    MEMBER dx AS LONG
    MEMBER dy AS LONG
    MEMBER mouseData AS DWORD
    MEMBER dwFlags AS DWORD
    MEMBER time AS DWORD
    MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR ????

DEFINE INPUT_MOUSE := 0 // The event IS a mouse event. Use the mi STRUCTURE
OF the UNION.
DEFINE INPUT_KEYBOARD := 1  // The event IS a keyboard event. Use the ki
STRUCTURE OF the UNION.
DEFINE INPUT_HARDWARE := 2   // The event is a hardware event. Use the hi
structure of the union.


_DLL FUNCTION SendInput ( nInputs AS DWORD , pInputs AS _winINPUT  , cbSize
AS INT ) AS DWORD PASCAL:User32.SendInput

-----------------------------------

about the dwExtraInfo member i´m not sure if it´s correct, but at least this
sample works for me. It opens here a Submenu via <Alt> + <L>. Without using
the UNION SendInPut() fails with the errorcode  87 ->
ERROR_INVALID_PARAMETER

----------------------

FUNCTION TestKeyboardSendInPut() AS VOID
LOCAL ip IS _winINPUT
LOCAL dwError AS DWORD


    ip.type := INPUT_KEYBOARD
    ip.Input.ki.wScan := 0
    ip.Input.ki.time := 0
    ip.Input.ki.dwExtraInfo := 0

    //  -----------------------

    // Press "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := 0  // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Press "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ))
    ip.Input.ki.dwFlags := 0 // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

     // Release the "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ) )
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Release the "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    IF SendInput(1, @ip, _SIZEOF( _winINPUT)) == 0

       dwError := GetLastError()

    MsgInfo ( NTrim ( dwError )  + crlf + ErrString ( dwError ) )

    ENDIF

    RETURN

---------------

regards
Karl-Heinz 

[toc] | [prev] | [next] | [standalone]


#11791

From"Jamal" <noooospam@example.com>
Date2018-07-31 15:00 -0400
Message-ID<pjqbk8$tip$1@news.albasani.net>
In reply to#11790
>> about the dwExtraInfo member i´m not sure if it´s correct <<

ULONG_PTR  is defined as DWORD_PTR, so:

Maybe:  MEMBER dwExtraInfo as DWORD PTR

Source: 
https://docs.microsoft.com/en-us/windows/desktop/winprog/windows-data-types

Jamal

"Karl-Heinz"  wrote in message news:fsb90iFovieU1@mid.individual.net...

Hi Gerhard,

> for a phone dial by our app, we have to do a keyboard simulation.
> Therefor I found the WIN32 function SendInput(). Has somebody a sample
> with VO to do this?

it seems that it´s neccesarry to create a UNION. Here´s what i did so far:

UNION _UnionSendInput
   MEMBER mi IS _WINMOUSEINPUT
   MEMBER ki IS _winKEYBDINPUT
   MEMBER hi IS _winHARDWAREINPUT

STRUCTURE _winINPUT
  MEMBER type AS DWORD
  MEMBER Input IS _UnionSendInput  //  <-------

/*
  MEMBER mi IS  _WINMOUSEINPUT
  MEMBER ki IS _winKEYBDINPUT
  MEMBER hi IS _winHARDWAREINPUT
*/

STRUCTURE _winHARDWAREINPUT
   MEMBER uMsg AS DWORD
   MEMBER wParamL AS WORD
   MEMBER wParamH AS WORD

STRUCTURE  _winKEYBDINPUT
   MEMBER wVk AS WORD
   MEMBER wScan AS WORD
   MEMBER dwFlags AS DWORD
   MEMBER time AS DWORD
   MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR  ???

STRUCTURE _WINMOUSEINPUT
    MEMBER dx AS LONG
    MEMBER dy AS LONG
    MEMBER mouseData AS DWORD
    MEMBER dwFlags AS DWORD
    MEMBER time AS DWORD
    MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR ????

DEFINE INPUT_MOUSE := 0 // The event IS a mouse event. Use the mi STRUCTURE
OF the UNION.
DEFINE INPUT_KEYBOARD := 1  // The event IS a keyboard event. Use the ki
STRUCTURE OF the UNION.
DEFINE INPUT_HARDWARE := 2   // The event is a hardware event. Use the hi
structure of the union.


_DLL FUNCTION SendInput ( nInputs AS DWORD , pInputs AS _winINPUT  , cbSize
AS INT ) AS DWORD PASCAL:User32.SendInput

-----------------------------------

about the dwExtraInfo member i´m not sure if it´s correct, but at least this
sample works for me. It opens here a Submenu via <Alt> + <L>. Without using
the UNION SendInPut() fails with the errorcode  87 ->
ERROR_INVALID_PARAMETER

----------------------

FUNCTION TestKeyboardSendInPut() AS VOID
LOCAL ip IS _winINPUT
LOCAL dwError AS DWORD


    ip.type := INPUT_KEYBOARD
    ip.Input.ki.wScan := 0
    ip.Input.ki.time := 0
    ip.Input.ki.dwExtraInfo := 0

    //  -----------------------

    // Press "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := 0  // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Press "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ))
    ip.Input.ki.dwFlags := 0 // 0 for key press
    SendInput(1, @ip, _SIZEOF( _winINPUT))

     // Release the "L" key
    ip.Input.ki.wVk := WORD ( Asc ( "L" ) )
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    SendInput(1, @ip, _SIZEOF( _winINPUT))

    // Release the "Alt" key
    ip.Input.ki.wVk := VK_MENU
    ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
    IF SendInput(1, @ip, _SIZEOF( _winINPUT)) == 0

       dwError := GetLastError()

    MsgInfo ( NTrim ( dwError )  + crlf + ErrString ( dwError ) )

    ENDIF

    RETURN

---------------

regards
Karl-Heinz 

[toc] | [prev] | [next] | [standalone]


#11792

FromGerhard Bunzel <g.bunzel@domonet.de>
Date2018-08-02 09:00 +0200
Message-ID<pjua73$voa$1@news-1.m-online.net>
In reply to#11790
Hi Karl-Heinz,

...thanks for that sample - works perfect.

Thaks again.

Best regards

Gerhard


Am 31.07.2018 um 16:11 schrieb Karl-Heinz:
> Hi Gerhard,
> 
>> for a phone dial by our app, we have to do a keyboard simulation.
>> Therefor I found the WIN32 function SendInput(). Has somebody a sample
>> with VO to do this?
> 
> it seems that it´s neccesarry to create a UNION. Here´s what i did so far:
> 
> UNION _UnionSendInput
>    MEMBER mi IS _WINMOUSEINPUT
>    MEMBER ki IS _winKEYBDINPUT
>    MEMBER hi IS _winHARDWAREINPUT
> 
> STRUCTURE _winINPUT
>   MEMBER type AS DWORD
>   MEMBER Input IS _UnionSendInput  //  <-------
> 
> /*
>   MEMBER mi IS  _WINMOUSEINPUT
>   MEMBER ki IS _winKEYBDINPUT
>   MEMBER hi IS _winHARDWAREINPUT
> */
> 
> STRUCTURE _winHARDWAREINPUT
>    MEMBER uMsg AS DWORD
>    MEMBER wParamL AS WORD
>    MEMBER wParamH AS WORD
> 
> STRUCTURE  _winKEYBDINPUT
>    MEMBER wVk AS WORD
>    MEMBER wScan AS WORD
>    MEMBER dwFlags AS DWORD
>    MEMBER time AS DWORD
>    MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR  ???
> 
> STRUCTURE _WINMOUSEINPUT
>     MEMBER dx AS LONG
>     MEMBER dy AS LONG
>     MEMBER mouseData AS DWORD
>     MEMBER dwFlags AS DWORD
>     MEMBER time AS DWORD
>     MEMBER dwExtraInfo AS _WINULARGE_INTEGER // ULONG_PTR ????
> 
> DEFINE INPUT_MOUSE := 0 // The event IS a mouse event. Use the mi STRUCTURE
> OF the UNION.
> DEFINE INPUT_KEYBOARD := 1  // The event IS a keyboard event. Use the ki
> STRUCTURE OF the UNION.
> DEFINE INPUT_HARDWARE := 2   // The event is a hardware event. Use the hi
> structure of the union.
> 
> 
> _DLL FUNCTION SendInput ( nInputs AS DWORD , pInputs AS _winINPUT  , cbSize
> AS INT ) AS DWORD PASCAL:User32.SendInput
> 
> -----------------------------------
> 
> about the dwExtraInfo member i´m not sure if it´s correct, but at least 
> this
> sample works for me. It opens here a Submenu via <Alt> + <L>. Without using
> the UNION SendInPut() fails with the errorcode  87 ->
> ERROR_INVALID_PARAMETER
> 
> ----------------------
> 
> FUNCTION TestKeyboardSendInPut() AS VOID
> LOCAL ip IS _winINPUT
> LOCAL dwError AS DWORD
> 
> 
>     ip.type := INPUT_KEYBOARD
>     ip.Input.ki.wScan := 0
>     ip.Input.ki.time := 0
>     ip.Input.ki.dwExtraInfo := 0
> 
>     //  -----------------------
> 
>     // Press "Alt" key
>     ip.Input.ki.wVk := VK_MENU
>     ip.Input.ki.dwFlags := 0  // 0 for key press
>     SendInput(1, @ip, _SIZEOF( _winINPUT))
> 
>     // Press "L" key
>     ip.Input.ki.wVk := WORD ( Asc ( "L" ))
>     ip.Input.ki.dwFlags := 0 // 0 for key press
>     SendInput(1, @ip, _SIZEOF( _winINPUT))
> 
>      // Release the "L" key
>     ip.Input.ki.wVk := WORD ( Asc ( "L" ) )
>     ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
>     SendInput(1, @ip, _SIZEOF( _winINPUT))
> 
>     // Release the "Alt" key
>     ip.Input.ki.wVk := VK_MENU
>     ip.Input.ki.dwFlags := KEYEVENTF_KEYUP
>     IF SendInput(1, @ip, _SIZEOF( _winINPUT)) == 0
> 
>        dwError := GetLastError()
> 
>     MsgInfo ( NTrim ( dwError )  + crlf + ErrString ( dwError ) )
> 
>     ENDIF
> 
>     RETURN
> 
> ---------------
> 
> regards
> Karl-Heinz

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web