diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-05-07 12:54:05 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-05-07 13:00:30 (GMT) |
commit | 12348ea833bf731a0a977cd201d6804c6f3af221 (patch) | |
tree | 9f1ee1acf86a8cea1a365c02640ebf2636ac5cf7 /src/gui/widgets/qmenu_wince.cpp | |
parent | f2fc8979cbeb732fe4799ec43d6d376aba0a87c9 (diff) | |
download | Qt-12348ea833bf731a0a977cd201d6804c6f3af221.zip Qt-12348ea833bf731a0a977cd201d6804c6f3af221.tar.gz Qt-12348ea833bf731a0a977cd201d6804c6f3af221.tar.bz2 |
handle the back soft key on Windows mobile SmartPhones
We must tell the system that we want to intercept the back key on
Windows mobile. Each toplevel widget that needs correct back key
behaviour needs to have a menu bar. Why? Ask Microsoft...
Task-number: 248846
Reviewed-by: thartman
Diffstat (limited to 'src/gui/widgets/qmenu_wince.cpp')
-rw-r--r-- | src/gui/widgets/qmenu_wince.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index ea58d46..847a623 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -58,6 +58,9 @@ #include <QtCore/qlibrary.h> #include <commctrl.h> +#if Q_OS_WINCE_WM +# include <windowsm.h> +#endif #include "qguifunctions_wince.h" @@ -71,6 +74,12 @@ #define SHCMBM_GETSUBMENU (WM_USER + 401) #endif +#ifdef Q_OS_WINCE_WM +# define SHMBOF_NODEFAULT 0x00000001 +# define SHMBOF_NOTIFY 0x00000002 +# define SHCMBM_OVERRIDEKEY (WM_USER + 0x193) +#endif + extern bool qt_wince_is_smartphone();//defined in qguifunctions_wce.cpp extern bool qt_wince_is_pocket_pc(); //defined in qguifunctions_wce.cpp @@ -204,8 +213,13 @@ static HWND qt_wce_create_menubar(HWND parentHandle, HINSTANCE resourceHandle, i mbi.dwFlags = flags; mbi.nToolBarId = toolbarID; - if (ptrCreateMenuBar(&mbi)) + if (ptrCreateMenuBar(&mbi)) { + // Tell the menu bar that we want to override hot key behaviour. + LPARAM lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, + SHMBOF_NODEFAULT | SHMBOF_NOTIFY); + SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam); return mbi.hwndMB; + } } return 0; } |