Re: Catch (OEM Hardware) PocketPC Phone/Volume Press



Hello Paul,

Thank you for your input. I had just recently read something about
RegisterHotKey in another area and it looks like that is the way im going to
need to go. One thing I would like to note was that they(the other poster)
remarked the phone process(maybe cprog.exe i cant remember exactly) must be
killed before the register will take effect(Did you run into this type of
issue?). I wonder if this process(cprog...) starts up again and the key isnt
registered so the same problem with registering while its running happens
again? maybe that it needs to be killed again to reinstantiate the
RegisterHotKey for it and not the custom app.

Thanks again for your input. Im going to start reading about RegisterHotKey
and GAPI too, just in case. Ill post here if i come up with an workable
solution to my problem

Thanks
DrewG

"Paul Kay" wrote:

A search for the coredll.dll API call RegisterHotKey in this group and the
compactframework group should set you on your way.

I have been working on a similar schema for the last few days, and can tell
you that although you can get full control over the (upto) 6 hardware keys
and the additional Phone Answer and End Buttons, the Volume toggle and the 2
new (WM5>) Softkeys by registering them to the current application, no one
seems to have found a method to Unregister the Phone etc keys so that they
once again perform as previously. The (upto) 6 'standard' hardware keys do
no exhibit the same problem however.

Whether the problem with the Phone Edition keys is OEM specific or general
with the Phone Edition OS, I haven't yet investigated, I have only been
testing with various HTC devices and derivatives.

I have gleaned from past posts that it is possible to gain and re-instate
control over the Phone Edition specific buttons by using GAPI (bizarrely,
though I guess the MS games team had more time and desire to get full
control of all the available buttons!) I haven't had time to test this
myself yet, as the RegisterHotKey approach has given me all I need at the
moment.

Paul Kay



"werD" <werD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B7A5AE55-C25F-4472-A2D0-4F4301C1C159@xxxxxxxxxxxxxxxx

Hello im working on a locking application (similar to certain oems built
in
tool) for windows mobile 5/compact framework

When running, Im able to trap the screen/keyboard input and all 6 hardware
buttons, but if i click the phone buttons or volume button the app loses
focus and i have a half useless device. This is a HTC Wizard

Here's the code im using to trap the hardware buttons but i cant seem to
find where the phone/volume buttons are accessed.


Dim hk As HardwareKeys = HardwareKeys.ApplicationKey1
Dim i As Integer = 0
While i <= 6
Try
Dim hwb As HardwareButton = New HardwareButton
hwb.AssociatedControl = Me
hwb.HardwareKey = hk + i

Catch ex As Exception

Me.Label1.Text &= ex.Message
End Try
i += 1

End While
Dim regkey As RegistryKey =
Registry.LocalMachine.OpenSubKey("Software\Microsoft\Shell\Keys", True)

Me.Label1.Text = regkey.SubKeyCount
For Each skey As String In regkey.GetSubKeyNames
Me.Label1.Text &= skey.ToString & " , "
Next
regkey.Close()


I would greatly appreciate any advice on this



.