Hi,

I have an app that have numerous pages. These 'pages' are controls with
controls in them (only one page is visible at any one time). When I tap on
the Back Key (emulator), it minimizes the app. I tried adding KeyPress in
the main form, I also tried adding KeyPress in the page's main control,
neither see the ESC key. If for example, the focus is a listview and the
user presses the Back key, who gets 'told' and what do they get told? Do I
need to add a KeyPress to ListView and all other controls I use? Is there
an easier way?

I have searched the web, but all I have found is "Add KeyPress to the Form".

Thanks!

Hilton

Re: Smartphone: Back key by Fabien

Fabien
Mon Nov 06 14:15:20 CST 2006

Hi,

Check out this functions : UnregisterHotKey/RegisterHotKey.

BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/





Hilton a =E9crit :

> Hi,
>
> I have an app that have numerous pages. These 'pages' are controls with
> controls in them (only one page is visible at any one time). When I tap =
on
> the Back Key (emulator), it minimizes the app. I tried adding KeyPress in
> the main form, I also tried adding KeyPress in the page's main control,
> neither see the ESC key. If for example, the focus is a listview and the
> user presses the Back key, who gets 'told' and what do they get told? Do=
I
> need to add a KeyPress to ListView and all other controls I use? Is there
> an easier way?
>
> I have searched the web, but all I have found is "Add KeyPress to the For=
m".
>=20
> Thanks!
>=20
> Hilton


Re: Smartphone: Back key by robf

robf
Mon Nov 06 14:38:03 CST 2006

Try looking at this:

http://msdn2.microsoft.com/en-us/library/ms172543(VS.80).aspx

Rob

Hilton wrote:
> Hi,
>
> I have an app that have numerous pages. These 'pages' are controls with
> controls in them (only one page is visible at any one time). When I tap on
> the Back Key (emulator), it minimizes the app. I tried adding KeyPress in
> the main form, I also tried adding KeyPress in the page's main control,
> neither see the ESC key. If for example, the focus is a listview and the
> user presses the Back key, who gets 'told' and what do they get told? Do I
> need to add a KeyPress to ListView and all other controls I use? Is there
> an easier way?
>
> I have searched the web, but all I have found is "Add KeyPress to the Form".
>
> Thanks!
>
> Hilton


Re: Smartphone: Back key by Hilton

Hilton
Mon Nov 06 14:52:01 CST 2006

Fabien,

I (once) tried the functions you mention, but even when my app was
minimized, it was still grabbing the keystrokes. Should I have registered
with Activated and Unregistered with Deactivated? (I ran out of time to try
this).

Thanks!

Hilton

"Fabien" <fab_00_2002@msn.com> wrote in message
news:1162844120.286318.108820@k70g2000cwa.googlegroups.com...
Hi,

Check out this functions : UnregisterHotKey/RegisterHotKey.

BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/





Hilton a écrit :

> Hi,
>
> I have an app that have numerous pages. These 'pages' are controls with
> controls in them (only one page is visible at any one time). When I tap
> on
> the Back Key (emulator), it minimizes the app. I tried adding KeyPress in
> the main form, I also tried adding KeyPress in the page's main control,
> neither see the ESC key. If for example, the focus is a listview and the
> user presses the Back key, who gets 'told' and what do they get told? Do
> I
> need to add a KeyPress to ListView and all other controls I use? Is there
> an easier way?
>
> I have searched the web, but all I have found is "Add KeyPress to the
> Form".
>
> Thanks!
>
> Hilton



Re: Smartphone: Back key by Hilton

Hilton
Mon Nov 06 14:53:19 CST 2006

Rob,

This is the article to which I was referring. It says put KeyPress in the
form code, but my initial tests show that the form never receives a
keypress - which makes sense wince another control had the focus.

Hilton


<robf@mageware.com> wrote in message
news:1162845483.618512.187710@h54g2000cwb.googlegroups.com...
> Try looking at this:
>
> http://msdn2.microsoft.com/en-us/library/ms172543(VS.80).aspx
>
> Rob
>
> Hilton wrote:
>> Hi,
>>
>> I have an app that have numerous pages. These 'pages' are controls with
>> controls in them (only one page is visible at any one time). When I tap
>> on
>> the Back Key (emulator), it minimizes the app. I tried adding KeyPress
>> in
>> the main form, I also tried adding KeyPress in the page's main control,
>> neither see the ESC key. If for example, the focus is a listview and the
>> user presses the Back key, who gets 'told' and what do they get told? Do
>> I
>> need to add a KeyPress to ListView and all other controls I use? Is
>> there
>> an easier way?
>>
>> I have searched the web, but all I have found is "Add KeyPress to the
>> Form".
>>
>> Thanks!
>>
>> Hilton
>



Re: Smartphone: Back key by LiYin

LiYin
Mon Nov 06 19:30:09 CST 2006

I scratched two section codes of mine , maybe will help you:

Step 1(add after MenuBar have been created):
HWND hMenuBar = ::SHFindMenuBar( GetSafeHwnd() );
if ( hMenuBar )
{
::SendMessage( hMenuBar , SHCMBM_OVERRIDEKEY , VK_TBACK , MAKELPARAM(
SHMBOF_NOTIFY | SHMBOF_NODEFAULT, SHMBOF_NOTIFY | SHMBOF_NODEFAULT ) );
// Save the Handle of Menu [ 9:55 10/30/2006 LiYin]
m_hMenu = (HMENU) ::SendMessage( hMenuBar, SHCMBM_GETMENU, 0, 0);
}

Step2: (Catch the back key message)
// Catch the WM_HOTKEY message [ 16:19 10/26/2006 LiYin]
if ( message == WM_HOTKEY )
{
if ( HIWORD( lParam ) == VK_TBACK )
{
SHSendBackToFocusWindow( message , wParam , lParam );
return TRUE;
}
}


"Hilton" <nospam@nospam.com> wrote in message
news:9bL3h.2177$vP1.481@newssvr13.news.prodigy.com...
> Hi,
>
> I have an app that have numerous pages. These 'pages' are controls with
> controls in them (only one page is visible at any one time). When I tap
> on the Back Key (emulator), it minimizes the app. I tried adding KeyPress
> in the main form, I also tried adding KeyPress in the page's main control,
> neither see the ESC key. If for example, the focus is a listview and the
> user presses the Back key, who gets 'told' and what do they get told? Do
> I need to add a KeyPress to ListView and all other controls I use? Is
> there an easier way?
>
> I have searched the web, but all I have found is "Add KeyPress to the
> Form".
>
> Thanks!
>
> Hilton
>
>
>