Re: User input to native application
- From: "Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 19:59:20 -0800
good point, I don't know if all the necessary UM services are running yet.
I know you can enumerate the interfaces in KM at this time though, so the
info is somewhere in the system ;)
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jeremy Boschen" <jboschen[at]mutexed[dot]com> wrote in message
news:urr3QXxEHHA.1748@xxxxxxxxxxxxxxxxxxxxxxx
Can you do this in a native app with the SetupDiXxx functions?
- Jeremy Boschen
"Doron Holan [MS]" <doronh@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:eS%23$1irEHHA.4464@xxxxxxxxxxxxxxxxxxxxxxx
do not use the hardcoded names \Device\KeyboardClassX ... there may be
holes in the namespace. Instead, enumerate the keyboard device interface
GUID_DEVINTERFACE_KEYBOARD and open each instance reported.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Jeremy B" <jeremyb@xxxxxxxxxxx> wrote in message
news:ui6$7RnEHHA.5028@xxxxxxxxxxxxxxxxxxxxxxx
There are some issues with doing this, but for what you want it's fine I
think. Basically you can't be sure there will even be a keyboard
attached, so requiring input may be impossible.
In a nutshell...
1) Open \\Device\\KeyboardClassX where X=0-?, via NtCreateFile. Open
either the first or all until it fails
2) Create an event to wait on, for each device opened
3) Read from each device via NtReadFile with KEYBOARD_INPUT_DATA as your
input buffer
4) If the read is pending, wait on the events or for a timeout. To get
the progress you'll have to wait in intervals and post output to the
screen.
There are some examples floating around on the web.
- Jeremy Boschen
"Mickey Lane" <none@xxxxxxxx> wrote in message
news:eE8yGijEHHA.4680@xxxxxxxxxxxxxxxxxxxxxxx
Hi Don,
The app is built and invoked in the same manner as chkdsk.
I want to provide an option in test & debug situations where the user
can say "Skip this for now" by allowing 10 seconds for them to hit
any key.
In normal situations, the program would do its thing. ('Normal' in this
case is - like chkdsk - not very often.)
Mickey.
"Don Burn" <burn@xxxxxxxxxxxxxxxx> wrote in message
news:%23bhobRjEHHA.3396@xxxxxxxxxxxxxxxxxxxxxxx
I will give you the standard warning here, don't expect a user to be
present, so rather than "Strike any key to abort" unless you really are
benign it should be strike any key to proceed, and of course have a
timeout to allow the boot to proceed anyway.
Are you asking about forcing the display and input, or are you asking
about writing a native application?
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
"Mickey Lane" <none@xxxxxxxx> wrote in message
news:ORYdmHjEHHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
I need to update a native application (runs pre-boot like chkdsk) with
something that lets the user 'strike any key to abort...'
Any clues on keywords I can use to search for something on this?
Other hints?
Thanks,
Mickey.
.
- References:
- Re: User input to native application
- From: Jeremy Boschen
- Re: User input to native application
- Prev by Date: Re: Is it possible to trap system wide WM_SYSCOMMAND notifications
- Next by Date: Re: 1394 Isochronous Transfer! - Tim Roberts
- Previous by thread: Re: User input to native application
- Next by thread: Re: 1394 Isochronous Transfer! - Tim Roberts
- Index(es):
Relevant Pages
|