Shortcut menu for Windows Mobile Development

Source: Internet
Author: User

Today, someone in the Development Group asked you how to press and hold on PPC to bring up a shortcut menu.

Unlike windows, PPC does not rely on responding to the wm_rbuttondown message, but on wm_lbuttondown. It's not surprising that there is no right-click on PPC.

The following code is correct:

......

Case wm_lbuttondown:

{
Shrginfo shrg;
Shrg. cbsize = sizeof (shrg );
Shrg. hwndclient = m_hwnd;
Shrg. ptdown. x = loword (lparam );
Shrg. ptdown. Y = hiword (lparam );
Shrg. dwflags = shrg_returncmd;

Cpoint point;
Point. x = shrg. ptdown. X;
Point. Y = shrg. ptdown. Y;

If (: shrecognizegesture (& shrg) = gn_contextmenu) // long key message
{
Cmenu menu;
Menu. loadmenu (idr_menu_down );

Cmenu * ppopupmenu = menu. getsubmenu (0 );

Clienttoscreen (& Point );

Ppopupmenu-> trackpopupmenu (tpm_leftalign, point. X, point. Y, this );
}

}

......

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.