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

Tech-Archive recommends: Speed Up your PC by fixing your registry



H Paul Ive been messing around witthis some more and I see what you mean
about not being able to re register the phone apps and softkeys. Have you
been able to find the key codesfor the volume control and windows control on
the HTC's. If so Id much appreciate you passing them along.


i seem to be able to unregister the presses without a problem but im not
able to associate the buttons with my app. is there an issue with the way i
calling register hotkey?


<DllImport("coredll.dll", SetLastError:=True)> _
Public Shared Function UnRegisterHotKey(ByVal Handle As
IntPtr, ByVal id As Integer) As Boolean
End Function

RegisterHotKey(Me.Handle, 0, 0, 112)


' am i correct i saying that the above call should associate the left
SoftKey with my app?



"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



.


Quantcast