Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#1667 closed Bug (Fixed)

WinMove, Child-Window, Default.

Reported by: mvg Owned by: Jon
Milestone: Component: AutoIt
Version: Severity: None
Keywords: winmove child default Cc:


Not sure about this, (child of child of child ... headache?)
but when using WinMove() on a child Gui-window while using the Default keyword the result is kinda unexpected.
The argument here is that with the use of the Default keyword it is implied that no changes are made to that aspect of the element.
With Child-windows this is unfornately not the case.

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

#include <Debug.au3>
Enum $_logwin_ = 1, $_console_, $_msgbox_, $_file_
_DebugSetup(Default, False, $_console_, 'DebugOut.log')
;~ _DebugOut('msg')
;~ _DebugReportVar('msg', 'var/data')

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <StaticConstants.au3>


Func _Main()
	Local $hGUI, $h_cGUI
	Local $res

	$hGUI = GUICreate("Main Gui", 200, 200, 10, 10, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
	$res = WinGetPos($hGUI) ;; returns absolute (destop relative) coordinates.
	_DebugReportVar('[1] WinGetPos($hGUI)', $res) ;### Debug DebugOut.

	$h_cGUI = GUICreate("Child GUI", 100, 100, 10, 10, $WS_CHILD, -1, $hGUI)
	$res = WinGetPos($h_cGUI) ;; returns absolute (destop relative) coordinates.
	_DebugReportVar('[1] WinGetPos($h_cGUI)', $res) ;### Debug DebugOut.

	GUISetState(@SW_SHOW, $h_cGUI)
	GUICtrlCreateLabel('', 10, 10, 100, 100, $SS_WHITEFRAME)
	GUISetState(@SW_SHOW, $hGUI)

	Sleep(1000 * 0.5)

	$res = WinMove($h_cGUI, '', Default, Default) ;; moves to relative position inside parrent GUI, using absolute child-window coordinates.
	_DebugReportVar('[2] WinMove()', $res) ;### Debug DebugOut.

	$res = WinGetPos($h_cGUI)
	_DebugReportVar('[3] WinGetPos()', $res) ;### Debug DebugOut.

	Do ;; gui wait.
	Until GUIGetMsg() = $GUI_EVENT_CLOSE ;; Or Not WinActive($hGUI)


Attachments (0)

Change History (5)

comment:1 Changed 14 years ago by Jpm

  • Milestone set to
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5890] in version:

comment:2 Changed 13 years ago by Jpm

  • Resolution Fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 13 years ago by TicketCleanup

  • Milestone deleted

Automatic ticket cleanup.

comment:4 Changed 11 years ago by Jon

  • Resolution set to Rejected
  • Status changed from reopened to closed

comment:5 Changed 11 years ago by Jon

  • Milestone set to
  • Owner changed from Jpm to Jon
  • Resolution changed from Rejected to Fixed

Fixed by revision [8179] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jon.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.