Advertisement
AZJIO

Test GUIFrame.au3

Jul 27th, 2013
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 37.05 KB | None | 0 0
  1. #include-once
  2.  
  3. ; #INDEX# ============================================================================================================
  4. ; Title .........: GUIFrame
  5. ; AutoIt Version : 3.3 +
  6. ; Language ......: English
  7. ; Description ...: Splits a GUI into slideable and resizable 2 part frames which can be further split if required
  8. ; Remarks .......: - The UDF uses OnAutoItExitRegister to call _GUIFrame_Exit to delete subclassed separator bars
  9. ;                    using the UDF created WndProc and to release the Callback on exit
  10. ;                  - If the script already has a WM_SIZE handler then do NOT use _GUIFrame_ResizeReg,
  11. ;                    but call _GUIFrame_SIZE_Handler from within the existing handler
  12. ; Author ........: Original UDF by Kip
  13. ; Modified ......; This version by Melba23 - using x64 compatible code drawn from Yashied's WinAPIEx library
  14. ; ====================================================================================================================
  15.  
  16. ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
  17.  
  18. ; #INCLUDES# =========================================================================================================
  19. #include <WinAPI.au3>
  20.  
  21. ; #GLOBAL VARIABLES# =================================================================================================
  22.  
  23. ; Array to hold handles for each frame set
  24. Global $aGF_HandleIndex[1][7] = [[0, 0, 0]]
  25. ; [0][0] = 0 ; Count of frames      [0][1] = Move registered flag
  26. ; [n][0] = Parent GUI handle        [n][4] = Original GUI handle
  27. ; [n][1] = First frame handle       [n][5] = Indices of first frame internal frames
  28. ; [n][2] = Second frame handle      [n][6] = Indices of second frame internal frames
  29. ; [n][3] = Separator bar handle
  30.  
  31. ; Array to hold sizing percentages for each frame set
  32. Global $aGF_SizingIndex[1][8]
  33. ; [n][0] = First frame min      [n][2] = X coord    [n][4] = Width      [n][6] = Seperator percentage position
  34. ; [n][1] = Second frame min     [n][3] = Y coord    [n][5] = Height     [n][7] = Resize type (0/1/2)
  35.  
  36. ; Array to hold other settings for each frame set
  37. Global $aGF_SettingsIndex[1][3]
  38. ; [n][0] = Separator orientation (vert/horz = 0/1)
  39. ; [n][1] = Resizable frame flag (0/1)
  40. ; [n][2] = Separator size (default = 5)
  41.  
  42. ; Array to hold WinProc handles for each separator
  43. Global $aGF_SepProcIndex[1][2] = [[0, 0]]
  44.  
  45. ; Store registered Callback handle
  46. Global $hGF_RegCallBack = DllCallbackRegister("_GUIFrame_SepWndProc", "lresult", "hwnd;uint;wparam;lparam")
  47. $aGF_SepProcIndex[0][1] = DllCallbackGetPtr($hGF_RegCallBack)
  48.  
  49. ; #ONAUTOITEXIT FUNCTIONS# ===========================================================================================
  50. OnAutoItExitRegister("_GUIFrame_Exit")
  51.  
  52. ; #CURRENT# ==========================================================================================================
  53. ; _GUIFrame_Create:       Splits a GUI into 2 frames
  54. ; _GUIFrame_SetMin:       Sets minimum sizes for each frame
  55. ; _GUIFrame_ResizeSet:    Sets resizing flag for all or specified frame sets
  56. ; _GUIFrame_GetHandle:    Returns the handle of a frame element (required for further splitting)
  57. ; _GUIFrame_Switch:       Sets a frame element as current GUI
  58. ; _GUIFrame_GetSepPos:    Returns the current position of the separator
  59. ; _GUIFrame_SetSepPos:    Moves the separator bar to adjust frame sizes
  60. ; _GUIFrame_ResizeReg:    Registers WM_SIZE message for resizing
  61. ; _GUIFrame_SIZE_Handler: Called from a WM_SIZE message handler to resize frames using _GUIFrame_Move
  62. ; ====================================================================================================================
  63.  
  64. ; #INTERNAL_USE_ONLY#=================================================================================================
  65. ; _GUIFrame_SepSubClass:   Sets new WndProc for frame separator bar
  66. ; _GUIFrame_SepWndProc:    New WndProc for frame separator bar
  67. ; _GUIFrame_SepPassMsg:    Passes Msg to original frame WndProc for action
  68. ; _GUIFrame_Move:          Moves and resizes frame elements and separator bars
  69. ; _GUIFrame_Exit:          Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle
  70. ; ====================================================================================================================
  71.  
  72. ; #FUNCTION# =========================================================================================================
  73. ; Name...........: _GUIFrame_Create
  74. ; Description ...: Splits a GUI into 2 frames
  75. ; Syntax.........: _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iWidth = 0, $iHeight = 0, $iStyle = 0, $iExStyle = 0)
  76. ; Parameters ....: $hWnd - Handle of GUI to split
  77. ;                  $iSepOrient - Orientation of separator bar: 0 = Vertical (default), 1 = Horizontal
  78. ;                  $iSepPos - Required initial position of separator (default = centre of frame GUI)
  79. ;                  $iSepSize - Size of separator bar (default = 5, min = 3, max = 9)
  80. ;                  $iX - Left of frame area (default = 0)
  81. ;                  $iY - Top of frame area (default = 0)
  82. ;                  $iWidth - Width of frame area (default = full width)
  83. ;                  $iHeight - Height of frame area (default = full height)
  84. ;                  SiStyle - Required style value for frame elements
  85. ;                  SiExStyle - Required extended style value for frame elements
  86. ; Requirement(s).: v3.3 +
  87. ; Return values .: Success:  Returns index number of frame/separator set
  88. ;                  Failure:  Returns 0 and sets @error as follows:
  89. ;                  1 = Child limit exceeded
  90. ;                  2 = GUI creation failed
  91. ;                  2 = Separator subclassing failed
  92. ; Author ........: Kip
  93. ; Modified ......: Melba23
  94. ; Remarks .......:
  95. ; Example........: Yes
  96. ;=====================================================================================================================
  97. Func _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iOrg_Width = 0, $iOrg_Height = 0, $iStyle = 0, $iExStyle = 0)
  98.  
  99.     Local $iSeperator_Pos, $hSeparator, $hFirstFrame, $hSecondFrame, $nSepPercent
  100.  
  101.     ; Set separator size
  102.     Local $iSeparatorSize = 5
  103.     Switch $iSepSize
  104.         Case 3 To 9
  105.             $iSeparatorSize = $iSepSize
  106.     EndSwitch
  107.  
  108.     ; Set default sizing if no parameters set
  109.     Local $iWidth = $iOrg_Width
  110.     Local $iHeight = $iOrg_Height
  111.     Local $aFullSize = WinGetClientSize($hWnd)
  112.     If Not $iOrg_Width Then $iWidth = $aFullSize[0]
  113.     If Not $iOrg_Height Then $iHeight = $aFullSize[1]
  114.  
  115.     ; Create parent GUI within client area
  116.     Local $hParent = GUICreate("FrameParent", $iWidth, $iHeight, $iX, $iY, BitOR(0x40000000, $iStyle), $iExStyle, $hWnd) ; $WS_CHILD
  117.     GUISetState(@SW_SHOW, $hParent)
  118.  
  119.     ; Confirm size of frame parent client area
  120.     Local $aSize = WinGetClientSize($hParent)
  121.     $iWidth = $aSize[0]
  122.     $iHeight = $aSize[1]
  123.  
  124.     If $iSepOrient = 0 Then
  125.  
  126.         ; Set initial separator position
  127.         $iSeperator_Pos = $iSepPos
  128.         ; Adjust position if not within GUI or default set (=0)
  129.         If $iSepPos > $iWidth Or $iSepPos < 1 Then
  130.             $iSeperator_Pos = Round(($iWidth / 2) - ($iSeparatorSize / 2))
  131.         EndIf
  132.         ; Create separator bar and force cursor change over separator
  133.         $hSeparator = GUICreate("", $iSeparatorSize, $iHeight, $iSeperator_Pos, 0, 0x40000000, -1, $hParent) ;$WS_CHILD
  134.         GUISetCursor(13, 1, $hSeparator)
  135.         GUICtrlCreateLabel("", 0, 0, $iSeparatorSize, $iHeight, -1, 0x00000001) ; $WS_EX_DLGMODALFRAME
  136.         GUISetState(@SW_SHOW, $hSeparator)
  137.         ; Create the sizable frames
  138.         $hFirstFrame = GUICreate("", $iSeperator_Pos, $iHeight, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD
  139.         GUISetState(@SW_SHOW, $hFirstFrame)
  140.         $hSecondFrame = GUICreate("", $iWidth - ($iSeperator_Pos + $iSeparatorSize), $iHeight, $iSeperator_Pos + $iSeparatorSize, 0, 0x40000000, -1, $hParent) ;$WS_CHILD
  141.         GUISetState(@SW_SHOW, $hSecondFrame)
  142.         ; Set seperator position percentage
  143.         $nSepPercent = $iSeperator_Pos / $iWidth
  144.  
  145.     Else
  146.  
  147.         $iSeperator_Pos = $iSepPos
  148.         If $iSepPos > $iHeight Or $iSepPos < 1 Then
  149.             $iSeperator_Pos = Round(($iHeight / 2) - ($iSeparatorSize / 2))
  150.         EndIf
  151.         $hSeparator = GUICreate("", $iWidth, $iSeparatorSize, 0, $iSeperator_Pos, 0x40000000, -1, $hParent) ;$WS_CHILD
  152.         GUISetCursor(11, 1, $hSeparator)
  153.         GUICtrlCreateLabel("", 0, 0, $iWidth, $iSeparatorSize, -1, 0x01) ; $WS_EX_DLGMODALFRAME
  154.         GUISetState(@SW_SHOW, $hSeparator)
  155.         $hFirstFrame = GUICreate("", $iWidth, $iSeperator_Pos, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD
  156.         GUISetState(@SW_SHOW, $hFirstFrame)
  157.         $hSecondFrame = GUICreate("", $iWidth, $iHeight - ($iSeperator_Pos + $iSeparatorSize), 0, $iSeperator_Pos + $iSeparatorSize, 0x40000000, -1, $hParent) ;$WS_CHILD
  158.         GUISetState(@SW_SHOW, $hSecondFrame)
  159.         $nSepPercent = $iSeperator_Pos / $iHeight
  160.  
  161.     EndIf
  162.  
  163.     ; Check for error creating GUIs
  164.     If $hParent = 0 Or $hSeparator = 0 Or $hFirstFrame = 0 Or $hSecondFrame = 0 Then
  165.         ; Delete all GUIs and return error
  166.         GUIDelete($hParent)
  167.         GUIDelete($hSeparator)
  168.         GUIDelete($hFirstFrame)
  169.         GUIDelete($hSecondFrame)
  170.         Return SetError(2, 0, 0)
  171.     EndIf
  172.  
  173.     ; Subclass the separator
  174.     If _GUIFrame_SepSubClass($hSeparator) = 0 Then
  175.         ; If Subclassing failed then delete all GUIs and return error
  176.         GUIDelete($hParent)
  177.         GUIDelete($hSeparator)
  178.         GUIDelete($hFirstFrame)
  179.         GUIDelete($hSecondFrame)
  180.         Return SetError(3, 0, 0)
  181.     EndIf
  182.  
  183.     ; Create new lines in the storage arrays for this frame set
  184.     Local $iIndex = $aGF_HandleIndex[0][0] + 1
  185.     ReDim $aGF_HandleIndex[$iIndex + 1][7]
  186.     ReDim $aGF_SizingIndex[$iIndex + 1][8]
  187.     ReDim $aGF_SettingsIndex[$iIndex + 1][3]
  188.  
  189.     ; Store this frame set handles/variables/defaults in the new lines
  190.     $aGF_HandleIndex[0][0] = $iIndex
  191.     $aGF_HandleIndex[$iIndex][0] = $hParent
  192.     $aGF_HandleIndex[$iIndex][1] = $hFirstFrame
  193.     $aGF_HandleIndex[$iIndex][2] = $hSecondFrame
  194.     $aGF_HandleIndex[$iIndex][3] = $hSeparator
  195.     $aGF_HandleIndex[$iIndex][4] = $hWnd
  196.     $aGF_HandleIndex[$iIndex][5] = 0
  197.     $aGF_HandleIndex[$iIndex][6] = 0
  198.     $aGF_SizingIndex[$iIndex][0] = 0
  199.     $aGF_SizingIndex[$iIndex][1] = 0
  200.     $aGF_SizingIndex[$iIndex][6] = $nSepPercent
  201.     $aGF_SettingsIndex[$iIndex][0] = $iSepOrient
  202.     $aGF_SettingsIndex[$iIndex][1] = 0
  203.     $aGF_SettingsIndex[$iIndex][2] = $iSeparatorSize
  204.  
  205.     ; Store this frame index in parent line if parent is an existing frame
  206.     For $i = 1 To $aGF_HandleIndex[0][0] - 1
  207.         If $aGF_HandleIndex[$i][1] = $hWnd Then
  208.             If $aGF_HandleIndex[$i][5] = 0 Then
  209.                 $aGF_HandleIndex[$i][5] = $iIndex
  210.             Else
  211.                 $aGF_HandleIndex[$i][5] &= "|" & $iIndex
  212.             EndIf
  213.             ExitLoop
  214.         EndIf
  215.         If $aGF_HandleIndex[$i][2] = $hWnd Then
  216.             If $aGF_HandleIndex[$i][6] = 0 Then
  217.                 $aGF_HandleIndex[$i][6] = $iIndex
  218.             Else
  219.                 $aGF_HandleIndex[$i][6] &= "|" & $iIndex
  220.             EndIf
  221.             ExitLoop
  222.         EndIf
  223.     Next
  224.  
  225.     ; Store coordinate and size fractions
  226.     If $iX Then
  227.         $aGF_SizingIndex[$iIndex][2] = $iX / $aFullSize[0]
  228.     Else
  229.         $aGF_SizingIndex[$iIndex][2] = 0
  230.     EndIf
  231.     If $iY Then
  232.         $aGF_SizingIndex[$iIndex][3] = $iY / $aFullSize[1]
  233.     Else
  234.         $aGF_SizingIndex[$iIndex][3] = 0
  235.     EndIf
  236.     If $iOrg_Width Then
  237.         $aGF_SizingIndex[$iIndex][4] = $iOrg_Width / $aFullSize[0]
  238.     Else
  239.         $aGF_SizingIndex[$iIndex][4] = 1
  240.     EndIf
  241.     If $iOrg_Height Then
  242.         $aGF_SizingIndex[$iIndex][5] = $iOrg_Height / $aFullSize[1]
  243.     Else
  244.         $aGF_SizingIndex[$iIndex][5] = 1
  245.     EndIf
  246.  
  247.     ; Switch back to main GUI
  248.     GUISwitch($hWnd)
  249.  
  250.     ; Return the index for this frame
  251.     Return $iIndex
  252.  
  253. EndFunc   ;==>_GUIFrame_Create
  254.  
  255. ; #FUNCTION# =========================================================================================================
  256. ; Name...........: _GUIFrame_SetMin
  257. ; Description ...: Sets minimum sizes for frames
  258. ; Syntax.........: _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False)
  259. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create
  260. ;                  $iFirstMin - Min size of first (left/top) frame - max half size
  261. ;                  $iSecondMin - Min Size of second (right/bottom) frame - max half size
  262. ;                  $fAbsolute - True = Minima fixed when GUI resized
  263. ;                             - False = Minima adjusted on resize to equivalent percentage of new GUI size (default)
  264. ; Requirement(s).: v3.3 +
  265. ; Return values .: None
  266. ; Author ........: Melba23 based on some original code by Kip
  267. ; Modified ......:
  268. ; Remarks .......: If the frame is resized, these minima are adjusted accordingly unless $fAbsolute is set
  269. ; Example........: Yes
  270. ;=====================================================================================================================
  271. Func _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False)
  272.  
  273.     ; Check for valid frame index
  274.     If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0
  275.     ; Get size of parent
  276.     Local $aSize = WinGetClientSize($aGF_HandleIndex[$iFrame][0])
  277.     ; Now check orientation and determine
  278.     Local $iMax, $iFullSize
  279.     If $aGF_SettingsIndex[$iFrame][0] = 0 Then
  280.         $iMax = Floor(($aSize[0] / 2) - $aGF_SettingsIndex[$iFrame][2])
  281.         $iFullSize = $aSize[0]
  282.     Else
  283.         $iMax = Floor(($aSize[1] / 2) - $aGF_SettingsIndex[$iFrame][2])
  284.         $iFullSize = $aSize[1]
  285.     EndIf
  286.     ; Set minimums
  287.     If $fAbsolute Then
  288.         $aGF_SizingIndex[$iFrame][0] = Int($iFirstMin)
  289.         $aGF_SizingIndex[$iFrame][1] = Int($iSecondMin)
  290.     Else
  291.         If $iFirstMin > $iMax Then
  292.             $aGF_SizingIndex[$iFrame][0] = $iMax / $iFullSize
  293.         Else
  294.             $aGF_SizingIndex[$iFrame][0] = $iFirstMin / $iFullSize
  295.         EndIf
  296.         If $iSecondMin > $iMax Then
  297.             $aGF_SizingIndex[$iFrame][1] = $iMax / $iFullSize
  298.         Else
  299.             $aGF_SizingIndex[$iFrame][1] = $iSecondMin / $iFullSize
  300.         EndIf
  301.     EndIf
  302.  
  303. EndFunc   ;==>_GUIFrame_SetMin
  304.  
  305. ; #FUNCTION# =========================================================================================================
  306. ; Name...........: _GUIFrame_ResizeSet
  307. ; Description ...: Sets resizing flag for frames
  308. ; Syntax.........: _GUIFrame_ResizeSet($iFrame = 0[, $iType = 0])
  309. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create (Default - 0 = all existing frames)
  310. ;                  $iType  - Separator behaviour on GUI resize
  311. ;                            0 = Frames retain percentage size (default)
  312. ;                            1 = Top/left frame fixed size
  313. ;                            2 = Bottom/right frame fixed size
  314. ; Requirement(s).: v3.3 +
  315. ; Return values .: Success: 2 - All existing frame flags set
  316. ;                           1 - Specified flag set
  317. ;                  Failure: 0 with @error set to:
  318. ;                           1 - Invalid frame specified
  319. ;                           2 - Invalid type parameter
  320. ; Author ........: Melba23
  321. ; Modified ......:
  322. ; Remarks .......:
  323. ; Example........: Yes
  324. ;=====================================================================================================================
  325. Func _GUIFrame_ResizeSet($iFrame = 0, $iType = 0)
  326.  
  327.     Switch $iType
  328.         Case 0, 1, 2
  329.             ; Valid
  330.         Case Else
  331.             Return SetError(2, 0, 0)
  332.     EndSwitch
  333.  
  334.     Switch $iFrame
  335.         Case 0 ; Set all frames
  336.             For $i = 1 To $aGF_HandleIndex[0][0]
  337.                 $aGF_SettingsIndex[$i][1] = 1
  338.                 $aGF_SizingIndex[$i][7] = $iType
  339.             Next
  340.             Return 2
  341.         Case 1 To $aGF_HandleIndex[0][0] ; Only valid frames accepted
  342.             $aGF_SettingsIndex[$iFrame][1] = 1
  343.             $aGF_SizingIndex[$iFrame][7] = $iType
  344.             Return 1
  345.         Case Else ; Error
  346.             Return SetError(1, 0, 0)
  347.     EndSwitch
  348.  
  349. EndFunc   ;==>_GUIFrame_ResizeSet
  350.  
  351. ; #FUNCTION# =========================================================================================================
  352. ; Name...........: _GUIFrame_GetHandle
  353. ; Description ...: Returns the handle of a frame element (required for further splitting)
  354. ; Syntax.........: _GUIFrame_GetHandle($iFrame, $iElement)
  355. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create
  356. ;                  $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame
  357. ; Requirement(s).: v3.3 +
  358. ; Return values .: Success: Handle of frame
  359. ;                  Failure: 0 with @error set as follows
  360. ;                           1 - Invalid frame specified
  361. ;                           2 - Invalid element specified
  362. ; Author ........: Kip
  363. ; Modified ......: Melba23
  364. ; Remarks .......: _GUIFrame_Create requires a GUI handle as a parameter
  365. ; Example........: Yes
  366. ;=====================================================================================================================
  367. Func _GUIFrame_GetHandle($iFrame, $iElement)
  368.  
  369.     ; Check valid frame index and element
  370.     Switch $iFrame
  371.         Case 1 To $aGF_HandleIndex[0][0]
  372.             Switch $iElement
  373.                 Case 1, 2
  374.                     ; Return handle
  375.                     Return $aGF_HandleIndex[$iFrame][$iElement]
  376.             EndSwitch
  377.             Return SetError(2, 0, 0)
  378.     EndSwitch
  379.     Return SetError(1, 0, 0)
  380.  
  381. EndFunc   ;==>_GUIFrame_GetHandle
  382.  
  383. ; #FUNCTION# =========================================================================================================
  384. ; Name...........: _GUIFrame_Switch
  385. ; Description ...: Sets a frame element as current GUI
  386. ; Syntax.........: _GUIFrame_Switch($iFrame, $iElement)
  387. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create
  388. ;                  $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame
  389. ; Requirement(s).: v3.3 +
  390. ; Return values .: None
  391. ; Author ........: Kip
  392. ; Modified ......: Melba23
  393. ; Remarks .......: Subsequent controls are created in the specified frame element
  394. ; Example........: Yes
  395. ;=====================================================================================================================
  396. Func _GUIFrame_Switch($iFrame, $iElement)
  397.  
  398.     ; Check valid frame index and element
  399.     Switch $iFrame
  400.         Case 1 To $aGF_HandleIndex[0][0]
  401.             Switch $iElement
  402.                 Case 1, 2
  403.                     ; Switch to specified element
  404.                     Return GUISwitch($aGF_HandleIndex[$iFrame][$iElement])
  405.             EndSwitch
  406.             Return SetError(2, 0, 0)
  407.     EndSwitch
  408.     Return SetError(1, 0, 0)
  409.  
  410. EndFunc   ;==>_GUIFrame_Switch
  411.  
  412. ; #FUNCTION# =========================================================================================================
  413. ; Name...........: _GUIFrame_GetSepPos()
  414. ; Description ...: Returns the current position of the separator
  415. ; Syntax.........: _GUIFrame_GetSepPos($iFrame)
  416. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create
  417. ; Requirement(s).: v3.3 +
  418. ; Return values .: Success: Position of separator
  419. ;                  Failure: -1 = Invalid frame specified
  420. ; Author ........: Melba23
  421. ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create
  422. ;                  to restore exit position on restart
  423. ; Example........: Yes
  424. ;=====================================================================================================================
  425. Func _GUIFrame_GetSepPos($iFrame)
  426.  
  427.     Local $iSepPos
  428.  
  429.     ; Check for valid frame index
  430.     If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return -1
  431.  
  432.     ; Get position of first frame
  433.     Local $aFrame_Pos = WinGetPos($aGF_HandleIndex[$iFrame][1])
  434.     ; Get position of separator
  435.     Local $aSep_Pos = WinGetPos($aGF_HandleIndex[$iFrame][3])
  436.     ; Check on separator orientation
  437.     If $aGF_SettingsIndex[$iFrame][0] Then
  438.         $iSepPos = $aSep_Pos[1] - $aFrame_Pos[1]
  439.     Else
  440.         $iSepPos = $aSep_Pos[0] - $aFrame_Pos[0]
  441.     EndIf
  442.     Return $iSepPos
  443.  
  444. EndFunc   ;==>_GUIFrame_GetSepPos
  445.  
  446. ; #FUNCTION# =========================================================================================================
  447. ; Name...........: _GUIFrame_SetSepPos()
  448. ; Description ...: Moves the separator bar to adjust frame sizes
  449. ; Syntax.........: _GUIFrame_SetSepPos($iFrame, $iSepPos)
  450. ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create
  451. ;                  $iSepos - Position of separator bar within frame
  452. ; Requirement(s).: v3.3 +
  453. ; Return values .: Success: 1
  454. ;                  Failure: 0 with @error set as follows
  455. ;                           1 - Invalid frame specified
  456. ;                           2 - Invalid separator position (outside frame)
  457. ;                           3 - Invalid separator position (below frame minimum size)
  458. ; Author ........: Melba23
  459. ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create
  460. ;                  to restore exit position on restart
  461. ; Example........: Yes
  462. ;=====================================================================================================================
  463. Func _GUIFrame_SetSepPos($iFrame, $iSepPos)
  464.  
  465.     Local $iFirstMin, $iSecondMin
  466.  
  467.     ; Check for valid frame index
  468.     If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return SetError(1, 0, 0)
  469.  
  470.     ; Check separator actually needs to move
  471.     If $iSepPos = _GUIFrame_GetSepPos($iFrame) Then Return 1
  472.  
  473.     ; Get frame GUI size
  474.     Local $aWinPos = WinGetPos($aGF_HandleIndex[$iFrame][0])
  475.     ; Depending on separator orientation
  476.     If $aGF_SettingsIndex[$iFrame][0] Then
  477.         ; Check sep position is valid
  478.         If $iSepPos < 0 Or $iSepPos > $aWinPos[3] Then Return SetError(2, 0, 0)
  479.         ; Determine minima for frames
  480.         $iFirstMin = $aWinPos[3] * $aGF_SizingIndex[$iFrame][0]
  481.         $iSecondMin = ($aWinPos[3] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2]
  482.         ; Check required value is valid
  483.         If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0)
  484.         ; Move frames and seperator
  485.         WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $aWinPos[2], $iSepPos)
  486.         WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSepPos + $aGF_SettingsIndex[$iFrame][2], $aWinPos[2], $aWinPos[3] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2]))
  487.         WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSepPos, $aWinPos[2], $aGF_SettingsIndex[$iFrame][2])
  488.     Else
  489.         If $iSepPos < 0 Or $iSepPos > $aWinPos[2] Then Return SetError(2, 0, 0)
  490.         $iFirstMin = $aWinPos[2] * $aGF_SizingIndex[$iFrame][0]
  491.         $iSecondMin = ($aWinPos[2] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2]
  492.         If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0)
  493.         WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSepPos, $aWinPos[3])
  494.         WinMove($aGF_HandleIndex[$iFrame][2], "", $iSepPos + $aGF_SettingsIndex[$iFrame][2], 0, $aWinPos[2] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2]), $aWinPos[3])
  495.         WinMove($aGF_HandleIndex[$iFrame][3], "", $iSepPos, 0, $aGF_SettingsIndex[$iFrame][2], $aWinPos[3])
  496.     EndIf
  497.     Return 1
  498.  
  499. EndFunc   ;==>_GUIFrame_SetSepPos
  500.  
  501. ; #FUNCTION# =========================================================================================================
  502. ; Name...........: _GUIFrame_ResizeReg
  503. ; Description ...: Registers WM_SIZE message for resizing
  504. ; Syntax.........: _GUIFrame_ResizeReg()
  505. ; Parameters ....: None
  506. ; Requirement(s).: v3.3 +
  507. ; Return values .: Success: 1 - Message handler registered
  508. ;                  Failure: 0 with @error set to 1 - Message handler already registered
  509. ; Author ........: Melba23
  510. ; Modified ......:
  511. ; Remarks .......:
  512. ; Example........: Yes
  513. ;=====================================================================================================================
  514. Func _GUIFrame_ResizeReg()
  515.  
  516.     ; Register the WM_SIZE message
  517.     If $aGF_HandleIndex[0][1] = 0 Then
  518.         Local $iRet = GUIRegisterMsg(0x05, "_GUIFrame_SIZE_Handler") ; $WM_SIZE
  519.         If $iRet Then
  520.             $aGF_HandleIndex[0][1] = 1
  521.             Return 1
  522.         EndIf
  523.     EndIf
  524.     Return SetError(1, 0, 0)
  525.  
  526. EndFunc   ;==>_GUIFrame_ResizeReg
  527.  
  528. ; #FUNCTION# =========================================================================================================
  529. ; Name...........: _GUIFrame_SIZE_Handler
  530. ; Description ...: Used to resize frames when resizing of holding GUI occurs
  531. ; Syntax.........: _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam)
  532. ; Parameters ....: None
  533. ; Requirement(s).: v3.3 +
  534. ; Return values .: None
  535. ; Author ........: Melba23
  536. ; Modified ......:
  537. ; Remarks .......: If the script already has a WM_SIZE handler, then just call this function from within it
  538. ;                  and do NOT use the _GUIFrame_ResizeReg function
  539. ; Example........: Yes
  540. ;=====================================================================================================================
  541. Func _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam)
  542.  
  543.     #forceref $iMsg, $wParam, $lParam
  544.     Local $iIndex
  545.  
  546.     ; Get index of base frame GUI
  547.     For $iIndex = 1 To $aGF_HandleIndex[0][0]
  548.         If $aGF_HandleIndex[$iIndex][4] = $hWnd Then ExitLoop
  549.     Next
  550.  
  551.     ; If handle not found
  552.     If $iIndex > $aGF_HandleIndex[0][0] Then Return "GUI_RUNDEFMSG"
  553.  
  554.     ; Check if we should resize this set
  555.     If $aGF_SettingsIndex[$iIndex][1] = 1 Then
  556.  
  557.         ; Get new base GUI size
  558.         Local $aSize = WinGetClientSize($hWnd)
  559.         ; Resize frames
  560.         _GUIFrame_Move($iIndex, $aSize[0] * $aGF_SizingIndex[$iIndex][2], $aSize[1] * $aGF_SizingIndex[$iIndex][3], $aSize[0] * $aGF_SizingIndex[$iIndex][4], $aSize[1] * $aGF_SizingIndex[$iIndex][5])
  561.  
  562.         ; Adjust any resizeable internal frames - array elements are adjacent for ease of coding
  563.         For $i = 0 To 1
  564.             ; Adjust internal frames of first/second frame if any exist
  565.             If $aGF_HandleIndex[$iIndex][5 + $i] <> 0 Then
  566.                 ; StringSplit the element content on "|"
  567.                 Local $aInternal = StringSplit($aGF_HandleIndex[$iIndex][5 + $i], "|")
  568.                 ; Then loop though the Number(values) found
  569.                 For $j = 1 To $aInternal[0]
  570.                     Local $iIntIndex = Number($aInternal[$j])
  571.                     ; Check if internal frame is resizable
  572.                     If $aGF_SettingsIndex[$iIntIndex][1] = 1 Then
  573.                         ; And change if so
  574.                         _GUIFrame_SIZE_Handler($aGF_HandleIndex[$iIntIndex][4], $iMsg, $wParam, $lParam)
  575.                     EndIf
  576.                 Next
  577.             EndIf
  578.         Next
  579.  
  580.     EndIf
  581.  
  582.     Return "GUI_RUNDEFMSG"
  583.  
  584. EndFunc   ;==>_GUIFrame_SIZE_Handler
  585.  
  586. ; #INTERNAL_USE_ONLY#============================================================================================================
  587. ; Name...........: _GUIFrame_SepSubClass
  588. ; Description ...: Sets new WndProc for frame separator bar
  589. ; Author ........: Kip
  590. ; Modified.......: Melba23, using SetWindowLongPtr x64 compatible code drawn from Yashied's WinAPIEx library
  591. ; Remarks .......: This function is used internally by _GUIFrame_Create
  592. ; ===============================================================================================================================
  593. Func _GUIFrame_SepSubClass($hWnd)
  594.  
  595.     Local $aRet
  596.  
  597.     ; Check separator has not already been used
  598.     For $i = 1 To $aGF_SepProcIndex[0][0]
  599.         If $aGF_SepProcIndex[$i][0] = $hWnd Then Return 0
  600.     Next
  601.  
  602.     ; Store current WinProc handle in new array line
  603.     Local $iIndex = $aGF_SepProcIndex[0][0] + 1
  604.     ReDim $aGF_SepProcIndex[$iIndex + 1][2]
  605.     $aGF_SepProcIndex[0][0] = $iIndex
  606.     $aGF_SepProcIndex[$iIndex][0] = $hWnd
  607.     ; Subclass separator bar
  608.     If @AutoItX64 Then
  609.         $aRet = DllCall('user32.dll', 'long_ptr', 'SetWindowLongPtrW', 'hwnd', $hWnd, 'int', -4, 'long_ptr', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC
  610.     Else
  611.         $aRet = DllCall('user32.dll', 'long', 'SetWindowLongW', 'hwnd', $hWnd, 'int', -4, 'long', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC
  612.     EndIf
  613.     ; Check for subclassing error
  614.     If @error Or $aRet[0] = 0 Then Return 0
  615.     ; Return success
  616.     $aGF_SepProcIndex[$iIndex][1] = $aRet[0]
  617.     Return 1
  618.  
  619. EndFunc   ;==>_GUIFrame_SepSubClass
  620.  
  621. ; #INTERNAL_USE_ONLY#============================================================================================================
  622. ; Name...........: _GUIFrame_SepWndProc
  623. ; Description ...: New WndProc for frame separator bar
  624. ; Author ........: Kip
  625. ; Modified.......: Melba23
  626. ; Remarks .......: This function is used internally by _GUIFrame_SepSubClass
  627. ; ===============================================================================================================================
  628. Func _GUIFrame_SepWndProc($hWnd, $iMsg, $wParam, $lParam)
  629.  
  630.     Local $iSubtract, $fAbsolute = False
  631.  
  632.     If $iMsg = 0x0111 Then ; WM_COMMAND
  633.  
  634.         ; Check if hWnd is a Separator bar
  635.         For $iIndex = 1 To $aGF_HandleIndex[0][0]
  636.             If $aGF_HandleIndex[$iIndex][3] = $hWnd Then ExitLoop
  637.         Next
  638.         ; If not then pass message on to org WndProc
  639.         If $iIndex > $aGF_HandleIndex[0][0] Then Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam)
  640.  
  641.         ; Extract values from array
  642.         Local $hParent = $aGF_HandleIndex[$iIndex][0]
  643.         Local $hFirstFrame = $aGF_HandleIndex[$iIndex][1]
  644.         Local $hSecondFrame = $aGF_HandleIndex[$iIndex][2]
  645.         Local $hSeparator = $aGF_HandleIndex[$iIndex][3]
  646.         Local $iFirstMin = $aGF_SizingIndex[$iIndex][0]
  647.         Local $iSecondMin = $aGF_SizingIndex[$iIndex][1]
  648.         If $iFirstMin > 1 Or $iSecondMin > 1 Then
  649.             $fAbsolute = True
  650.         EndIf
  651.         Local $iSeparatorSize = $aGF_SettingsIndex[$iIndex][2]
  652.  
  653.         ; Get client size of the parent
  654.         Local $aClientSize = WinGetClientSize($hParent)
  655.         Local $iWidth = $aClientSize[0]
  656.         Local $iHeight = $aClientSize[1]
  657.  
  658.         ; Get cursor info for the Separator
  659.         Local $aCInfo = GUIGetCursorInfo($hSeparator)
  660.  
  661.         ; Depending on separator orientation
  662.         If $aGF_SettingsIndex[$iIndex][0] = 0 Then
  663.  
  664.             ; Get Separator X-coord
  665.             $iSubtract = $aCInfo[0]
  666.  
  667.             ; GUISetCursor(13, 1, $hFirstFrame)
  668.             ; GUISetCursor(13, 1, $hSecondFrame)
  669.             GUISetCursor(13, 1, $hParent)
  670.             Do
  671.                 Sleep(10)
  672.                 ; Get parent X-coord
  673.                 $aCInfo = GUIGetCursorInfo($hParent)
  674.  
  675.                 ; Determine width of first frame
  676.                 Local $iFirstWidth = $aCInfo[0] - $iSubtract
  677.                 ; And ensure it is at least minimum
  678.                 If $fAbsolute Then
  679.                     If $iFirstWidth < $iFirstMin Then $iFirstWidth = $iFirstMin
  680.                     If $iWidth - $iFirstWidth - $iSeparatorSize < $iSecondMin Then $iFirstWidth = $iWidth - $iSeparatorSize - $iSecondMin
  681.                 Else
  682.                     If $iFirstWidth < $iWidth * $iFirstMin Then $iFirstWidth = $iWidth * $iFirstMin
  683.                     If $iWidth - ($iFirstWidth + $iSeparatorSize) < $iWidth * $iSecondMin Then $iFirstWidth = $iWidth - ($iWidth * $iSecondMin) - $iSeparatorSize
  684.                 EndIf
  685.  
  686.                 ; Move the GUIs to the correct places
  687.                 WinMove($hFirstFrame, "", 0, 0, $iFirstWidth, $iHeight)
  688.                 WinMove($hSecondFrame, "", $iFirstWidth + $iSeparatorSize, 0, $iWidth - ($iFirstWidth + $iSeparatorSize), $iHeight)
  689.                 WinMove($hSeparator, "", $iFirstWidth, 0, $iSeparatorSize, $iHeight)
  690.  
  691.                 ; Do until the mouse button is released
  692.             ; Until Not _WinAPI_GetAsyncKeyState(0x01)
  693.             Until Not $aCInfo[2]
  694.             ; GUISetCursor(2, 0, $hFirstFrame)
  695.             ; GUISetCursor(2, 0, $hSecondFrame)
  696.             GUISetCursor(2, 0, $hParent)
  697.  
  698.             ; Store current separator percentage position
  699.             $aGF_SizingIndex[$iIndex][6] = $iFirstWidth / $iWidth
  700.  
  701.         ElseIf $aGF_SettingsIndex[$iIndex][0] = 1 Then
  702.  
  703.             $iSubtract = $aCInfo[1]
  704.             ; GUISetCursor(11, 1, $hFirstFrame)
  705.             ; GUISetCursor(11, 1, $hSecondFrame)
  706.             GUISetCursor(11, 1, $hParent)
  707.             Do
  708.                 Sleep(10)
  709.                 $aCInfo = GUIGetCursorInfo($hParent)
  710.                 Local $iCursorY = $aCInfo[1]
  711.                 Local $iFirstHeight = $iCursorY - $iSubtract
  712.                 If $fAbsolute Then
  713.                     If $iFirstHeight < $iFirstMin Then $iFirstHeight = $iFirstMin
  714.                     If $iHeight - $iFirstHeight - $iSeparatorSize < $iSecondMin Then $iFirstHeight = $iHeight - $iSeparatorSize - $iSecondMin
  715.                 Else
  716.                     If $iFirstHeight < $iHeight * $iFirstMin Then $iFirstHeight = $iHeight * $iFirstMin
  717.                     If $iHeight - ($iFirstHeight + $iSeparatorSize) < $iHeight * $iSecondMin Then $iFirstHeight = $iHeight - ($iHeight * $iSecondMin) - $iSeparatorSize
  718.                 EndIf
  719.                 WinMove($hFirstFrame, "", 0, 0, $iWidth, $iFirstHeight)
  720.                 WinMove($hSecondFrame, "", 0, $iFirstHeight + $iSeparatorSize, $iWidth, $iHeight - ($iFirstHeight + $iSeparatorSize))
  721.                 WinMove($hSeparator, "", 0, $iFirstHeight, $iWidth, $iSeparatorSize)
  722.             Until Not $aCInfo[2]
  723.             ; GUISetCursor(2, 0, $hFirstFrame)
  724.             ; GUISetCursor(2, 0, $hSecondFrame)
  725.             GUISetCursor(2, 0, $hParent)
  726.             $aGF_SizingIndex[$iIndex][6] = $iFirstHeight / $iHeight
  727.  
  728.         EndIf
  729.  
  730.     EndIf
  731.  
  732.     ; Pass the message on to org WndProc
  733.     Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam)
  734.  
  735. EndFunc   ;==>_GUIFrame_SepWndProc
  736.  
  737. ; #INTERNAL_USE_ONLY#============================================================================================================
  738. ; Name...........: _GUIFrame_SepPassMsg
  739. ; Description ...: Passes Msg to frame parent WndProc for action
  740. ; Author ........: Kip
  741. ; Modified.......: Melba23
  742. ; Remarks .......: This function is used internally by _GUIFrame_SepWndProc
  743. ; ===============================================================================================================================
  744. Func _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam)
  745.  
  746.     For $i = 1 To $aGF_SepProcIndex[0][0]
  747.         If $aGF_SepProcIndex[$i][0] = $hWnd Then Return _WinAPI_CallWindowProc($aGF_SepProcIndex[$i][1], $hWnd, $iMsg, $wParam, $lParam)
  748.     Next
  749.  
  750. EndFunc   ;==>_GUIFrame_SepPassMsg
  751.  
  752. ; #INTERNAL_USE_ONLY#============================================================================================================
  753. ; Name...........: _GUIFrame_Move
  754. ; Description ...: Moves and resizes frame elements and separator bars
  755. ; Author ........: Kip
  756. ; Modified.......: Melba23
  757. ; Remarks .......: This function is used internally by _GUIFrame_SIZE_Handler
  758. ; ===============================================================================================================================
  759. Func _GUIFrame_Move($iFrame, $iX, $iY, $iWidth = 0, $iHeight = 0)
  760.  
  761.     If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0
  762.  
  763.     Local $fAbsolute = False, $iDimension, $iActual_Size_1, $iActual_Size_2, $iSize
  764.     Local $iOrientation = $aGF_SettingsIndex[$iFrame][0]
  765.     Local $iSeparatorSize = $aGF_SettingsIndex[$iFrame][2]
  766.  
  767.     ; Set size if not specified
  768.     If Not $iWidth Then $iWidth = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][0])
  769.     If Not $iHeight Then $iHeight = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][0])
  770.  
  771.     ; Move parent
  772.     WinMove($aGF_HandleIndex[$iFrame][0], "", $iX, $iY, $iWidth, $iHeight)
  773.  
  774.     ; Depending on separator orientation get required width/height values
  775.     If $iOrientation = 1 Then
  776.         $iDimension = $iHeight
  777.         $iActual_Size_1 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][1])
  778.         $iActual_Size_2 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][2])
  779.     Else
  780.         $iDimension = $iWidth
  781.         $iActual_Size_1 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][1])
  782.         $iActual_Size_2 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][2])
  783.     EndIf
  784.  
  785.     ; Check resize type required
  786.     Switch $aGF_SizingIndex[$iFrame][7]
  787.         Case 0
  788.             ; Determine new size for first frame using separator position percentage
  789.             $iSize = Int($iDimension * $aGF_SizingIndex[$iFrame][6])
  790.         Case 1
  791.             ; Get current fixed first frame size
  792.             $iSize = $iActual_Size_1
  793.         Case 2
  794.             ; Determine new first frame size with fixed second frame size
  795.             $iSize = $iDimension - $iSeparatorSize - $iActual_Size_2
  796.     EndSwitch
  797.  
  798.     ; Set frame min percentages
  799.     Local $iFirstMin = $aGF_SizingIndex[$iFrame][0]
  800.     Local $iSecondMin = $aGF_SizingIndex[$iFrame][1]
  801.     If $iFirstMin > 1 Or $iSecondMin > 1 Then
  802.         $fAbsolute = True
  803.     EndIf
  804.  
  805.     ; Check for minimum size of first frame
  806.     Local $iAdjust_Other = True
  807.     Local $fSep_Adjusted = False
  808.  
  809.     ; Adjust first frame size
  810.     If $fAbsolute Then
  811.         If $iSize < $iFirstMin Then
  812.             $iSize = $iFirstMin
  813.             $iAdjust_Other = False
  814.             $fSep_Adjusted = True
  815.         EndIf
  816.     Else
  817.         If $iSize < $iDimension * $iFirstMin Then
  818.             $iSize = $iDimension * $iFirstMin
  819.             $iAdjust_Other = False
  820.             $fSep_Adjusted = True
  821.         EndIf
  822.     EndIf
  823.  
  824.     ; Now adjust second frame if first not adjusted
  825.     If $iAdjust_Other Then
  826.  
  827.         ; Find max available size for this frame
  828.         Local $iSecondMax = $iDimension - $iFirstMin - $iSeparatorSize
  829.         If $iSecondMax < $iSecondMin Then
  830.             $iSecondMin = $iSecondMax
  831.         EndIf
  832.  
  833.         ; Adjust second frame size
  834.         If $fAbsolute Then
  835.             If $iActual_Size_2 < $iSecondMin Then
  836.                 $iSize = $iDimension - $iSecondMin - $iSeparatorSize
  837.                 $fSep_Adjusted = True
  838.             EndIf
  839.         Else
  840.             If $iActual_Size_2 < $iDimension * $iSecondMin Then
  841.                 $iSize = $iDimension - ($iDimension * $iSecondMin) - $iSeparatorSize
  842.                 $fSep_Adjusted = True
  843.             EndIf
  844.         EndIf
  845.     EndIf
  846.  
  847.     ; If the separator has been moved programatically then reset percentage size of first frame
  848.     If $fSep_Adjusted Then
  849.         $aGF_SizingIndex[$iFrame][6] = $iSize / $iDimension
  850.     EndIf
  851.  
  852.     ; Move and resize GUIs according to orientation
  853.     If $iOrientation = 1 Then
  854.         WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iWidth, $iSize)
  855.         WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSize + $iSeparatorSize, $iWidth, $iHeight - $iSize - $iSeparatorSize)
  856.         WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSize, $iWidth, $iSeparatorSize)
  857.     Else
  858.         WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSize, $iHeight)
  859.         WinMove($aGF_HandleIndex[$iFrame][2], "", $iSize + $iSeparatorSize, 0, $iWidth - $iSize - $iSeparatorSize, $iHeight)
  860.         WinMove($aGF_HandleIndex[$iFrame][3], "", $iSize, 0, $iSeparatorSize, $iHeight)
  861.     EndIf
  862.  
  863. EndFunc   ;==>_GUIFrame_Move
  864.  
  865. ; #INTERNAL_USE_ONLY#============================================================================================================
  866. ; Name...........: _GUIFrame_Exit()
  867. ; Description ...: Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle
  868. ; Author ........: Melba23
  869. ; Remarks .......: Called by OnAutoItExitRegister to delete all subclassed separator bars and to free the UDF created WndProc.
  870. ; Example........: Yes
  871. ;================================================================================================================================
  872. Func _GUIFrame_Exit()
  873.  
  874.     ; Delete all subclassed separator bars
  875.     For $i = $aGF_HandleIndex[0][0] To 1 Step -1
  876.         GUIDelete($aGF_HandleIndex[$i][3])
  877.     Next
  878.     ; Free registered Callback handle
  879.     DllCallbackFree($hGF_RegCallBack)
  880.  
  881. EndFunc   ;==>_GUIFrame_Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement