Home All Groups Group Topic Archive Search About
Author
29 Jan 2009 7:23 PM
Karl E. Peterson
Is there anyone out there who wants to use Unicode characters with the SendInput
function?  I had someone ask me recently if I could update my SendKeys replacement
sample (http://vb.mvps.org/samples/SendInput) such that they could also send Unicode
characters with it.  I tweaked it a bit, and she reported it was now working for
her, but I'm not sure it was a most-representative user doing the testing.  I have
no need (or interest) in using that functionality myself, so I'm not sure if my
assumptions were good for others.  Anyone wanna have a crack at it?
--
..NET: It's About Trust!
http://vfred.mvps.org

Author
21 Feb 2009 7:04 AM
Tony
Show quote Hide quote
"Karl E. Peterson" wrote:

> Is there anyone out there who wants to use Unicode characters with the SendInput
> function?  I had someone ask me recently if I could update my SendKeys replacement
> sample (http://vb.mvps.org/samples/SendInput) such that they could also send Unicode
> characters with it.  I tweaked it a bit, and she reported it was now working for
> her, but I'm not sure it was a most-representative user doing the testing.  I have
> no need (or interest) in using that functionality myself, so I'm not sure if my
> assumptions were good for others.  Anyone wanna have a crack at it?
> --
> ..NET: It's About Trust!
http://vfred.mvps.org
>
>
>

Does anyone know why apps running in a DOS window will ignore SendInput with
KEYEVENTF_UNICODE?
I can send chars to the DOS prompt, but if I start "edit", all chars are
ignored.

Thanks for any help,

Tony
Author
21 Feb 2009 12:33 PM
Thorsten Albers
Tony <T***@discussions.microsoft.com> schrieb im Beitrag
<E7B49C75-502A-48E1-89E5-A8A0AD186***@microsoft.com>...
> Does anyone know why apps running in a DOS window will ignore SendInput
with
> KEYEVENTF_UNICODE?
> I can send chars to the DOS prompt, but if I start "edit", all chars are
> ignored.

Before sending the key input to a window check by a call to
IsWindowUnicode(), if the window is Unicode enabled at all. If it is not,
it will not handle Unicode input and messages in any case. If it is, it
might be possible that it supports Unicode input and messages.

--
Thorsten Albers

albers (a) uni-freiburg.de
Author
22 Feb 2009 12:01 AM
Tony
Show quote Hide quote
"Thorsten Albers" wrote:

> Tony <T***@discussions.microsoft.com> schrieb im Beitrag
> <E7B49C75-502A-48E1-89E5-A8A0AD186***@microsoft.com>...
> > Does anyone know why apps running in a DOS window will ignore SendInput
> with
> > KEYEVENTF_UNICODE?
> > I can send chars to the DOS prompt, but if I start "edit", all chars are
> > ignored.
>
> Before sending the key input to a window check by a call to
> IsWindowUnicode(), if the window is Unicode enabled at all. If it is not,
> it will not handle Unicode input and messages in any case. If it is, it
> might be possible that it supports Unicode input and messages.
>
> --
> Thorsten Albers
>
> albers (a) uni-freiburg.de
>
>

Thanks for the quick reply.
The window in question is the Command Prompt on XP. It does return TRUE to
IsWindowUnicode, and it works fine. The problem is launching an app within
the Command Prompt window, like "edit".
Once "edit" is running, all keystrokes are ignored.

Does anyone know why?
Author
22 Feb 2009 1:04 PM
Thorsten Albers
Tony <T***@discussions.microsoft.com> schrieb im Beitrag
<57BF5ECF-9ECB-4E6B-94D6-89FB52DCA***@microsoft.com>...
> The window in question is the Command Prompt on XP. It does return TRUE
to
> IsWindowUnicode, and it works fine. The problem is launching an app
within
> the Command Prompt window, like "edit".
> Once "edit" is running, all keystrokes are ignored.
> Does anyone know why?

Presumably because 'Edit' is not Unicode-enabled? Try to load a Unicode
text in edit and see what happens.

--
Thorsten Albers

albers (a) uni-freiburg.de