if (type == OS.GN_CONTEXTMENU) showMenu (menu, x, y);
if (type == OS.GN_CONTEXTMENU) showMenu (x, y);
LRESULT wmLButtonDown (int hwnd, int wParam, int lParam) {	boolean dragging = false, mouseDown = true;	boolean dragDetect = hooks (SWT.DragDetect);	if (dragDetect) {		if (!OS.IsWinCE) {			/*			* Feature in Windows.  It's possible that the drag			* operation will not be started while the mouse is			* down, meaning that the mouse should be captured.			* This can happen when the user types the ESC key			* to cancel the drag.  The fix is to query the state			* of the mouse and capture the mouse accordingly.			*/			POINT pt = new POINT ();			pt.x = (short) (lParam & 0xFFFF);			pt.y = (short) (lParam >> 16);			OS.ClientToScreen (hwnd, pt);			dragging = OS.DragDetect (hwnd, pt);			mouseDown = OS.GetKeyState (OS.VK_LBUTTON) < 0;		}	}	sendMouseEvent (SWT.MouseDown, 1, hwnd, OS.WM_LBUTTONDOWN, wParam, lParam);	int result = callWindowProc (hwnd, OS.WM_LBUTTONDOWN, wParam, lParam);		if (OS.IsPPC) {		/*		* Note: On WinCE PPC, only attempt to recognize the gesture for		* a context menu when the control contains a valid menu or there		* are listeners for the MenuDetect event.		*/		Menu menu = getMenu ();		boolean hasMenu = menu != null && !menu.isDisposed ();		if (hasMenu || hooks (SWT.MenuDetect)) {			int x = (short) (lParam & 0xFFFF);			int y = (short) (lParam >> 16);			SHRGINFO shrg = new SHRGINFO ();			shrg.cbSize = SHRGINFO.sizeof;			shrg.hwndClient = hwnd;			shrg.ptDown_x = x;			shrg.ptDown_y = y; 			shrg.dwFlags = OS.SHRG_RETURNCMD;			int type = OS.SHRecognizeGesture (shrg);			if (type == OS.GN_CONTEXTMENU) showMenu (menu, x, y);		}	}	if (mouseDown) {		if (OS.GetCapture () != hwnd) OS.SetCapture (hwnd);	}	if (dragging) {		Event event = new Event ();		event.x = (short) (lParam & 0xFFFF);		event.y = (short) (lParam >> 16);		postEvent (SWT.DragDetect, event);	} else {		if (dragDetect) {			/*			* Feature in Windows.  DragDetect() captures the mouse			* and tracks its movement until the user releases the			* left mouse button, presses the ESC key, or moves the			* mouse outside the drag rectangle.  If the user moves			* the mouse outside of the drag rectangle, DragDetect()			* returns true and a drag and drop operation can be			* started.  When the left mouse button is released or			* the ESC key is pressed, these events are consumed by			* DragDetect() so that application code that matches			* mouse down/up pairs or looks for the ESC key will not			* function properly.  The fix is to send the missing			* events when the drag has not started.			* 			* NOTE: For now, don't send a fake WM_KEYDOWN/WM_KEYUP			* events for the ESC key.  This would require computing			* wParam (the key) and lParam (the repeat count, scan code,			* extended-key flag, context code, previous key-state flag,			* and transition-state flag) which is non-trivial.			*/			if (OS.GetKeyState (OS.VK_ESCAPE) >= 0) {				OS.SendMessage (hwnd, OS.WM_LBUTTONUP, wParam, lParam);			}		}	}	return new LRESULT (result);}