lastTime = OS.GetMessageTime ();
lastTime = getLastEventTime ();
int getClickCount (int type, int button, int hwnd, int lParam) {	switch (type) {		case SWT.MouseDown:			int doubleClick = OS.GetDoubleClickTime ();			if (clickRect == null) clickRect = new RECT ();			int deltaTime = Math.abs (lastTime - OS.GetMessageTime ());			POINT pt = new POINT ();			pt.x = (short) (lParam & 0xFFFF);			pt.y = (short) (lParam >> 16);			if (lastHwnd == hwnd && lastButton == button && (deltaTime <= doubleClick) && OS.PtInRect (clickRect, pt)) {				clickCount++;			} else {				clickCount = 1;			}			//FALL THROUGH		case SWT.MouseDoubleClick:			lastHwnd = hwnd;			lastButton = button;			lastTime = OS.GetMessageTime ();			int xInset = OS.GetSystemMetrics (OS.SM_CXDOUBLECLK) / 2;			int yInset = OS.GetSystemMetrics (OS.SM_CYDOUBLECLK) / 2;			int x = (short) (lParam & 0xFFFF), y = (short) (lParam >> 16);			OS.SetRect (clickRect, x - xInset, y - yInset, x + xInset, y + yInset);			//FALL THROUGH		case SWT.MouseUp:			return clickCount;	}	return 0;}