Re: Trap red/green phone button..

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In C++, i have used

RegisterHotKey(hWnd, 115, 0, 115);

i don't have MOD_NONE.......so i have used 0....but don't work.


"Peter Foot [MVP]" wrote:

You should use KeyModifiers.None for the phone keys. Also note that you
can't use this method to trap the phone keys on Smartphone, only on Pocket
PC Phone Edition.

Peter

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"Azzi Stefano" <AzziStefano@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:77B51A08-B1B0-4BEB-8CD8-BB0A36D23D6F@xxxxxxxxxxxxxxxx
Hi everyone, this is my problem:
I need to trap RED and GREEN phone button press and in C# i have solved
whit
this:

public enum KeyModifiers : int
{
None = 0,
Alt = 1,
Control = 2,
Shift = 4,
Windows = 8,
ModKeyUp = 0x1000
}

public enum KeysHardware : int
{
RedPhoneButton = 0x73,
GreenPhoneButton = 0x72
}

[DllImport("coredll.dll")]
private static extern bool RegisterHotKey(IntPtr hWnd, int id,
KeyModifier modifiers, int key);


RegisterHotKey(hWnd, KeysHardware.RedPhoneButton, KeyModifiers.None,
KeysHardware.RedPhoneButton);

...

In C# i trap key press on my form with a MessageWindows event and this
work
fine, but in C++ this don't work...

RegisterHotKey(hWnd, 115, 0, 115);
i put 0 in UINT fsModifiers parameter but don't work...i have further
tested
whit
MOD_WIN, MOD_KEYUP, MOD_CONTROL....but don't work...

Can help me?
Thanks in advance..

--Ste







.



Relevant Pages

  • [PATCH 4/8] Notifier chain update: die_chain changes
    ... int signr; ... Trap & Exception support ...
    (Linux-Kernel)
  • Re: Random integer formula?
    ... >> I ran it from the Immediate window using ... numbers without having to worry about whether to use Int() or Fix. ... >point you got the trap you could see exactly what Rndhad produced, ... but I usually break them ...
    (microsoft.public.vb.general.discussion)
  • Re: Annoying compiler warning
    ... C89 says: "The representations of integral types shall define ... a trap value. ... int type. ...
    (comp.lang.c)
  • Re: struct assignment and indeterminate values
    ... struct {int a, b;} x, y; ... representation, even though the value of a member of the structure ... or union may be a trap representation". ... That looks as though, after the assignment, no undefined behavior has occurred, ...
    (comp.lang.c)
  • Re: Trap red/green phone button..
    ... You should use KeyModifiers.None for the phone keys. ... can't use this method to trap the phone keys on Smartphone, ... public enum KeyModifiers: int ...
    (microsoft.public.dotnet.framework.compactframework)