changeset 67:3f4e6a4ecc09

Table, TableItem, TableColumn
author Frank Benoit <benoit@tionex.de>
date Mon, 04 Feb 2008 20:01:30 +0100
parents 774d936d1380
children 5c549a70cf43
files dwt/internal/win32/OS.d dwt/internal/win32/WINAPI.d dwt/internal/win32/WINTYPES.d dwt/widgets/Shell.d dwt/widgets/Table.d dwt/widgets/TableColumn.d dwt/widgets/TableItem.d tango_sys_win32/Types.di
diffstat 8 files changed, 895 insertions(+), 903 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/internal/win32/OS.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/internal/win32/OS.d	Mon Feb 04 20:01:30 2008 +0100
@@ -1696,8 +1696,8 @@
     public static const int TME_QUERY = 0x40000000;
     public static const int TMPF_VECTOR = 0x2;
     public static const int TMT_CONTENTMARGINS = 3602;
-    public static const char[] TOOLBARCLASSNAME = "ToolbarWindow32"; //$NON-NLS-1$
-    public static const char[] TOOLTIPS_CLASS = "tooltips_class32"; //$NON-NLS-1$
+    public static const TCHAR[] TOOLBARCLASSNAME = "ToolbarWindow32"; //$NON-NLS-1$
+    public static const TCHAR[] TOOLTIPS_CLASS = "tooltips_class32"; //$NON-NLS-1$
     public static const int TP_BUTTON = 1;
     public static const int TP_DROPDOWNBUTTON = 2;
     public static const int TP_SPLITBUTTON = 3;
@@ -4534,6 +4534,7 @@
 alias WINAPI.SetWindowPlacement SetWindowPlacement;
 alias WINAPI.SetWindowPos SetWindowPos;
 alias WINAPI.SetWindowRgn SetWindowRgn;
+alias WINAPI.SetWindowTheme SetWindowTheme;
 alias STDWIN.SetWorldTransform SetWorldTransform;
 alias WINAPI.SetWindowTextA SetWindowTextA;
 alias WINAPI.SetWindowTextW SetWindowTextW;
--- a/dwt/internal/win32/WINAPI.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/internal/win32/WINAPI.d	Mon Feb 04 20:01:30 2008 +0100
@@ -148,6 +148,11 @@
     LPCRECT pBoundingRect,
     LPRECT pExtentRect
 );
+HRESULT SetWindowTheme(
+    HWND hwnd,
+    LPCWSTR pszSubAppName,
+    LPCWSTR pszSubIdList
+);
 }
 //--------------------------------------------------------------------------------------
 
--- a/dwt/internal/win32/WINTYPES.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/internal/win32/WINTYPES.d	Mon Feb 04 20:01:30 2008 +0100
@@ -57,6 +57,14 @@
     NMHDR hdr;
     LITEM item;
 }
+struct NMLVODSTATECHANGE {
+  NMHDR hdr;
+  int iFrom;
+  int iTo;
+  UINT uNewState;
+  UINT uOldState;
+}
+
 // ....
 //--------------------------------------------------------------------------------
 
