Menu menu = getMenu (); return showMenu (menu, x, y) ? LRESULT.ZERO : null;
return showMenu (x, y) ? LRESULT.ZERO : null;
LRESULT wmContextMenu (int hwnd, int wParam, int lParam) {	if (wParam != hwnd) return null;		/*	* Feature in Windows.  SHRecognizeGesture() sends an undocumented	* WM_CONTEXTMENU notification when the flag SHRG_NOTIFY_PARENT is	* not set.  This causes the context menu to be displayed twice,	* once by the caller of SHRecognizeGesture() and once from this	* method.  The fix is to ignore WM_CONTEXTMENU notifications on	* all WinCE platforms.	* 	* NOTE: This only happens on WM2003.  Previous WinCE versions did	* not support WM_CONTEXTMENU.	*/	if (OS.IsWinCE) return null;		/*	* Feature in Windows.  When the user presses  WM_NCRBUTTONUP,	* a WM_CONTEXTMENU message is generated.  This happens when	* the user releases the mouse over a scroll bar.  Normally,	* window displays the default scrolling menu but applications	* can process WM_CONTEXTMENU to display a different menu.	* Typically, an application does not want to supply a special	* scroll menu.  The fix is to look for a WM_CONTEXTMENU that	* originated from a mouse event and display the menu when the	* mouse was released in the client area.	*/	int x = 0, y = 0;	if (lParam != -1) {		POINT pt = new POINT ();		x = pt.x = (short) (lParam & 0xFFFF);		y = pt.y = (short) (lParam >> 16);		OS.ScreenToClient (hwnd, pt);		RECT rect = new RECT ();		OS.GetClientRect (hwnd, rect);		if (!OS.PtInRect (rect, pt)) return null;	} else {		int pos = OS.GetMessagePos ();		x = (short) (pos & 0xFFFF);		y = (short) (pos >> 16);	}	/* Show the menu */	Menu menu = getMenu ();	return showMenu (menu, x, y) ? LRESULT.ZERO : null;}