ChrisL Posted May 12, 2011 Share Posted May 12, 2011 (edited) Here is a reproducer script of my problem.Drag the little Merlins around and they are bound to the inner cell.Drag left right up and down and all seems to work.Now, drag the little merlin up and Keep going up with your mouse then release the mouse when it is way above the main gui.The Cell window shrinks in height, it never does it with left, right or down only when you drag up.(I'm using Win7 this may not be relevant!)Any ideas?expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> Opt("GuiOnEventMode",1) Opt("MustDeclareVars",1) Global $HWNDMAIN, $GUI_W = 800, $GUI_H = 600 Global $HWNDCHILD, $Child_W = 600, $Child_H = 400 Global $activePackage = 0, $activeChildren[1] = [0], $activeCell = 0 $HWNDMAIN = GUICreate("Main", $GUI_W, $GUI_H, Default, Default) GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit") GUISetState() $HWNDCHILD = GUICreate("",$Child_W,$Child_H,100, 100, BitOR($WS_POPUP,$WS_BORDER),$WS_EX_MDICHILD,$HWNDMAIN) GUISetBkColor(0xFFFFBB) GUISetState() $activePackage = $HWNDCHILD ;Simulates something from full script GUIRegisterMsg($WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING") _CreateCell($HWNDCHILD, 136, 142 ) _CreateCell($HWNDCHILD, 136, 142 ) While 1 Sleep(250) WEnd Func WM_WINDOWPOSCHANGING($hWnd, $Msg, $wParam, $lParam) ConsoleWrite("WM_WINDOWPOSCHANGING" & @CRLF) Local $i For $i = 1 to $activeChildren[0] If $hWnd = $activeChildren[$i] then $activeCell = $HWND ConsoleWrite($activeCell & @CRLF) ExitLoop EndIf Next If $hWnd <> $activeCell then Return If $activePackage = 0 then Return Local $aMain_Pos = WinGetPos($activePackage) ;Get the position of the ParentCell If NOT IsArray($aMain_Pos) then Return ;Get the position of the window which is currently dragging and specify the drag limits Local $stWinPos = DllStructCreate("uint;uint;int;int;int;int;uint", $lParam) Local $iLeft = DllStructGetData($stWinPos, 3) Local $iTop = DllStructGetData($stWinPos, 4) Local $iWidth = DllStructGetData($stWinPos, 5) Local $iHeight = DllStructGetData($stWinPos, 6) Local $iX_Min = $aMain_Pos[0] Local $iY_Min = $aMain_Pos[1] Local $iX_Max = $aMain_Pos[0] + $aMain_Pos[2] - $iWidth Local $iY_Max = $aMain_Pos[1] + $aMain_Pos[3] - $iHeight ConsoleWrite("X = " & $iLeft & @CRLF & _ "Y = " & $iTop & @CRLF & _ "W = " & $iWidth & @CRLF & _ "H = " & $iHeight & @crlf) If $iLeft < $iX_Min Then DllStructSetData($stWinPos, 3, $iX_Min) If $iLeft > $iX_Max Then DllStructSetData($stWinPos, 3, $iX_Max) If $iTop < $iY_Min Then DllStructSetData($stWinPos, 4, $iY_Min) ;<<<<<<<<<<<<< This one doesn't obey properly and if the mouse continues to drag up the window will be resized after mouse is released If $iTop > $iY_Max Then DllStructSetData($stWinPos, 4, $iY_Max) Return $GUI_RUNDEFMSG EndFunc Func _CreateCell($vHWND, $w,$h ) Local $HWNDCHILD = GUICreate("",$w, $h, 1, 1, BitOR($WS_POPUP,$WS_BORDER),$WS_EX_MDICHILD,$vHWND) GUICtrlCreatePic(@ProgramFilesDir & "\AutoIt3\Examples\GUI\Merlin.gif",0,0,$w,$h,Default,$GUI_WS_EX_PARENTDRAG) GUISetState() ReDim $activeChildren[$activeChildren[0] +2] $activeChildren[$activeChildren[0] +1] = $HWNDCHILD $activeChildren[0] +=1 Return $HWNDCHILD EndFunc Func _Exit() Exit EndFuncThis is the problem I'm seeing Edited May 12, 2011 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
wakillon Posted May 12, 2011 Share Posted May 12, 2011 I'm on XpSp3 and there is no bug. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
ChrisL Posted May 12, 2011 Author Share Posted May 12, 2011 Thanks, I just fired up the wife's Vista laptop and it works perfectly on there too. Can anyone else try this with Win7 please, and if there are any thoughts on how to fix it I'd be grateful.. [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
guinness Posted May 12, 2011 Share Posted May 12, 2011 It doesn't work on Windows 7 x64 until I use #AutoIt3Wrapper_UseX64=N As to what caused this is something I can't answer right now UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
ChrisL Posted May 13, 2011 Author Share Posted May 13, 2011 Bump [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted May 18, 2011 Author Share Posted May 18, 2011 Here is how I got round it if anyone is interested, although I'm not sure why I needed to get round it! expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <misc.au3> Opt("GuiOnEventMode",1) Opt("MustDeclareVars",1) Global $HWNDMAIN, $GUI_W = 800, $GUI_H = 600 Global $HWNDCHILD, $Child_W = 600, $Child_H = 400 Global $activePackage = 0, $activeChildren[1] = [0], $GUI_CTRLID = 0 $HWNDMAIN = GUICreate("Main", $GUI_W, $GUI_H, Default, Default) GUISetOnEvent($GUI_EVENT_CLOSE,"_Exit") GUISetState() $HWNDCHILD = GUICreate("",$Child_W,$Child_H,100, 100, BitOR($WS_POPUP,$WS_BORDER),$WS_EX_MDICHILD,$HWNDMAIN) GUISetBkColor(0xFFFFBB) GUISetState() $activePackage = $HWNDCHILD ;Simulates something from full script GUIRegisterMsg($WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING") _CreateCell($HWNDCHILD, 136, 142 ) _CreateCell($HWNDCHILD, 136, 142 ) While 1 Sleep(250) WEnd Func WM_WINDOWPOSCHANGING($hWnd, $Msg, $wParam, $lParam) ConsoleWrite("WM_WINDOWPOSCHANGING" & @CRLF) Local $i, $activeCell = 0 For $i = 1 to $activeChildren[0] If $hWnd = $activeChildren[$i] then $activeCell = $HWND ConsoleWrite($activeCell & @CRLF) ExitLoop EndIf Next If WinActive($HWNDMAIN) then Return If $hWnd <> $activeCell then Return If $activePackage = 0 then Return Local $aMain_Pos = WinGetPos($activePackage) ;Get the position of the ParentCell If NOT IsArray($aMain_Pos) then Return Local $aCell_Pos = WinGetPos($HWND) ;<< patch If NOT IsArray($aCell_Pos) then Return ;Get the position of the window which is currently dragging and specify the drag limits Local $stWinPos = DllStructCreate("uint;uint;int;int;int;int;uint", $lParam) Local $iLeft = DllStructGetData($stWinPos, 3) Local $iTop = DllStructGetData($stWinPos, 4) Local $iWidth = $aCell_Pos[2] ;<< patch DllStructGetData($stWinPos, 5) Local $iHeight = $aCell_Pos[3] ;<< patch DllStructGetData($stWinPos, 6) If DllStructGetData($stWinPos, 5) <> $iWidth then DllStructSetData($stWinPos, 5, $iWidth) If DllStructGetData($stWinPos, 6) <> $iHeight then DllStructSetData($stWinPos, 6, $iHeight) Local $iX_Min = $aMain_Pos[0] Local $iY_Min = $aMain_Pos[1] Local $iX_Max = ($aMain_Pos[0] + $aMain_Pos[2]) - $iWidth Local $iY_Max = ($aMain_Pos[1] + $aMain_Pos[3]) - $iHeight ConsoleWrite("X = " & $iLeft & @CRLF & _ "Y = " & $iTop & @CRLF & _ "W = " & $iWidth & @CRLF & _ "H = " & $iHeight & @crlf) If $iLeft < $iX_Min Then DllStructSetData($stWinPos, 3, $iX_Min) If $iLeft > $iX_Max Then DllStructSetData($stWinPos, 3, $iX_Max) If $iTop < $iY_Min Then DllStructSetData($stWinPos, 4, $iY_Min) If $iTop > $iY_Max Then DllStructSetData($stWinPos, 4, $iY_Max) Return $GUI_RUNDEFMSG EndFunc Func _CreateCell($vHWND, $w,$h ) Local $HWNDCHILD = GUICreate("",$w, $h, 1, 1, BitOR($WS_POPUP,$WS_BORDER),$WS_EX_MDICHILD,$vHWND) GUICtrlCreatePic(@ProgramFilesDir & "\AutoIt3\Examples\GUI\Merlin.gif",0,0,$w,$h, $WS_CLIPSIBLINGS ,$GUI_WS_EX_PARENTDRAG) GUICtrlCreateLabel("",0,0,$w,$h,Default,$GUI_WS_EX_PARENTDRAG) GUICtrlSetOnEvent(-1,"_MouseClick") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) GUISetState() ReDim $activeChildren[$activeChildren[0] +2] $activeChildren[$activeChildren[0] +1] = $HWNDCHILD $activeChildren[0] +=1 Return $HWNDCHILD EndFunc Func _MouseClick() $GUI_CTRLID = @GUI_CtrlId EndFunc Func _Exit() Exit EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now