--- a/dwt/widgets/Shell.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/widgets/Shell.d	Mon Feb 04 20:01:30 2008 +0100
@@ -510,7 +510,7 @@
 void createBalloonTipHandle () {
     balloonTipHandle_ = OS.CreateWindowEx (
         0,
-        StrToTCHARz( OS.TOOLTIPS_CLASS ),
+        OS.TOOLTIPS_CLASS.ptr,
         null,
         OS.TTS_ALWAYSTIP | OS.TTS_BALLOON,
         OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0,
@@ -618,7 +618,7 @@
 void createToolTipHandle () {
     toolTipHandle_ = OS.CreateWindowEx (
         0,
-        StrToTCHARz( OS.TOOLTIPS_CLASS ),
+        OS.TOOLTIPS_CLASS.ptr,
         null,
         OS.TTS_ALWAYSTIP,
         OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0,
--- a/dwt/widgets/Table.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/widgets/Table.d	Mon Feb 04 20:01:30 2008 +0100
@@ -10,13 +10,6 @@
  *******************************************************************************/
 module dwt.widgets.Table;
 
-import dwt.widgets.Composite;
-class Table : Composite {
-}
-/++
-
-//import java.util.*;
-
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.events.SelectionEvent;
@@ -28,32 +21,19 @@
 import dwt.graphics.Point;
 import dwt.graphics.Rectangle;
 import dwt.internal.ImageList;
-import dwt.internal.win32.HDHITTESTINFO;
-import dwt.internal.win32.HDITEM;
-import dwt.internal.win32.LRESULT;
-import dwt.internal.win32.LVCOLUMN;
-import dwt.internal.win32.LVHITTESTINFO;
-import dwt.internal.win32.LVITEM;
-import dwt.internal.win32.MEASUREITEMSTRUCT;
-import dwt.internal.win32.NMHDR;
-import dwt.internal.win32.NMHEADER;
-import dwt.internal.win32.NMLISTVIEW;
-import dwt.internal.win32.NMLVCUSTOMDRAW;
-import dwt.internal.win32.NMLVDISPINFO;
-import dwt.internal.win32.NMLVODSTATECHANGE;
-import dwt.internal.win32.NMRGINFO;
-import dwt.internal.win32.NMTTDISPINFO;
 import dwt.internal.win32.OS;
-import dwt.internal.win32.PAINTSTRUCT;
-import dwt.internal.win32.POINT;
-import dwt.internal.win32.RECT;
-import dwt.internal.win32.SCROLLINFO;
-import dwt.internal.win32.TCHAR;
-import dwt.internal.win32.TEXTMETRIC;
-import dwt.internal.win32.TEXTMETRICA;
-import dwt.internal.win32.TEXTMETRICW;
-import dwt.internal.win32.TOOLINFO;
-import dwt.internal.win32.WNDCLASS;
+
+import dwt.widgets.Composite;
+import dwt.widgets.TableItem;
+import dwt.widgets.TableColumn;
+import dwt.widgets.Listener;
+import dwt.widgets.TypedListener;
+import dwt.widgets.Event;
+import dwt.widgets.Control;
+import dwt.widgets.Display;
+
+import dwt.dwthelper.utils;
+
 
 /**
  * Instances of this class implement a selectable user interface
@@ -100,7 +80,7 @@
  * </p>
  */
 
-public class Table extends Composite {
+public class Table : Composite {
 
     alias Composite.computeSize computeSize;
     alias Composite.setBackgroundImage setBackgroundImage;
@@ -117,21 +97,22 @@
     bool ignoreCustomDraw, ignoreDrawForeground, ignoreDrawBackground, ignoreDrawFocus, ignoreDrawSelection, ignoreDrawHot;
     bool customDraw, dragStarted, explorerTheme, firstColumnImage, fixScrollWidth, tipRequested, wasSelected, wasResized;
     bool ignoreActivate, ignoreSelect, ignoreShrink, ignoreResize, ignoreColumnMove, ignoreColumnResize;
-    int headerToolTipHandle, itemHeight, lastIndexOf, lastWidth, sortDirection, resizeCount, selectionForeground, hotIndex;
-    static /*final*/ int HeaderProc;
-    static final int INSET = 4;
-    static final int GRID_WIDTH = 1;
-    static final int SORT_WIDTH = 10;
-    static final int HEADER_MARGIN = 12;
-    static final int HEADER_EXTRA = 3;
-    static final int VISTA_EXTRA = 2;
-    static final int EXPLORER_EXTRA = 2;
-    static final bool EXPLORER_THEME = true;
-    static final int TableProc;
-    static final TCHAR TableClass = new TCHAR (0, OS.WC_LISTVIEW, true);
-    static {
-        WNDCLASS lpWndClass = new WNDCLASS ();
-        OS.GetClassInfo (0, TableClass, lpWndClass);
+    HWND headerToolTipHandle;
+    int itemHeight, lastIndexOf, lastWidth, sortDirection, resizeCount, selectionForeground, hotIndex;
+    static /*final*/ WNDPROC HeaderProc;
+    static const int INSET = 4;
+    static const int GRID_WIDTH = 1;
+    static const int SORT_WIDTH = 10;
+    static const int HEADER_MARGIN = 12;
+    static const int HEADER_EXTRA = 3;
+    static const int VISTA_EXTRA = 2;
+    static const int EXPLORER_EXTRA = 2;
+    static const bool EXPLORER_THEME = true;
+    static const WNDPROC TableProc;
+    static const TCHAR[] TableClass = OS.WC_LISTVIEW;
+    static this() {
+        WNDCLASS lpWndClass;
+        OS.GetClassInfo (null, TableClass.ptr, &lpWndClass);
         TableProc = lpWndClass.lpfnWndProc;
     }
 
@@ -168,7 +149,7 @@
  * @see Widget#checkSubclass
  * @see Widget#getStyle
  */
-public Table (Composite parent, int style) {
+public this (Composite parent, int style) {
     super (parent, checkStyle (style));
 }
 
@@ -228,14 +209,14 @@
     addListener (DWT.DefaultSelection,typedListener);
 }
 
-override int callWindowProc (int hwnd, int msg, int wParam, int lParam) {
+override LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) {
     return callWindowProc (hwnd, msg, wParam, lParam, false);
 }
 
-int callWindowProc (int hwnd, int msg, int wParam, int lParam, bool forceSelect) {
-    if (handle is 0) return 0;
+LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam, bool forceSelect) {
+    if (handle is null) return LRESULT.ZERO;
     if (handle !is hwnd) {
-        return OS.CallWindowProc (HeaderProc, hwnd, msg, wParam, lParam);
+        return cast(LRESULT) OS.CallWindowProc (HeaderProc, hwnd, msg, wParam, lParam);
     }
     int topIndex = 0;
     bool checkSelection = false, checkActivate = false, redraw = false;
@@ -333,8 +314,8 @@
             if (redraw) {
                 OS.DefWindowProc (handle, OS.WM_SETREDRAW, 1, 0);
                 OS.InvalidateRect (handle, null, true);
-                int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                if (hwndHeader !is 0) OS.InvalidateRect (hwndHeader, null, true);
+                auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                if (hwndHeader !is null) OS.InvalidateRect (hwndHeader, null, true);
             }
             //FALL THROUGH
 
@@ -367,7 +348,7 @@
             }
         }
     }
-    return code;
+    return cast(LRESULT) code;
 }
 
 static int checkStyle (int style) {
@@ -382,11 +363,11 @@
     return checkBits (style, DWT.SINGLE, DWT.MULTI, 0, 0, 0, 0);
 }
 
-LRESULT CDDS_ITEMPOSTPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
-    int hDC = nmcd.hdc;
+LRESULT CDDS_ITEMPOSTPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
+    auto hDC = nmcd.nmcd.hdc;
     if (explorerTheme && !ignoreCustomDraw) {
         hotIndex = -1;
-        if (hooks (DWT.EraseItem) && nmcd.left !is nmcd.right) {
+        if (hooks (DWT.EraseItem) && nmcd.nmcd.rc.left !is nmcd.nmcd.rc.right) {
             OS.RestoreDC (hDC, -1);
         }
     }
@@ -402,36 +383,36 @@
     * it is necessary to draw the focus rectangle after the
     * item has been drawn.
     */
-    if (!ignoreCustomDraw && !ignoreDrawFocus && nmcd.left !is nmcd.right) {
+    if (!ignoreCustomDraw && !ignoreDrawFocus && nmcd.nmcd.rc.left !is nmcd.nmcd.rc.right) {
         if (OS.IsWindowVisible (handle) && OS.IsWindowEnabled (handle)) {
             if (!explorerTheme && (style & DWT.FULL_SELECTION) !is 0) {
                 if (OS.SendMessage (handle, OS.LVM_GETBKCOLOR, 0, 0) is OS.CLR_NONE) {
                     int dwExStyle = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
                     if ((dwExStyle & OS.LVS_EX_FULLROWSELECT) is 0) {
 //                      if ((nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
-                        if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.dwItemSpec) {
+                        if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.nmcd.dwItemSpec) {
                             if (handle is OS.GetFocus ()) {
                                 int uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
                                 if ((uiState & OS.UISF_HIDEFOCUS) is 0) {
-                                    RECT rect = new RECT ();
+                                    RECT rect;
                                     rect.left = OS.LVIR_BOUNDS;
                                     bool oldIgnore = ignoreCustomDraw;
                                     ignoreCustomDraw = true;
-                                    OS.SendMessage (handle, OS. LVM_GETITEMRECT, nmcd.dwItemSpec, rect);
-                                    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                                    OS.SendMessage (handle, OS. LVM_GETITEMRECT, nmcd.nmcd.dwItemSpec, &rect);
+                                    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
                                     int index = OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, 0, 0);
-                                    RECT itemRect = new RECT ();
+                                    RECT itemRect;
                                     if (index is 0) {
                                         itemRect.left = OS.LVIR_LABEL;
-                                        OS.SendMessage (handle, OS. LVM_GETITEMRECT, index, itemRect);
+                                        OS.SendMessage (handle, OS. LVM_GETITEMRECT, index, &itemRect);
                                     } else {
                                         itemRect.top = index;
                                         itemRect.left = OS.LVIR_ICON;
-                                        OS.SendMessage (handle, OS. LVM_GETSUBITEMRECT, nmcd.dwItemSpec, itemRect);
+                                        OS.SendMessage (handle, OS. LVM_GETSUBITEMRECT, nmcd.nmcd.dwItemSpec, &itemRect);
                                     }
                                     ignoreCustomDraw = oldIgnore;
                                     rect.left = itemRect.left;
-                                    OS.DrawFocusRect (nmcd.hdc, rect);
+                                    OS.DrawFocusRect (nmcd.nmcd.hdc, &rect);
                                 }
                             }
                         }
@@ -440,10 +421,10 @@
             }
         }
     }
-    return null;
+    return LRESULT.NULL;
 }
 
-LRESULT CDDS_ITEMPREPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
+LRESULT CDDS_ITEMPREPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
     /*
     * Bug in Windows.  When the table has the extended style
     * LVS_EX_FULLROWSELECT and LVM_SETBKCOLOR is used with
@@ -462,9 +443,9 @@
                 if (OS.SendMessage (handle, OS.LVM_GETBKCOLOR, 0, 0) is OS.CLR_NONE) {
                     int dwExStyle = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
                     if ((dwExStyle & OS.LVS_EX_FULLROWSELECT) is 0) {
-                        if ((nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
-                            nmcd.uItemState &= ~OS.CDIS_FOCUS;
-                            OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
+                        if ((nmcd.nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
+                            nmcd.nmcd.uItemState &= ~OS.CDIS_FOCUS;
+                            OS.MoveMemory (cast(NMLVCUSTOMDRAW*)lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
                         }
                     }
                 }
@@ -472,19 +453,19 @@
         }
     }
     if (explorerTheme && !ignoreCustomDraw) {
-        hotIndex = (nmcd.uItemState & OS.CDIS_HOT) !is 0 ? nmcd.dwItemSpec : -1;
-        if (hooks (DWT.EraseItem) && nmcd.left !is nmcd.right) {
-            OS.SaveDC (nmcd.hdc);
-            int hrgn = OS.CreateRectRgn (0, 0, 0, 0);
-            OS.SelectClipRgn (nmcd.hdc, hrgn);
+        hotIndex = (nmcd.nmcd.uItemState & OS.CDIS_HOT) !is 0 ? nmcd.nmcd.dwItemSpec : -1;
+        if (hooks (DWT.EraseItem) && nmcd.nmcd.rc.left !is nmcd.nmcd.rc.right) {
+            OS.SaveDC (nmcd.nmcd.hdc);
+            auto hrgn = OS.CreateRectRgn (0, 0, 0, 0);
+            OS.SelectClipRgn (nmcd.nmcd.hdc, hrgn);
             OS.DeleteObject (hrgn);
         }
     }
-    return new LRESULT (OS.CDRF_NOTIFYSUBITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
+    return cast(LRESULT) (OS.CDRF_NOTIFYSUBITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
 }
 
-LRESULT CDDS_POSTPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
-    if (ignoreCustomDraw) return null;
+LRESULT CDDS_POSTPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
+    if (ignoreCustomDraw) return LRESULT.NULL;
     /*
     * Bug in Windows.  When the table has the extended style
     * LVS_EX_FULLROWSELECT and LVM_SETBKCOLOR is used with
@@ -500,13 +481,13 @@
                 if ((dwExStyle & OS.LVS_EX_FULLROWSELECT) is 0) {
                     int bits = OS.LVS_EX_FULLROWSELECT;
                     if (OS.IsWinCE) {
-                        RECT rect = new RECT ();
-                        bool damaged = OS.GetUpdateRect (handle, rect, true);
+                        RECT rect;
+                        bool damaged = cast(bool) OS.GetUpdateRect (handle, &rect, true);
                         OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, bits);
                         OS.ValidateRect (handle, null);
-                        if (damaged) OS.InvalidateRect (handle, rect, true);
+                        if (damaged) OS.InvalidateRect (handle, &rect, true);
                     } else {
-                        int rgn = OS.CreateRectRgn (0, 0, 0, 0);
+                        auto rgn = OS.CreateRectRgn (0, 0, 0, 0);
                         int result = OS.GetUpdateRgn (handle, rgn, true);
                         OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, bits);
                         OS.ValidateRect (handle, null);
@@ -517,12 +498,12 @@
             }
         }
     }
-    return null;
+    return LRESULT.NULL;
 }
 
-LRESULT CDDS_PREPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
+LRESULT CDDS_PREPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
     if (ignoreCustomDraw) {
-        return new LRESULT (OS.CDRF_NOTIFYITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
+        return cast(LRESULT) (OS.CDRF_NOTIFYITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
     }
     /*
     * Bug in Windows.  When the table has the extended style
@@ -539,13 +520,13 @@
                 if ((dwExStyle & OS.LVS_EX_FULLROWSELECT) !is 0) {
                     int bits = OS.LVS_EX_FULLROWSELECT;
                     if (OS.IsWinCE) {
-                        RECT rect = new RECT ();
-                        bool damaged = OS.GetUpdateRect (handle, rect, true);
+                        RECT rect;
+                        bool damaged = cast(bool) OS.GetUpdateRect (handle, &rect, true);
                         OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, 0);
                         OS.ValidateRect (handle, null);
-                        if (damaged) OS.InvalidateRect (handle, rect, true);
+                        if (damaged) OS.InvalidateRect (handle, &rect, true);
                     } else {
-                        int rgn = OS.CreateRectRgn (0, 0, 0, 0);
+                        auto rgn = OS.CreateRectRgn (0, 0, 0, 0);
                         int result = OS.GetUpdateRgn (handle, rgn, true);
                         OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, 0);
                         OS.ValidateRect (handle, null);
@@ -565,44 +546,44 @@
         * The fix is to draw the background using custom draw.
         */
         if (explorerTheme && columnCount is 0) {
-            int hDC = nmcd.hdc;
-            RECT rect = new RECT ();
-            OS.SetRect (rect, nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
+            auto hDC = nmcd.nmcd.hdc;
+            RECT rect;
+            OS.SetRect (&rect, nmcd.nmcd.rc.left, nmcd.nmcd.rc.top, nmcd.nmcd.rc.right, nmcd.nmcd.rc.bottom);
             if (OS.IsWindowEnabled (handle) || findImageControl () !is null) {
-                drawBackground (hDC, rect);
+                drawBackground (hDC, &rect);
             } else {
-                fillBackground (hDC, OS.GetSysColor (OS.COLOR_3DFACE), rect);
+                fillBackground (hDC, OS.GetSysColor (OS.COLOR_3DFACE), &rect);
             }
             draw = false;
         }
         if (draw) {
             Control control = findBackgroundControl ();
             if (control !is null && control.backgroundImage !is null) {
-                RECT rect = new RECT ();
-                OS.SetRect (rect, nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
-                fillImageBackground (nmcd.hdc, control, rect);
+                RECT rect;
+                OS.SetRect (&rect, nmcd.nmcd.rc.left, nmcd.nmcd.rc.top, nmcd.nmcd.rc.right, nmcd.nmcd.rc.bottom);
+                fillImageBackground (nmcd.nmcd.hdc, control, &rect);
             } else {
                 if (OS.SendMessage (handle, OS.LVM_GETBKCOLOR, 0, 0) is OS.CLR_NONE) {
                     if (OS.IsWindowEnabled (handle)) {
-                        RECT rect = new RECT ();
-                        OS.SetRect (rect, nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
+                        RECT rect;
+                        OS.SetRect (&rect, nmcd.nmcd.rc.left, nmcd.nmcd.rc.top, nmcd.nmcd.rc.right, nmcd.nmcd.rc.bottom);
                         if (control is null) control = this;
-                        fillBackground (nmcd.hdc, control.getBackgroundPixel (), rect);
+                        fillBackground (nmcd.nmcd.hdc, control.getBackgroundPixel (), &rect);
                         if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
                             if (sortColumn !is null && sortDirection !is DWT.NONE) {
                                 int index = indexOf (sortColumn);
                                 if (index !is -1) {
                                     parent.forceResize ();
                                     int clrSortBk = getSortColumnPixel ();
-                                    RECT columnRect = new RECT (), headerRect = new RECT ();
-                                    OS.GetClientRect (handle, columnRect);
-                                    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                                    if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect) !is 0) {
-                                        OS.MapWindowPoints (hwndHeader, handle, headerRect, 2);
+                                    RECT columnRect, headerRect;
+                                    OS.GetClientRect (handle, &columnRect);
+                                    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                                    if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect) !is 0) {
+                                        OS.MapWindowPoints (hwndHeader, handle, cast(POINT*) &headerRect, 2);
                                         columnRect.left = headerRect.left;
                                         columnRect.right = headerRect.right;
-                                        if (OS.IntersectRect(columnRect, columnRect, rect)) {
-                                            fillBackground (nmcd.hdc, clrSortBk, columnRect);
+                                        if (OS.IntersectRect(&columnRect, &columnRect, &rect)) {
+                                            fillBackground (nmcd.nmcd.hdc, clrSortBk, &columnRect);
                                         }
                                     }
                                 }
@@ -613,13 +594,13 @@
             }
         }
     }
-    return new LRESULT (OS.CDRF_NOTIFYITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
+    return cast(LRESULT) (OS.CDRF_NOTIFYITEMDRAW | OS.CDRF_NOTIFYPOSTPAINT);
 }
 
-LRESULT CDDS_SUBITEMPOSTPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
-    if (ignoreCustomDraw) return null;
-    if (nmcd.left is nmcd.right) return new LRESULT (OS.CDRF_DODEFAULT);
-    int hDC = nmcd.hdc;
+LRESULT CDDS_SUBITEMPOSTPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
+    if (ignoreCustomDraw) return LRESULT.NULL;
+    if (nmcd.nmcd.rc.left is nmcd.nmcd.rc.right) return cast(LRESULT) (OS.CDRF_DODEFAULT);
+    auto hDC = nmcd.nmcd.hdc;
     if (ignoreDrawForeground) OS.RestoreDC (hDC, -1);
     if (OS.IsWindowVisible (handle)) {
         /*
@@ -634,7 +615,8 @@
                     int oldColumn = OS.SendMessage (handle, OS.LVM_GETSELECTEDCOLUMN, 0, 0);
                     if (oldColumn is -1) {
                         int newColumn = indexOf (sortColumn);
-                        int result = 0, rgn = 0;
+                        int result = 0;
+                        HRGN rgn;
                         if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
                             rgn = OS.CreateRectRgn (0, 0, 0, 0);
                             result = OS.GetUpdateRgn (handle, rgn, true);
@@ -650,17 +632,17 @@
             }
         }
         if (hooks (DWT.PaintItem)) {
-            TableItem item = _getItem (nmcd.dwItemSpec);
+            TableItem item = _getItem (nmcd.nmcd.dwItemSpec);
             sendPaintItemEvent (item, nmcd);
             //widget could be disposed at this point
         }
     }
-    return null;
+    return LRESULT.NULL;
 }
 
-LRESULT CDDS_SUBITEMPREPAINT (NMLVCUSTOMDRAW nmcd, int wParam, int lParam) {
-    int hDC = nmcd.hdc;
-    if (explorerTheme && !ignoreCustomDraw && hooks (DWT.EraseItem) && (nmcd.left !is nmcd.right)) {
+LRESULT CDDS_SUBITEMPREPAINT (NMLVCUSTOMDRAW* nmcd, int wParam, int lParam) {
+    auto hDC = nmcd.nmcd.hdc;
+    if (explorerTheme && !ignoreCustomDraw && hooks (DWT.EraseItem) && (nmcd.nmcd.rc.left !is nmcd.nmcd.rc.right)) {
         OS.RestoreDC (hDC, -1);
     }
     /*
@@ -671,25 +653,25 @@
     * has been added to the array.  The fix is to check for
     * null.
     */
-    TableItem item = _getItem (nmcd.dwItemSpec);
-    if (item is null) return null;
-    int hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : -1;
-    if (hFont is -1) hFont = item.font;
-    if (hFont !is -1) OS.SelectObject (hDC, hFont);
-    if (ignoreCustomDraw || (nmcd.left is nmcd.right)) {
-        return new LRESULT (hFont is -1 ? OS.CDRF_DODEFAULT : OS.CDRF_NEWFONT);
+    TableItem item = _getItem (nmcd.nmcd.dwItemSpec);
+    if (item is null) return LRESULT.NULL;
+    HFONT hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : cast(HFONT)-1;
+    if (hFont is cast(HFONT)-1) hFont = item.font;
+    if (hFont !is cast(HFONT)-1) OS.SelectObject (hDC, hFont);
+    if (ignoreCustomDraw || (nmcd.nmcd.rc.left is nmcd.nmcd.rc.right)) {
+        return cast(LRESULT) (hFont is cast(HFONT)-1 ? OS.CDRF_DODEFAULT : OS.CDRF_NEWFONT);
     }
     int code = OS.CDRF_DODEFAULT;
     selectionForeground = -1;
     ignoreDrawForeground = ignoreDrawSelection = ignoreDrawFocus = ignoreDrawBackground = false;
     if (OS.IsWindowVisible (handle)) {
         if (hooks (DWT.MeasureItem)) {
-            sendMeasureItemEvent (item, nmcd.dwItemSpec, nmcd.iSubItem, nmcd.hdc);
-            if (isDisposed () || item.isDisposed ()) return null;
+            sendMeasureItemEvent (item, nmcd.nmcd.dwItemSpec, nmcd.iSubItem, nmcd.nmcd.hdc);
+            if (isDisposed () || item.isDisposed ()) return LRESULT.NULL;
         }
         if (hooks (DWT.EraseItem)) {
             sendEraseItemEvent (item, nmcd, lParam);
-            if (isDisposed () || item.isDisposed ()) return null;
+            if (isDisposed () || item.isDisposed ()) return LRESULT.NULL;
             code |= OS.CDRF_NOTIFYPOSTPAINT;
         }
         if (ignoreDrawForeground || hooks (DWT.PaintItem)) code |= OS.CDRF_NOTIFYPOSTPAINT;
@@ -716,11 +698,11 @@
                 * even for items that are not selected.  The fix is to get
                 * the selection state from the item.
                 */
-                LVITEM lvItem = new LVITEM ();
+                LVITEM lvItem;
                 lvItem.mask = OS.LVIF_STATE;
                 lvItem.stateMask = OS.LVIS_SELECTED;
-                lvItem.iItem = nmcd.dwItemSpec;
-                int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+                lvItem.iItem = nmcd.nmcd.dwItemSpec;
+                int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, &lvItem);
                 if ((result !is 0 && (lvItem.state & OS.LVIS_SELECTED) !is 0)) {
                     int clrSelection = -1;
                     if (nmcd.iSubItem is 0) {
@@ -742,8 +724,8 @@
                         }
                     }
                     if (clrSelection !is -1) {
-                        RECT rect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, nmcd.iSubItem !is 0, true, false, hDC);
-                        fillBackground (hDC, clrSelection, rect);
+                        RECT rect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, nmcd.iSubItem !is 0, true, false, hDC);
+                        fillBackground (hDC, clrSelection, &rect);
                     }
                 }
             }
@@ -758,15 +740,15 @@
         * attribute could have changed.
         */
         bool hasAttributes = true;
-        if (hFont is -1 && clrText is -1 && clrTextBk is -1) {
+        if (hFont is cast(HFONT)-1 && clrText is -1 && clrTextBk is -1) {
             if (item.cellForeground is null && item.cellBackground is null && item.cellFont is null) {
-                int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
                 int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
                 if (count is 1) hasAttributes = false;
             }
         }
         if (hasAttributes) {
-            if (hFont is -1) hFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
+            if (hFont is cast(HFONT)-1) hFont = cast(HFONT) OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
             OS.SelectObject (hDC, hFont);
             if (OS.IsWindowEnabled (handle)) {
                 nmcd.clrText = clrText is -1 ? getForegroundPixel () : clrText;
@@ -799,7 +781,8 @@
         if (clrTextBk !is -1) {
             int oldColumn = OS.SendMessage (handle, OS.LVM_GETSELECTEDCOLUMN, 0, 0);
             if (oldColumn !is -1 && oldColumn is nmcd.iSubItem) {
-                int result = 0, rgn = 0;
+                int result = 0;
+                HRGN rgn;
                 if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
                     rgn = OS.CreateRectRgn (0, 0, 0, 0);
                     result = OS.GetUpdateRgn (handle, rgn, true);
@@ -825,11 +808,11 @@
         } else {
             nmcd.clrTextBk = OS.GetSysColor (OS.COLOR_3DFACE);
         }
-        nmcd.uItemState &= ~OS.CDIS_SELECTED;
+        nmcd.nmcd.uItemState &= ~OS.CDIS_SELECTED;
         OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
         code |= OS.CDRF_NEWFONT;
     }
-    return new LRESULT (code);
+    return cast(LRESULT) (code);
 }
 
 override void checkBuffered () {
@@ -864,9 +847,9 @@
     return true;
 }
 
-override bool checkHandle (int hwnd) {
+override bool checkHandle (HWND hwnd) {
     if (hwnd is handle) return true;
-    return hwnd is OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    return hwnd is cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
 }
 
 override protected void checkSubclass () {
@@ -913,11 +896,11 @@
         * cached bounds.
         */
         if ((style & DWT.VIRTUAL) is 0 && item.cached) {
-            LVITEM lvItem = new LVITEM ();
+            LVITEM lvItem;
             lvItem.mask = OS.LVIF_TEXT | OS.LVIF_INDENT;
             lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
             lvItem.iItem = index;
-            OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+            OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
             item.cached = false;
         }
         if (currentItem is null && drawCount is 0 && OS.IsWindowVisible (handle)) {
@@ -960,7 +943,7 @@
     if (start is 0 && end is count - 1) {
         clearAll ();
     } else {
-        LVITEM lvItem = null;
+        LVITEM lvItem;
         bool cleared = false;
         for (int i=start; i<=end; i++) {
             TableItem item = items [i];
@@ -981,13 +964,13 @@
                 * cached bounds.
                 */
                 if ((style & DWT.VIRTUAL) is 0 && item.cached) {
-                    if (lvItem is null) {
-                        lvItem = new LVITEM ();
+                    //if (lvItem is null) {
+                        //lvItem = new LVITEM ();
                         lvItem.mask = OS.LVIF_TEXT | OS.LVIF_INDENT;
                         lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-                    }
+                    //}
                     lvItem.iItem = i;
-                    OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+                    OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
                     item.cached = false;
                 }
             }
@@ -1034,7 +1017,7 @@
             error (DWT.ERROR_INVALID_RANGE);
         }
     }
-    LVITEM lvItem = null;
+    LVITEM lvItem;
     bool cleared = false;
     for (int i=0; i<indices.length; i++) {
         int index = indices [i];
@@ -1056,13 +1039,13 @@
             * cached bounds.
             */
             if ((style & DWT.VIRTUAL) is 0 && item.cached) {
-                if (lvItem is null) {
-                    lvItem = new LVITEM ();
+                //if (lvItem is null) {
+                    //lvItem = new LVITEM ();
                     lvItem.mask = OS.LVIF_TEXT | OS.LVIF_INDENT;
                     lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-                }
+                //}
                 lvItem.iItem = i;
-                OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
                 item.cached = false;
             }
             if (currentItem is null && drawCount is 0 && OS.IsWindowVisible (handle)) {
@@ -1091,7 +1074,7 @@
  */
 public void clearAll () {
     checkWidget ();
-    LVITEM lvItem = null;
+    LVITEM lvItem;
     bool cleared = false;
     int count = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
     for (int i=0; i<count; i++) {
@@ -1113,13 +1096,13 @@
             * cached bounds.
             */
             if ((style & DWT.VIRTUAL) is 0 && item.cached) {
-                if (lvItem is null) {
-                    lvItem = new LVITEM ();
+                //if (lvItem is null) {
+                    //lvItem = new LVITEM ();
                     lvItem.mask = OS.LVIF_TEXT | OS.LVIF_INDENT;
                     lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-                }
+                //}
                 lvItem.iItem = i;
-                OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
                 item.cached = false;
             }
         }
@@ -1157,9 +1140,9 @@
 //          OS.ReleaseDC (handle, hDC);
 //      }
 //  }
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    RECT rect = new RECT ();
-    OS.GetWindowRect (hwndHeader, rect);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    RECT rect;
+    OS.GetWindowRect (hwndHeader, &rect);
     int height = rect.bottom - rect.top;
     int bits = 0;
     if (wHint !is DWT.DEFAULT) {
@@ -1201,14 +1184,14 @@
     if (EXPLORER_THEME) {
         if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
             explorerTheme = true;
-            OS.SetWindowTheme (handle, Display.EXPLORER, null);
+            OS.SetWindowTheme (handle, Display.EXPLORER.ptr, null);
         }
     }
 
     /* Get the header window proc */
-    if (HeaderProc is 0) {
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-        HeaderProc = OS.GetWindowLong (hwndHeader, OS.GWL_WNDPROC);
+    if (HeaderProc is null) {
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        HeaderProc = cast(WNDPROC) OS.GetWindowLong (hwndHeader, OS.GWL_WNDPROC);
     }
 
     /*
@@ -1221,7 +1204,7 @@
     * not have the problem).  This is the recommended work
     * around from the MSDN.
     */
-    if (!OS.IsWinCE) {
+    static if (!OS.IsWinCE) {
         if (OS.COMCTL32_MAJOR < 6) {
             OS.SendMessage (handle, OS.CCM_SETVERSION, 5, 0);
         }
@@ -1256,7 +1239,7 @@
     * The control will not destroy a font that it did not
     * create.
     */
-    int hFont = OS.GetStockObject (OS.SYSTEM_FONT);
+    auto hFont = OS.GetStockObject (OS.SYSTEM_FONT);
     OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0);
 
     /*
@@ -1266,12 +1249,12 @@
     * The fix is to set the text to an empty string when
     * the column is inserted.
     */
-    LVCOLUMN lvColumn = new LVCOLUMN ();
+    LVCOLUMN lvColumn;
     lvColumn.mask = OS.LVCF_TEXT | OS.LVCF_WIDTH;
-    int hHeap = OS.GetProcessHeap ();
-    int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);
+    auto hHeap = OS.GetProcessHeap ();
+    auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);
     lvColumn.pszText = pszText;
-    OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, 0, lvColumn);
+    OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, 0, &lvColumn);
     OS.HeapFree (hHeap, 0, pszText);
 
     /* Set the extended style bits */
@@ -1292,26 +1275,26 @@
     */
     if (OS.WIN32_VERSION < OS.VERSION (4, 10)) return;
     if ((style & DWT.RIGHT_TO_LEFT) !is 0) {
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
         int bits2 = OS.GetWindowLong (hwndHeader, OS.GWL_EXSTYLE);
         OS.SetWindowLong (hwndHeader, OS.GWL_EXSTYLE, bits2 | OS.WS_EX_LAYOUTRTL);
     }
 }
 
 void createHeaderToolTips () {
-    if (OS.IsWinCE) return;
-    if (headerToolTipHandle !is 0) return;
+    static if (OS.IsWinCE) return;
+    if (headerToolTipHandle !is null) return;
     headerToolTipHandle = OS.CreateWindowEx (
         0,
-        new TCHAR (0, OS.TOOLTIPS_CLASS, true),
+        OS.TOOLTIPS_CLASS.ptr,
         null,
         0,
         OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0,
         handle,
-        0,
+        null,
         OS.GetModuleHandle (null),
         null);
-    if (headerToolTipHandle is 0) error (DWT.ERROR_NO_HANDLES);
+    if (headerToolTipHandle is null) error (DWT.ERROR_NO_HANDLES);
     /*
     * Feature in Windows.  Despite the fact that the
     * tool tip text contains \r\n, the tooltip will
@@ -1337,9 +1320,9 @@
     for (int i=0; i<itemCount; i++) {
         TableItem item = items [i];
         if (item !is null) {
-            String [] strings = item.strings;
+            char[] [] strings = item.strings;
             if (strings !is null) {
-                String [] temp = new String [columnCount + 1];
+                char[] [] temp = new char[] [columnCount + 1];
                 System.arraycopy (strings, 0, temp, 0, index);
                 System.arraycopy (strings, index, temp, index + 1, columnCount -  index);
                 item.strings = temp;
@@ -1354,7 +1337,7 @@
             if (index is 0) {
                 if (columnCount !is 0) {
                     if (strings is null) {
-                        item.strings = new String [columnCount + 1];
+                        item.strings = new char[] [columnCount + 1];
                         item.strings [1] = item.text;
                     }
                     item.text = ""; //$NON-NLS-1$
@@ -1382,11 +1365,11 @@
                 item.cellForeground = temp;
             }
             if (item.cellFont !is null) {
-                int [] cellFont = item.cellFont;
-                int [] temp = new int [columnCount + 1];
+                auto cellFont = item.cellFont;
+                HFONT[] temp = new HFONT[]( columnCount + 1 );
                 System.arraycopy (cellFont, 0, temp, 0, index);
                 System.arraycopy (cellFont, index, temp, index + 1, columnCount - index);
-                temp [index] = -1;
+                temp [index] = cast(HFONT)-1;
                 item.cellFont = temp;
             }
         }
@@ -1409,69 +1392,69 @@
     ignoreColumnResize = true;
     if (index is 0) {
         if (columnCount > 1) {
-            LVCOLUMN lvColumn = new LVCOLUMN ();
+            LVCOLUMN lvColumn;
             lvColumn.mask = OS.LVCF_WIDTH;
-            OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, 1, lvColumn);
-            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 1, lvColumn);
+            OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, 1, &lvColumn);
+            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 1, &lvColumn);
             int width = lvColumn.cx;
             int cchTextMax = 1024;
-            int hHeap = OS.GetProcessHeap ();
+            auto hHeap = OS.GetProcessHeap ();
             int byteCount = cchTextMax * TCHAR.sizeof;
-            int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
+            auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
             lvColumn.mask = OS.LVCF_TEXT | OS.LVCF_IMAGE | OS.LVCF_WIDTH | OS.LVCF_FMT;
             lvColumn.pszText = pszText;
             lvColumn.cchTextMax = cchTextMax;
-            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 0, lvColumn);
-            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 1, lvColumn);
+            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 0, &lvColumn);
+            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 1, &lvColumn);
             lvColumn.fmt = OS.LVCFMT_IMAGE;
             lvColumn.cx = width;
             lvColumn.iImage = OS.I_IMAGENONE;
-            lvColumn.pszText = lvColumn.cchTextMax = 0;
-            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, lvColumn);
+            lvColumn.pszText = null, lvColumn.cchTextMax = 0;
+            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, &lvColumn);
             lvColumn.mask = OS.LVCF_FMT;
             lvColumn.fmt = OS.LVCFMT_LEFT;
-            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, lvColumn);
-            if (pszText !is 0) OS.HeapFree (hHeap, 0, pszText);
+            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, &lvColumn);
+            if (pszText !is null) OS.HeapFree (hHeap, 0, pszText);
         } else {
             OS.SendMessage (handle, OS.LVM_SETCOLUMNWIDTH, 0, 0);
         }
         if ((parent.style & DWT.VIRTUAL) is 0) {
-            LVITEM lvItem = new LVITEM ();
+            LVITEM lvItem;
             lvItem.mask = OS.LVIF_TEXT | OS.LVIF_IMAGE;
             lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
             lvItem.iImage = OS.I_IMAGECALLBACK;
             for (int i=0; i<itemCount; i++) {
                 lvItem.iItem = i;
-                OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
             }
         }
     } else {
         int fmt = OS.LVCFMT_LEFT;
         if ((column.style & DWT.CENTER) is DWT.CENTER) fmt = OS.LVCFMT_CENTER;
         if ((column.style & DWT.RIGHT) is DWT.RIGHT) fmt = OS.LVCFMT_RIGHT;
-        LVCOLUMN lvColumn = new LVCOLUMN ();
+        LVCOLUMN lvColumn;
         lvColumn.mask = OS.LVCF_WIDTH | OS.LVCF_FMT;
         lvColumn.fmt = fmt;
-        OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, index, lvColumn);
+        OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, index, &lvColumn);
     }
     ignoreColumnResize = false;
 
     /* Add the tool tip item for the header */
-    if (headerToolTipHandle !is 0) {
-        RECT rect = new RECT ();
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, rect) !is 0) {
-            TOOLINFO lpti = new TOOLINFO ();
+    if (headerToolTipHandle !is null) {
+        RECT rect;
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) {
+            TOOLINFO lpti;
             lpti.cbSize = TOOLINFO.sizeof;
             lpti.uFlags = OS.TTF_SUBCLASS;
             lpti.hwnd = hwndHeader;
             lpti.uId = column.id = display.nextToolTipId++;
-            lpti.left = rect.left;
-            lpti.top = rect.top;
-            lpti.right = rect.right;
-            lpti.bottom = rect.bottom;
+            lpti.rect.left = rect.left;
+            lpti.rect.top = rect.top;
+            lpti.rect.right = rect.right;
+            lpti.rect.bottom = rect.bottom;
             lpti.lpszText = OS.LPSTR_TEXTCALLBACK;
-            OS.SendMessage (headerToolTipHandle, OS.TTM_ADDTOOL, 0, lpti);
+            OS.SendMessage (headerToolTipHandle, OS.TTM_ADDTOOL, 0, &lpti);
         }
     }
 }
@@ -1492,7 +1475,7 @@
         System.arraycopy (items, 0, newItems, 0, items.length);
         items = newItems;
     }
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_TEXT | OS.LVIF_IMAGE;
     lvItem.iItem = index;
     lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
@@ -1511,7 +1494,7 @@
     /* Insert the item */
     setDeferResize (true);
     ignoreSelect = ignoreShrink = true;
-    int result = OS.SendMessage (handle, OS.LVM_INSERTITEM, 0, lvItem);
+    int result = OS.SendMessage (handle, OS.LVM_INSERTITEM, 0, &lvItem);
     ignoreSelect = ignoreShrink = false;
     if (result is -1) error (DWT.ERROR_ITEM_NOT_ADDED);
     System.arraycopy (items, index, items, index + 1, count - index);
@@ -1535,8 +1518,8 @@
 
 override void deregister () {
     super.deregister ();
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    if (hwndHeader !is 0) display.removeControl (hwndHeader);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    if (hwndHeader !is null) display.removeControl (hwndHeader);
 }
 
 /**
@@ -1560,7 +1543,7 @@
     checkWidget ();
     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (indices.length is 0) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.stateMask = OS.LVIS_SELECTED;
     for (int i=0; i<indices.length; i++) {
         /*
@@ -1569,7 +1552,7 @@
         */
         if (indices [i] >= 0) {
             ignoreSelect = true;
-            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, indices [i], lvItem);
+            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, indices [i], &lvItem);
             ignoreSelect = false;
         }
     }
@@ -1594,10 +1577,10 @@
     * items.  Ensure that index is greater than -1.
     */
     if (index < 0) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.stateMask = OS.LVIS_SELECTED;
     ignoreSelect = true;
-    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, lvItem);
+    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, &lvItem);
     ignoreSelect = false;
 }
 
@@ -1622,7 +1605,7 @@
     if (start is 0 && end is count - 1) {
         deselectAll ();
     } else {
-        LVITEM lvItem = new LVITEM ();
+        LVITEM lvItem;
         lvItem.stateMask = OS.LVIS_SELECTED;
         /*
         * An index of -1 will apply the change to all
@@ -1631,7 +1614,7 @@
         start = Math.max (0, start);
         for (int i=start; i<=end; i++) {
             ignoreSelect = true;
-            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, i, lvItem);
+            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, i, &lvItem);
             ignoreSelect = false;
         }
     }
@@ -1647,11 +1630,11 @@
  */
 public void deselectAll () {
     checkWidget ();
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_STATE;
     lvItem.stateMask = OS.LVIS_SELECTED;
     ignoreSelect = true;
-    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
+    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, &lvItem);
     ignoreSelect = false;
 }
 
@@ -1671,7 +1654,7 @@
     }
     int orderIndex = 0;
     int [] oldOrder = new int [columnCount];
-    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder);
+    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder.ptr);
     while (orderIndex < columnCount) {
         if (oldOrder [orderIndex] is index) break;
         orderIndex++;
@@ -1683,45 +1666,45 @@
         if (columnCount > 1) {
             index = 1;
             int cchTextMax = 1024;
-            int hHeap = OS.GetProcessHeap ();
+            auto hHeap = OS.GetProcessHeap ();
             int byteCount = cchTextMax * TCHAR.sizeof;
-            int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
-            LVCOLUMN lvColumn = new LVCOLUMN ();
+            auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
+            LVCOLUMN lvColumn;
             lvColumn.mask = OS.LVCF_TEXT | OS.LVCF_IMAGE | OS.LVCF_WIDTH | OS.LVCF_FMT;
             lvColumn.pszText = pszText;
             lvColumn.cchTextMax = cchTextMax;
-            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 1, lvColumn);
+            OS.SendMessage (handle, OS.LVM_GETCOLUMN, 1, &lvColumn);
             lvColumn.fmt &= ~(OS.LVCFMT_CENTER | OS.LVCFMT_RIGHT);
             lvColumn.fmt |= OS.LVCFMT_LEFT;
-            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, lvColumn);
-            if (pszText !is 0) OS.HeapFree (hHeap, 0, pszText);
+            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, &lvColumn);
+            if (pszText !is null) OS.HeapFree (hHeap, 0, pszText);
         } else {
-            int hHeap = OS.GetProcessHeap ();
-            int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);
-            LVCOLUMN lvColumn = new LVCOLUMN ();
+            auto hHeap = OS.GetProcessHeap ();
+            auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);
+            LVCOLUMN lvColumn;
             lvColumn.mask = OS.LVCF_TEXT | OS.LVCF_IMAGE | OS.LVCF_WIDTH | OS.LVCF_FMT;
             lvColumn.pszText = pszText;
             lvColumn.iImage = OS.I_IMAGENONE;
             lvColumn.fmt = OS.LVCFMT_LEFT;
