Re: Sending keystrokes to the another application



You should be using the standard interface for a SIP rather than an
application to take advantage of the interface specifically designed to do
what you're trying to do.

-Chris


"me" <me@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:77CB145B-C1D8-42E1-91E4-65D8870479C5@xxxxxxxxxxxxxxxx
> Hi Paul,
>
> I don't quite understand. When I press a button from my keyboard
> application
> then the keyboard application have a focus and it sends character to
> itself.
> How I set a focus or what ever it is to another application? Where could I
> find sample code about using PostKeybdMessage? I tried one below but evc++
> get errors...
>
>
> UINT flag = KeyStateDownFlag;
> UINT char = _T( 'ü' );
>
> PostKeybdMessage( (HWND)-1, 0, flag, 1, &flag, &char );
>
> error C2065: 'KeyStateDownFlag' : undeclared identifier
> error C2628: 'UINT' followed by 'char' is illegal (did you forget a ';'?)
> error C2513: 'unsigned int' : no variable declared before '='
> error C2062: type 'char' unexpected
>
>
> Thanks!
>
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> You don't get to pick who gets the characters, in most cases; the user
>> does
>> that. You can use PostKeybdMessage() and/or keybd_event() to send key
>> data.
>> Usually you want to just send it to whatever the currently focused window
>> is, not to a specific window (that's inconsistent with how the user
>> interface works), and that's very easy with either function.
>>
>> Paul T.
>>
>> "me" <me@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:C21DDC88-D0F0-4201-83B4-F782BD87D580@xxxxxxxxxxxxxxxx
>> > Hi!
>> >
>> > I need to create custom keyboard for Windows CE. I'm using SendInput
>> > method
>> > for sending chars. When I press my button the keyboard application is
>> > focused. How can I set application that should receive chars focused?
>> > The
>> > application that receives data could be Word, Excel, Internet Explorer
>> > ect.
>> > Is there any sample code about this?
>>
>>
>>


.