diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index bcfd141fe0d..e9d76e272aa 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -668,12 +668,25 @@ Control computeTabRoot () { void createHandle () { long hwndParent = widgetParent (); + + int x=OS.CW_USEDEFAULT; + int y=0; + + // Set it to be near the top-left corner of the parent shell by default + if (hwndParent != 0) { + RECT rect = new RECT(); + OS.GetWindowRect(hwndParent, rect); + + x = rect.left + 100; + y = rect.top + 100; + } + handle = OS.CreateWindowEx ( widgetExtStyle (), windowClass (), null, widgetStyle (), - OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0, + x, y, OS.CW_USEDEFAULT, 0, hwndParent, 0, OS.GetModuleHandle (null),