-            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, lvColumn);
-            if (pszText !is 0) OS.HeapFree (hHeap, 0, pszText);
+            OS.SendMessage (handle, OS.LVM_SETCOLUMN, 0, &lvColumn);
+            if (pszText !is null) OS.HeapFree (hHeap, 0, pszText);
             if (OS.COMCTL32_MAJOR >= 6) {
-                HDITEM hdItem = new HDITEM ();
+                HDITEM hdItem;
                 hdItem.mask = OS.HDI_FORMAT;
                 hdItem.fmt = OS.HDF_LEFT;
-                int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, hdItem);
+                auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, &hdItem);
             }
         }
         if ((parent.style & DWT.VIRTUAL) is 0) {
-            LVITEM lvItem = new LVITEM ();
+            LVITEM lvItem;
             lvItem.mask = OS.LVIF_TEXT | OS.LVIF_IMAGE;
             lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
             lvItem.iImage = OS.I_IMAGECALLBACK;
             int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
             for (int i=0; i<itemCount; i++) {
                 lvItem.iItem = i;
-                OS.SendMessage (handle, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (handle, OS.LVM_SETITEM, 0, &lvItem);
             }
         }
     }
@@ -1745,11 +1728,11 @@
                 item.cellFont = null;
             } else {
                 if (item.strings !is null) {
-                    String [] strings = item.strings;
+                    char[] [] strings = item.strings;
                     if (index is 0) {
                         item.text = strings [1] !is null ? strings [1] : ""; //$NON-NLS-1$
                     }
-                    String [] temp = new String [columnCount];
+                    char[] [] temp = new char[] [columnCount];
                     System.arraycopy (strings, 0, temp, 0, index);
                     System.arraycopy (strings, index + 1, temp, index, columnCount - index);
                     item.strings = temp;
@@ -1781,8 +1764,8 @@
                     item.cellForeground = temp;
                 }
                 if (item.cellFont !is null) {
-                    int [] cellFont = item.cellFont;
-                    int [] temp = new int [columnCount];
+                    HFONT [] cellFont = item.cellFont;
+                    HFONT [] temp = new HFONT[]( columnCount );
                     System.arraycopy (cellFont, 0, temp, 0, index);
                     System.arraycopy (cellFont, index + 1, temp, index, columnCount - index);
                     item.cellFont = temp;
@@ -1814,14 +1797,14 @@
                 newOrder [count++] = newIndex;
             }
         }
-        OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder);
+        OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder.ptr);
         int j = 0;
         while (j < newOrder.length) {
             if (oldOrder [j] !is newOrder [j]) break;
             j++;
         }
         if (j !is newOrder.length) {
-            OS.SendMessage (handle, OS.LVM_SETCOLUMNORDERARRAY, newOrder.length, newOrder);
+            OS.SendMessage (handle, OS.LVM_SETCOLUMNORDERARRAY, newOrder.length, newOrder.ptr);
             /*
             * Bug in Windows.  When LVM_SETCOLUMNORDERARRAY is used to change
             * the column order, the header redraws correctly but the table does
@@ -1842,12 +1825,12 @@
     }
 
     /* Remove the tool tip item for the header */
-    if (headerToolTipHandle !is 0) {
-        TOOLINFO lpti = new TOOLINFO ();
+    if (headerToolTipHandle !is null) {
+        TOOLINFO lpti;
         lpti.cbSize = TOOLINFO.sizeof;
         lpti.uId = column.id;
-        lpti.hwnd = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-        OS.SendMessage (headerToolTipHandle, OS.TTM_DELTOOL, 0, lpti);
+        lpti.hwnd = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        OS.SendMessage (headerToolTipHandle, OS.TTM_DELTOOL, 0, &lpti);
     }
 }
 
@@ -1878,25 +1861,25 @@
     * the state image list to be the same size as the image list.
     */
     if ((style & DWT.CHECK) is 0) return;
-    int hImageList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
-    if (hImageList is 0) return;
-    int [] cx = new int [1], cy = new int [1];
-    OS.ImageList_GetIconSize (hImageList, cx, cy);
-    int hStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
-    if (hStateList is 0) return;
-    int [] stateCx = new int [1], stateCy = new int [1];
-    OS.ImageList_GetIconSize (hStateList, stateCx, stateCy);
-    if (cx [0] is stateCx [0] && cy [0] is stateCy [0]) return;
-    setCheckboxImageList (cx [0], cy [0], fixScroll);
+    HANDLE hImageList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
+    if (hImageList is null) return;
+    int cx, cy;
+    OS.ImageList_GetIconSize (hImageList, &cx, &cy);
+    HANDLE hStateList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+    if (hStateList is null) return;
+    int stateCx, stateCy;
+    OS.ImageList_GetIconSize (hStateList, &stateCx, &stateCy);
+    if (cx is stateCx && cy is stateCy ) return;
+    setCheckboxImageList (cx, cy, fixScroll);
 }
 
 void fixCheckboxImageListColor (bool fixScroll) {
     if ((style & DWT.CHECK) is 0) return;
-    int hStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
-    if (hStateList is 0) return;
-    int [] cx = new int [1], cy = new int [1];
-    OS.ImageList_GetIconSize (hStateList, cx, cy);
-    setCheckboxImageList (cx [0], cy [0], fixScroll);
+    auto hStateList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+    if (hStateList is null) return;
+    int cx, cy;
+    OS.ImageList_GetIconSize (hStateList, &cx, &cy);
+    setCheckboxImageList (cx, cy, fixScroll);
 }
 
 void fixItemHeight (bool fixScroll) {
@@ -1931,18 +1914,18 @@
         setRedraw (false);
         setTopIndex (0);
     }
-    int hOldList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
-    if (hOldList !is 0) return;
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    RECT rect = new RECT ();
-    OS.GetWindowRect (hwndHeader, rect);
+    auto hOldList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
+    if (hOldList !is null) return;
+    auto hwndHeader = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    RECT rect;
+    OS.GetWindowRect (hwndHeader, &rect);
     int height = rect.bottom - rect.top - 1;
-    int hImageList = OS.ImageList_Create (1, height, 0, 0, 0);
+    auto hImageList = OS.ImageList_Create (1, height, 0, 0, 0);
     OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, hImageList);
     fixCheckboxImageList (false);
     OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, 0);
     if (headerImageList !is null) {
-        int hHeaderImageList = headerImageList.getHandle ();
+        auto hHeaderImageList = headerImageList.getHandle ();
         OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, hHeaderImageList);
     }
     OS.ImageList_Destroy (hImageList);
@@ -2036,7 +2019,7 @@
     checkWidget ();
     if (columnCount is 0) return new int [0];
     int [] order = new int [columnCount];
-    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order);
+    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order.ptr);
     return order;
 }
 
@@ -2108,10 +2091,10 @@
  */
 public int getHeaderHeight () {
     checkWidget ();
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    if (hwndHeader is 0) return 0;
-    RECT rect = new RECT ();
-    OS.GetWindowRect (hwndHeader, rect);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    if (hwndHeader is null) return 0;
+    RECT rect;
+    OS.GetWindowRect (hwndHeader, &rect);
     return rect.bottom - rect.top;
 }
 
@@ -2186,9 +2169,9 @@
 public TableItem getItem (Point point) {
     checkWidget ();
     if (point is null) error (DWT.ERROR_NULL_ARGUMENT);
-    LVHITTESTINFO pinfo = new LVHITTESTINFO ();
-    pinfo.x = point.x;  pinfo.y = point.y;
-    OS.SendMessage (handle, OS.LVM_HITTEST, 0, pinfo);
+    LVHITTESTINFO pinfo;
+    pinfo.pt.x = point.x;  pinfo.pt.y = point.y;
+    OS.SendMessage (handle, OS.LVM_HITTEST, 0, &pinfo);
     if (pinfo.iItem !is -1) {
         /*
         * Bug in Windows.  When the point that is used by
@@ -2201,15 +2184,15 @@
         if (pinfo.iItem is 0) {
             int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
             if ((bits & OS.LVS_NOCOLUMNHEADER) is 0) {
-                int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                if (hwndHeader !is 0) {
-                    RECT rect = new RECT ();
-                    OS.GetWindowRect (hwndHeader, rect);
-                    POINT pt = new POINT ();
-                    pt.x = pinfo.x;
-                    pt.y = pinfo.y;
-                    OS.MapWindowPoints (handle, 0, pt, 1);
-                    if (OS.PtInRect (rect, pt)) return null;
+                auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                if (hwndHeader !is null) {
+                    RECT rect;
+                    OS.GetWindowRect (hwndHeader, &rect);
+                    POINT pt;
+                    pt.x = pinfo.pt.x;
+                    pt.y = pinfo.pt.y;
+                    OS.MapWindowPoints (handle, null, &pt, 1);
+                    if (OS.PtInRect (&rect, pt)) return null;
                 }
             }
         }
@@ -2477,9 +2460,9 @@
 }
 
 bool hasChildren () {
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    int hwndChild = OS.GetWindow (handle, OS.GW_CHILD);
-    while (hwndChild !is 0) {
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndChild = OS.GetWindow (handle, OS.GW_CHILD);
+    while (hwndChild !is null) {
         if (hwndChild !is hwndHeader) return true;
         hwndChild = OS.GetWindow (hwndChild, OS.GW_HWNDNEXT);
     }
@@ -2498,7 +2481,7 @@
         imageList = display.getImageList (style & DWT.RIGHT_TO_LEFT, bounds.width, bounds.height);
         int index = imageList.indexOf (image);
         if (index is -1) index = imageList.add (image);
-        int hImageList = imageList.getHandle ();
+        auto hImageList = imageList.getHandle ();
         /*
         * Bug in Windows.  Making any change to an item that
         * changes the item height of a table while the table
@@ -2515,8 +2498,8 @@
         }
         OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, hImageList);
         if (headerImageList !is null) {
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-            int hHeaderImageList = headerImageList.getHandle ();
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            auto hHeaderImageList = headerImageList.getHandle ();
             OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, hHeaderImageList);
         }
         fixCheckboxImageList (false);
@@ -2539,8 +2522,8 @@
         headerImageList = display.getImageList (style & DWT.RIGHT_TO_LEFT, bounds.width, bounds.height);
         int index = headerImageList.indexOf (image);
         if (index is -1) index = headerImageList.add (image);
-        int hImageList = headerImageList.getHandle ();
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        auto hImageList = headerImageList.getHandle ();
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
         OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, hImageList);
         return index;
     }
@@ -2628,18 +2611,18 @@
  */
 public bool isSelected (int index) {
     checkWidget ();
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_STATE;
     lvItem.stateMask = OS.LVIS_SELECTED;
     lvItem.iItem = index;
-    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, &lvItem);
     return (result !is 0) && ((lvItem.state & OS.LVIS_SELECTED) !is 0);
 }
 
 override void register () {
     super.register ();
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    if (hwndHeader !is 0) display.addControl (hwndHeader, this);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    if (hwndHeader !is null) display.addControl (hwndHeader, this);
 }
 
 override void releaseChildren (bool destroy) {
@@ -2697,16 +2680,16 @@
         display.releaseImageList (imageList);
     }
     if (headerImageList !is null) {
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
         OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, 0);
         display.releaseImageList (headerImageList);
     }
     imageList = headerImageList = null;
-    int hStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+    auto hStateList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
     OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_STATE, 0);
-    if (hStateList !is 0) OS.ImageList_Destroy (hStateList);
-    if (headerToolTipHandle !is 0) OS.DestroyWindow (headerToolTipHandle);
-    headerToolTipHandle = 0;
+    if (hStateList !is null) OS.ImageList_Destroy (hStateList);
+    if (headerToolTipHandle !is null) OS.DestroyWindow (headerToolTipHandle);
+    headerToolTipHandle = null;
 }
 
 /**
@@ -2953,7 +2936,7 @@
     if (indices is null) error (DWT.ERROR_NULL_ARGUMENT);
     int length = indices.length;
     if (length is 0 || ((style & DWT.SINGLE) !is 0 && length > 1)) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.state = OS.LVIS_SELECTED;
     lvItem.stateMask = OS.LVIS_SELECTED;
     for (int i=length-1; i>=0; --i) {
@@ -2963,7 +2946,7 @@
         */
         if (indices [i] >= 0) {
             ignoreSelect = true;
-            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, indices [i], lvItem);
+            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, indices [i], &lvItem);
             ignoreSelect = false;
         }
     }
@@ -2988,11 +2971,11 @@
     * items.  Ensure that index is greater than -1.
     */
     if (index < 0) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.state = OS.LVIS_SELECTED;
     lvItem.stateMask = OS.LVIS_SELECTED;
     ignoreSelect = true;
-    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, lvItem);
+    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, &lvItem);
     ignoreSelect = false;
 }
 
@@ -3033,12 +3016,12 @@
         * An index of -1 will apply the change to all
         * items.  Indices must be greater than -1.
         */
-        LVITEM lvItem = new LVITEM ();
+        LVITEM lvItem;
         lvItem.state = OS.LVIS_SELECTED;
         lvItem.stateMask = OS.LVIS_SELECTED;
         for (int i=start; i<=end; i++) {
             ignoreSelect = true;
-            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, i, lvItem);
+            OS.SendMessage (handle, OS.LVM_SETITEMSTATE, i, &lvItem);
             ignoreSelect = false;
         }
     }
@@ -3058,19 +3041,19 @@
 public void selectAll () {
     checkWidget ();
     if ((style & DWT.SINGLE) !is 0) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_STATE;
     lvItem.state = OS.LVIS_SELECTED;
     lvItem.stateMask = OS.LVIS_SELECTED;
     ignoreSelect = true;
-    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, lvItem);
+    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, -1, &lvItem);
     ignoreSelect = false;
 }
 
-void sendEraseItemEvent (TableItem item, NMLVCUSTOMDRAW nmcd, int lParam) {
-    int hDC = nmcd.hdc;
-    int hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : -1;
-    if (hFont is -1) hFont = item.font;
+void sendEraseItemEvent (TableItem item, NMLVCUSTOMDRAW* nmcd, int lParam) {
+    auto hDC = nmcd.nmcd.hdc;
+    auto hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : cast(HFONT)-1;
+    if (hFont is cast(HFONT)-1) hFont = item.font;
     int clrText = item.cellForeground !is null ? item.cellForeground [nmcd.iSubItem] : -1;
     if (clrText is -1) clrText = item.foreground;
     int clrTextBk = -1;
@@ -3090,18 +3073,18 @@
     * even for items that are not selected.  The fix is to get
     * the selection state from the item.
     */
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_STATE;
     lvItem.stateMask = OS.LVIS_SELECTED;
-    lvItem.iItem = nmcd.dwItemSpec;
-    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+    lvItem.iItem = nmcd.nmcd.dwItemSpec;
+    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, &lvItem);
     bool selected = (result !is 0 && (lvItem.state & OS.LVIS_SELECTED) !is 0);
     GCData data = new GCData ();
     data.device = display;
     int clrSelectionBk = -1;
     bool drawSelected = false, drawBackground = false, drawHot = false;
     if (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0) {
-        drawHot = hotIndex is nmcd.dwItemSpec;
+        drawHot = hotIndex is nmcd.nmcd.dwItemSpec;
     }
     if (OS.IsWindowEnabled (handle)) {
         if (selected && (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0)) {
@@ -3141,16 +3124,16 @@
     }
     data.hFont = hFont;
     data.uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
-    int nSavedDC = OS.SaveDC (hDC);
+    auto nSavedDC = OS.SaveDC (hDC);
     GC gc = GC.win32_new (hDC, data);
-    RECT cellRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, true, hDC);
+    RECT cellRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, true, hDC);
     Event event = new Event ();
     event.item = item;
     event.gc = gc;
     event.index = nmcd.iSubItem;
     event.detail |= DWT.FOREGROUND;
-//  if ((nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
-    if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.dwItemSpec) {
+//  if ((nmcd.nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
+    if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.nmcd.dwItemSpec) {
         if (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0) {
             if (handle is OS.GetFocus ()) {
                 int uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
@@ -3168,7 +3151,7 @@
     gc.setClipping (event.x, event.y, event.width, event.height);
     sendEvent (DWT.EraseItem, event);
     event.gc = null;
-    int clrSelectionText = data.foreground;
+    auto clrSelectionText = data.foreground;
     gc.dispose ();
     OS.RestoreDC (hDC, nSavedDC);
     if (isDisposed () || item.isDisposed ()) return;
@@ -3187,40 +3170,40 @@
             if (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0) {
                 selectionForeground = clrSelectionText;
             }
-            nmcd.uItemState &= ~OS.CDIS_SELECTED;
+            nmcd.nmcd.uItemState &= ~OS.CDIS_SELECTED;
             OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
         }
     } else {
         if (ignoreDrawSelection) {
-            nmcd.uItemState |= OS.CDIS_SELECTED;
+            nmcd.nmcd.uItemState |= OS.CDIS_SELECTED;
             OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
         }
     }
     if (ignoreDrawFocus) {
-        nmcd.uItemState &= ~OS.CDIS_FOCUS;
+        nmcd.nmcd.uItemState &= ~OS.CDIS_FOCUS;
         OS.MoveMemory (lParam, nmcd, NMLVCUSTOMDRAW.sizeof);
     }
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     bool firstColumn = nmcd.iSubItem is OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, 0, 0);
     if (ignoreDrawForeground && ignoreDrawHot) {
         if (!ignoreDrawBackground && drawBackground) {
-            RECT backgroundRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, false, true, false, hDC);
-            fillBackground (hDC, clrTextBk, backgroundRect);
+            RECT backgroundRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, false, true, false, hDC);
+            fillBackground (hDC, clrTextBk, &backgroundRect);
         }
     }
     if (!ignoreDrawHot || (!ignoreDrawSelection && clrSelectionBk !is -1)) {
         if (explorerTheme) {
             bool hot = drawHot;
-            RECT pClipRect = new RECT ();
-            OS.SetRect (pClipRect, nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
-            RECT rect = new RECT ();
-            OS.SetRect (rect, nmcd.left, nmcd.top, nmcd.right, nmcd.bottom);
+            RECT pClipRect;
+            OS.SetRect (&pClipRect, nmcd.nmcd.rc.left, nmcd.nmcd.rc.top, nmcd.nmcd.rc.right, nmcd.nmcd.rc.bottom);
+            RECT rect;
+            OS.SetRect (&rect, nmcd.nmcd.rc.left, nmcd.nmcd.rc.top, nmcd.nmcd.rc.right, nmcd.nmcd.rc.bottom);
             if ((style & DWT.FULL_SELECTION) !is 0) {
                 int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
                 int index = OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, count - 1, 0);
-                RECT headerRect = new RECT ();
-                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);
-                OS.MapWindowPoints (hwndHeader, handle, headerRect, 2);
+                RECT headerRect;
+                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
+                OS.MapWindowPoints (hwndHeader, handle, cast(POINT*) &headerRect, 2);
                 rect.left = 0;
                 rect.right = headerRect.right;
                 pClipRect.left = cellRect.left;
@@ -3229,32 +3212,32 @@
                 rect.right += EXPLORER_EXTRA;
                 pClipRect.right += EXPLORER_EXTRA;
             }
-            int hTheme = OS.OpenThemeData (handle, Display.LISTVIEW);
+            auto hTheme = OS.OpenThemeData (handle, Display.LISTVIEW.ptr);
             int iStateId = selected ? OS.LISS_SELECTED : OS.LISS_HOT;
             if (OS.GetFocus () !is handle && selected && !hot) iStateId = OS.LISS_SELECTEDNOTFOCUS;
-            OS.DrawThemeBackground (hTheme, hDC, OS.LVP_LISTITEM, iStateId, rect, pClipRect);
+            OS.DrawThemeBackground (hTheme, hDC, OS.LVP_LISTITEM, iStateId, &rect, &pClipRect);
             OS.CloseThemeData (hTheme);
         } else {
             bool fullText = ((style & DWT.FULL_SELECTION) !is 0 || !firstColumn);
-            RECT textRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, false, fullText, false, hDC);
-            fillBackground (hDC, clrSelectionBk, textRect);
+            RECT textRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, false, fullText, false, hDC);
+            fillBackground (hDC, clrSelectionBk, &textRect);
         }
     }
     if (ignoreDrawForeground) {
-        RECT clipRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, false, hDC);
+        RECT clipRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, false, hDC);
         OS.SaveDC (hDC);
