Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
End Users
Pocket PCActiveSyncMultimediaEBooksWirelessSmartPhones
Developers
Windows MobileSmartPhonesWinCE ProgrammingVB for WinCEVC++ for WinCEPlatform BuilderTest Tools
PocketPC DirectoryFree SoftwareWeb Resources
Related Topics
PalmMobile PhonesMore Topics ...

Pocket PC Forum / Developers / VC++ for WinCE / July 2008

Tip: Looking for answers? Try searching our database.

How to prevent the back key from closing my app

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CodeTestDummy - 10 Jul 2008 20:50 GMT
All,

I am writing an app using VS 2008 for my phone that has Win Mobile 6.1 I
think.  How could I prevent the back key from closing my app?  Thanks in
advance.
Christopher Fairbairn [MVP] - 10 Jul 2008 23:12 GMT
Hi,

> I am writing an app using VS 2008 for my phone that has Win Mobile 6.1 I
> think.  How could I prevent the back key from closing my app?  Thanks in
> advance.

You don't mention which language or framework you are using.

The Navigation Keys section of the Windows Mobile Smartphone documentation
(http://msdn.microsoft.com/en-us/library/ms832342.aspx) has two pages
dealing with how to deal with the Back key if you don't want the default
behaviour (see the See Also section at the bottom). The key is to send the
SHCMBM_OVERRIDEKEY window message to your dialog's menubar.

If you are a .NET Compact Framework developer the "How To: Override the
Smartphone Back Key" article available on MSDN at
http://msdn.microsoft.com/en-us/library/ms172543.aspx may be helpful

It may have been better to post this question to the
microsoft.public.smartphone.developer newsgroup.

Hope this helps,
Christopher Fairbairn
CodeTestDummy - 11 Jul 2008 03:16 GMT
I am using VC++.

> Hi,
>
[quoted text clipped - 19 lines]
> Hope this helps,
> Christopher Fairbairn
vishal.g.shah@gmail.com - 11 Jul 2008 16:10 GMT
u can try using pretranslate message..
add PreTranslateMessage and capture Back button pressed it will
override default back button handler..

BOOL CXYZAppDlg::PreTranslateMessage(MSG* pMsg)
{

       if(pMsg->message==WM_KEYDOWN)
       {
               switch(pMsg->wParam)
               {
               //
               // capture your back button here
               }
               pMsg->message = 0;
       }

       return CDialog::PreTranslateMessage(pMsg);

}
On Jul 11, 7:16 am, "CodeTestDummy"
<sharp_mind.TAKETHIS...@email.TAKETHISOUT.msn.comm> wrote:
> I am using VC++.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.