diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java index 435a1cad1d..17fa407f8d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java @@ -67,10 +67,17 @@ public class Scale extends Control { * code, other than SWT, could create a control with * this class name, and fail unexpectedly. */ - lpWndClass.hInstance = OS.GetModuleHandle (null); + long /*int*/ hInstance = OS.GetModuleHandle (null); + long /*int*/ hHeap = OS.GetProcessHeap (); + lpWndClass.hInstance = hInstance; lpWndClass.style &= ~OS.CS_GLOBALCLASS; lpWndClass.style |= OS.CS_DBLCLKS; + int byteCount = TrackBarClass.length () * TCHAR.sizeof; + long /*int*/ lpszClassName = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); + OS.MoveMemory (lpszClassName, TrackBarClass, byteCount); + lpWndClass.lpszClassName = lpszClassName; OS.RegisterClass (lpWndClass); + OS.HeapFree (hHeap, 0, lpszClassName); } /** |