-        OS.SelectClipRgn (hDC, 0);
+        OS.SelectClipRgn (hDC, null);
         OS.ExcludeClipRect (hDC, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom);
     }
 }
 
-Event sendMeasureItemEvent (TableItem item, int row, int column, int hDC) {
-    int hFont = item.cellFont !is null ? item.cellFont [column] : -1;
-    if (hFont is -1) hFont = item.font;
+Event sendMeasureItemEvent (TableItem item, int row, int column, HDC hDC) {
+    auto hFont = item.cellFont !is null ? item.cellFont [column] : cast(HFONT)-1;
+    if (hFont is cast(HFONT)-1) hFont = item.font;
     GCData data = new GCData ();
     data.device = display;
     data.hFont = hFont;
-    int nSavedDC = OS.SaveDC (hDC);
+    auto nSavedDC = OS.SaveDC (hDC);
     GC gc = GC.win32_new (hDC, data);
     RECT itemRect = item.getBounds (row, column, true, true, false, false, hDC);
     Event event = new Event ();
@@ -3294,10 +3277,10 @@
     * box, the widget eats the mouse up.  When the mouse is dragged,
     * the widget does not eat the mouse up.
     */
-    LVHITTESTINFO pinfo = new LVHITTESTINFO ();
-    pinfo.x = (short) (lParam & 0xFFFF);
-    pinfo.y = (short) (lParam >> 16);
-    OS.SendMessage (handle, OS.LVM_HITTEST, 0, pinfo);
+    LVHITTESTINFO pinfo;
+    pinfo.pt.x = cast(short) (lParam & 0xFFFF);
+    pinfo.pt.y = cast(short) (lParam >> 16);
+    OS.SendMessage (handle, OS.LVM_HITTEST, 0, &pinfo);
     Display display = this.display;
     display.captureChanged = false;
     if (!sendMouseEvent (type, button, handle, msg, wParam, lParam)) {
@@ -3345,11 +3328,11 @@
     bool forceSelect = false;
     int count = OS.SendMessage (handle, OS.LVM_GETSELECTEDCOUNT, 0, 0);
     if (count is 1 && pinfo.iItem !is -1) {
-        LVITEM lvItem = new LVITEM ();
+        LVITEM lvItem;
         lvItem.mask = OS.LVIF_STATE;
         lvItem.stateMask = OS.LVIS_SELECTED;
         lvItem.iItem = pinfo.iItem;
-        OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+        OS.SendMessage (handle, OS.LVM_GETITEM, 0, &lvItem);
         if ((lvItem.state & OS.LVIS_SELECTED) !is 0) {
             forceSelect = true;
         }
@@ -3385,30 +3368,30 @@
         }
     }
     dragStarted = false;
-    return new LRESULT (code);
+    return cast(LRESULT) (code);
 }
 
-void sendPaintItemEvent (TableItem item, NMLVCUSTOMDRAW nmcd) {
-    int hDC = nmcd.hdc;
+void sendPaintItemEvent (TableItem item, NMLVCUSTOMDRAW* nmcd) {
+    auto hDC = nmcd.nmcd.hdc;
     GCData data = new GCData ();
     data.device = display;
-    int hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : -1;
-    if (hFont is -1) hFont = item.font;
+    auto hFont = item.cellFont !is null ? item.cellFont [nmcd.iSubItem] : cast(HFONT)-1;
+    if (hFont is cast(HFONT)-1) hFont = item.font;
     data.hFont = hFont;
     /*
     * Bug in Windows.  For some reason, CDIS_SELECTED always set,
     * even for items that are not selected.  The fix is to get
     * the selection state from the item.
     */
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.mask = OS.LVIF_STATE;
     lvItem.stateMask = OS.LVIS_SELECTED;
-    lvItem.iItem = nmcd.dwItemSpec;
-    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, lvItem);
+    lvItem.iItem = nmcd.nmcd.dwItemSpec;
+    int result = OS.SendMessage (handle, OS.LVM_GETITEM, 0, &lvItem);
     bool selected = result !is 0 && (lvItem.state & OS.LVIS_SELECTED) !is 0;
     bool drawSelected = false, drawBackground = false, drawHot = false;
     if (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0) {
-        drawHot = hotIndex is nmcd.dwItemSpec;
+        drawHot = hotIndex is nmcd.nmcd.dwItemSpec;
     }
     if (OS.IsWindowEnabled (handle)) {
         if (selected && (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0)) {
@@ -3456,16 +3439,16 @@
         data.background = OS.GetSysColor (OS.COLOR_3DFACE);
     }
     data.uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
-    int nSavedDC = OS.SaveDC (hDC);
+    auto nSavedDC = OS.SaveDC (hDC);
     GC gc = GC.win32_new (hDC, data);
-    RECT itemRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, true, false, false, hDC);
+    RECT itemRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, true, false, false, hDC);
     Event event = new Event ();
     event.item = item;
     event.gc = gc;
     event.index = nmcd.iSubItem;
     event.detail |= DWT.FOREGROUND;
-//  if ((nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
-    if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.dwItemSpec) {
+//  if ((nmcd.nmcd.uItemState & OS.CDIS_FOCUS) !is 0) {
+    if (OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED) is nmcd.nmcd.dwItemSpec) {
         if (nmcd.iSubItem is 0 || (style & DWT.FULL_SELECTION) !is 0) {
             if (handle is OS.GetFocus ()) {
                 int uiState = OS.SendMessage (handle, OS.WM_QUERYUISTATE, 0, 0);
@@ -3480,7 +3463,7 @@
     event.y = itemRect.top;
     event.width = itemRect.right - itemRect.left;
     event.height = itemRect.bottom - itemRect.top;
-    RECT cellRect = item.getBounds (nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, true, hDC);
+    RECT cellRect = item.getBounds (nmcd.nmcd.dwItemSpec, nmcd.iSubItem, true, true, true, true, hDC);
     int cellWidth = cellRect.right - cellRect.left;
     int cellHeight = cellRect.bottom - cellRect.top;
     gc.setClipping (cellRect.left, cellRect.top, cellWidth, cellHeight);
@@ -3490,9 +3473,9 @@
     OS.RestoreDC (hDC, nSavedDC);
 }
 
-override void setBackgroundImage (int hBitmap) {
+override void setBackgroundImage (HBITMAP hBitmap) {
     super.setBackgroundImage (hBitmap);
-    if (!customDraw) setBackgroundTransparent (hBitmap !is 0);
+    if (!customDraw) setBackgroundTransparent (hBitmap !is null);
 }
 
 override void setBackgroundPixel (int newPixel) {
@@ -3643,14 +3626,14 @@
 public void setColumnOrder (int [] order) {
     checkWidget ();
     if (order is null) error (DWT.ERROR_NULL_ARGUMENT);
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     if (columnCount is 0) {
         if (order.length !is 0) error (DWT.ERROR_INVALID_ARGUMENT);
         return;
     }
     if (order.length !is columnCount) error (DWT.ERROR_INVALID_ARGUMENT);
     int [] oldOrder = new int [columnCount];
-    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder);
+    OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, oldOrder.ptr);
     bool reorder = false;
     bool [] seen = new bool [columnCount];
     for (int i=0; i<order.length; i++) {
@@ -3663,10 +3646,10 @@
     if (reorder) {
         RECT [] oldRects = new RECT [columnCount];
         for (int i=0; i<columnCount; i++) {
-            oldRects [i] = new RECT ();
-            OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, oldRects [i]);
+            //oldRects [i] = new RECT ();
+            OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, &oldRects [i]);
         }
-        OS.SendMessage (handle, OS.LVM_SETCOLUMNORDERARRAY, order.length, order);
+        OS.SendMessage (handle, OS.LVM_SETCOLUMNORDERARRAY, order.length, order.ptr);
         /*
         * Bug in Windows.  When LVM_SETCOLUMNORDERARRAY is used to change
         * the column order, the header redraws correctly but the table does
@@ -3675,11 +3658,11 @@
         OS.InvalidateRect (handle, null, true);
         TableColumn[] newColumns = new TableColumn [columnCount];
         System.arraycopy (columns, 0, newColumns, 0, columnCount);
-        RECT newRect = new RECT ();
+        RECT newRect;
         for (int i=0; i<columnCount; i++) {
             TableColumn column = newColumns [i];
             if (!column.isDisposed ()) {
-                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, newRect);
+                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, &newRect);
                 if (newRect.left !is oldRects [i].left) {
                     column.updateToolTip (i);
                     column.sendEvent (DWT.Move);
@@ -3713,12 +3696,12 @@
                 if (--drawCount is 0 /*&& OS.IsWindowVisible (handle)*/) {
                     OS.DefWindowProc (handle, OS.WM_SETREDRAW, 1, 0);
                     if (OS.IsWinCE) {
-                        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                        if (hwndHeader !is 0) OS.InvalidateRect (hwndHeader, null, true);
+                        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                        if (hwndHeader !is null) OS.InvalidateRect (hwndHeader, null, true);
                         OS.InvalidateRect (handle, null, true);
                     } else {
                         int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN;
-                        OS.RedrawWindow (handle, null, 0, flags);
+                        OS.RedrawWindow (handle, null, null, flags);
                     }
                 }
             }
@@ -3727,7 +3710,7 @@
                 setResizeChildren (false);
                 sendEvent (DWT.Resize);
                 if (isDisposed ()) return;
-                if (layout !is null) {
+                if (layout_ !is null) {
                     markLayout (false, false);
                     updateLayout (false, false);
                 }
@@ -3743,9 +3726,9 @@
     if (OS.IsWinCE) {
         flags |= OS.ILC_COLOR;
     } else {
-        int hDC = OS.GetDC (handle);
-        int bits = OS.GetDeviceCaps (hDC, OS.BITSPIXEL);
-        int planes = OS.GetDeviceCaps (hDC, OS.PLANES);
+        auto hDC = OS.GetDC (handle);
+        auto bits = OS.GetDeviceCaps (hDC, OS.BITSPIXEL);
+        auto planes = OS.GetDeviceCaps (hDC, OS.PLANES);
         OS.ReleaseDC (handle, hDC);
         int depth = bits * planes;
         switch (depth) {
@@ -3759,13 +3742,13 @@
     }
     if ((style & DWT.RIGHT_TO_LEFT) !is 0) flags |= OS.ILC_MIRROR;
     if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) flags |= OS.ILC_MASK;
-    int hStateList = OS.ImageList_Create (width, height, flags, count, count);
-    int hDC = OS.GetDC (handle);
-    int memDC = OS.CreateCompatibleDC (hDC);
-    int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
-    int hOldBitmap = OS.SelectObject (memDC, hBitmap);
-    RECT rect = new RECT ();
-    OS.SetRect (rect, 0, 0, width * count, height);
+    auto hStateList = OS.ImageList_Create (width, height, flags, count, count);
+    auto hDC = OS.GetDC (handle);
+    auto memDC = OS.CreateCompatibleDC (hDC);
+    auto hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
+    auto hOldBitmap = OS.SelectObject (memDC, hBitmap);
+    RECT rect;
+    OS.SetRect (&rect, 0, 0, width * count, height);
     int clrBackground;
     if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
         Control control = findBackgroundControl ();
@@ -3777,40 +3760,40 @@
             clrBackground = 0x0200FF00;
         }
     }
-    int hBrush = OS.CreateSolidBrush (clrBackground);
-    OS.FillRect (memDC, rect, hBrush);
+    auto hBrush = OS.CreateSolidBrush (clrBackground);
+    OS.FillRect (memDC, &rect, hBrush);
     OS.DeleteObject (hBrush);
-    int oldFont = OS.SelectObject (hDC, defaultFont ());
-    TEXTMETRIC tm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();
-    OS.GetTextMetrics (hDC, tm);
+    auto oldFont = OS.SelectObject (hDC, defaultFont ());
+    TEXTMETRIC tm;
+    OS.GetTextMetrics (hDC, &tm);
     OS.SelectObject (hDC, oldFont);
     int itemWidth = Math.min (tm.tmHeight, width);
     int itemHeight = Math.min (tm.tmHeight, height);
     int left = (width - itemWidth) / 2, top = (height - itemHeight) / 2 + 1;
-    OS.SetRect (rect, left, top, left + itemWidth, top + itemHeight);
+    OS.SetRect (&rect, left, top, left + itemWidth, top + itemHeight);
     if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
-        int hTheme = display.hButtonTheme ();
-        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);
+        auto hTheme = display.hButtonTheme ();
+        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, &rect, null);
         rect.left += width;  rect.right += width;
-        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_CHECKEDNORMAL, rect, null);
+        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_CHECKEDNORMAL, &rect, null);
         rect.left += width;  rect.right += width;
-        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);
+        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, &rect, null);
         rect.left += width;  rect.right += width;
-        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_MIXEDNORMAL, rect, null);
+        OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_MIXEDNORMAL, &rect, null);
     } else {
-        OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_FLAT);
+        OS.DrawFrameControl (memDC, &rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_FLAT);
         rect.left += width;  rect.right += width;
-        OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_FLAT);
+        OS.DrawFrameControl (memDC, &rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_FLAT);
         rect.left += width;  rect.right += width;
-        OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_INACTIVE | OS.DFCS_FLAT);
+        OS.DrawFrameControl (memDC, &rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_INACTIVE | OS.DFCS_FLAT);
         rect.left += width;  rect.right += width;
-        OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_INACTIVE | OS.DFCS_FLAT);
+        OS.DrawFrameControl (memDC, &rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_INACTIVE | OS.DFCS_FLAT);
     }
     OS.SelectObject (memDC, hOldBitmap);
     OS.DeleteDC (memDC);
     OS.ReleaseDC (handle, hDC);
     if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
-        OS.ImageList_Add (hStateList, hBitmap, 0);
+        OS.ImageList_Add (hStateList, hBitmap, null);
     } else {
         OS.ImageList_AddMasked (hStateList, hBitmap, clrBackground);
     }
@@ -3829,9 +3812,9 @@
         setRedraw (false);
         setTopIndex (0);
     }
-    int hOldStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+    auto hOldStateList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
     OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_STATE, hStateList);
-    if (hOldStateList !is 0) OS.ImageList_Destroy (hOldStateList);
+    if (hOldStateList !is null) OS.ImageList_Destroy (hOldStateList);
     /*
     * Bug in Windows.  Setting the LVSIL_STATE state image list
     * when the table already has a LVSIL_SMALL image list causes
@@ -3839,7 +3822,7 @@
     * LVSIL_SMALL image list.
     */
     if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {
-        int hImageList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
+        auto hImageList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
         OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, hImageList);
     }
     if (fixScroll && topIndex !is 0) {
@@ -3855,11 +3838,11 @@
     * items.  Ensure that index is greater than -1.
     */
     if (index < 0) return;
-    LVITEM lvItem = new LVITEM ();
+    LVITEM lvItem;
     lvItem.state = OS.LVIS_FOCUSED;
     lvItem.stateMask = OS.LVIS_FOCUSED;
     ignoreSelect = true;
-    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, lvItem);
+    OS.SendMessage (handle, OS.LVM_SETITEMSTATE, index, &lvItem);
     ignoreSelect = false;
     OS.SendMessage (handle, OS.LVM_SETSELECTIONMARK, 0, index);
 }
@@ -3900,7 +3883,7 @@
     * to be redrawn but not the column headers.  The fix is
     * to force a redraw of the column headers.
     */
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     OS.InvalidateRect (hwndHeader, null, true);
 }
 
@@ -4058,7 +4041,7 @@
         * WM_SETFONT which recomputes and assigns the default item
         * height.
         */
-        int hFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
+        auto hFont = cast(HFONT) OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
         OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0);
     } else {
         /*
@@ -4068,15 +4051,15 @@
         * WM_MEASUREITEM to be sent, then clear LVS_OWNERDRAWFIXED.
         */
         forceResize ();
-        RECT rect = new RECT ();
-        OS.GetWindowRect (handle, rect);
+        RECT rect;
+        OS.GetWindowRect (handle, &rect);
         int width = rect.right - rect.left, height = rect.bottom - rect.top;
         int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
         OS.SetWindowLong (handle, OS.GWL_STYLE, bits | OS.LVS_OWNERDRAWFIXED);
         int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOREDRAW | OS.SWP_NOZORDER;
         ignoreResize = true;
-        SetWindowPos (handle, 0 , 0, 0, width, height + 1, flags);
-        SetWindowPos (handle, 0 , 0, 0, width, height, flags);
+        SetWindowPos (handle, null , 0, 0, width, height + 1, flags);
+        SetWindowPos (handle, null , 0, 0, width, height, flags);
         ignoreResize = false;
         OS.SetWindowLong (handle, OS.GWL_STYLE, bits);
     }
