Rewrite the back health behavior on Windows Mobile Platform

Source: Internet
Author: User

This back key is very strange. If it is not processed by default, even if there is an edit control in the current dialog, it still does not act as a back-to-delete key, or closes the current dialog box, roll back to the previous one. The solution is also simple. When you press back, the OS will throw a wm_hotkey message. We can capture this message and rewrite the back key behavior.

CodeAs follows:

When oninitdialog, shcmbm_overridekey is sent to override vk_back.

Hwnd hwndmenubar = shfindmenubar (m_hwnd );
Sendmessage (hwndmenubar, shcmbm_overridekey, vk_tback, makelparam (shmbof_nodefault | shmbof_notify, shmbof_nodefault | shmbof_notify ));

Then, when the dailog responds to the wm_hotkey, it performs the following processing:

Lresult cmydlg: onhotkey (uint umsg, wparam, lparam, bool & bhandled)
{
If (vk_tback = hiword (lparam ))
{
Bhandled = true;
Shsendbacktofocuswindow (umsg, wparam, lparam );
}
Return 0;
}

 

Write Based on the wtl framework. If you use the original SDK, make some modifications on your own.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.