case OS.LVN_MARQUEEBEGIN: return LRESULT.ONE;
LRESULT wmNotifyChild (int wParam, int lParam) {	NMHDR hdr = new NMHDR ();	OS.MoveMemory (hdr, lParam, NMHDR.sizeof);	switch (hdr.code) {		case OS.LVN_ODFINDITEMA:		case OS.LVN_ODFINDITEMW: {			if ((style & SWT.VIRTUAL) != 0) return new LRESULT (-1);			break;		}		case OS.LVN_GETDISPINFOA:		case OS.LVN_GETDISPINFOW: {//			if (drawCount != 0 || !OS.IsWindowVisible (handle)) break;			NMLVDISPINFO plvfi = new NMLVDISPINFO ();			OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof);						/*			* When an item is being deleted from a virtual table, do not			* allow the application to provide data for a new item that			* becomes visible until the item has been removed from the			* items array.  Because arbitrary application code can run			* during the callback, the items array might be accessed			* in an inconsistent state.  Rather than answering the data			* right away, queue a redraw for later.			*/			if ((style & SWT.VIRTUAL) != 0) {				if (ignoreShrink) {					OS.SendMessage (handle, OS.LVM_REDRAWITEMS, plvfi.iItem, plvfi.iItem);					break;				}			}			/*			* Feature in Windows.  When a new table item is inserted			* using LVM_INSERTITEM in a table that is transparent			* (ie. LVM_SETBKCOLOR has been called with CLR_NONE),			* TVM_INSERTITEM calls LVN_GETDISPINFO before the item			* has been added to the array.  The fix is to check for			* null.			*/			TableItem item = _getItem (plvfi.iItem);			if (item == null) break;						/*			* The cached flag is used by both virtual and non-virtual			* tables to indicate that Windows has asked at least once			* for a table item.			*/			if (!item.cached) {				if ((style & SWT.VIRTUAL) != 0) {					lastIndexOf = plvfi.iItem;					if (!checkData (item, lastIndexOf, false)) break;					TableItem newItem = fixScrollWidth ? null : item;					if (setScrollWidth (newItem, true)) {						OS.InvalidateRect (handle, null, true);					}				}				item.cached = true;			}			if ((plvfi.mask & OS.LVIF_TEXT) != 0) {				String string = null;				if (plvfi.iSubItem == 0) {					string = item.text;				} else {					String [] strings  = item.strings;					if (strings != null) string = strings [plvfi.iSubItem];				}				if (string != null) {					/*					* Bug in Windows.  When pszText points to a zero length					* NULL terminated string, Windows correctly draws the					* empty string but the cache of the bounds for the item					* is not reset.  This means that when the text for the					* item is set and then reset to an empty string, the					* selection draws using the bounds of the previous text.					* The fix is to use a space rather than an empty string					* when anything but a tool tip is requested (to avoid					* a tool tip that is a single space).					* 					* NOTE: This is only a problem for items in the first					* column.  Assigning NULL to other columns stops Windows					* from drawing the selection when LVS_EX_FULLROWSELECT					* is set.					*/					if (!tipRequested && string.length () == 0 && plvfi.iSubItem == 0) {						string = " "; //$NON-NLS-1$					}					TCHAR buffer = new TCHAR (getCodePage (), string, false);					int byteCount = Math.min (buffer.length (), plvfi.cchTextMax - 1) * TCHAR.sizeof;					OS.MoveMemory (plvfi.pszText, buffer, byteCount);					OS.MoveMemory (plvfi.pszText + byteCount, new byte [TCHAR.sizeof], TCHAR.sizeof);					plvfi.cchTextMax = Math.min (plvfi.cchTextMax, string.length () + 1);				}			}			if ((plvfi.mask & OS.LVIF_IMAGE) != 0) {				Image image = null;				if (plvfi.iSubItem == 0) {					image = item.image;				} else {					Image [] images = item.images;					if (images != null) image = images [plvfi.iSubItem];				}				if (image != null) plvfi.iImage = imageIndex (image);			}			if ((plvfi.mask & OS.LVIF_STATE) != 0) {				if (plvfi.iSubItem == 0) {					int state = 1;					if (item.checked) state++;					if (item.grayed) state +=2;					plvfi.state = state << 12;					plvfi.stateMask = OS.LVIS_STATEIMAGEMASK;				}			}			if ((plvfi.mask & OS.LVIF_INDENT) != 0) {				if (plvfi.iSubItem == 0) plvfi.iIndent = item.imageIndent;			}			OS.MoveMemory (lParam, plvfi, NMLVDISPINFO.sizeof);			break;		}		case OS.NM_CUSTOMDRAW: {			int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);			if (hdr.hwndFrom == hwndHeader) break;			if (!customDraw && findImageControl () == null) {				/*				* Feature in Windows.  When the table is disabled, it draws				* with a gray background but does not gray the text.  The fix				* is to explicitly gray the text using Custom Draw.				*/				if (OS.IsWindowEnabled (handle)) break;			}			NMLVCUSTOMDRAW nmcd = new NMLVCUSTOMDRAW ();			OS.MoveMemory (nmcd, lParam, NMLVCUSTOMDRAW.sizeof);			switch (nmcd.dwDrawStage) {				case OS.CDDS_PREPAINT: return CDDS_PREPAINT (wParam, lParam);				case OS.CDDS_ITEMPREPAINT: return CDDS_ITEMPREPAINT (wParam, lParam);				case OS.CDDS_SUBITEMPREPAINT: return CDDS_SUBITEMPREPAINT (wParam, lParam);				case OS.CDDS_SUBITEMPOSTPAINT: return CDDS_SUBITEMPOSTPAINT (wParam, lParam);				case OS.CDDS_POSTPAINT: return CDDS_POSTPAINT (wParam, lParam);			}			break;		}		case OS.LVN_MARQUEEBEGIN: return LRESULT.ONE;		case OS.LVN_BEGINDRAG:		case OS.LVN_BEGINRDRAG: {			dragStarted = true;			if (hdr.code == OS.LVN_BEGINDRAG) {				int pos = OS.GetMessagePos ();				POINT pt = new POINT ();				pt.x = (short) (pos & 0xFFFF);				pt.y = (short) (pos >> 16); 				OS.ScreenToClient (handle, pt);				sendDragEvent (pt.x, pt.y);			}			break;		}		case OS.LVN_COLUMNCLICK: {			NMLISTVIEW pnmlv = new NMLISTVIEW ();			OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);			TableColumn column = columns [pnmlv.iSubItem];			if (column != null) {				column.postEvent (SWT.Selection);			}			break;		}		case OS.LVN_ITEMACTIVATE: {			if (ignoreActivate) break;			NMLISTVIEW pnmlv = new NMLISTVIEW ();			OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);			if (pnmlv.iItem != -1) {				Event event = new Event ();				event.item = _getItem (pnmlv.iItem);				postEvent (SWT.DefaultSelection, event);			}			break;		}		case OS.LVN_ITEMCHANGED: {			if (!ignoreSelect) {				NMLISTVIEW pnmlv = new NMLISTVIEW ();				OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);				if ((pnmlv.uChanged & OS.LVIF_STATE) != 0) {					if (pnmlv.iItem == -1) {						wasSelected = true;					} else {						boolean oldSelected = (pnmlv.uOldState & OS.LVIS_SELECTED) != 0;						boolean newSelected = (pnmlv.uNewState & OS.LVIS_SELECTED) != 0;						if (oldSelected != newSelected) wasSelected = true;					}				}			}			if (hooks (SWT.EraseItem) || hooks (SWT.PaintItem)) {				int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);				int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);				if (count != 0) {					forceResize ();					RECT rect = new RECT ();					OS.GetClientRect (handle, rect);					NMLISTVIEW pnmlv = new NMLISTVIEW ();					OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);					if (pnmlv.iItem != -1) {						RECT itemRect = new RECT ();						itemRect.left = OS.LVIR_BOUNDS;						ignoreCustomDraw = true;						OS.SendMessage (handle, OS. LVM_GETITEMRECT, pnmlv.iItem, itemRect);						ignoreCustomDraw = false;						RECT headerRect = new RECT ();						int index = OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, count - 1, 0);						OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);						OS.MapWindowPoints (hwndHeader, handle, headerRect, 2);						rect.left = headerRect.right;						rect.top = itemRect.top;						rect.bottom = itemRect.bottom;					}					OS.InvalidateRect (handle, rect, true);				}			}			break;		}		case OS.NM_RECOGNIZEGESTURE:			/* 			* Feature on Pocket PC.  The tree and table controls detect the tap			* and hold gesture by default. They send a GN_CONTEXTMENU message to show			* the popup menu.  This default behaviour is unwanted on Pocket PC 2002			* when no menu has been set, as it still draws a red circle.  The fix			* is to disable this default behaviour when no menu is set by returning			* TRUE when receiving the Pocket PC 2002 specific NM_RECOGNIZEGESTURE			* message.			*/			if (OS.IsPPC) {				boolean hasMenu = menu != null && !menu.isDisposed ();				if (!hasMenu && !hooks (SWT.MenuDetect)) return LRESULT.ONE;			}			break;		case OS.GN_CONTEXTMENU:			if (OS.IsPPC) {				boolean hasMenu = menu != null && !menu.isDisposed ();				if (hasMenu || hooks (SWT.MenuDetect)) {					NMRGINFO nmrg = new NMRGINFO ();					OS.MoveMemory (nmrg, lParam, NMRGINFO.sizeof);					showMenu (nmrg.x, nmrg.y);					return LRESULT.ONE;				}			}			break;	}	return super.wmNotifyChild (wParam, lParam);}