@@ -4178,20 +4161,20 @@
             */
             setDeferResize (true);
             OS.SendMessage (handle, OS.WM_SETREDRAW, 1, 0);
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-            if (hwndHeader !is 0) OS.SendMessage (hwndHeader, OS.WM_SETREDRAW, 1, 0);
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            if (hwndHeader !is null) OS.SendMessage (hwndHeader, OS.WM_SETREDRAW, 1, 0);
             if ((state & HIDDEN) !is 0) {
                 state &= ~HIDDEN;
                 OS.ShowWindow (handle, OS.SW_HIDE);
             } else {
                 if (OS.IsWinCE) {
                     OS.InvalidateRect (handle, null, false);
-                    if (hwndHeader !is 0) {
+                    if (hwndHeader !is null) {
                         OS.InvalidateRect (hwndHeader, null, false);
                     }
                 } else {
                     int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN;
-                    OS.RedrawWindow (handle, null, 0, flags);
+                    OS.RedrawWindow (handle, null, null, flags);
                 }
             }
             setDeferResize (false);
@@ -4199,8 +4182,8 @@
     } else {
         if (drawCount++ is 0) {
             OS.SendMessage (handle, OS.WM_SETREDRAW, 0, 0);
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-            if (hwndHeader !is 0) OS.SendMessage (hwndHeader, OS.WM_SETREDRAW, 0, 0);
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            if (hwndHeader !is null) OS.SendMessage (hwndHeader, OS.WM_SETREDRAW, 0, 0);
 
             /*
             * When many items are added to a table, it is faster to
@@ -4238,35 +4221,35 @@
         int newWidth = 0, imageIndent = 0, index = 0;
         int itemCount = OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
         while (index < itemCount) {
-            String string = null;
-            int font = -1;
+            char[] string = null;
+            HFONT font = cast(HFONT)-1;
             if (item !is null) {
                 string = item.text;
                 imageIndent = Math.max (imageIndent, item.imageIndent);
                 if (item.cellFont !is null) font = item.cellFont [0];
-                if (font is -1) font = item.font;
+                if (font is cast(HFONT)-1) font = item.font;
             } else {
                 if (items [index] !is null) {
                     TableItem tableItem = items [index];
                     string = tableItem.text;
                     imageIndent = Math.max (imageIndent, tableItem.imageIndent);
                     if (tableItem.cellFont !is null) font = tableItem.cellFont [0];
-                    if (font is -1) font = tableItem.font;
+                    if (font is cast(HFONT)-1) font = tableItem.font;
                 }
             }
-            if (string !is null && string.length () !is 0) {
-                if (font !is -1) {
-                    int hDC = OS.GetDC (handle);
-                    int oldFont = OS.SelectObject (hDC, font);
+            if (string !is null && string.length !is 0) {
+                if (font !is cast(HFONT)-1) {
+                    auto hDC = OS.GetDC (handle);
+                    auto oldFont = OS.SelectObject (hDC, font);
                     int flags = OS.DT_CALCRECT | OS.DT_SINGLELINE | OS.DT_NOPREFIX;
-                    TCHAR buffer = new TCHAR (getCodePage (), string, false);
-                    RECT rect = new RECT ();
-                    OS.DrawText (hDC, buffer, buffer.length (), rect, flags);
+                    TCHAR[] buffer = StrToTCHARs (getCodePage (), string, false);
+                    RECT rect;
+                    OS.DrawText (hDC, buffer.ptr, buffer.length, &rect, flags);
                     OS.SelectObject (hDC, oldFont);
                     OS.ReleaseDC (handle, hDC);
                     newWidth = Math.max (newWidth, rect.right - rect.left);
                 } else {
-                    TCHAR buffer = new TCHAR (getCodePage (), string, true);
+                    TCHAR* buffer = StrToTCHARz (getCodePage (), string );
                     newWidth = Math.max (newWidth, OS.SendMessage (handle, OS.LVM_GETSTRINGWIDTH, 0, buffer));
                 }
             }
@@ -4284,20 +4267,20 @@
         * space.
         */
         if (newWidth is 0) {
-            TCHAR buffer = new TCHAR (getCodePage (), " ", true);
-            newWidth = Math.max (newWidth, OS.SendMessage (handle, OS.LVM_GETSTRINGWIDTH, 0, buffer));
+            TCHAR[] buffer = StrToTCHARs (getCodePage (), " ", true);
+            newWidth = Math.max (newWidth, OS.SendMessage (handle, OS.LVM_GETSTRINGWIDTH, 0, buffer.ptr));
         }
-        int hStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
-        if (hStateList !is 0) {
-            int [] cx = new int [1], cy = new int [1];
-            OS.ImageList_GetIconSize (hStateList, cx, cy);
-            newWidth += cx [0] + INSET;
+        auto hStateList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+        if (hStateList !is null) {
+            int cx, cy;
+            OS.ImageList_GetIconSize (hStateList, &cx, &cy);
+            newWidth += cx + INSET;
         }
-        int hImageList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
-        if (hImageList !is 0) {
-            int [] cx = new int [1], cy = new int [1];
-            OS.ImageList_GetIconSize (hImageList, cx, cy);
-            newWidth += (imageIndent + 1) * cx [0];
+        auto hImageList = cast(HANDLE) OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_SMALL, 0);
+        if (hImageList !is null) {
+            int cx, cy;
+            OS.ImageList_GetIconSize (hImageList, &cx, &cy);
+            newWidth += (imageIndent + 1) * cx;
         } else {
             /*
             * Bug in Windows.  When LVM_SETIMAGELIST is used to remove the
@@ -4332,12 +4315,12 @@
             if (redraw) {
                 OS.DefWindowProc (handle, OS.WM_SETREDRAW, 1, 0);
                 if (OS.IsWinCE) {
-                    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                    if (hwndHeader !is 0) OS.InvalidateRect (hwndHeader, null, true);
+                    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                    if (hwndHeader !is null) OS.InvalidateRect (hwndHeader, null, true);
                     OS.InvalidateRect (handle, null, true);
                 } else {
                     int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN;
-                    OS.RedrawWindow (handle, null, 0, flags);
+                    OS.RedrawWindow (handle, null, null, flags);
                 }
             }
             return true;
@@ -4403,7 +4386,7 @@
 public void setSelection (TableItem  item) {
     checkWidget ();
     if (item is null) error (DWT.ERROR_NULL_ARGUMENT);
-    setSelection (new TableItem [] {item});
+    setSelection ([item]);
 }
 
 /**
@@ -4557,7 +4540,7 @@
 
 void setSubImagesVisible (bool visible) {
     int dwExStyle = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
-    if ((dwExStyle & OS.LVS_EX_SUBITEMIMAGES) !is 0 is visible) return;
+    if (((dwExStyle & OS.LVS_EX_SUBITEMIMAGES) !is 0 ) is visible) return;
     int bits = visible ? OS.LVS_EX_SUBITEMIMAGES : 0;
     OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, OS.LVS_EX_SUBITEMIMAGES, bits);
 }
@@ -4573,12 +4556,12 @@
         * Windows to reserve the smallest possible space when an image
         * list is removed.
         */
-        int hImageList = OS.ImageList_Create (1, 1, 0, 0, 0);
+        auto hImageList = OS.ImageList_Create (1, 1, 0, 0, 0);
         OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, hImageList);
         OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_SMALL, 0);
         if (headerImageList !is null) {
-            int hHeaderImageList = headerImageList.getHandle ();
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            auto hHeaderImageList = headerImageList.getHandle ();
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
             OS.SendMessage (hwndHeader, OS.HDM_SETIMAGELIST, 0, hHeaderImageList);
         }
         OS.ImageList_Destroy (hImageList);
@@ -4659,10 +4642,10 @@
     }
 
     /* Use LVM_SCROLL to scroll the table */
-    RECT rect = new RECT ();
+    RECT rect;
     rect.left = OS.LVIR_BOUNDS;
     ignoreCustomDraw = true;
-    OS.SendMessage (handle, OS.LVM_GETITEMRECT, 0, rect);
+    OS.SendMessage (handle, OS.LVM_GETITEMRECT, 0, &rect);
     ignoreCustomDraw = false;
     int dy = (index - topIndex) * (rect.bottom - rect.top);
     OS.SendMessage (handle, OS.LVM_SCROLL, 0, dy);
@@ -4702,12 +4685,12 @@
     * the width of the first. The left edge of the second column is
     * also used as the right edge of the first.
     */
-    RECT itemRect = new RECT ();
+    RECT itemRect;
     itemRect.left = OS.LVIR_BOUNDS;
     if (index is 0) {
         itemRect.top = 1;
         ignoreCustomDraw = true;
-        OS.SendMessage (handle, OS.LVM_GETSUBITEMRECT, -1, itemRect);
+        OS.SendMessage (handle, OS.LVM_GETSUBITEMRECT, -1, &itemRect);
         ignoreCustomDraw = false;
         itemRect.right = itemRect.left;
         int width = OS.SendMessage (handle, OS.LVM_GETCOLUMNWIDTH, 0, 0);
@@ -4715,7 +4698,7 @@
     } else {
         itemRect.top = index;
         ignoreCustomDraw = true;
-        OS.SendMessage (handle, OS.LVM_GETSUBITEMRECT, -1, itemRect);
+        OS.SendMessage (handle, OS.LVM_GETSUBITEMRECT, -1, &itemRect);
         ignoreCustomDraw = false;
     }
     /*
@@ -4728,14 +4711,14 @@
     int oldPos = 0;
     int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
     if ((bits & OS.LVS_EX_GRIDLINES) !is 0) {
-        SCROLLINFO info = new SCROLLINFO ();
+        SCROLLINFO info;
         info.cbSize = SCROLLINFO.sizeof;
         info.fMask = OS.SIF_POS;
-        OS.GetScrollInfo (handle, OS.SB_HORZ, info);
+        OS.GetScrollInfo (handle, OS.SB_HORZ, &info);
         oldPos = info.nPos;
     }
-    RECT rect = new RECT ();
-    OS.GetClientRect (handle, rect);
+    RECT rect;
+    OS.GetClientRect (handle, &rect);
     if (itemRect.left < rect.left) {
         int dx = itemRect.left - rect.left;
         OS.SendMessage (handle, OS.LVM_SCROLL, dx, 0);
@@ -4754,14 +4737,14 @@
     * get the new scroll position and redraw the new area.
     */
     if ((bits & OS.LVS_EX_GRIDLINES) !is 0) {
-        SCROLLINFO info = new SCROLLINFO ();
+        SCROLLINFO info;
         info.cbSize = SCROLLINFO.sizeof;
         info.fMask = OS.SIF_POS;
-        OS.GetScrollInfo (handle, OS.SB_HORZ, info);
+        OS.GetScrollInfo (handle, OS.SB_HORZ, &info);
         int newPos = info.nPos;
         if (newPos < oldPos) {
             rect.right = oldPos - newPos + GRID_WIDTH;
-            OS.InvalidateRect (handle, rect, true);
+            OS.InvalidateRect (handle, &rect, true);
         }
     }
 }
@@ -4861,19 +4844,19 @@
 
 override void subclass () {
     super.subclass ();
-    if (HeaderProc !is 0) {
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    if (HeaderProc !is null) {
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
         OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, display.windowProc);
     }
 }
 
-override String toolTipText (NMTTDISPINFO hdr) {
-    int hwndToolTip = OS.SendMessage (handle, OS.LVM_GETTOOLTIPS, 0, 0);
-    if (hwndToolTip is hdr.hwndFrom && toolTipText !is null) return ""; //$NON-NLS-1$
-    if (headerToolTipHandle is hdr.hwndFrom) {
+override char[] toolTipText (NMTTDISPINFO* hdr) {
+    auto hwndToolTip = cast(HWND) OS.SendMessage (handle, OS.LVM_GETTOOLTIPS, 0, 0);
+    if (hwndToolTip is hdr.hdr.hwndFrom && toolTipText_ !is null) return ""; //$NON-NLS-1$
+    if (headerToolTipHandle is hdr.hdr.hwndFrom) {
         for (int i=0; i<columnCount; i++) {
             TableColumn column = columns [i];
-            if (column.id is hdr.idFrom) return column.toolTipText;
+            if (column.id is hdr.hdr.idFrom) return column.toolTipText;
         }
     }
     return super.toolTipText (hdr);
@@ -4881,9 +4864,9 @@
 
 override void unsubclass () {
     super.unsubclass ();
-    if (HeaderProc !is 0) {
-        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-        OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, HeaderProc);
+    if (HeaderProc !is null) {
+        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+        OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int) HeaderProc);
     }
 }
 
@@ -4900,38 +4883,38 @@
     * NOTE: The header tooltip can subclass the header proc so the
     * current proc must be restored or header tooltips stop working.
     */
-    int oldHeaderProc = 0, oldTableProc = 0;
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    WNDPROC oldHeaderProc, oldTableProc;
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     bool fixSubclass = !hasChildren () && !hooks (DWT.Paint) && !filters (DWT.Paint);
     if (fixSubclass) {
-        oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, TableProc);
-        oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, HeaderProc);
+        oldTableProc = cast(WNDPROC) OS.SetWindowLong (handle, OS.GWL_WNDPROC, cast(int) TableProc);
+        oldHeaderProc = cast(WNDPROC) OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int) HeaderProc);
     }
     super.update (all);
     if (fixSubclass) {
-        OS.SetWindowLong (handle, OS.GWL_WNDPROC, oldTableProc);
-        OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, oldHeaderProc);
+        OS.SetWindowLong (handle, OS.GWL_WNDPROC, cast(int) oldTableProc);
+        OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int) oldHeaderProc);
     }
 }
 
 void updateHeaderToolTips () {
-    if (headerToolTipHandle is 0) return;
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-    RECT rect = new RECT ();
-    TOOLINFO lpti = new TOOLINFO ();
+    if (headerToolTipHandle is null) return;
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    RECT rect;
+    TOOLINFO lpti;
     lpti.cbSize = TOOLINFO.sizeof;
     lpti.uFlags = OS.TTF_SUBCLASS;
     lpti.hwnd = hwndHeader;
     lpti.lpszText = OS.LPSTR_TEXTCALLBACK;
     for (int i=0; i<columnCount; i++) {
         TableColumn column = columns [i];
-        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, rect) !is 0) {
+        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, i, &rect) !is 0) {
             lpti.uId = column.id = display.nextToolTipId++;
-            lpti.left = rect.left;
-            lpti.top = rect.top;
-            lpti.right = rect.right;
-            lpti.bottom = rect.bottom;
-            OS.SendMessage (headerToolTipHandle, OS.TTM_ADDTOOL, 0, lpti);
+            lpti.rect.left = rect.left;
+            lpti.rect.top = rect.top;
+            lpti.rect.right = rect.right;
+            lpti.rect.bottom = rect.bottom;
+            OS.SendMessage (headerToolTipHandle, OS.TTM_ADDTOOL, 0, &lpti);
         }
     }
 }
@@ -4974,16 +4957,16 @@
     return bits;
 }
 
