Re: Sending Keystrokes
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Fri, 19 Oct 2007 13:51:56 -0700
Control keys are problematic with PostKeybdMessage. keybd_event works much
better for that sort of key.
Paul T.
"dbgrick" <dbgrick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2E1B1E39-0C76-4FEF-AAB6-0A069E5AF310@xxxxxxxxxxxxxxxx
Here is the Pinvoke.net reference:
http://pinvoke.net/default.aspx/coredll.PostKeybdMessage
Regards,
Rick D.
Contractor
"dbgrick" wrote:
You can P\Invoke the follwoing method PostKeybdMessage. Here is the
pertinent web page:
http://msdn2.microsoft.com/en-us/library/ms910657.aspx
I Hope this helps.
Regards,
Rick D.
Contractor
"Arthur Dent" wrote:
Hello all...
I am trying to send keystrokes to an application. The application is
irrelevant. My software resides on a Symbol unit with a mag-stripe
reader.
What we want is for the user to be able to configure a prefix and
suffix, so
that when they swipe a card, it will read the card, prepend/append the
prefix and suffix and then just forward on all that string data to the
currently active window. The BIGGEST point of this, is control
characters,
so that the user can set a suffix of TAB + ENTER, such that when a card
is
swiped, it will put the read data into a text field, then automatically
tab
to the next control (a button) and press enter, thereby submitting a
form.
(this other application is some 3rd party 'ware we have no access to
change).
Everything works fine, except for the control characters. They work
kind of,
but not the way we need... if i have open a wordpad or notepad type
app, it
will insert the TAB and CR into the document as you would expect. But
in a
form, the tab character doesn't advance controls (it just beeps) and
the
enter key the same, it doesnt actually press a button (even if i put
the
focus on the button first), again, it just beeps.
I am using the SendKeys code from OpenNETCF.org, I have tried sending
the
keys using the escape words as in the code ("{TAB}" and "{ENTER}") and
i've
tried actually just embedding Chr(9) and Chr(13) in the text string
being
processed. But neither works.
Please help, i Have to be able to send control keystrokes to the
focused
form.
Thanks in advance,
Arthur Dent.
.
- References:
- Sending Keystrokes
- From: Arthur Dent
- Sending Keystrokes
- Prev by Date: Re: How to disable screen saver/auto power off in Compact Framework (C#)
- Next by Date: Re: Q: Masking a TextBox
- Previous by thread: Re: Sending Keystrokes
- Next by thread: Q: Masking a TextBox
- Index(es):
Relevant Pages
|