-override TCHAR windowClass () {
-    return TableClass;
+override char[] windowClass () {
+    return TCHARsToStr( TableClass );
 }
 
 override int windowProc () {
-    return TableProc;
+    return cast(int) TableProc;
 }
 
-override int windowProc (int hwnd, int msg, int wParam, int lParam) {
-    if (handle is 0) return 0;
+override int windowProc (HWND hwnd, int msg, int wParam, int lParam) {
+    if (handle is null) return 0;
     if (hwnd !is handle) {
         switch (msg) {
             /* This code is intentionally commented */
@@ -5008,8 +4991,8 @@
                 */
                 if (OS.COMCTL32_MAJOR < 6) {
                     if (lParam !is 0) {
-                        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                        if (lParam !is hwndHeader) OS.InvalidateRect (hwndHeader, null, true);
+                        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                        if (lParam !is cast(int)hwndHeader) OS.InvalidateRect (hwndHeader, null, true);
                     }
                 }
                 break;
@@ -5027,8 +5010,8 @@
                 break;
             }
             case OS.WM_NOTIFY: {
-                NMHDR hdr = new NMHDR ();
-                OS.MoveMemory (hdr, lParam, NMHDR.sizeof);
+                NMHDR* hdr = cast(NMHDR*)lParam;
+                //OS.MoveMemory (hdr, lParam, NMHDR.sizeof);
                 switch (hdr.code) {
                     case OS.TTN_SHOW:
                     case OS.TTN_POP:
@@ -5039,22 +5022,22 @@
                 break;
             }
             case OS.WM_SETCURSOR: {
-                if (wParam is hwnd) {
-                    int hitTest = (short) (lParam & 0xFFFF);
+                if (wParam is cast(int)hwnd) {
+                    int hitTest = cast(short) (lParam & 0xFFFF);
                     if (hitTest is OS.HTCLIENT) {
-                        HDHITTESTINFO pinfo = new HDHITTESTINFO ();
+                        HDHITTESTINFO pinfo;
                         int pos = OS.GetMessagePos ();
-                        POINT pt = new POINT ();
-                        pt.x = (short) (pos & 0xFFFF);
-                        pt.y = (short) (pos >> 16);
-                        OS.ScreenToClient (hwnd, pt);
-                        pinfo.x = pt.x;
-                        pinfo.y = pt.y;
-                        int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
-                        int index = OS.SendMessage (hwndHeader, OS.HDM_HITTEST, 0, pinfo);
+                        POINT pt;
+                        pt.x = cast(short) (pos & 0xFFFF);
+                        pt.y = cast(short) (pos >> 16);
+                        OS.ScreenToClient (hwnd, &pt);
+                        pinfo.pt.x = pt.x;
+                        pinfo.pt.y = pt.y;
+                        auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                        int index = OS.SendMessage (hwndHeader, OS.HDM_HITTEST, 0, &pinfo);
                         if (0 <= index && index < columnCount && !columns [index].resizable) {
                             if ((pinfo.flags & (OS.HHT_ONDIVIDER | OS.HHT_ONDIVOPEN)) !is 0) {
-                                OS.SetCursor (OS.LoadCursor (0, OS.IDC_ARROW));
+                                OS.SetCursor (OS.LoadCursor (null, cast(TCHAR*)OS.IDC_ARROW));
                                 return 1;
                             }
                         }
@@ -5070,7 +5053,7 @@
 
 override LRESULT WM_CHAR (int wParam, int lParam) {
     LRESULT result = super.WM_CHAR (wParam, lParam);
-    if (result !is null) return result;
+    if (result !is LRESULT.NULL) return result;
     switch (wParam) {
         case ' ':
             if ((style & DWT.CHECK) !is 0) {
@@ -5090,7 +5073,7 @@
             * performed in WM_KEYDOWN from WM_CHAR.
             */
             int code = callWindowProc (handle, OS.WM_KEYDOWN, wParam, lParam);
-            return new LRESULT (code);
+            return cast(LRESULT) (code);
         case DWT.CR:
             /*
             * Feature in Windows.  Windows sends LVN_ITEMACTIVATE from WM_KEYDOWN
@@ -5153,7 +5136,7 @@
 
 override LRESULT WM_KEYDOWN (int wParam, int lParam) {
     LRESULT result = super.WM_KEYDOWN (wParam, lParam);
-    if (result !is null) return result;
+    if (result !is LRESULT.NULL) return result;
     switch (wParam) {
         case OS.VK_SPACE:
             /*
@@ -5198,14 +5181,14 @@
             * current proc must be restored or header tooltips stop working.
             */
             int oldHeaderProc = 0, oldTableProc = 0;
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
             bool fixSubclass = !hasChildren () && !hooks (DWT.Paint) && !filters (DWT.Paint);
             if (fixSubclass) {
-                oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, TableProc);
-                oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, HeaderProc);
+                oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, cast(int) TableProc);
+                oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int) HeaderProc);
             }
             int code = callWindowProc (handle, OS.WM_KEYDOWN, wParam, lParam);
-            result = code is 0 ? LRESULT.ZERO : new LRESULT (code);
+            result = code is 0 ? LRESULT.ZERO : cast(LRESULT) (code);
             if (fixSubclass) {
                 OS.SetWindowLong (handle, OS.GWL_WNDPROC, oldTableProc);
                 OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, oldHeaderProc);
@@ -5242,10 +5225,10 @@
     * wrong, this is unexpected.  The fix is to detect the
     * case and avoid calling the window proc.
     */
-    LVHITTESTINFO pinfo = new LVHITTESTINFO ();
-    pinfo.x = (short) (lParam & 0xFFFF);
-    pinfo.y = (short) (lParam >> 16);
-    int index = OS.SendMessage (handle, OS.LVM_HITTEST, 0, pinfo);
+    LVHITTESTINFO pinfo;
+    pinfo.pt.x = cast(short) (lParam & 0xFFFF);
+    pinfo.pt.y = cast(short) (lParam >> 16);
+    int index = OS.SendMessage (handle, OS.LVM_HITTEST, 0, &pinfo);
     Display display = this.display;
     display.captureChanged = false;
     sendMouseEvent (DWT.MouseDown, 1, handle, OS.WM_LBUTTONDOWN, wParam, lParam);
@@ -5294,9 +5277,9 @@
 
     /* Look for check/uncheck */
     if ((style & DWT.CHECK) !is 0) {
-        LVHITTESTINFO pinfo = new LVHITTESTINFO ();
-        pinfo.x = (short) (lParam & 0xFFFF);
-        pinfo.y = (short) (lParam >> 16);
+        LVHITTESTINFO pinfo;
+        pinfo.pt.x = cast(short) (lParam & 0xFFFF);
+        pinfo.pt.y = cast(short) (lParam >> 16);
         /*
         * Note that when the table has LVS_EX_FULLROWSELECT and the
         * user clicks anywhere on a row except on the check box, all
@@ -5305,7 +5288,7 @@
         * the correct way to determine that the user has selected
         * the check box, equality is needed.
         */
-        int index = OS.SendMessage (handle, OS.LVM_HITTEST, 0, pinfo);
+        int index = OS.SendMessage (handle, OS.LVM_HITTEST, 0, &pinfo);
         if (index !is -1 && pinfo.flags is OS.LVHT_ONITEMSTATEICON) {
             TableItem item = _getItem (index);
             item.setChecked (!item.getChecked (), true);
@@ -5349,46 +5332,46 @@
             int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
             if ((bits & OS.LVS_EX_DOUBLEBUFFER) is 0) {
                 GC gc = null;
-                int paintDC = 0;
-                PAINTSTRUCT ps = new PAINTSTRUCT ();
+                HDC paintDC;
+                PAINTSTRUCT ps;
                 bool hooksPaint = hooks (DWT.Paint);
                 if (hooksPaint) {
                     GCData data = new GCData ();
-                    data.ps = ps;
+                    data.ps = &ps;
                     data.hwnd = handle;
                     gc = GC.win32_new (this, data);
                     paintDC = gc.handle;
                 } else {
-                    paintDC = OS.BeginPaint (handle, ps);
+                    paintDC = OS.BeginPaint (handle, &ps);
                 }
-                int width = ps.right - ps.left;
-                int height = ps.bottom - ps.top;
+                int width = ps.rcPaint.right - ps.rcPaint.left;
+                int height = ps.rcPaint.bottom - ps.rcPaint.top;
                 if (width !is 0 && height !is 0) {
-                    int hDC = OS.CreateCompatibleDC (paintDC);
-                    POINT lpPoint1 = new POINT (), lpPoint2 = new POINT ();
-                    OS.SetWindowOrgEx (hDC, ps.left, ps.top, lpPoint1);
-                    OS.SetBrushOrgEx (hDC, ps.left, ps.top, lpPoint2);
-                    int hBitmap = OS.CreateCompatibleBitmap (paintDC, width, height);
-                    int hOldBitmap = OS.SelectObject (hDC, hBitmap);
+                    auto hDC = OS.CreateCompatibleDC (paintDC);
+                    POINT lpPoint1, lpPoint2;
+                    OS.SetWindowOrgEx (hDC, ps.rcPaint.left, ps.rcPaint.top, &lpPoint1);
+                    OS.SetBrushOrgEx (hDC, ps.rcPaint.left, ps.rcPaint.top, &lpPoint2);
+                    auto hBitmap = OS.CreateCompatibleBitmap (paintDC, width, height);
+                    auto hOldBitmap = OS.SelectObject (hDC, hBitmap);
                     if (OS.SendMessage (handle, OS.LVM_GETBKCOLOR, 0, 0) !is OS.CLR_NONE) {
-                        RECT rect = new RECT ();
-                        OS.SetRect (rect, ps.left, ps.top, ps.right, ps.bottom);
-                        drawBackground (hDC, rect);
+                        RECT rect;
+                        OS.SetRect (&rect, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom);
+                        drawBackground (hDC, &rect);
                     }
-                    callWindowProc (handle, OS.WM_PAINT, hDC, 0);
+                    callWindowProc (handle, OS.WM_PAINT, cast(int) hDC, 0);
                     OS.SetWindowOrgEx (hDC, lpPoint1.x, lpPoint1.y, null);
                     OS.SetBrushOrgEx (hDC, lpPoint2.x, lpPoint2.y, null);
-                    OS.BitBlt (paintDC, ps.left, ps.top, width, height, hDC, 0, 0, OS.SRCCOPY);
+                    OS.BitBlt (paintDC, ps.rcPaint.left, ps.rcPaint.top, width, height, hDC, 0, 0, OS.SRCCOPY);
                     OS.SelectObject (hDC, hOldBitmap);
                     OS.DeleteObject (hBitmap);
                     OS.DeleteObject (hDC);
                     if (hooksPaint) {
                         Event event = new Event ();
                         event.gc = gc;
-                        event.x = ps.left;
-                        event.y = ps.top;
-                        event.width = ps.right - ps.left;
-                        event.height = ps.bottom - ps.top;
+                        event.x = ps.rcPaint.left;
+                        event.y = ps.rcPaint.top;
+                        event.width = ps.rcPaint.right - ps.rcPaint.left;
+                        event.height = ps.rcPaint.bottom - ps.rcPaint.top;
                         sendEvent (DWT.Paint, event);
                         // widget could be disposed at this point
                         event.gc = null;
@@ -5397,7 +5380,7 @@
                 if (hooksPaint) {
                     gc.dispose ();
                 } else {
-                    OS.EndPaint (handle, ps);
+                    OS.EndPaint (handle, &ps);
                 }
                 return LRESULT.ZERO;
             }
@@ -5414,10 +5397,10 @@
     * wrong, this is unexpected.  The fix is to detect the
     * case and avoid calling the window proc.
     */
-    LVHITTESTINFO pinfo = new LVHITTESTINFO ();
-    pinfo.x = (short) (lParam & 0xFFFF);
-    pinfo.y = (short) (lParam >> 16);
-    OS.SendMessage (handle, OS.LVM_HITTEST, 0, pinfo);
+    LVHITTESTINFO pinfo;
+    pinfo.pt.x = cast(short) (lParam & 0xFFFF);
+    pinfo.pt.y = cast(short) (lParam >> 16);
+    OS.SendMessage (handle, OS.LVM_HITTEST, 0, &pinfo);
     Display display = this.display;
     display.captureChanged = false;
     sendMouseEvent (DWT.MouseDown, 3, handle, OS.WM_RBUTTONDOWN, wParam, lParam);
@@ -5466,11 +5449,11 @@
     if (count is 0) return result;
     int index = OS.SendMessage (handle, OS.LVM_GETNEXTITEM, -1, OS.LVNI_FOCUSED);
     if (index is -1) {
-        LVITEM lvItem = new LVITEM ();
+        LVITEM lvItem;
         lvItem.state = OS.LVIS_FOCUSED;
         lvItem.stateMask = OS.LVIS_FOCUSED;
         ignoreSelect = true;
-        OS.SendMessage (handle, OS.LVM_SETITEMSTATE, 0, lvItem);
+        OS.SendMessage (handle, OS.LVM_SETITEMSTATE, 0, &lvItem);
         ignoreSelect = false;
     }
     return result;
@@ -5478,7 +5461,7 @@
 
 override LRESULT WM_SETFONT (int wParam, int lParam) {
     LRESULT result = super.WM_SETFONT (wParam, lParam);
-    if (result !is null) return result;
+    if (result !is LRESULT.NULL) return result;
 
     /*
     * Bug in Windows.  When a header has a sort indicator
@@ -5491,30 +5474,30 @@
     * the header so that all that is necessary here is to
     * set the default first.
     */
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     OS.SendMessage (hwndHeader, OS.WM_SETFONT, 0, lParam);
 
-    if (headerToolTipHandle !is 0) {
+    if (headerToolTipHandle !is null) {
         OS.SendMessage (headerToolTipHandle, OS.WM_SETFONT, wParam, lParam);
     }
     return result;
 }
 
 override LRESULT WM_SIZE (int wParam, int lParam) {
-    if (ignoreResize) return null;
+    if (ignoreResize) return LRESULT.NULL;
     if (hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) {
         OS.InvalidateRect (handle, null, true);
     }
     if (resizeCount !is 0) {
         wasResized = true;
-        return null;
+        return LRESULT.NULL;
     }
     return super.WM_SIZE (wParam, lParam);
 }
 
 override LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) {
     LRESULT result = super.WM_SYSCOLORCHANGE (wParam, lParam);
-    if (result !is null) return result;
+    if (result !is LRESULT.NULL) return result;
     if (findBackgroundControl () is null) {
         setBackgroundPixel (defaultBackground ());
     } else {
@@ -5536,10 +5519,10 @@
     int oldPos = 0;
     int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
     if ((bits & OS.LVS_EX_GRIDLINES) !is 0) {
-        SCROLLINFO info = new SCROLLINFO ();
+        SCROLLINFO info;
         info.cbSize = SCROLLINFO.sizeof;
         info.fMask = OS.SIF_POS;
-        OS.GetScrollInfo (handle, OS.SB_HORZ, info);
+        OS.GetScrollInfo (handle, OS.SB_HORZ, &info);
         oldPos = info.nPos;
     }
 
@@ -5555,11 +5538,11 @@
     * current proc must be restored or header tooltips stop working.
     */
     int oldHeaderProc = 0, oldTableProc = 0;
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     bool fixSubclass = !hasChildren () && !hooks (DWT.Paint) && !filters (DWT.Paint);
     if (fixSubclass) {
-        oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, TableProc);
-        oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, HeaderProc);
+        oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, cast(int)TableProc);
+        oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int)HeaderProc);
     }
     LRESULT result = super.WM_HSCROLL (wParam, lParam);
     if (fixSubclass) {
@@ -5575,16 +5558,16 @@
     * get the new scroll position and redraw the new area.
     */
     if ((bits & OS.LVS_EX_GRIDLINES) !is 0) {
-        SCROLLINFO info = new SCROLLINFO ();
+        SCROLLINFO info;
         info.cbSize = SCROLLINFO.sizeof;
         info.fMask = OS.SIF_POS;
-        OS.GetScrollInfo (handle, OS.SB_HORZ, info);
+        OS.GetScrollInfo (handle, OS.SB_HORZ, &info);
         int newPos = info.nPos;
         if (newPos < oldPos) {
-            RECT rect = new RECT ();
-            OS.GetClientRect (handle, rect);
+            RECT rect;
+            OS.GetClientRect (handle, &rect);
             rect.right = oldPos - newPos + GRID_WIDTH;
-            OS.InvalidateRect (handle, rect, true);
+            OS.InvalidateRect (handle, &rect, true);
         }
     }
     return result;
@@ -5603,11 +5586,11 @@
     * current proc must be restored or header tooltips stop working.
     */
     int oldHeaderProc = 0, oldTableProc = 0;
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     bool fixSubclass = !hasChildren () && !hooks (DWT.Paint) && !filters (DWT.Paint);
     if (fixSubclass) {
-        oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, TableProc);
-        oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, HeaderProc);
+        oldTableProc = OS.SetWindowLong (handle, OS.GWL_WNDPROC, cast(int) TableProc);
+        oldHeaderProc = OS.SetWindowLong (hwndHeader, OS.GWL_WNDPROC, cast(int) HeaderProc);
     }
     LRESULT result = super.WM_VSCROLL (wParam, lParam);
     if (fixSubclass) {
@@ -5633,11 +5616,11 @@
                 break;
             case OS.SB_LINEDOWN:
             case OS.SB_LINEUP:
-                RECT rect = new RECT ();
-                OS.GetWindowRect (hwndHeader, rect);
+                RECT rect;
+                OS.GetWindowRect (hwndHeader, &rect);
                 int headerHeight = rect.bottom - rect.top;
-                RECT clientRect = new RECT ();
-                OS.GetClientRect (handle, clientRect);
+                RECT clientRect;
+                OS.GetClientRect (handle, &clientRect);
                 clientRect.top += headerHeight;
                 int empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);
                 int oneItem = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 1, 0);
@@ -5647,7 +5630,7 @@
                 } else {
                     clientRect.bottom = clientRect.top + itemHeight + GRID_WIDTH;
                 }
-                OS.InvalidateRect (handle, clientRect, true);
+                OS.InvalidateRect (handle, &clientRect, true);
                 break;
             case OS.SB_PAGEDOWN:
             case OS.SB_PAGEUP:
@@ -5659,21 +5642,21 @@
 }
 
 override LRESULT wmMeasureChild (int wParam, int lParam) {
-    MEASUREITEMSTRUCT struct = new MEASUREITEMSTRUCT ();
-    OS.MoveMemory (struct, lParam, MEASUREITEMSTRUCT.sizeof);
+    MEASUREITEMSTRUCT* struct_ = cast(MEASUREITEMSTRUCT*)lParam;
+    //OS.MoveMemory (struct_, lParam, MEASUREITEMSTRUCT.sizeof);
     if (itemHeight is -1) {
         int empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);
         int oneItem = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 1, 0);
-        struct.itemHeight = (oneItem >> 16) - (empty >> 16);
+        struct_.itemHeight = (oneItem >> 16) - (empty >> 16);
     } else {
-        struct.itemHeight = itemHeight;
-    }
-    OS.MoveMemory (lParam, struct, MEASUREITEMSTRUCT.sizeof);
-    return null;
+        struct_.itemHeight = itemHeight;
+    }
+    //OS.MoveMemory (lParam, struct_, MEASUREITEMSTRUCT.sizeof);
+    return LRESULT.NULL;
 }
 
-override LRESULT wmNotify (NMHDR hdr, int wParam, int lParam) {
-    int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+override LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) {
+    auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
     if (hdr.hwndFrom is hwndHeader) {
         /*
         * Feature in Windows.  On NT, the automatically created
@@ -5695,8 +5678,8 @@
             case OS.HDN_DIVIDERDBLCLICKW:
             case OS.HDN_DIVIDERDBLCLICKA: {
                 if (columnCount is 0) return LRESULT.ONE;
-                NMHEADER phdn = new NMHEADER ();
-                OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
+                NMHEADER* phdn = cast(NMHEADER*)lParam;
+                //OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
                 TableColumn column = columns [phdn.iItem];
                 if (column !is null && !column.getResizable ()) {
                     return LRESULT.ONE;
@@ -5735,8 +5718,8 @@
                 int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
                 if ((bits & OS.LVS_EX_HEADERDRAGDROP) is 0) break;
                 if (columnCount is 0) return LRESULT.ONE;
-                NMHEADER phdn = new NMHEADER ();
-                OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
+                NMHEADER* phdn = cast(NMHEADER*)lParam;
+                //OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
                 if (phdn.iItem !is -1) {
                     TableColumn column = columns [phdn.iItem];
                     if (column !is null && !column.getMoveable ()) {
@@ -5749,15 +5732,15 @@
             case OS.HDN_ENDDRAG: {
                 int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
                 if ((bits & OS.LVS_EX_HEADERDRAGDROP) is 0) break;
-                NMHEADER phdn = new NMHEADER ();
-                OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
-                if (phdn.iItem !is -1 && phdn.pitem !is 0) {
-                    HDITEM pitem = new HDITEM ();
-                    OS.MoveMemory (pitem, phdn.pitem, HDITEM.sizeof);
+                NMHEADER* phdn = cast(NMHEADER*)lParam;
+                //OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
+                if (phdn.iItem !is -1 && phdn.pitem !is null) {
+                    HDITEM* pitem = cast(HDITEM*)phdn.pitem;
+                    //OS.MoveMemory (pitem, phdn.pitem, HDITEM.sizeof);
                     if ((pitem.mask & OS.HDI_ORDER) !is 0 && pitem.iOrder !is -1) {
                         if (columnCount is 0) break;
                         int [] order = new int [columnCount];
-                        OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order);
+                        OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order.ptr);
                         int index = 0;
                         while (index < order.length) {
                             if (order [index] is phdn.iItem) break;
@@ -5792,19 +5775,19 @@
                 if (lastWidth is 0 && width > 0) {
                     int bits = OS.SendMessage (handle, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
                     if ((bits & OS.LVS_EX_GRIDLINES) !is 0) {
-                        RECT rect = new RECT ();
-                        OS.GetClientRect (handle, rect);
+                        RECT rect;
+                        OS.GetClientRect (handle, &rect);
                         rect.right = rect.left + width;
-                        OS.InvalidateRect (handle, rect, true);
+                        OS.InvalidateRect (handle, &rect, true);
                     }
                 }
                 lastWidth = width;
                 if (!ignoreColumnResize) {
-                    NMHEADER phdn = new NMHEADER ();
-                    OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
-                    if (phdn.pitem !is 0) {
-                        HDITEM pitem = new HDITEM ();
-                        OS.MoveMemory (pitem, phdn.pitem, HDITEM.sizeof);
+                    NMHEADER* phdn = cast(NMHEADER*)lParam;
+                    //OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
+                    if (phdn.pitem !is null) {
+                        HDITEM* pitem = cast(HDITEM*)phdn.pitem;
+                        //OS.MoveMemory (pitem, phdn.pitem, HDITEM.sizeof);
                         if ((pitem.mask & OS.HDI_WIDTH) !is 0) {
                             TableColumn column = columns [phdn.iItem];
                             if (column !is null) {
@@ -5820,7 +5803,7 @@
                                 TableColumn [] newColumns = new TableColumn [columnCount];
                                 System.arraycopy (columns, 0, newColumns, 0, columnCount);
                                 int [] order = new int [columnCount];
-                                OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order);
+                                OS.SendMessage (handle, OS.LVM_GETCOLUMNORDERARRAY, columnCount, order.ptr);
                                 bool moved = false;
                                 for (int i=0; i<columnCount; i++) {
                                     TableColumn nextColumn = newColumns [order [i]];
@@ -5838,8 +5821,8 @@
             }
             case OS.HDN_ITEMDBLCLICKW:
             case OS.HDN_ITEMDBLCLICKA: {
-                NMHEADER phdn = new NMHEADER ();
-                OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
+                NMHEADER* phdn = cast(NMHEADER*)lParam;
+                //OS.MoveMemory (phdn, lParam, NMHEADER.sizeof);
                 TableColumn column = columns [phdn.iItem];
                 if (column !is null) {
                     column.postEvent (DWT.DefaultSelection);
@@ -5849,31 +5832,31 @@
         }
     }
     LRESULT result = super.wmNotify (hdr, wParam, lParam);
-    if (result !is null) return result;
+    if (result !is LRESULT.NULL) return result;
     switch (hdr.code) {
         case OS.TTN_GETDISPINFOA:
         case OS.TTN_GETDISPINFOW: {
             tipRequested = true;
             int code = callWindowProc (handle, OS.WM_NOTIFY, wParam, lParam);
             tipRequested = false;
-            return new LRESULT (code);
+            return cast(LRESULT) (code);
         }
     }
     return result;
 }
 
-override LRESULT wmNotifyChild (NMHDR hdr, int wParam, int lParam) {
+override LRESULT wmNotifyChild (NMHDR* hdr, int wParam, int lParam) {
     switch (hdr.code) {
         case OS.LVN_ODFINDITEMA:
         case OS.LVN_ODFINDITEMW: {
-            if ((style & DWT.VIRTUAL) !is 0) return new LRESULT (-1);
+            if ((style & DWT.VIRTUAL) !is 0) return cast(LRESULT) (-1);
             break;
         }
         case OS.LVN_ODSTATECHANGED: {
             if ((style & DWT.VIRTUAL) !is 0) {
                 if (!ignoreSelect) {
-                    NMLVODSTATECHANGE lpStateChange  = new NMLVODSTATECHANGE ();
-                    OS.MoveMemory (lpStateChange, lParam, NMLVODSTATECHANGE.sizeof);
+                    NMLVODSTATECHANGE* lpStateChange  = cast(NMLVODSTATECHANGE*)lParam;
+                    //OS.MoveMemory (lpStateChange, lParam, NMLVODSTATECHANGE.sizeof);
                     bool oldSelected = (lpStateChange.uOldState & OS.LVIS_SELECTED) !is 0;
                     bool newSelected = (lpStateChange.uNewState & OS.LVIS_SELECTED) !is 0;
                     if (oldSelected !is newSelected) wasSelected = true;
@@ -5884,8 +5867,8 @@
         case OS.LVN_GETDISPINFOA:
         case OS.LVN_GETDISPINFOW: {
 //          if (drawCount !is 0 || !OS.IsWindowVisible (handle)) break;
-            NMLVDISPINFO plvfi = new NMLVDISPINFO ();
-            OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof);
+            NMLVDISPINFO* plvfi = cast(NMLVDISPINFO*)lParam;
+            //OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof);
 
             /*
             * When an item is being deleted from a virtual table, do not
@@ -5898,7 +5881,7 @@
             */
             if ((style & DWT.VIRTUAL) !is 0) {
                 if (ignoreShrink) {
-                    OS.SendMessage (handle, OS.LVM_REDRAWITEMS, plvfi.iItem, plvfi.iItem);
+                    OS.SendMessage (handle, OS.LVM_REDRAWITEMS, plvfi.item.iItem, plvfi.item.iItem);
                     break;
                 }
             }
@@ -5911,7 +5894,7 @@
             * has been added to the array.  The fix is to check for
             * null.
             */
-            TableItem item = _getItem (plvfi.iItem);
+            TableItem item = _getItem (plvfi.item.iItem);
             if (item is null) break;
 
             /*
@@ -5921,7 +5904,7 @@
             */
             if (!item.cached) {
                 if ((style & DWT.VIRTUAL) !is 0) {
-                    lastIndexOf = plvfi.iItem;
+                    lastIndexOf = plvfi.item.iItem;
                     if (!checkData (item, lastIndexOf, false)) break;
                     TableItem newItem = fixScrollWidth ? null : item;
                     if (setScrollWidth (newItem, true)) {
@@ -5930,13 +5913,13 @@
                 }
                 item.cached = true;
             }
-            if ((plvfi.mask & OS.LVIF_TEXT) !is 0) {
-                String string = null;
-                if (plvfi.iSubItem is 0) {
+            if ((plvfi.item.mask & OS.LVIF_TEXT) !is 0) {
+                char[] string = null;
+                if (plvfi.item.iSubItem is 0) {
                     string = item.text;
                 } else {
-                    String [] strings  = item.strings;
-                    if (strings !is null) string = strings [plvfi.iSubItem];
+                    char[] [] strings  = item.strings;
+                    if (strings !is null) string = strings [plvfi.item.iSubItem];
                 }
                 if (string !is null) {
                     /*
@@ -5955,60 +5938,61 @@
                     * from drawing the selection when LVS_EX_FULLROWSELECT
                     * is set.
                     */
-                    int length = Math.min (string.length (), plvfi.cchTextMax - 1);
-                    if (!tipRequested && plvfi.iSubItem is 0 && length is 0) {
+                    int length_ = Math.min (string.length, plvfi.item.cchTextMax - 1);
+                    if (!tipRequested && plvfi.item.iSubItem is 0 && length_ is 0) {
                         string = " "; //$NON-NLS-1$
-                        length = 1;
+                        length_ = 1;
                     }
                     char [] buffer = display.tableBuffer;
-                    if (buffer is null || plvfi.cchTextMax > buffer.length) {
-                        buffer = display.tableBuffer = new char [plvfi.cchTextMax];
+                    if (buffer is null || plvfi.item.cchTextMax > buffer.length) {
+                        buffer = display.tableBuffer = new char [plvfi.item.cchTextMax];
                     }
-                    string.getChars (0, length, buffer, 0);
-                    buffer [length++] = 0;
-                    if (OS.IsUnicode) {
-                        OS.MoveMemory (plvfi.pszText, buffer, length * 2);
+                    string.getChars (0, length_, buffer, 0);
+                    buffer [length_++] = 0;
+                    static if (OS.IsUnicode) {
+                        OS.MoveMemory (plvfi.item.pszText, buffer.ptr, length_ * 2);
                     } else {
-                        OS.WideCharToMultiByte (getCodePage (), 0, buffer, length, plvfi.pszText, plvfi.cchTextMax, null, null);
-                        OS.MoveMemory (plvfi.pszText + plvfi.cchTextMax - 1, new byte [1], 1);
+                        OS.WideCharToMultiByte (getCodePage (), 0, buffer.ptr, length_, plvfi.item.pszText, plvfi.item.cchTextMax, null, null);
+                        byte dummy;
+                        OS.MoveMemory (plvfi.item.pszText + plvfi.item.cchTextMax - 1, &dummy, 1);
                     }
                 }
             }
             bool move = false;
-            if ((plvfi.mask & OS.LVIF_IMAGE) !is 0) {
+            if ((plvfi.item.mask & OS.LVIF_IMAGE) !is 0) {
                 Image image = null;
-                if (plvfi.iSubItem is 0) {
+                if (plvfi.item.iSubItem is 0) {
                     image = item.image;
                 } else {
                     Image [] images = item.images;
-                    if (images !is null) image = images [plvfi.iSubItem];
+                    if (images !is null) image = images [plvfi.item.iSubItem];
                 }
                 if (image !is null) {
-                    plvfi.iImage = imageIndex (image, plvfi.iSubItem);
+                    plvfi.item.iImage = imageIndex (image, plvfi.item.iSubItem);
                     move = true;
                 }
             }
-            if ((plvfi.mask & OS.LVIF_STATE) !is 0) {
-                if (plvfi.iSubItem is 0) {
+            if ((plvfi.item.mask & OS.LVIF_STATE) !is 0) {
+                if (plvfi.item.iSubItem is 0) {
                     int state = 1;
                     if (item.checked) state++;
                     if (item.grayed) state +=2;
-                    plvfi.state = state << 12;
-                    plvfi.stateMask = OS.LVIS_STATEIMAGEMASK;
+                    plvfi.item.state = state << 12;
+                    plvfi.item.stateMask = OS.LVIS_STATEIMAGEMASK;
                     move = true;
                 }
             }
-            if ((plvfi.mask & OS.LVIF_INDENT) !is 0) {
-                if (plvfi.iSubItem is 0) {
-                    plvfi.iIndent = item.imageIndent;
+            if ((plvfi.item.mask & OS.LVIF_INDENT) !is 0) {
+                if (plvfi.item.iSubItem is 0) {
+                    plvfi.item.iIndent = item.imageIndent;
                     move = true;
                 }
             }
-            if (move) OS.MoveMemory (lParam, plvfi, NMLVDISPINFO.sizeof);
+            //if (move) OS.MoveMemory (lParam, plvfi, NMLVDISPINFO.sizeof);
             break;
         }
         case OS.NM_CUSTOMDRAW: {
-            int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+            auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
             if (hdr.hwndFrom is hwndHeader) break;
             if (!customDraw && findImageControl () is null) {
                 /*
@@ -6026,9 +6010,9 @@
                     if (!explorerTheme || columnCount !is 0) break;
                 }
             }
-            NMLVCUSTOMDRAW nmcd = new NMLVCUSTOMDRAW ();
-            OS.MoveMemory (nmcd, lParam, NMLVCUSTOMDRAW.sizeof);
-            switch (nmcd.dwDrawStage) {
+            NMLVCUSTOMDRAW* nmcd = cast(NMLVCUSTOMDRAW*)lParam;
+            //OS.MoveMemory (nmcd, lParam, NMLVCUSTOMDRAW.sizeof);
+            switch (nmcd.nmcd.dwDrawStage) {
                 case OS.CDDS_PREPAINT: return CDDS_PREPAINT (nmcd, wParam, lParam);
                 case OS.CDDS_ITEMPREPAINT: return CDDS_ITEMPREPAINT (nmcd, wParam, lParam);
                 case OS.CDDS_ITEMPOSTPAINT: return CDDS_ITEMPOSTPAINT (nmcd, wParam, lParam);
@@ -6050,17 +6034,17 @@
             dragStarted = true;
             if (hdr.code is 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);
+                POINT pt;
+                pt.x = cast(short) (pos & 0xFFFF);
+                pt.y = cast(short) (pos >> 16);
+                OS.ScreenToClient (handle, &pt);
                 sendDragEvent (1, pt.x, pt.y);
             }
             break;
         }
         case OS.LVN_COLUMNCLICK: {
-            NMLISTVIEW pnmlv = new NMLISTVIEW ();
-            OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);
+            NMLISTVIEW* pnmlv = cast(NMLISTVIEW*)lParam;
+            //OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);
             TableColumn column = columns [pnmlv.iSubItem];
             if (column !is null) {
                 column.postEvent (DWT.Selection);
@@ -6069,8 +6053,8 @@
         }
         case OS.LVN_ITEMACTIVATE: {
             if (ignoreActivate) break;
-            NMLISTVIEW pnmlv = new NMLISTVIEW ();
-            OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);
+            NMLISTVIEW* pnmlv = cast(NMLISTVIEW*)lParam;
+            //OS.MoveMemory(pnmlv, lParam, NMLISTVIEW.sizeof);
             if (pnmlv.iItem !is -1) {
                 Event event = new Event ();
                 event.item = _getItem (pnmlv.iItem);
@@ -6080,8 +6064,8 @@
         }
         case OS.LVN_ITEMCHANGED: {
             if (!ignoreSelect) {
-                NMLISTVIEW pnmlv = new NMLISTVIEW ();
-                OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);
+                NMLISTVIEW* pnmlv = cast(NMLISTVIEW*)lParam;
+                //OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);
                 if ((pnmlv.uChanged & OS.LVIF_STATE) !is 0) {
                     if (pnmlv.iItem is -1) {
                         wasSelected = true;
@@ -6093,28 +6077,28 @@
                 }
             }
             if (hooks (DWT.EraseItem) || hooks (DWT.PaintItem)) {
-                int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
+                auto hwndHeader = cast(HWND) OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
                 int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
                 if (count !is 0) {
                     forceResize ();
-                    RECT rect = new RECT ();
-                    OS.GetClientRect (handle, rect);
-                    NMLISTVIEW pnmlv = new NMLISTVIEW ();
-                    OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);
+                    RECT rect;
+                    OS.GetClientRect (handle, &rect);
+                    NMLISTVIEW* pnmlv = cast(NMLISTVIEW*)lParam;
+                    //OS.MoveMemory (pnmlv, lParam, NMLISTVIEW.sizeof);
                     if (pnmlv.iItem !is -1) {
-                        RECT itemRect = new RECT ();
+                        RECT itemRect;
                         itemRect.left = OS.LVIR_BOUNDS;
                         ignoreCustomDraw = true;
-                        OS.SendMessage (handle, OS. LVM_GETITEMRECT, pnmlv.iItem, itemRect);
+                        OS.SendMessage (handle, OS. LVM_GETITEMRECT, pnmlv.iItem, &itemRect);
                         ignoreCustomDraw = false;
-                        RECT headerRect = new RECT ();
+                        RECT headerRect;
                         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);
+                        OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
+                        OS.MapWindowPoints (hwndHeader, handle, cast(POINT*) &headerRect, 2);
                         rect.left = headerRect.right;
                         rect.top = itemRect.top;
                         rect.bottom = itemRect.bottom;
-                        OS.InvalidateRect (handle, rect, true);
+                        OS.InvalidateRect (handle, &rect, true);
                     }
                 }
             }
@@ -6130,17 +6114,17 @@
             * TRUE when receiving the Pocket PC 2002 specific NM_RECOGNIZEGESTURE
             * message.
             */
-            if (OS.IsPPC) {
+            if (OS.IsPPC_) {
                 bool hasMenu = menu !is null && !menu.isDisposed ();
                 if (!hasMenu && !hooks (DWT.MenuDetect)) return LRESULT.ONE;
             }
             break;
         case OS.GN_CONTEXTMENU:
-            if (OS.IsPPC) {
+            if (OS.IsPPC_) {
                 bool hasMenu = menu !is null && !menu.isDisposed ();
                 if (hasMenu || hooks (DWT.MenuDetect)) {
-                    NMRGINFO nmrg = new NMRGINFO ();
-                    OS.MoveMemory (nmrg, lParam, NMRGINFO.sizeof);
+                    NMRGINFO* nmrg = cast(NMRGINFO*)lParam;
+                    //OS.MoveMemory (nmrg, lParam, NMRGINFO.sizeof);
                     showMenu (nmrg.x, nmrg.y);
                     return LRESULT.ONE;
                 }
@@ -6151,4 +6135,4 @@
 }
 
 }
-++/
+
--- a/dwt/widgets/TableColumn.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/widgets/TableColumn.d	Mon Feb 04 20:01:30 2008 +0100
@@ -10,15 +10,6 @@
  *******************************************************************************/
 module dwt.widgets.TableColumn;
 
-import dwt.widgets.Item;
-import dwt.widgets.Widget;
-class TableColumn : Item {
-    public this (Widget parent, int style) {
-        super (parent, style);
-    }
-}
-
-/++
 
 import dwt.DWT;
 import dwt.DWTException;
@@ -27,12 +18,16 @@
 import dwt.events.SelectionListener;
 import dwt.graphics.Image;
 import dwt.graphics.Rectangle;
-import dwt.internal.win32.HDITEM;
-import dwt.internal.win32.LVCOLUMN;
 import dwt.internal.win32.OS;
-import dwt.internal.win32.RECT;
-import dwt.internal.win32.TCHAR;
-import dwt.internal.win32.TOOLINFO;
+
+import dwt.widgets.Item;
+import dwt.widgets.Widget;
+import dwt.widgets.Table;
+import dwt.widgets.TypedListener;
+import dwt.widgets.TableItem;
+import dwt.widgets.Event;
+
+import dwt.dwthelper.utils;
 
 /**
  * Instances of this class represent a column in a table widget.
@@ -48,10 +43,10 @@
  * IMPORTANT: This class is <em>not</em> intended to be subclassed.
  * </p>
  */
-public class TableColumn extends Item {
+public class TableColumn : Item {
     Table parent;
     bool resizable, moveable;
-    String toolTipText;
+    char[] toolTipText;
     int id;
 
 /**
@@ -86,7 +81,7 @@
  * @see Widget#checkSubclass
  * @see Widget#getStyle
  */
-public TableColumn (Table parent, int style) {
+public this (Table parent, int style) {
     super (parent, checkStyle (style));
     resizable = true;
     this.parent = parent;
@@ -127,7 +122,7 @@
  * @see Widget#checkSubclass
  * @see Widget#getStyle
  */
-public TableColumn (Table parent, int style, int index) {
+public this (Table parent, int style, int index) {
     super (parent, checkStyle (style));
     resizable = true;
     this.parent = parent;
@@ -226,7 +221,7 @@
     return DWT.LEFT;
 }
 
-override String getNameText () {
+override char[] getNameText () {
     return getText ();
 }
 
@@ -300,7 +295,7 @@
  *
  * @since 3.2
  */
-public String getToolTipText () {
+public char[] getToolTipText () {
     checkWidget();
     return toolTipText;
 }
@@ -319,7 +314,7 @@
     checkWidget ();
     int index = parent.indexOf (this);
     if (index is -1) return 0;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     return OS.SendMessage (hwnd, OS.LVM_GETCOLUMNWIDTH, index, 0);
 }
 
@@ -338,9 +333,9 @@
     checkWidget ();
     int index = parent.indexOf (this);
     if (index is -1) return;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     int oldWidth = OS.SendMessage (hwnd, OS.LVM_GETCOLUMNWIDTH, index, 0);
-    TCHAR buffer = new TCHAR (parent.getCodePage (), text, true);
+    TCHAR* buffer = StrToTCHARz (parent.getCodePage (), text);
     int headerWidth = OS.SendMessage (hwnd, OS.LVM_GETSTRINGWIDTH, 0, buffer) + Table.HEADER_MARGIN;
     if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) headerWidth += Table.HEADER_EXTRA;
     bool hasHeaderImage = false;
@@ -362,7 +357,7 @@
         }
         int margin = 0;
         if (OS.COMCTL32_VERSION >= OS.VERSION (5, 80)) {
-            int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+            auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
             margin = OS.SendMessage (hwndHeader, OS.HDM_GETBITMAPMARGIN, 0, 0);
         } else {
             margin = OS.GetSystemMetrics (OS.SM_CXEDGE) * 3;
@@ -379,27 +374,27 @@
     * each items ourselves rather than letting Windows do it.
     */
     if ((index is 0 && !parent.firstColumnImage) || parent.hooks (DWT.MeasureItem)) {
-        RECT headerRect = new RECT ();
-        int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-        OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);
-        OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
-        int hDC = OS.GetDC (hwnd);
-        int oldFont = 0, newFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0);
-        if (newFont !is 0) oldFont = OS.SelectObject (hDC, newFont);
+        RECT headerRect;
+        auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+        OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
+        OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*) &headerRect, 2);
+        auto hDC = OS.GetDC (hwnd);
+        HFONT oldFont, newFont = cast(HFONT) OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0);
+        if (newFont !is null) oldFont = OS.SelectObject (hDC, newFont);
         int count = OS.SendMessage (hwnd, OS.LVM_GETITEMCOUNT, 0, 0);
         for (int i=0; i<count; i++) {
             TableItem item = parent.items [i];
             if (item !is null) {
-                int hFont = item.cellFont !is null ? item.cellFont [index] : -1;
-                if (hFont is -1) hFont = item.font;
-                if (hFont !is -1) hFont = OS.SelectObject (hDC, hFont);
+                auto hFont = item.cellFont !is null ? item.cellFont [index] : cast(HFONT)-1;
+                if (hFont is cast(HFONT)-1) hFont = item.font;
+                if (hFont !is cast(HFONT)-1) hFont = OS.SelectObject (hDC, hFont);
                 Event event = parent.sendMeasureItemEvent (item, i, index, hDC);
-                if (hFont !is -1) hFont = OS.SelectObject (hDC, hFont);
+                if (hFont !is cast(HFONT)-1) hFont = OS.SelectObject (hDC, hFont);
                 if (isDisposed () || parent.isDisposed ()) break;
                 columnWidth = Math.max (columnWidth, event.x + event.width - headerRect.left);
             }
         }
-        if (newFont !is 0) OS.SelectObject (hDC, oldFont);
+        if (newFont !is null) OS.SelectObject (hDC, oldFont);
         OS.ReleaseDC (hwnd, hDC);
         OS.SendMessage (hwnd, OS.LVM_SETCOLUMNWIDTH, index, columnWidth);
     } else {
@@ -421,11 +416,11 @@
             * width by the width of the image list.
             */
             if ((parent.style & DWT.CHECK) !is 0) {
-                int hStateList = OS.SendMessage (hwnd, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
-                if (hStateList !is 0) {
-                    int [] cx = new int [1], cy = new int [1];
-                    OS.ImageList_GetIconSize (hStateList, cx, cy);
-                    columnWidth += cx [0];
+                auto hStateList = cast(HANDLE) OS.SendMessage (hwnd, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0);
+                if (hStateList !is null) {
+                    int cx, cy;
+                    OS.ImageList_GetIconSize (hStateList, &cx, &cy);
+                    columnWidth += cx;
                 }
             }
         }
@@ -439,19 +434,19 @@
             * resize the table to be small, set the column width and then
             * restore the table to its original size.
             */
-            RECT rect = null;
+            RECT rect;
             bool fixWidth = index is parent.getColumnCount () - 1;
             if (fixWidth) {
-                rect = new RECT ();
-                OS.GetWindowRect (hwnd, rect);
+                //rect = new RECT ();
+                OS.GetWindowRect (hwnd, &rect);
                 OS.UpdateWindow (hwnd);
                 int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOREDRAW | OS.SWP_NOZORDER;
-                SetWindowPos (hwnd, 0, 0, 0, 0, rect.bottom - rect.top, flags);
+                SetWindowPos (hwnd, null, 0, 0, 0, rect.bottom - rect.top, flags);
             }
             OS.SendMessage (hwnd, OS.LVM_SETCOLUMNWIDTH, index, OS.LVSCW_AUTOSIZE_USEHEADER);
             if (fixWidth) {
                 int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOZORDER;
-                SetWindowPos (hwnd, 0, 0, 0, rect.right - rect.left, rect.bottom - rect.top, flags);
+                SetWindowPos (hwnd, null, 0, 0, rect.right - rect.left, rect.bottom - rect.top, flags);
             }
         } else {
             OS.SendMessage (hwnd, OS.LVM_SETCOLUMNWIDTH, index, headerWidth);
@@ -562,17 +557,17 @@
     if (index is -1 || index is 0) return;
     style &= ~(DWT.LEFT | DWT.RIGHT | DWT.CENTER);
     style |= alignment & (DWT.LEFT | DWT.RIGHT | DWT.CENTER);
-    int hwnd = parent.handle;
-    LVCOLUMN lvColumn = new LVCOLUMN ();
+    auto hwnd = parent.handle;
+    LVCOLUMN lvColumn;
     lvColumn.mask = OS.LVCF_FMT | OS.LVCF_IMAGE;
-    OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, lvColumn);
+    OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, &lvColumn);
     lvColumn.fmt &= ~OS.LVCFMT_JUSTIFYMASK;
     int fmt = 0;
     if ((style & DWT.LEFT) is DWT.LEFT) fmt = OS.LVCFMT_LEFT;
     if ((style & DWT.CENTER) is DWT.CENTER) fmt = OS.LVCFMT_CENTER;
     if ((style & DWT.RIGHT) is DWT.RIGHT) fmt = OS.LVCFMT_RIGHT;
     lvColumn.fmt |= fmt;
-    OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, lvColumn);
+    OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, &lvColumn);
     /*
     * Bug in Windows.  When LVM_SETCOLUMN is used to change
     * the alignment of a column, the column is not redrawn
@@ -581,14 +576,14 @@
     */
     if (index !is 0) {
         parent.forceResize ();
-        RECT rect = new RECT (), headerRect = new RECT ();
-        OS.GetClientRect (hwnd, rect);
-        int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-        OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);
-        OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
+        RECT rect, headerRect;
+        OS.GetClientRect (hwnd, &rect);
+        auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+        OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect);
+        OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*) &headerRect, 2);
         rect.left = headerRect.left;
         rect.right = headerRect.right;
-        OS.InvalidateRect (hwnd, rect, true);
+        OS.InvalidateRect (hwnd, &rect, true);
     }
 }
 
@@ -606,12 +601,12 @@
 void setImage (Image image, bool sort, bool right) {
     int index = parent.indexOf (this);
     if (index is -1) return;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     if (OS.COMCTL32_MAJOR < 6) {
-        int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-        HDITEM hdItem = new HDITEM ();
+        auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+        HDITEM hdItem;
         hdItem.mask = OS.HDI_FORMAT | OS.HDI_IMAGE | OS.HDI_BITMAP;
-        OS.SendMessage (hwndHeader, OS.HDM_GETITEM, index, hdItem);
+        OS.SendMessage (hwndHeader, OS.HDM_GETITEM, index, cast(int) &hdItem);
         hdItem.fmt &= ~OS.HDF_BITMAP_ON_RIGHT;
         if (image !is null) {
             if (sort) {
@@ -629,11 +624,11 @@
         } else {
             hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_BITMAP);
         }
-        OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, hdItem);
+        OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, cast(int) &hdItem);
     } else {
-        LVCOLUMN lvColumn = new LVCOLUMN ();
+        LVCOLUMN lvColumn;
         lvColumn.mask = OS.LVCF_FMT | OS.LVCF_IMAGE;
-        OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, lvColumn);
+        OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, &lvColumn);
         if (image !is null) {
             lvColumn.fmt |= OS.LVCFMT_IMAGE;
             lvColumn.iImage = parent.imageIndexHeader (image);
@@ -642,7 +637,7 @@
             lvColumn.mask &= ~OS.LVCF_IMAGE;
             lvColumn.fmt &= ~(OS.LVCFMT_IMAGE | OS.LVCFMT_BITMAP_ON_RIGHT);
         }
-        OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, lvColumn);
+        OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, &lvColumn);
     }
 }
 
@@ -696,11 +691,11 @@
     if (OS.COMCTL32_MAJOR >= 6) {
         int index = parent.indexOf (this);
         if (index is -1) return;
-        int hwnd = parent.handle;
-        int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-        HDITEM hdItem = new HDITEM ();
+        auto hwnd = parent.handle;
+        auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+        HDITEM hdItem;
         hdItem.mask = OS.HDI_FORMAT | OS.HDI_IMAGE;
-        OS.SendMessage (hwndHeader, OS.HDM_GETITEM, index, hdItem);
+        OS.SendMessage (hwndHeader, OS.HDM_GETITEM, index, &hdItem);
         switch (direction) {
             case DWT.UP:
                 hdItem.fmt &= ~(OS.HDF_IMAGE | OS.HDF_SORTDOWN);
@@ -721,7 +716,7 @@
                 }
                 break;
         }
-        OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, hdItem);
+        OS.SendMessage (hwndHeader, OS.HDM_SETITEM, index, &hdItem);
         /*
         * Bug in Windows.  When LVM_SETSELECTEDCOLUMN is used to
         * specify a selected column, Windows does not redraw either
@@ -736,28 +731,28 @@
         * selected column.
         */
         parent.forceResize ();
-        RECT rect = new RECT ();
-        OS.GetClientRect (hwnd, rect);
+        RECT rect;
+        OS.GetClientRect (hwnd, &rect);
         if (OS.SendMessage (hwnd, OS.LVM_GETBKCOLOR, 0, 0) !is OS.CLR_NONE) {
             int oldColumn = OS.SendMessage (hwnd, OS.LVM_GETSELECTEDCOLUMN, 0, 0);
             int newColumn = direction is DWT.NONE ? -1 : index;
             OS.SendMessage (hwnd, OS.LVM_SETSELECTEDCOLUMN, newColumn, 0);
-            RECT headerRect = new RECT ();
+            RECT headerRect;
             if (oldColumn !is -1) {
-                if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, oldColumn, headerRect) !is 0) {
-                    OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
+                if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, oldColumn, &headerRect) !is 0) {
+                    OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*) &headerRect, 2);
                     rect.left = headerRect.left;
                     rect.right = headerRect.right;
-                    OS.InvalidateRect (hwnd, rect, true);
+                    OS.InvalidateRect (hwnd, &rect, true);
                 }
             }
         }
-        RECT headerRect = new RECT ();
-        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect) !is 0) {
-            OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
+        RECT headerRect;
+        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &headerRect) !is 0) {
+            OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*)  &headerRect, 2);
             rect.left = headerRect.left;
             rect.right = headerRect.right;
-            OS.InvalidateRect (hwnd, rect, true);
+            OS.InvalidateRect (hwnd, &rect, true);
         }
     } else {
         switch (direction) {
@@ -772,10 +767,10 @@
     }
 }
 
-override public void setText (String string) {
+override public void setText (char[] string) {
     checkWidget ();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
-    if (string.equals (text)) return;
+    if (string==/*eq*/text) return;
     int index = parent.indexOf (this);
     if (index is -1) return;
     super.setText (string);
@@ -787,10 +782,10 @@
     * text does not draw.  The fix is to query and then
     * set the alignment.
     */
-    int hwnd = parent.handle;
-    LVCOLUMN lvColumn = new LVCOLUMN ();
+    auto hwnd = parent.handle;
+    LVCOLUMN lvColumn;
     lvColumn.mask = OS.LVCF_FMT;
-    OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, lvColumn);
+    OS.SendMessage (hwnd, OS.LVM_GETCOLUMN, index, cast(int) &lvColumn);
 
     /*
     * Bug in Windows.  When a column header contains a
@@ -800,15 +795,15 @@
     * mnemonic characters and replace doubled mnemonics
     * with spaces.
     */
-    int hHeap = OS.GetProcessHeap ();
-    TCHAR buffer = new TCHAR (parent.getCodePage (), fixMnemonic (string), true);
-    int byteCount = buffer.length () * TCHAR.sizeof;
-    int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
-    OS.MoveMemory (pszText, buffer, byteCount);
+    auto hHeap = OS.GetProcessHeap ();
+    TCHAR[] buffer = StrToTCHARs (parent.getCodePage (), fixMnemonic (string), true);
+    int byteCount = buffer.length * TCHAR.sizeof;
+    auto pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
+    OS.MoveMemory (pszText, buffer.ptr, byteCount);
     lvColumn.mask |= OS.LVCF_TEXT;
     lvColumn.pszText = pszText;
-    int result = OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, lvColumn);
-    if (pszText !is 0) OS.HeapFree (hHeap, 0, pszText);
+    int result = OS.SendMessage (hwnd, OS.LVM_SETCOLUMN, index, cast(int) &lvColumn);
+    if (pszText !is null) OS.HeapFree (hHeap, 0, pszText);
     if (result is 0) error (DWT.ERROR_CANNOT_SET_TEXT);
 }
 
@@ -825,11 +820,11 @@
  *
  * @since 3.2
  */
-public void setToolTipText (String string) {
+public void setToolTipText (char[] string) {
     checkWidget();
     toolTipText = string;
-    int hwndHeaderToolTip = parent.headerToolTipHandle;
-    if (hwndHeaderToolTip is 0) {
+    auto hwndHeaderToolTip = parent.headerToolTipHandle;
+    if (hwndHeaderToolTip is null) {
         parent.createHeaderToolTips ();
         parent.updateHeaderToolTips ();
     }
@@ -850,29 +845,29 @@
     if (width < 0) return;
     int index = parent.indexOf (this);
     if (index is -1) return;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     OS.SendMessage (hwnd, OS.LVM_SETCOLUMNWIDTH, index, width);
 }
 
 void updateToolTip (int index) {
-    int hwndHeaderToolTip = parent.headerToolTipHandle;
-    if (hwndHeaderToolTip !is 0) {
-        int hwnd = parent.handle;
-        int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-        RECT rect = new RECT ();
-        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, rect) !is 0) {
-            TOOLINFO lpti = new TOOLINFO ();
+    auto hwndHeaderToolTip = parent.headerToolTipHandle;
+    if (hwndHeaderToolTip !is null) {
+        auto hwnd = parent.handle;
+        auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+        RECT rect;
+        if (OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, &rect) !is 0) {
+            TOOLINFO lpti;
             lpti.cbSize = TOOLINFO.sizeof;
             lpti.hwnd = hwndHeader;
             lpti.uId = id;
-            lpti.left = rect.left;
-            lpti.top = rect.top;
-            lpti.right = rect.right;
-            lpti.bottom = rect.bottom;
-            OS.SendMessage (hwndHeaderToolTip, OS.TTM_NEWTOOLRECT, 0, lpti);
+            lpti.rect.left = rect.left;
+            lpti.rect.top = rect.top;
+            lpti.rect.right = rect.right;
+            lpti.rect.bottom = rect.bottom;
+            OS.SendMessage (hwndHeaderToolTip, OS.TTM_NEWTOOLRECT, 0, &lpti);
         }
     }
 }
 
 }
-++/
+
--- a/dwt/widgets/TableItem.d	Mon Feb 04 16:26:54 2008 +0100
+++ b/dwt/widgets/TableItem.d	Mon Feb 04 20:01:30 2008 +0100
@@ -10,26 +10,20 @@
  *******************************************************************************/
 module dwt.widgets.TableItem;
 
-import dwt.widgets.Item;
-import dwt.widgets.Widget;
-
-class TableItem : Item {
-    public this (Widget parent, int style) {
-        super (parent, style);
-    }
-}
-/++
-
 import dwt.DWT;
 import dwt.DWTException;
 import dwt.graphics.Color;
 import dwt.graphics.Font;
 import dwt.graphics.Image;
 import dwt.graphics.Rectangle;
-import dwt.internal.win32.LVITEM;
 import dwt.internal.win32.OS;
-import dwt.internal.win32.RECT;
-import dwt.internal.win32.TCHAR;
+
+import dwt.widgets.Item;
+import dwt.widgets.Widget;
+import dwt.widgets.Table;
+import dwt.widgets.Event;
+
+import dwt.dwthelper.utils;
 
 /**
  * Instances of this class represent a selectable user interface object
@@ -45,13 +39,15 @@
  * </p>
  */
 
-public class TableItem extends Item {
+public class TableItem : Item {
     Table parent;
-    String [] strings;
+    char[] [] strings;
     Image [] images;
     bool checked, grayed, cached;
-    int imageIndent, background = -1, foreground = -1, font = -1;
-    int [] cellBackground, cellForeground, cellFont;
+    int imageIndent, background = -1, foreground = -1;
+    HFONT font = cast(HFONT)-1;
+    int [] cellBackground, cellForeground;
+    HFONT[] cellFont;
 
 /**
  * Constructs a new instance of this class given its parent
@@ -83,7 +79,7 @@
  * @see Widget#checkSubclass
  * @see Widget#getStyle
  */
-public TableItem (Table parent, int style) {
+public this (Table parent, int style) {
     this (parent, style, checkNull (parent).getItemCount (), true);
 }
 
@@ -119,11 +115,11 @@
  * @see Widget#checkSubclass
  * @see Widget#getStyle
  */
-public TableItem (Table parent, int style, int index) {
+public this (Table parent, int style, int index) {
     this (parent, style, index, true);
 }
 
-TableItem (Table parent, int style, int index, bool create) {
+this (Table parent, int style, int index, bool create) {
     super (parent, style);
     this.parent = parent;
     if (create) parent.createItem (this, index);
@@ -145,8 +141,10 @@
     images = null;
     imageIndent = 0;
     checked = grayed = false;
-    background = foreground = font = -1;
-    cellBackground = cellForeground = cellFont = null;
+    background = foreground = -1;
+    font = cast(HFONT)-1;
+    cellBackground = cellForeground = null;
+    cellFont = null;
     if ((parent.style & DWT.VIRTUAL) !is 0) cached = false;
 }
 
@@ -242,46 +240,46 @@
 }
 
 RECT getBounds (int row, int column, bool getText, bool getImage, bool fullText) {
-    return getBounds (row, column, getText, getImage, fullText, false, 0);
+    return getBounds (row, column, getText, getImage, fullText, false, null);
 }
 
-RECT getBounds (int row, int column, bool getText, bool getImage, bool fullText, bool fullImage, int hDC) {
-    if (!getText && !getImage) return new RECT ();
+RECT getBounds (int row, int column, bool getText, bool getImage, bool fullText, bool fullImage, HDC hDC) {
+    if (!getText && !getImage) return RECT.init;
     int columnCount = parent.getColumnCount ();
     if (!(0 <= column && column < Math.max (1, columnCount))) {
-        return new RECT ();
+        return RECT.init;
     }
     if (parent.fixScrollWidth) parent.setScrollWidth (null, true);
-    RECT rect = new RECT ();
-    int hwnd = parent.handle;
+    RECT rect;
+    auto hwnd = parent.handle;
     int bits = OS.SendMessage (hwnd, OS.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
     if (column is 0 && (bits & OS.LVS_EX_FULLROWSELECT) is 0) {
         if (parent.explorerTheme) {
             rect.left = OS.LVIR_ICON;
             parent.ignoreCustomDraw = true;
-            int code = OS.SendMessage (hwnd, OS. LVM_GETITEMRECT, row, rect);
+            int code = OS.SendMessage (hwnd, OS. LVM_GETITEMRECT, row, &rect);
             parent.ignoreCustomDraw = false;
-            if (code is 0) return new RECT ();
+            if (code is 0) return RECT.init;
             if (getText) {
                 int width = 0;
-                int hFont = cellFont !is null ? cellFont [column] : -1;
-                if (hFont is -1) hFont = font;
-                if (hFont is -1 && hDC is 0) {
-                    TCHAR buffer = new TCHAR (parent.getCodePage (), text, true);
+                auto hFont = cellFont !is null ? cellFont [column] : cast(HFONT)-1;
+                if (hFont is cast(HFONT)-1) hFont = font;
+                if (hFont is cast(HFONT)-1 && hDC is null) {
+                    TCHAR* buffer = StrToTCHARz (parent.getCodePage (), text);
                     width = OS.SendMessage (hwnd, OS.LVM_GETSTRINGWIDTH, 0, buffer);
                 } else {
-                    TCHAR buffer = new TCHAR (parent.getCodePage (), text, false);
-                    int textDC = hDC !is 0 ? hDC : OS.GetDC (hwnd), oldFont = -1;
-                    if (hDC is 0) {
-                        if (hFont is -1) hFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0);
+                    TCHAR[] buffer = StrToTCHARs (parent.getCodePage (), text, false);
+                    auto textDC = hDC !is null ? hDC : OS.GetDC (hwnd), oldFont = cast(HFONT)-1;
+                    if (hDC is null) {
+                        if (hFont is cast(HFONT)-1) hFont = cast(HFONT) OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0);
                         oldFont = OS.SelectObject (textDC, hFont);
                     }
-                    RECT textRect = new RECT ();
+                    RECT textRect;
                     int flags = OS.DT_NOPREFIX | OS.DT_SINGLELINE | OS.DT_CALCRECT;
-                    OS.DrawText (textDC, buffer, buffer.length (), textRect, flags);
+                    OS.DrawText (textDC, buffer.ptr, buffer.length, &textRect, flags);
                     width = textRect.right - textRect.left;
-                    if (hDC is 0) {
-                        if (oldFont !is -1) OS.SelectObject (textDC, oldFont);
+                    if (hDC is null) {
+                        if (oldFont !is cast(HFONT)-1) OS.SelectObject (textDC, oldFont);
                         OS.ReleaseDC (hwnd, textDC);
                     }
                 }
@@ -292,30 +290,30 @@
             if (getText) {
                 rect.left = OS.LVIR_SELECTBOUNDS;
                 parent.ignoreCustomDraw = true;
-                int code = OS.SendMessage (hwnd, OS.LVM_GETITEMRECT, row, rect);
+                int code = OS.SendMessage (hwnd, OS.LVM_GETITEMRECT, row, &rect);
                 parent.ignoreCustomDraw = false;
-                if (code is 0) return new RECT ();
+                if (code is 0) return RECT.init;
                 if (!getImage) {
-                    RECT iconRect = new RECT ();
+                    RECT iconRect;
                     iconRect.left = OS.LVIR_ICON;
                     parent.ignoreCustomDraw = true;
-                    code = OS.SendMessage (hwnd, OS. LVM_GETITEMRECT, row, iconRect);
+                    code = OS.SendMessage (hwnd, OS. LVM_GETITEMRECT, row, &iconRect);
                     parent.ignoreCustomDraw = false;
                     if (code !is 0) rect.left = iconRect.right;
                 }
             } else {
                 rect.left = OS.LVIR_ICON;
                 parent.ignoreCustomDraw = true;
-                int code = OS.SendMessage (hwnd, OS.LVM_GETITEMRECT, row, rect);
+                int code = OS.SendMessage (hwnd, OS.LVM_GETITEMRECT, row, &rect);
                 parent.ignoreCustomDraw = false;
-                if (code is 0) return new RECT ();
+                if (code is 0) return RECT.init;
             }
         }
         if (fullText || fullImage) {
-            RECT headerRect = new RECT ();
-            int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-            OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, 0, headerRect);
-            OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
+            RECT headerRect;
+            auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+            OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, 0, &headerRect);
+            OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*) &headerRect, 2);
             if (getText && fullText) rect.right = headerRect.right;
             if (getImage && fullImage) rect.left = headerRect.left;
         }
@@ -328,7 +326,7 @@
         */
         bool hasImage = (column is 0 && image !is null) || (images !is null && images [column] !is null);
         rect.top = column;
-        if (fullText || fullImage || hDC is 0) {
+        if (fullText || fullImage || hDC is null) {
             /*
             * Bug in Windows.  Despite the fact that the documentation states
             * that LVIR_BOUNDS and LVIR_LABEL are identical when used with
@@ -337,9 +335,9 @@
             */
             rect.left = getText ? OS.LVIR_LABEL : OS.LVIR_ICON;
             parent.ignoreCustomDraw = true;
-            int code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, rect);
+            int code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, &rect);
             parent.ignoreCustomDraw = false;
-            if (code is 0) return new RECT ();
+            if (code is 0) return RECT.init;
             /*
             * Feature in Windows.  Calling LVM_GETSUBITEMRECT with LVIR_LABEL
             * and zero for the column number gives the bounds of the first item
@@ -350,19 +348,19 @@
             * bounds using the icon bounds.
             */
             if (column is 0 && getText && getImage) {
-                RECT iconRect = new RECT ();
+                RECT iconRect;
                 iconRect.left = OS.LVIR_ICON;
                 parent.ignoreCustomDraw = true;
-                code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, iconRect);
+                code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, &iconRect);
                 parent.ignoreCustomDraw = false;
                 if (code !is 0) rect.left = iconRect.left;
             }
             if (hasImage) {
                 if (column !is 0 && getText && !getImage) {
-                    RECT iconRect = new RECT ();
+                    RECT iconRect;
                     iconRect.top = column;
                     iconRect.left = OS.LVIR_ICON;
-                    if (OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, iconRect) !is 0) {
+                    if (OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, &iconRect) !is 0) {
                         rect.left = iconRect.right + Table.INSET / 2;
                     }
                 }
@@ -370,26 +368,26 @@
                 if (getImage && !getText) rect.right = rect.left;
             }
             if (column is 0 && fullImage) {
-                RECT headerRect = new RECT ();
-                int hwndHeader = OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
-                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, 0, headerRect);
-                OS.MapWindowPoints (hwndHeader, hwnd, headerRect, 2);
+                RECT headerRect;
+                auto hwndHeader = cast(HWND) OS.SendMessage (hwnd, OS.LVM_GETHEADER, 0, 0);
+                OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, 0, &headerRect);
+                OS.MapWindowPoints (hwndHeader, hwnd, cast(POINT*) &headerRect, 2);
                 rect.left = headerRect.left;
             }
         } else {
             rect.left = OS.LVIR_ICON;
             parent.ignoreCustomDraw = true;
-            int code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, rect);
+            int code = OS.SendMessage (hwnd, OS. LVM_GETSUBITEMRECT, row, &rect);
             parent.ignoreCustomDraw = false;
-            if (code is 0) return new RECT ();
+            if (code is 0) return RECT.init;
             if (!hasImage) rect.right = rect.left;
             if (getText) {
-                String string = column is 0 ? text : strings !is null ? strings [column] : null;
+                char[] string = column is 0 ? text : strings !is null ? strings [column] : null;
                 if (string !is null) {
-                    RECT textRect = new RECT ();
-                    TCHAR buffer = new TCHAR (parent.getCodePage (), string, false);
+                    RECT textRect;
+                    TCHAR[] buffer = StrToTCHARs (parent.getCodePage (), string, false);
                     int flags = OS.DT_NOPREFIX | OS.DT_SINGLELINE | OS.DT_CALCRECT;
-                    OS.DrawText (hDC, buffer, buffer.length (), textRect, flags);
+                    OS.DrawText (hDC, buffer.ptr, buffer.length, &textRect, flags);
                     rect.right += textRect.right - textRect.left + Table.INSET * 3 + 1;
                 }
             }
@@ -444,7 +442,7 @@
 public Font getFont () {
     checkWidget ();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
-    return font is -1 ? parent.getFont () : Font.win32_new (display, font);
+    return font is cast(HFONT)-1 ? parent.getFont () : Font.win32_new (display, font);
 }
 
 /**
@@ -466,8 +464,8 @@
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     int count = Math.max (1, parent.getColumnCount ());
     if (0 > index || index > count -1) return getFont ();
-    int hFont = (cellFont !is null) ? cellFont [index] : font;
-    return hFont is -1 ? getFont () : Font.win32_new (display, hFont);
+    auto hFont = (cellFont !is null) ? cellFont [index] : font;
+    return hFont is cast(HFONT)-1 ? getFont () : Font.win32_new (display, hFont);
 }
 
 /**
@@ -599,7 +597,7 @@
     return imageIndent;
 }
 
-override String getNameText () {
+override char[] getNameText () {
     if ((parent.style & DWT.VIRTUAL) !is 0) {
         if (!cached) return "*virtual*"; //$NON-NLS-1$
     }
@@ -621,7 +619,7 @@
     return parent;
 }
 
-override public String getText () {
+override public char[] getText () {
     checkWidget();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     return super.getText ();
@@ -639,13 +637,13 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public String getText (int index) {
+public char[] getText (int index) {
     checkWidget();
     if (!parent.checkData (this, true)) error (DWT.ERROR_WIDGET_DISPOSED);
     if (index is 0) return getText ();
     if (strings !is null) {
         if (0 <= index && index < strings.length) {
-            String string = strings [index];
+            char[] string = strings [index];
             return string !is null ? string : "";
         }
     }
@@ -685,7 +683,7 @@
 
 void redraw () {
     if (parent.currentItem is this || parent.drawCount !is 0) return;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     if (!OS.IsWindowVisible (hwnd)) return;
     int index = parent.indexOf (this);
     if (index is -1) return;
@@ -694,12 +692,12 @@
 
 void redraw (int column, bool drawText, bool drawImage) {
     if (parent.currentItem is this || parent.drawCount !is 0) return;
-    int hwnd = parent.handle;
+    auto hwnd = parent.handle;
     if (!OS.IsWindowVisible (hwnd)) return;
     int index = parent.indexOf (this);
     if (index is -1) return;
     RECT rect = getBounds (index, column, drawText, drawImage, true);
-    OS.InvalidateRect (hwnd, rect, true);
+    OS.InvalidateRect (hwnd, &rect, true);
 }
 
 override void releaseHandle () {
@@ -711,7 +709,8 @@
     super.releaseWidget ();
     strings = null;
     images = null;
-    cellBackground = cellForeground = cellFont = null;
+    cellBackground = cellForeground = null;
+    cellFont = null;
 }
 
 /**
@@ -841,7 +840,7 @@
     if (font !is null && font.isDisposed ()) {
         DWT.error (DWT.ERROR_INVALID_ARGUMENT);
     }
-    int hFont = -1;
+    HFONT hFont = cast(HFONT)-1;
     if (font !is null) {
         parent.setCustomDraw (true);
         hFont = font.handle;
@@ -863,12 +862,12 @@
     if ((parent.style & DWT.VIRTUAL) is 0 && cached) {
         int itemIndex = parent.indexOf (this);
         if (itemIndex !is -1) {
-            int hwnd = parent.handle;
-            LVITEM lvItem = new LVITEM ();
+            auto hwnd = parent.handle;
+            LVITEM lvItem;
             lvItem.mask = OS.LVIF_TEXT;
             lvItem.iItem = itemIndex;
             lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-            OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem);
+            OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, cast(int) &lvItem);
             cached = false;
         }
     }
@@ -902,15 +901,15 @@
     }
     int count = Math.max (1, parent.getColumnCount ());
     if (0 > index || index > count - 1) return;
-    int hFont = -1;
+    auto hFont = cast(HFONT)-1;
     if (font !is null) {
         parent.setCustomDraw (true);
         hFont = font.handle;
     }
     if (cellFont is null) {
-        cellFont = new int [count];
+        cellFont = new HFONT [count];
         for (int i = 0; i < count; i++) {
-            cellFont [i] = -1;
+            cellFont [i] = cast(HFONT)-1;
         }
     }
     if (cellFont [index] is hFont) return;
@@ -931,12 +930,12 @@
         if ((parent.style & DWT.VIRTUAL) is 0 && cached) {
             int itemIndex = parent.indexOf (this);
             if (itemIndex !is -1) {
-                int hwnd = parent.handle;
-                LVITEM lvItem = new LVITEM ();
+                auto hwnd = parent.handle;
+                LVITEM lvItem;
                 lvItem.mask = OS.LVIF_TEXT;
                 lvItem.iItem = itemIndex;
                 lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-                OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, cast(int) &lvItem);
                 cached = false;
             }
         }
@@ -1054,7 +1053,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-override public void setImage (Image [] images) {
+public void setImage (Image [] images) {
     checkWidget();
     if (images is null) error (DWT.ERROR_NULL_ARGUMENT);
     for (int i=0; i<images.length; i++) {
@@ -1084,7 +1083,7 @@
     Image oldImage = null;
     if (index is 0) {
         if (image !is null && image.type is DWT.ICON) {
-            if (image.equals (this.image)) return;
+            if (image ==/*eq*/ this.image) return;
         }
         oldImage = this.image;
         super.setImage (image);
@@ -1097,7 +1096,7 @@
     }
     if (images !is null) {
         if (image !is null && image.type is DWT.ICON) {
-            if (image.equals (images [index])) return;
+            if (image ==/*eq*/ images [index] ) return;
         }
         oldImage = images [index];
         images [index] = image;
@@ -1112,7 +1111,7 @@
     redraw (index, drawText, true);
 }
 
-public void setImage (Image image) {
+override public void setImage (Image image) {
     checkWidget ();
     setImage (0, image);
 }
@@ -1140,12 +1139,12 @@
     } else {
         int index = parent.indexOf (this);
         if (index !is -1) {
-            int hwnd = parent.handle;
-            LVITEM lvItem = new LVITEM ();
+            auto hwnd = parent.handle;
+            LVITEM lvItem;
             lvItem.mask = OS.LVIF_INDENT;
             lvItem.iItem = index;
             lvItem.iIndent = indent;
-            OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem);
+            OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, cast(int) &lvItem);
         }
     }
     parent.setScrollWidth (this, false);
@@ -1165,11 +1164,11 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-override public void setText (String [] strings) {
+public void setText (char[] [] strings) {
     checkWidget();
     if (strings is null) error (DWT.ERROR_NULL_ARGUMENT);
     for (int i=0; i<strings.length; i++) {
-        String string = strings [i];
+        char[] string = strings [i];
         if (string !is null) setText (i, string);
     }
 }
@@ -1188,21 +1187,21 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void setText (int index, String string) {
+public void setText (int index, char[] string) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (index is 0) {
-        if (string.equals (text)) return;
+        if (string ==/*eq*/text) return;
         super.setText (string);
     }
     int count = Math.max (1, parent.getColumnCount ());
     if (0 > index || index > count - 1) return;
     if (strings is null && index !is 0)  {
-        strings = new String [count];
+        strings = new char[] [count];
         strings [0] = text;
     }
     if (strings !is null) {
-        if (string.equals (strings [index])) return;
+        if (string==/*eq*/strings [index]) return;
         strings [index] = string;
     }
     if ((parent.style & DWT.VIRTUAL) !is 0) cached = true;
@@ -1221,12 +1220,12 @@
         if ((parent.style & DWT.VIRTUAL) is 0 && cached) {
             int itemIndex = parent.indexOf (this);
             if (itemIndex !is -1) {
-                int hwnd = parent.handle;
-                LVITEM lvItem = new LVITEM ();
+                auto hwnd = parent.handle;
+                LVITEM lvItem;
                 lvItem.mask = OS.LVIF_TEXT;
                 lvItem.iItem = itemIndex;
                 lvItem.pszText = OS.LPSTR_TEXTCALLBACK;
-                OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem);
+                OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, cast(int) &lvItem);
                 cached = false;
             }
         }
@@ -1235,10 +1234,9 @@
     redraw (index, true, false);
 }
 
-public void setText (String string) {
+override public void setText (char[] string) {
     checkWidget();
     setText (0, string);
 }
 
 }
-++/
\ No newline at end of file
--- a/tango_sys_win32/Types.di	Mon Feb 04 16:26:54 2008 +0100
+++ b/tango_sys_win32/Types.di	Mon Feb 04 20:01:30 2008 +0100
@@ -9567,6 +9567,7 @@
 
 alias HD_HITTESTINFO _HD_HITTESTINFO;
 alias HD_HITTESTINFO THDHITTESTINFO;
+alias HD_HITTESTINFO  HDHITTESTINFO;
 alias HD_HITTESTINFO* PHDHITTESTINFO;
 
 struct HD_ITEM