Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/10/2019 in all areas

  1. water

    Task Scheduler

    Version 1.6.0.1

    2,270 downloads

    Extensive library to control and manipulate Microsoft Task Scheduler Service. Please check this site for the implementation status! Please check the History.txt file in the archive for the changelog. Please check the WIKI for details about how to use the UDF. BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2021-02-03) None Things to come (last changed: 2021-02-03) None
    1 point
  2. Trying to figure out how to do CallByName on AutoIt COM objects due to the lack of being able to set properties within an Execute() statement Several Ideas were Tried https://www.autoitscript.com/forum/topic/200129-set-object-properties-with-propertyname-and-value-taken-from-an-array/ I think this is the best; Patching the vtable of IDispatch so we can intercept a Fake function call ($obj.Au3_CallByName) use it like this Local $oDictionary = ObjCreate("Scripting.Dictionary") ; EXAMPLE Au3_CallByname_Init() ; (you can optionally provide a classname here but we patch the main Idispatch interface so really no need) $Au3_CallByName = "Add" ; Method we want to call $oDictionary.Au3_CallByName("Test", "Value") Au3_CallByname_Init(False) ; (Not Strictly Needed unhooked on exit) NOTE: Au3_CallByname_Init() doesn't have to be called at the top of the script, just call it before you need to call by name... Code + Example #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Au3CallByName, Bilgus Global $Au3_CallByName = 0 Local $hKernel32 = DllOpen("Kernel32.dll") OnAutoItExitRegister(__CallByNameCleanup) Func __CallByNameCleanup() Au3_CallByName_Init(False) ;Unload DllClose($hKernel32) EndFunc ;==>__CallByNameCleanup ; Takes a pointer to the v-table in a class and replaces specified member Id in it to a new one. Func __HookVTableEntry($pVtable, $iVtableOffset, $pHook, ByRef $pOldRet) ;;https://www.autoitscript.com/forum/topic/107678-hooking-into-the-idispatch-interface/ Local Const $PAGE_READWRITE = 0x04 Local $tpVtable = DllStructCreate("ptr", $pVtable) Local $szPtr = DllStructGetSize($tpVtable) Local $pFirstEntry, $pEntry, $tEntry, $aCall, $flOldProtect, $bStatus ; Dereference the vtable pointer $pFirstEntry = DllStructGetData($tpVtable, 1) $pEntry = $pFirstEntry + ($iVtableOffset * $szPtr) ; Make the memory free for all. Yay! $aCall = DllCall($hKernel32, "int", "VirtualProtect", "ptr", $pEntry, "long", $szPtr, "dword", $PAGE_READWRITE, "dword*", 0) If @error Or Not $aCall[0] Then ConsoleWriteError("Error: Failed To hook vTable" & @CRLF) Return False EndIf $flOldProtect = $aCall[4] $tEntry = DllStructCreate("ptr", $pEntry) $pOldRet = DllStructGetData($tEntry, 1) If $pOldRet <> $pHook Then DllStructSetData($tEntry, 1, $pHook) $bStatus = True Else ;Already Hooked ConsoleWriteError("Error: vTable is already hooked" & @CRLF) $bStatus = False EndIf ;put the memory protect back how we found it DllCall($hKernel32, "int", "VirtualProtect", "ptr", $pEntry, "long", $szPtr, "dword", $flOldProtect, "dword*", 0) Return $bStatus EndFunc ;==>__HookVTableEntry ; Everytime autoit wants to call a method, get or set a property in a object it needs to go to ; IDispatch::GetIDsFromNames. This is our version of that function, note that by defining this ourselves ; we can fool autoit to believe that the object supports a lot of different properties/methods. Func __IDispatch_GetIDsFromNames($pSelf, $riid, $rgszNames, $cNames, $lcid, $rgDispId) Local Const $CSTR_EQUAL = 0x02 Local Const $LOCALE_SYSTEM_DEFAULT = 0x800 Local Const $DISP_E_UNKNOWNNAME = 0x80020006 Local Static $pGIFN = __Pointer_GetIDsFromNames() Local Static $tpMember = DllStructCreate("ptr") If $Au3_CallByName Then Local $hRes, $aCall, $tMember ;autoit only asks for one member $aCall = DllCall($hKernel32, 'int', 'CompareStringW', 'dword', $LOCALE_SYSTEM_DEFAULT, 'dword', 0, 'wstr', "Au3_CallByName", 'int', -1, _ 'struct*', DllStructGetData(DllStructCreate("ptr[" & $cNames & "]", $rgszNames), 1, 1), 'int', -1) If Not @error And $aCall[0] = $CSTR_EQUAL Then ;ConsoleWrite("CallByName: " & $Au3_CallByName & @CRLF) $tMember = DllStructCreate("wchar[" & StringLen($Au3_CallByName) + 1 & "]") DllStructSetData($tMember, 1, $Au3_CallByName) DllStructSetData($tpMember, 1, DllStructGetPtr($tMember)) $rgszNames = $tpMember $Au3_CallByName = 0 EndIf EndIf ;Call the original GetIDsFromNames $hRes = DllCallAddress("LRESULT", $pGIFN, "ptr", $pSelf, "ptr", $riid, _ "struct*", $rgszNames, "dword", $cNames, "dword", $lcid, "ptr", $rgDispId) If @error Then ConsoleWrite("Error: GetIDsFromNames: " & @error & @CRLF) Return $DISP_E_UNKNOWNNAME EndIf Return $hRes[0] EndFunc ;==>__IDispatch_GetIDsFromNames Func __Pointer_GetIDsFromNames($ptr = 0) Local Static $pOldGIFN = $ptr If $ptr <> 0 Then $pOldGIFN = $ptr Return $pOldGIFN EndFunc ;==>__Pointer_GetIDsFromNames Func Au3_CallByName_Init($bHook = True, $classname = "shell.application") Local Const $iOffset_GetIDsFromNames = 5 Local Static $IDispatch_GetIDsFromNames_Callback = 0 Local $oObject, $pObject, $pHook, $pOldGIFN If $bHook Then If $IDispatch_GetIDsFromNames_Callback = 0 Then $IDispatch_GetIDsFromNames_Callback = DllCallbackRegister("__IDispatch_GetIDsFromNames", "LRESULT", "ptr;ptr;ptr;dword;dword;ptr") EndIf $pHook = DllCallbackGetPtr($IDispatch_GetIDsFromNames_Callback) Else $pHook = __Pointer_GetIDsFromNames() If $pHook <= 0 Then Return ;Already Unloaded EndIf $oObject = ObjCreate($classname) $pObject = DllStructSetData(DllStructCreate("ptr"), 1, $oObject) If __HookVTableEntry($pObject, $iOffset_GetIDsFromNames, $pHook, $pOldGIFN) Then __Pointer_GetIDsFromNames($pOldGIFN) ;Save the original pointer to GetIDsFromNames If Not $bHook Then DllCallbackFree($IDispatch_GetIDsFromNames_Callback) $IDispatch_GetIDsFromNames_Callback = 0 EndIf Else ;Error EndIf $oObject = 0 EndFunc ;==>Au3_CallByName_Init ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;TESTS; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Au3_CallByName_Init() #include <ie.au3> Global $oRegistrationInfo = _IECreate() Global $aRegistrationInfo[] = ['Left=10', 'Top= 10', 'Width=450', 'Height=600'] Global $oObject = $oRegistrationInfo Local $oDictionary = ObjCreate("Scripting.Dictionary") Local $oDictionary2 = ObjCreate("Scripting.Dictionary") ;Au3_CallByName_Init($oObject) __TS_TaskPropertiesSet($oObject, $aRegistrationInfo) MsgBox(0, "Info", "Press OK to exit") $oRegistrationInfo.quit $oRegistrationInfo = 0 $oObject = 0 Sleep(1000) For $i = 1 To 10 $Au3_CallByName = "Add" $oDictionary.Au3_CallByName("test1:" & $i, "Dictionary Item: " & $i) Next $Au3_CallByName = "keys" For $sKey In $oDictionary.Au3_CallByName() For $j = 0 To 1 $Au3_CallByName = ($j = 0) ? "Item" : "Exists" ConsoleWrite($sKey & " -> " & $oDictionary.Au3_CallByName($sKey) & @CRLF) Next Next Au3_CallByName_Init(False) ;Unload Au3_CallByName_Init() Local $aRegistrationInfo[] = ['Left=1000', 'Width=450'] ConsoleWrite(@CRLF & "NEW IE" & @CRLF & @CRLF) $oRegistrationInfo = _IECreate() __TS_TaskPropertiesSet($oRegistrationInfo, $aRegistrationInfo) MsgBox(0, "Info", "Press OK to exit") $oRegistrationInfo.quit For $i = 1 To 10 $Au3_CallByName = "Add" $oDictionary2.Au3_CallByName("test2:" & $i, "Dictionary Item: " & $i) Next $Au3_CallByName = "keys" For $sKey In $oDictionary2.Au3_CallByName() For $j = 0 To 1 $Au3_CallByName = ($j = 0) ? "Item" : "Exists" ConsoleWrite($sKey & " -> " & $oDictionary2.Au3_CallByName($sKey) & @CRLF) Next Next Au3_CallByName_Init(False) ;Unload (Not Strictly Needed, Done on Script Close) Func __TS_TaskPropertiesSet(ByRef $oObject, $aProperties) Local $aTemp If IsArray($aProperties) Then For $i = 0 To UBound($aProperties) - 1 $aTemp = StringSplit($aProperties[$i], "=", 2) ; 2 -> $STR_NOCOUNT) If @error Then ContinueLoop ConsoleWrite("Command: $oObject." & $aTemp[0] & " = " & $aTemp[1] & @CRLF) $Au3_CallByName = $aTemp[0] $oObject.Au3_CallByName = $aTemp[1] ConsoleWrite("Result : " & Hex(@error) & @CRLF) ; If @error Then Return SetError(1, @error, 0) Next EndIf EndFunc ;==>__TS_TaskPropertiesSet
    1 point
  3. Here an example: ;requires 3.3.15.0+ version #AutoIt3Wrapper_Version=b #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so ;/pe /rm ;~ #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <Array.au3> #include <WindowsConstants.au3> #include "_GDIPlus_GIFAnim.au3" _GDIPlus_Startup() Global $binGIFAnim = _BruceLee() Global $hGIFImage = _GDIPlus_BitmapCreateFromMemory($binGIFAnim) Global Const $iW = _GDIPlus_ImageGetWidth($hGIFImage), $iH = _GDIPlus_ImageGetHeight($hGIFImage) Global Const $hGUI = GUICreate("GIF Anim UDF Example", $iW, $iH) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) GUISetState() Global $iCurrentFrame = 0 Global Const $iAnimDimCount = _GDIPlus_GIFAnimGetFrameDimensionsCount($hGIFImage) Global Const $tGUID = _GDIPlus_GIFAnimGetFrameDimensionsList($hGIFImage, $iAnimDimCount) Global Const $iAnimFrameCount = _GDIPlus_GIFAnimGetFrameCount($hGIFImage, $tGUID) Global Const $aFrameDelays = _GDIPlus_GIFAnimGetFrameDelaysFromBinFile($binGIFAnim, $iAnimFrameCount) AdlibRegister("PlayAnimPreview", 10) Do If GUIGetMsg() = -3 Then ;$GUI_EVENT_CLOSE = -3 AdlibUnRegister("PlayAnimPreview") _GDIPlus_BitmapDispose($hGIFImage) _GDIPlus_Shutdown() GUIDelete() $binGIFAnim = 0 Exit EndIf Until False Func PlayAnimPreview() AdlibUnRegister("PlayAnimPreview") Local $iDelay = $aFrameDelays[$iCurrentFrame] Local Static $iTimerCurrentFrame = TimerInit() _GDIPlus_GIFAnimSelectActiveFrame($hGIFImage, $tGUID, $iCurrentFrame) Local $hBmp = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsClear($hGfx, 0xFFFFFFFF) _GDIPlus_GraphicsDrawImageRect($hGfx, $hGIFImage, 0, 0, $iW, $iH) Local $hBitmap_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172 , 0, $hBitmap_GDI)) ;$STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 _WinAPI_DeleteObject($hBitmap_GDI) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BitmapDispose($hBmp) If TimerDiff($iTimerCurrentFrame) > $iDelay Then $iCurrentFrame += 1 $iTimerCurrentFrame = TimerInit() EndIf If $iCurrentFrame > UBound($aFrameDelays) - 1 Then $iCurrentFrame = 0 AdlibRegister("PlayAnimPreview", 10) EndFunc ;==>PlayAnimPreview ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2016-12-01 Func _BruceLee($bSaveBinary = False, $sSavePath = @ScriptDir) Local $BruceLee $BruceLee &= 'd7sAR0lGODlhgAAggAD1EAAAADs6ADp2VScvNEFTAFNTaGdn76lCAMieYezHUvzVAFj++Wruy5j6AOC5/PKz/OrRAP///09PTr1vAAPWrXJwcHBWAFRUY2NhYGBgAICAgKGhoeShADH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4EaysAMo7RhxDrC5nAIimyBlTbLN8ADvdvJOYO6+XAB/OxilL' $BruceLee &= '3IupAGQIAQQ0IcdvACUpLN30A0+/AMmtxklv5XPWAAECzTXGLIQAAAA7' $BruceLee = _WinAPI_Base64Decode($BruceLee) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($BruceLee) & ']') DllStructSetData($tSource, 1, $BruceLee) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 17546) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\BruceLee_128x128.gif", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_BruceLee Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress Change variable $iCurrentFrame in line 20 to choose start frame. Requires _GDIPlus_GIFAnim.au3 which can be found here:
    1 point
  4. In your main AU3 file: Use: #Au3Stripper_Parameters=/MO /RSLN to be sure that compiled version and ***_stripped.au3 have the same content Use: #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 to initially/quickly check your code before runtime.
    1 point
  5. Musashi

    Launch a desktop shortcut

    - 1. Have you take a look into the folder : C:\Users\Public\Desktop and can you find a file named Snap1... there, or is the Name i.e. "xxx - Shortcut.lnk" - 2. Perhaps the desktop shortcut resides under @DesktopDir -> C:\Users\[Username]\Desktop Example : I created a desktoplink for a file namend Dummy.exe . Then I went to C:\Users\[Username]\Desktop and renamed the link to Snap1 (without the .lnk extension, because it is already one ) $sDesktopLink = '\Snap1.lnk' ShellExecuteWait(@DesktopDir & $sDesktopLink) worked well !
    1 point
  6. This recently came up in another thread and will be fixed in the next release. You can make it work now by using "{}" instead of a blank string for the 3rd parameter.
    1 point
  7. What you should have done is simply asked to have it moved, rather than creating another post. Threads merged.
    1 point
  8. Subz

    Continue script after reboot

    Assuming 64 bit, try: RegWrite("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN", "AutoInstaller", "REG_SZ", @ScriptFullPath & " /r")
    1 point
  9. Like I said earlier, I may have misdirected you when I mentioned Au3stripper. I would suggest that we step back and examine your development environment -- What's your Autoit version? Are you running the script from within Scite? If so, do you have the full version installed? Are you using #include to pull in any custom scripts/UDFs? Is AU3Check being executed when / if you run the script from Scite? etc
    1 point
  10. Might be good if you post the line of code where $G_CurrentVidList is being declared. Au3Stripper may not be the cause, but if you place the input cursor within the Au3 directive and then press F1, it should take you to a help file entry for Au3Stripper.
    1 point
  11. @Mbee No, the image shows that you are using IsDeclared() incorrectly. I tried to show you the correct syntax in my earlier post. Compare that to your screenshot to see the difference. Edit: Another possibility is that the variable is being removed by Au3Stripper. If that's the issue, you can resolve it using the #Au3Stripper_Ignore_Variables directive.
    1 point
  12. C and all other C-like languages do not use whitespace for terminating statements, so you have to use the semi-colon to indicate the end of a statement. While I do see the benefits of having a simple syntax where each line is a command, there are several neat things you can do without taking up a bunch of lines where whitespace doesn't matter... Like a single line for loop It all comes down to preference obviously, those are more well versed with C-like programming and have good enough experience may prefer to have a more flexible syntax over a simple but restrictive one. Anyone using JavaScript is already probably taking advantage of the "whitespace-agnostic" syntax unknowingly... whitespace based statement structure in these languages is also not really pretty in some cases, so if you can't make it pretty, make it short (while keeping it readable).
    1 point
  13. You have to use _WinAPI_DeleteObject($hBmpq) as it is a GDI bitmap object.
    1 point
  14. Ok, I got it. The code from 2011 is not x64 compatible when running it using Autoit x64. This should fix the crash: ;code by UEZ 2011 #AutoIt3Wrapper_UseX64=y #include <Array.au3> #include <Misc.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) _GDIPlus_Startup() $hHBitmap = _ScreenCapture_Capture("", 0, 0, @DesktopWidth, @DesktopHeight, False) $hTexture = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) $hTextureBrush = _GDIPlus_TextureCreate($hTexture) _WinAPI_DeleteObject($hHBitmap) $hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawImage($hGraphic, $hTexture, 0, 0) _GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2) $hPen = _GDIPlus_PenCreate(0xFFFF0000, 2) Global $dll = DllOpen("user32.dll") GUISetOnEvent(-3, "_Exit") $exitloop = False $min_x = @DesktopWidth $min_y = @DesktopHeight $max_x = 0 $max_y = 0 $mo = MouseGetCursor() Global $aPoints[2^20][2] $p = 1 GUISetCursor(14, 1, $hGUI) While Sleep(100) $mxo = MouseGetPos(0) $myo = MouseGetPos(1) While _IsPressed("01", $dll) * Sleep(10) $mx = MouseGetPos(0) $my = MouseGetPos(1) _GDIPlus_GraphicsDrawLine($hGraphic, $mx, $my, $mxo, $myo, $hPen) $mxo = $mx $myo = $my $aPoints[$p][0] = $mx $aPoints[$p][1] = $my $min_x = Min($min_x, $mx) $min_y = Min($min_y, $my) $max_x = Max($max_x, $mx) $max_y = Max($max_y, $my) $p += 1 $exitloop = True WEnd If $exitloop Then ExitLoop WEnd GUISetCursor($mo, 1, $hGUI) ReDim $aPoints[$p][2] $aPoints[0][0] = $p - 1 _GDIPlus_GraphicsDispose($hGraphic) $new_w = $max_x - $min_x $new_h = $max_y - $min_y $hBitmap_Hidden = _GDIPlus_BitmapCreateFromScan0(@DesktopWidth, @DesktopHeight) $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap_Hidden) _GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF) _GDIPlus_GraphicsFillPolygon($hContext, $aPoints, $hTextureBrush) $hBitmap_Capture = _GDIPlus_BitmapCloneArea($hBitmap_Hidden, $min_x, $min_y, $new_w, $new_h) ;~ _GDIPlus_ImageSaveToFile($hBitmap_Capture, "Testc.jpg") GUISetOnEvent(-3, "") GUIDelete($hGUI) $hGUI = GUICreate("Freehand Screen Capture by UEZ 2011", $new_w, $new_h) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) _GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap_Capture, 0, 0) GUISetOnEvent(-3, "_Exit") _GDIPlus_BitmapDispose($hBitmap_Hidden) _GDIPlus_BitmapDispose($hBitmap_Capture) _GDIPlus_GraphicsDispose($hContext) While Sleep(5000) WEnd Func Max($a, $b) If $a > $b Then Return $a Return $b EndFunc Func Min($a, $b) If $a < $b Then Return $a Return $b EndFunc Func _Exit() DllClose($dll) _GDIPlus_BrushDispose($hTextureBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_BitmapDispose($hTexture) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() GUIDelete($hGUI) $aPoints = 0 Exit EndFunc
    1 point
  15. [NEW VERSION] - 19 May 14 Added: - 1. A new function _GUIFrame_ResizeState to indicate when frames have been resized and the resizing is complete. The idea is to help users who fill frames with elements which require heavy processing (e.g. GDI images) and where continually rewriting the content would cause severe slowdowns. The function is called in the script idle loop and returns an array of flags indicating that a resizing action is complete. - 2. A new parameter ($fShowWindow) in the _GUIFrame_Create function. A few people have found that the frames do not always appear on creation - particularly if the GUI does not have focus during this process. KaFu came up with a workaround, not approved by the AutoIt devs, using the API to confirm the frame display. Setting this new parameter to True uses the API call - use it at your own risk and peril! Fixed: A couple of minor bugs which no-one had noticed - and now never will. New code below and in the attached zip. Previous changes: Changelog.txt Before we start, my sincere thanks to Kip who wrote the first version of this UDF and who very kindly allowed me to build on it to produce this new version. Many GUIs are divided into frames, where you can drag a separator bar to alter the relative sizes of the elements displayed within the GUI. Think of an Explorer window where the folder list is on one side and the files in the selected folder on the other - or SciTE with its editing and Director areas. The GUIFrame UDF allows you to divide your own GUIs into 2 frames with a separator bar. - The frames can be full-frame or set to a user-defined position and size within the GUI. - The minimum size of each frame can be specified. - The separator bar can be horizontal or vertical and its size and initial position set. - The frames can resize as the main GUI resizes or can remain at their original position and size. - You can even divide existing frames into further frames until you run out of space. - x86 and x64 compatible. [New] The frames themselves are normal AutoIt GUIs. You can colour them and create controls within them just as you would in any other script - functions are provided for easy navigation between them (think of GUISwitch). Here is an example script to show the UDF working: #include <guiconstantsex.au3> #include <windowsconstants.au3> #include "GUIFrame.au3" Global $iSep_Pos $hGUI = GUICreate("GUI_Frame Example 1", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() ; Create a 1st level frame $iFrame_A = _GUIFrame_Create($hGUI) _GUIFrame_SetMin($iFrame_A, 50, 100) _GUIFrame_Switch($iFrame_A, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $hButton_1 = GUICtrlCreateButton("Pos Sep", 10, 10, 50, 30) ; Create a 2nd level frame $iFrame_B = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_A, 1), 1) GUISetBkColor(0x00FF00, _GUIFrame_GetHandle($iFrame_B, 1)) _GUIFrame_SetMin($iFrame_B, 100, 100) _GUIFrame_Switch($iFrame_B, 1) $hButton_2 = GUICtrlCreateButton("Pos Sep", 10, 10, 50, 30) ; Create a 3rd level frame $iFrame_C = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_B, 2)) _GUIFrame_Switch($iFrame_C, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_C, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xD0D000) ; Create a 4th level frame $iFrame_D = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_C, 1), 1) _GUIFrame_Switch($iFrame_D, 1) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_D, 1)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0x00FFFF) _GUIFrame_Switch($iFrame_D, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_D, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF00FF) ; Set resizing flag for all created frames _GUIFrame_ResizeSet(0) ; Create a non-resizable 2nd level frame $iFrame_E = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_B, 1), 0, 0, 5, 5, 55, 200, 100) _GUIFrame_Switch($iFrame_E, 1) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_E, 1)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF8000) _GUIFrame_Switch($iFrame_E, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_E, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xD0C0D0) ; Register the $WM_SIZE handler to permit resizing _GUIFrame_ResizeReg() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; The UDF does all the tidying up as you exit Exit Case $hButton_1 _GUIFrame_SetSepPos($iFrame_A, 300) $iSep_Pos = _GUIFrame_GetSepPos($iFrame_A) GUICtrlSetData($hButton_1, $iSep_Pos) Sleep(1000) GUICtrlSetData($hButton_1, "Sep Pos") Case $hButton_2 $iRet = _GUIFrame_SetSepPos($iFrame_B, 310) $iSep_Pos = _GUIFrame_GetSepPos($iFrame_ GUICtrlSetData($hButton_2, $iSep_Pos) Sleep(1000) GUICtrlSetData($hButton_2, "Sep Pos") EndSwitch WEnd The UDF uses the WM_SIZE message sent by the original GUIs to determine when to resize frames. If you want to register the same message within your script, you can still use this UDF. All you have to do is call a specific UDF function within your own message handler, as you can see here: #include <guiconstantsex.au3> #include <windowsconstants.au3> #include "GUIFrame.au3" Global $iSep_Pos $hGUI = GUICreate("GUI_Frame Example 2", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() ; Register WM_SIZE to simulate the script requiring it GUIRegisterMsg($WM_SIZE, "_WM_SIZE") ; Create a 1st level frame $iFrame_A = _GUIFrame_Create($hGUI) _GUIFrame_SetMin($iFrame_A, 50, 100) _GUIFrame_Switch($iFrame_A, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $hButton_1 = GUICtrlCreateButton("Sep Pos", 10, 10, 50, 30) ; Create a 2nd level frame $iFrame_B = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_A, 1), 1) GUISetBkColor(0x00FF00, _GUIFrame_GetHandle($iFrame_B, 1)) _GUIFrame_SetMin($iFrame_B, 100, 100) _GUIFrame_Switch($iFrame_B, 1) $hButton_2 = GUICtrlCreateButton("Pos Sep", 10, 10, 50, 30) ; Create a 3rd level frame $iFrame_C = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_B, 2)) _GUIFrame_Switch($iFrame_C, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_C, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xD0D000) ; Create a 4th level frame $iFrame_D = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_C, 1), 1) _GUIFrame_Switch($iFrame_D, 1) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_D, 1)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0x00FFFF) _GUIFrame_Switch($iFrame_D, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_D, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF00FF) ; Set resizing flag for all created frames _GUIFrame_ResizeSet(0) ; Create a non-resizable 2nd level frame $iFrame_E = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_B, 1), 0, 0, 5, 5, 55, 200, 100) _GUIFrame_Switch($iFrame_E, 1) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_E, 1)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF8000) _GUIFrame_Switch($iFrame_E, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_E, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xD0C0D0) ; DO NOT Register the $WM_SIZE handler to permit resizing as the message is already registered ;_GUIFrame_ResizeReg() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; The UDF does all the tidying up as you exit Exit Case $hButton_1 _GUIFrame_SetSepPos($iFrame_A, 300) $iSep_Pos = _GUIFrame_GetSepPos($iFrame_A) GUICtrlSetData($hButton_1, $iSep_Pos) Sleep(1000) GUICtrlSetData($hButton_1, "Sep Pos") Case $hButton_2 $iRet = _GUIFrame_SetSepPos($iFrame_B, 310) $iSep_Pos = _GUIFrame_GetSepPos($iFrame_ GUICtrlSetData($hButton_2, $iSep_Pos) Sleep(1000) GUICtrlSetData($hButton_2, "Sep Pos") EndSwitch WEnd ; This is the already registered WM_SIZE handler Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; Just call the GUIFrame resizing function here - do NOT use the _GUIFrame_ResizeReg function in the script _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) Return "GUI_RUNDEFMSG" EndFunc ;==>_WM_SIZE An example to show how to set absolute/relative minimum frame sizes and the different behaviours available on GUI resizing: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIFrame.au3" Global $iSep_Pos $hGUI = GUICreate("GUI_Frame Example 3", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() ; Create a 1st level frame $iFrame_A = _GUIFrame_Create($hGUI, 1) _GUIFrame_SetMin($iFrame_A, 50, 125, True) ; This line sets the minima as absolute values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;_GUIFrame_SetMin($iFrame_A, 50, 125) ; This line adjusts the minima to equivalent percentages on resizing <<<<<<<<<<<<<<<<<<<<< _GUIFrame_Switch($iFrame_A, 1) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlCreateLabel("", 0, 0, 50, 50) GUICtrlSetBkColor(-1, 0x0000FF) GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetState(-1, $GUI_DISABLE) _GUIFrame_Switch($iFrame_A, 2) $aWinSize = WinGetClientSize(_GUIFrame_GetHandle($iFrame_A, 2)) GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) ; Set resizing flag for all created frames _GUIFrame_ResizeSet(0, 2) ; Adjust the second parameter to change the resizing behaviour <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ; Register the $WM_SIZE handler to permit resizing _GUIFrame_ResizeReg() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; The UDF does all the tidying up as you exit Exit EndSwitch WEnd [New] An example to show the resizing callback in action: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIFrame.au3" $hGUI = GUICreate("GUI_Frame Example #", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() ; Create a 1st level frame $iFrame_A = _GUIFrame_Create($hGUI) _GUIFrame_SetMin($iFrame_A, 50, 100) ; Create a 2nd level frame $iFrame_B = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_A, 1), 1) GUISetBkColor(0xCCFFCC, _GUIFrame_GetHandle($iFrame_B, 1)) _GUIFrame_Switch($iFrame_B, 2) $cSetSize = GUICtrlCreateButton("Set Sep", 10, 10, 80, 30) ; Create another 2nd level frame $iFrame_C = _GUIFrame_Create(_GUIFrame_GetHandle($iFrame_A, 2), 1) GUISetBkColor(0xCCCCFF, _GUIFrame_GetHandle($iFrame_C, 2)) ; Set resizing flag for all created frames _GUIFrame_ResizeSet(0) ; Register the WM_SIZE handler _GUIFrame_ResizeReg() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; The UDF does all the tidying up as you exit Exit Case $cSetSize ; Set separator position _GUIFrame_SetSepPos($iFrame_B, 100) EndSwitch ; Get resize flags $aResize = _GUIFrame_ResizeState() ; If a frame has been resized then the [0] element = 1 If $aResize[0] Then _Check_Frames($aResize) WEnd Func _Check_Frames($aFlags) ; Check specific frame flags If $aFlags[$iFrame_B] And $aFlags[$iFrame_C] Then MsgBox(0, "Resize", "Green and blue areas have been resized") Elseif $aFlags[$iFrame_B] Then MsgBox(0, "Resize", "Green area has been resized") ElseIf $aFlags[$iFrame_C] Then MsgBox(0, "Resize", "Blue area has been resized") EndIf EndFunc [New] Here is the GUIFrame UDF itself: #include-once ; #INDEX# ============================================================================================================ ; Title .........: GUIFrame ; AutoIt Version : 3.3 + ; Language ......: English ; Description ...: Splits a GUI into slideable and resizable 2 part frames which can be further split if required ; Remarks .......: - The UDF uses OnAutoItExitRegister to call _GUIFrame_Exit to delete subclassed separator bars ; using the UDF created WndProc and to release the Callback on exit ; - The UDF can indicate when a specific fram has been resized ; - If the script already has a WM_SIZE message handler then do NOT use _GUIFrame_ResizeReg, ; but call the _GUIFrame_SIZE_Handler function from within the existing handler ; Author ........: Original UDF by Kip ; Modified ......; This version by Melba23 - using x64 compatible code drawn from Yashied's WinAPIEx library ; ==================================================================================================================== ; #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ; #INCLUDES# ========================================================================================================= #include <WinAPI.au3> ; #GLOBAL VARIABLES# ================================================================================================= ; Array to hold handles for each frame set Global $aGF_HandleIndex[1][8] = [[0, 0, 0]] ; [0][0] = 0 ; Count of frames [0][1] = Move registered flag ; ; [n][0] = Parent GUI handle [n][4] = Original GUI handle ; [n][1] = First frame handle [n][5] = Indices of first frame internal frames ; [n][2] = Second frame handle [n][6] = Indices of second frame internal frames ; [n][3] = Separator bar handle [n][7] = Frame resize flag ; Array to hold sizing percentages for each frame set Global $aGF_SizingIndex[1][8] ; [n][0] = First frame min [n][2] = X coord [n][4] = Width [n][6] = Seperator percentage position ; [n][1] = Second frame min [n][3] = Y coord [n][5] = Height [n][7] = Resize type (0/1/2) ; Array to hold other settings for each frame set Global $aGF_SettingsIndex[1][3] ; [n][0] = Separator orientation (vert/horz = 0/1) ; [n][1] = Resizable frame flag (0/1) ; [n][2] = Separator size (default = 5) ; Array to hold WinProc handles for each separator Global $aGF_SepProcIndex[1][2] = [[0, 0]] ; Store registered Callback handle Global $hGF_RegCallBack = DllCallbackRegister("_GUIFrame_SepWndProc", "lresult", "hwnd;uint;wparam;lparam") $aGF_SepProcIndex[0][1] = DllCallbackGetPtr($hGF_RegCallBack) ; #ONAUTOITEXIT FUNCTIONS# =========================================================================================== OnAutoItExitRegister("_GUIFrame_Exit") ; #CURRENT# ========================================================================================================== ; _GUIFrame_Create: Splits a GUI into 2 frames ; _GUIFrame_SetMin: Sets minimum sizes for each frame ; _GUIFrame_ResizeSet: Sets resizing flag for all or specified frame sets ; _GUIFrame_GetHandle: Returns the handle of a frame element (required for further splitting) ; _GUIFrame_Switch: Sets a frame element as current GUI ; _GUIFrame_GetSepPos: Returns the current position of the separator ; _GUIFrame_SetSepPos: Moves the separator bar to adjust frame sizes ; _GUIFrame_ResizeState: Returns the resize state of the frames ; _GUIFrame_ResizeReg: Registers WM_SIZE message for resizing ; _GUIFrame_SIZE_Handler: WM_SIZE message handler to resize frames using _GUIFrame_Move ; ==================================================================================================================== ; #INTERNAL_USE_ONLY#================================================================================================= ; _GUIFrame_SepSubClass: Sets new WndProc for frame separator bar ; _GUIFrame_SepWndProc: New WndProc for frame separator bar ; _GUIFrame_SepPassMsg: Passes Msg to original frame WndProc for action ; _GUIFrame_Move: Moves and resizes frame elements and separator bars ; _GUIFrame_Exit: Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle ; ==================================================================================================================== ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_Create ; Description ...: Splits a GUI into 2 frames ; Syntax.........: _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iWidth = 0, $iHeight = 0, $iStyle = 0, $iExStyle = 0, $fShowWindow) ; Parameters ....: $hWnd - Handle of GUI to split ; $iSepOrient - Orientation of separator bar: 0 = Vertical (default), 1 = Horizontal ; $iSepPos - Required initial position of separator (default = centre of frame GUI) ; $iSepSize - Size of separator bar (default = 5, min = 3, max = 9) ; $iX - Left of frame area (default = 0) ; $iY - Top of frame area (default = 0) ; $iWidth - Width of frame area (default = full width) ; $iHeight - Height of frame area (default = full height) ; SiStyle - Required style value for frame elements ; SiExStyle - Required extended style value for frame elements ; $fShowWindow - True = Use API call to display frame if not displayed on start ; - False (default) - Do not use API call ; Requirement(s).: v3.3 + ; Return values .: Success: Returns index number of frame/separator set ; Failure: Returns 0 and sets @error as follows: ; 1 = Deprecated ; 2 = GUI creation failed ; 2 = Separator subclassing failed ; Author ........: Kip ; Modified ......: Melba23 ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_Create($hWnd, $iSepOrient = 0, $iSepPos = 0, $iSepSize = 5, $iX = 0, $iY = 0, $iOrg_Width = 0, $iOrg_Height = 0, $iStyle = 0, $iExStyle = 0, $fShowWindow = False) Local $iSeperator_Pos, $hSeparator, $hFirstFrame, $hSecondFrame, $nSepPercent ; Set separator size Local $iSeparatorSize = 5 Switch $iSepSize Case 3 To 9 $iSeparatorSize = $iSepSize EndSwitch ; Set default sizing if no parameters set Local $iWidth = $iOrg_Width Local $iHeight = $iOrg_Height Local $aFullSize = WinGetClientSize($hWnd) If Not $iOrg_Width Then $iWidth = $aFullSize[0] If Not $iOrg_Height Then $iHeight = $aFullSize[1] ; Create parent GUI within client area Local $hParent = GUICreate("FrameParent", $iWidth, $iHeight, $iX, $iY, BitOR(0x40000000, $iStyle), $iExStyle, $hWnd) ; $WS_CHILD If $fShowWindow Then _WinAPI_ShowWindow($hParent, @SW_SHOW) ; Possible fix if frames do not display on start GUISetState(@SW_SHOW, $hParent) ; Confirm size of frame parent client area Local $aSize = WinGetClientSize($hParent) $iWidth = $aSize[0] $iHeight = $aSize[1] If $iSepOrient = 0 Then ; Set initial separator position $iSeperator_Pos = $iSepPos ; Adjust position if not within GUI or default set (=0) If $iSepPos > $iWidth Or $iSepPos < 1 Then $iSeperator_Pos = Round(($iWidth / 2) - ($iSeparatorSize / 2)) EndIf ; Create separator bar and force cursor change over separator $hSeparator = GUICreate("", $iSeparatorSize, $iHeight, $iSeperator_Pos, 0, 0x40000000, -1, $hParent) ;$WS_CHILD GUICtrlCreateLabel("", 0, 0, $iSeparatorSize, $iHeight, -1, 0x00000001) ; $WS_EX_DLGMODALFRAME GUICtrlSetCursor(-1, 13) GUISetState(@SW_SHOW, $hSeparator) ; Create the sizable frames $hFirstFrame = GUICreate("", $iSeperator_Pos, $iHeight, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD GUISetState(@SW_SHOW, $hFirstFrame) $hSecondFrame = GUICreate("", $iWidth - ($iSeperator_Pos + $iSeparatorSize), $iHeight, $iSeperator_Pos + $iSeparatorSize, 0, 0x40000000, -1, $hParent) ;$WS_CHILD GUISetState(@SW_SHOW, $hSecondFrame) ; Set seperator position percentage $nSepPercent = $iSeperator_Pos / $iWidth Else $iSeperator_Pos = $iSepPos If $iSepPos > $iHeight Or $iSepPos < 1 Then $iSeperator_Pos = Round(($iHeight / 2) - ($iSeparatorSize / 2)) EndIf $hSeparator = GUICreate("", $iWidth, $iSeparatorSize, 0, $iSeperator_Pos, 0x40000000, -1, $hParent) ;$WS_CHILD GUICtrlCreateLabel("", 0, 0, $iWidth, $iSeparatorSize, -1, 0x01) ; $WS_EX_DLGMODALFRAME GUICtrlSetCursor(-1, 11) GUISetState(@SW_SHOW, $hSeparator) $hFirstFrame = GUICreate("", $iWidth, $iSeperator_Pos, 0, 0, 0x40000000, -1, $hParent) ;$WS_CHILD GUISetState(@SW_SHOW, $hFirstFrame) $hSecondFrame = GUICreate("", $iWidth, $iHeight - ($iSeperator_Pos + $iSeparatorSize), 0, $iSeperator_Pos + $iSeparatorSize, 0x40000000, -1, $hParent) ;$WS_CHILD GUISetState(@SW_SHOW, $hSecondFrame) $nSepPercent = $iSeperator_Pos / $iHeight EndIf ; Check for error creating GUIs If $hParent = 0 Or $hSeparator = 0 Or $hFirstFrame = 0 Or $hSecondFrame = 0 Then ; Delete all GUIs and return error GUIDelete($hParent) GUIDelete($hSeparator) GUIDelete($hFirstFrame) GUIDelete($hSecondFrame) Return SetError(2, 0, 0) EndIf ; Subclass the separator If _GUIFrame_SepSubClass($hSeparator) = 0 Then ; If Subclassing failed then delete all GUIs and return error GUIDelete($hParent) GUIDelete($hSeparator) GUIDelete($hFirstFrame) GUIDelete($hSecondFrame) Return SetError(3, 0, 0) EndIf ; Create new lines in the storage arrays for this frame set Local $iIndex = $aGF_HandleIndex[0][0] + 1 ReDim $aGF_HandleIndex[$iIndex + 1][8] ReDim $aGF_SizingIndex[$iIndex + 1][8] ReDim $aGF_SettingsIndex[$iIndex + 1][3] ; Store this frame set handles/variables/defaults in the new lines $aGF_HandleIndex[0][0] = $iIndex $aGF_HandleIndex[$iIndex][0] = $hParent $aGF_HandleIndex[$iIndex][1] = $hFirstFrame $aGF_HandleIndex[$iIndex][2] = $hSecondFrame $aGF_HandleIndex[$iIndex][3] = $hSeparator $aGF_HandleIndex[$iIndex][4] = $hWnd $aGF_HandleIndex[$iIndex][5] = 0 $aGF_HandleIndex[$iIndex][6] = 0 $aGF_SizingIndex[$iIndex][0] = 0 $aGF_SizingIndex[$iIndex][1] = 0 $aGF_SizingIndex[$iIndex][6] = $nSepPercent $aGF_SettingsIndex[$iIndex][0] = $iSepOrient $aGF_SettingsIndex[$iIndex][1] = 0 $aGF_SettingsIndex[$iIndex][2] = $iSeparatorSize ; Store this frame index in parent line if parent is an existing frame For $i = 1 To $aGF_HandleIndex[0][0] - 1 If $aGF_HandleIndex[$i][1] = $hWnd Then If $aGF_HandleIndex[$i][5] = 0 Then $aGF_HandleIndex[$i][5] = $iIndex Else $aGF_HandleIndex[$i][5] &= "|" & $iIndex EndIf ExitLoop EndIf If $aGF_HandleIndex[$i][2] = $hWnd Then If $aGF_HandleIndex[$i][6] = 0 Then $aGF_HandleIndex[$i][6] = $iIndex Else $aGF_HandleIndex[$i][6] &= "|" & $iIndex EndIf ExitLoop EndIf Next ; Store coordinate and size fractions If $iX Then $aGF_SizingIndex[$iIndex][2] = $iX / $aFullSize[0] Else $aGF_SizingIndex[$iIndex][2] = 0 EndIf If $iY Then $aGF_SizingIndex[$iIndex][3] = $iY / $aFullSize[1] Else $aGF_SizingIndex[$iIndex][3] = 0 EndIf If $iOrg_Width Then $aGF_SizingIndex[$iIndex][4] = $iOrg_Width / $aFullSize[0] Else $aGF_SizingIndex[$iIndex][4] = 1 EndIf If $iOrg_Height Then $aGF_SizingIndex[$iIndex][5] = $iOrg_Height / $aFullSize[1] Else $aGF_SizingIndex[$iIndex][5] = 1 EndIf ; Switch back to main GUI GUISwitch($hWnd) ; Return the index for this frame Return $iIndex EndFunc ;==>_GUIFrame_Create ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_SetMin ; Description ...: Sets minimum sizes for frames ; Syntax.........: _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create ; $iFirstMin - Min size of first (left/top) frame - max half size ; $iSecondMin - Min Size of second (right/bottom) frame - max half size ; $fAbsolute - True = Minima fixed when GUI resized ; - False = Minima adjusted on resize to equivalent percentage of new GUI size (default) ; Requirement(s).: v3.3 + ; Return values .: None ; Author ........: Melba23 based on some original code by Kip ; Modified ......: ; Remarks .......: If the frame is resized, these minima are adjusted accordingly unless $fAbsolute is set ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_SetMin($iFrame, $iFirstMin = 0, $iSecondMin = 0, $fAbsolute = False) ; Check for valid frame index If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0 ; Get size of parent Local $aSize = WinGetClientSize($aGF_HandleIndex[$iFrame][0]) ; Now check orientation and determine Local $iMax, $iFullSize If $aGF_SettingsIndex[$iFrame][0] = 0 Then $iMax = Floor(($aSize[0] / 2) - $aGF_SettingsIndex[$iFrame][2]) $iFullSize = $aSize[0] Else $iMax = Floor(($aSize[1] / 2) - $aGF_SettingsIndex[$iFrame][2]) $iFullSize = $aSize[1] EndIf ; Set minimums If $fAbsolute Then $aGF_SizingIndex[$iFrame][0] = Int($iFirstMin) $aGF_SizingIndex[$iFrame][1] = Int($iSecondMin) Else If $iFirstMin > $iMax Then $aGF_SizingIndex[$iFrame][0] = $iMax / $iFullSize Else $aGF_SizingIndex[$iFrame][0] = $iFirstMin / $iFullSize EndIf If $iSecondMin > $iMax Then $aGF_SizingIndex[$iFrame][1] = $iMax / $iFullSize Else $aGF_SizingIndex[$iFrame][1] = $iSecondMin / $iFullSize EndIf EndIf EndFunc ;==>_GUIFrame_SetMin ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_ResizeSet ; Description ...: Sets resizing flag for frames ; Syntax.........: _GUIFrame_ResizeSet($iFrame = 0[, $iType = 0]) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create (Default - 0 = all existing frames) ; $iType - Separator behaviour on GUI resize ; 0 = Frames retain percentage size (default) ; 1 = Top/left frame fixed size ; 2 = Bottom/right frame fixed size ; Requirement(s).: v3.3 + ; Return values .: Success: 2 - All existing frame flags set ; 1 - Specified flag set ; Failure: 0 with @error set to: ; 1 - Invalid frame specified ; 2 - Invalid type parameter ; Author ........: Melba23 ; Modified ......: ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_ResizeSet($iFrame = 0, $iType = 0) Switch $iType Case 0, 1, 2 ; Valid Case Else Return SetError(2, 0, 0) EndSwitch Switch $iFrame Case 0 ; Set all frames For $i = 1 To $aGF_HandleIndex[0][0] $aGF_SettingsIndex[$i][1] = 1 $aGF_SizingIndex[$i][7] = $iType Next Return 2 Case 1 To $aGF_HandleIndex[0][0] ; Only valid frames accepted $aGF_SettingsIndex[$iFrame][1] = 1 $aGF_SizingIndex[$iFrame][7] = $iType Return 1 Case Else ; Error Return SetError(1, 0, 0) EndSwitch EndFunc ;==>_GUIFrame_ResizeSet ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_GetHandle ; Description ...: Returns the handle of a frame element (required for further splitting) ; Syntax.........: _GUIFrame_GetHandle($iFrame, $iElement) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create ; $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame ; Requirement(s).: v3.3 + ; Return values .: Success: Handle of frame ; Failure: 0 with @error set as follows ; 1 - Invalid frame specified ; 2 - Invalid element specified ; Author ........: Kip ; Modified ......: Melba23 ; Remarks .......: _GUIFrame_Create requires a GUI handle as a parameter ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_GetHandle($iFrame, $iElement) ; Check valid frame index and element Switch $iFrame Case 1 To $aGF_HandleIndex[0][0] Switch $iElement Case 1, 2 ; Return handle Return $aGF_HandleIndex[$iFrame][$iElement] EndSwitch Return SetError(2, 0, 0) EndSwitch Return SetError(1, 0, 0) EndFunc ;==>_GUIFrame_GetHandle ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_Switch ; Description ...: Sets a frame element as current GUI ; Syntax.........: _GUIFrame_Switch($iFrame, $iElement) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create ; $iElement - 1 = first (left/top) frame, 2 = second (right/bottom) frame ; Requirement(s).: v3.3 + ; Return values .: None ; Author ........: Kip ; Modified ......: Melba23 ; Remarks .......: Subsequent controls are created in the specified frame element ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_Switch($iFrame, $iElement) ; Check valid frame index and element Switch $iFrame Case 1 To $aGF_HandleIndex[0][0] Switch $iElement Case 1, 2 ; Switch to specified element Return GUISwitch($aGF_HandleIndex[$iFrame][$iElement]) EndSwitch Return SetError(2, 0, 0) EndSwitch Return SetError(1, 0, 0) EndFunc ;==>_GUIFrame_Switch ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_GetSepPos() ; Description ...: Returns the current position of the separator ; Syntax.........: _GUIFrame_GetSepPos($iFrame) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create ; Requirement(s).: v3.3 + ; Return values .: Success: Position of separator ; Failure: -1 = Invalid frame specified ; Author ........: Melba23 ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create ; to restore exit position on restart ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_GetSepPos($iFrame) Local $iSepPos ; Check for valid frame index If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return -1 ; Get position of first frame Local $aFrame_Pos = WinGetPos($aGF_HandleIndex[$iFrame][1]) ; Get position of separator Local $aSep_Pos = WinGetPos($aGF_HandleIndex[$iFrame][3]) ; Check on separator orientation If $aGF_SettingsIndex[$iFrame][0] Then $iSepPos = $aSep_Pos[1] - $aFrame_Pos[1] Else $iSepPos = $aSep_Pos[0] - $aFrame_Pos[0] EndIf Return $iSepPos EndFunc ;==>_GUIFrame_GetSepPos ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_SetSepPos() ; Description ...: Moves the separator bar to adjust frame sizes ; Syntax.........: _GUIFrame_SetSepPos($iFrame, $iSepPos) ; Parameters ....: $iFrame - Index of frame set as returned by _GUIFrame_Create ; $iSepos - Position of separator bar within frame ; Requirement(s).: v3.3 + ; Return values .: Success: 1 ; Failure: 0 with @error set as follows ; 1 - Invalid frame specified ; 2 - Invalid separator position (outside frame) ; 3 - Invalid separator position (below frame minimum size) ; Author ........: Melba23 ; Remarks .......: This value can be stored and used as the initial separator position parameter in _GUIFrame_Create ; to restore exit position on restart ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_SetSepPos($iFrame, $iSepPos) Local $iFirstMin, $iSecondMin ; Check for valid frame index If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return SetError(1, 0, 0) ; Check separator actually needs to move If $iSepPos = _GUIFrame_GetSepPos($iFrame) Then Return 1 ; Get frame GUI size Local $aWinPos = WinGetPos($aGF_HandleIndex[$iFrame][0]) ; Depending on separator orientation If $aGF_SettingsIndex[$iFrame][0] Then ; Check sep position is valid If $iSepPos < 0 Or $iSepPos > $aWinPos[3] Then Return SetError(2, 0, 0) ; Determine minima for frames $iFirstMin = $aWinPos[3] * $aGF_SizingIndex[$iFrame][0] $iSecondMin = ($aWinPos[3] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2] ; Check required value is valid If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0) ; Move frames and seperator WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $aWinPos[2], $iSepPos) WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSepPos + $aGF_SettingsIndex[$iFrame][2], $aWinPos[2], $aWinPos[3] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2])) WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSepPos, $aWinPos[2], $aGF_SettingsIndex[$iFrame][2]) ; Store new separator position $aGF_SizingIndex[$iFrame][6] = $iSepPos / $aWinPos[3] Else If $iSepPos < 0 Or $iSepPos > $aWinPos[2] Then Return SetError(2, 0, 0) $iFirstMin = $aWinPos[2] * $aGF_SizingIndex[$iFrame][0] $iSecondMin = ($aWinPos[2] * (1 - $aGF_SizingIndex[$iFrame][1])) - $aGF_SettingsIndex[$iFrame][2] If $iSepPos < $iFirstMin Or $iSepPos > $iSecondMin Then Return SetError(3, 0, 0) WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSepPos, $aWinPos[3]) WinMove($aGF_HandleIndex[$iFrame][2], "", $iSepPos + $aGF_SettingsIndex[$iFrame][2], 0, $aWinPos[2] - ($iSepPos + $aGF_SettingsIndex[$iFrame][2]), $aWinPos[3]) WinMove($aGF_HandleIndex[$iFrame][3], "", $iSepPos, 0, $aGF_SettingsIndex[$iFrame][2], $aWinPos[3]) $aGF_SizingIndex[$iFrame][6] = $iSepPos / $aWinPos[2] EndIf ; Set callback $aGF_HandleIndex[$iFrame][7] = 1 Return 1 EndFunc ;==>_GUIFrame_SetSepPos ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_ResizeState ; Description ...: Returns the resize state of the frames ; Syntax.........: _GUIFrame_ResizeState() ; Parameters ....: None ; Requirement(s).: v3.3 + ; Return values .: Success: Array of frame resize flags ; Author ........: Melba23 ; Remarks .......: An array is always returned - the user must query the flag for the relevant frame to detect resizing ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_ResizeState() ; Create array to hold resize flags Local $aRet[$aGF_HandleIndex[0][0] + 1] = [0] For $i = 1 To $aGF_HandleIndex[0][0] ; Read state $aRet[$i] = $aGF_HandleIndex[$i][7] ; Set flag is resized If $aGF_HandleIndex[$i][7] Then $aRet[0] = 1 ; Clear resized flag $aGF_HandleIndex[$i][7] = 0 Next ; Return array of flags Return $aRet EndFunc ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_ResizeReg ; Description ...: Registers WM_SIZE message for resizing ; Syntax.........: _GUIFrame_ResizeReg() ; Parameters ....: None ; Requirement(s).: v3.3 + ; Return values .: Success: 1 - Message handler registered ; Failure: 0 with @error set to 1 - Message handler already registered ; Author ........: Melba23 ; Modified ......: ; Remarks .......: ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_ResizeReg() ; Register the WM_SIZE message If $aGF_HandleIndex[0][1] = 0 Then Local $iRet = GUIRegisterMsg(0x05, "_GUIFrame_SIZE_Handler") ; $WM_SIZE If $iRet Then $aGF_HandleIndex[0][1] = 1 Return 1 EndIf EndIf Return SetError(1, 0, 0) EndFunc ;==>_GUIFrame_ResizeReg ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIFrame_SIZE_Handler ; Description ...: Used to resize frames when resizing of holding GUI occurs ; Syntax.........: _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) ; Parameters ....: None ; Requirement(s).: v3.3 + ; Return values .: None ; Author ........: Melba23 ; Modified ......: ; Remarks .......: If the script already has a WM_SIZE handler, then just call this function from within it ; and do NOT use the _GUIFrame_ResizeReg function ; Example........: Yes ;===================================================================================================================== Func _GUIFrame_SIZE_Handler($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam Local $iIndex ; Get index of base frame GUI For $iIndex = 1 To $aGF_HandleIndex[0][0] If $aGF_HandleIndex[$iIndex][4] = $hWnd Then ExitLoop Next ; If handle not found If $iIndex > $aGF_HandleIndex[0][0] Then Return "GUI_RUNDEFMSG" ; Check if we should resize this set If $aGF_SettingsIndex[$iIndex][1] = 1 Then ; Get new base GUI size Local $aSize = WinGetClientSize($hWnd) ; Resize frames _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]) ; Adjust any resizeable internal frames - array elements are adjacent for ease of coding For $i = 0 To 1 ; Adjust internal frames of first/second frame if any exist If $aGF_HandleIndex[$iIndex][5 + $i] <> 0 Then ; StringSplit the element content on "|" Local $aInternal = StringSplit($aGF_HandleIndex[$iIndex][5 + $i], "|") ; Then loop though the Number(values) found For $j = 1 To $aInternal[0] Local $iIntIndex = Number($aInternal[$j]) ; Check if internal frame is resizable If $aGF_SettingsIndex[$iIntIndex][1] = 1 Then ; And change if so _GUIFrame_SIZE_Handler($aGF_HandleIndex[$iIntIndex][4], $iMsg, $wParam, $lParam) EndIf Next EndIf Next ; Set callback $aGF_HandleIndex[$iIndex][7] = 1 EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>_GUIFrame_SIZE_Handler ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _GUIFrame_SepSubClass ; Description ...: Sets new WndProc for frame separator bar ; Author ........: Kip ; Modified.......: Melba23, using SetWindowLongPtr x64 compatible code drawn from Yashied's WinAPIEx library ; Remarks .......: This function is used internally by _GUIFrame_Create ; =============================================================================================================================== Func _GUIFrame_SepSubClass($hWnd) Local $aRet ; Check separator has not already been used For $i = 1 To $aGF_SepProcIndex[0][0] If $aGF_SepProcIndex[$i][0] = $hWnd Then Return 0 Next ; Store current WinProc handle in new array line Local $iIndex = $aGF_SepProcIndex[0][0] + 1 ReDim $aGF_SepProcIndex[$iIndex + 1][2] $aGF_SepProcIndex[0][0] = $iIndex $aGF_SepProcIndex[$iIndex][0] = $hWnd ; Subclass separator bar If @AutoItX64 Then $aRet = DllCall('user32.dll', 'long_ptr', 'SetWindowLongPtrW', 'hwnd', $hWnd, 'int', -4, 'long_ptr', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC Else $aRet = DllCall('user32.dll', 'long', 'SetWindowLongW', 'hwnd', $hWnd, 'int', -4, 'long', $aGF_SepProcIndex[0][1]) ; $GWL_WNDPROC EndIf ; Check for subclassing error If @error Or $aRet[0] = 0 Then Return 0 ; Return success $aGF_SepProcIndex[$iIndex][1] = $aRet[0] Return 1 EndFunc ;==>_GUIFrame_SepSubClass ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _GUIFrame_SepWndProc ; Description ...: New WndProc for frame separator bar ; Author ........: Kip ; Modified.......: Melba23 ; Remarks .......: This function is used internally by _GUIFrame_SepSubClass ; =============================================================================================================================== Func _GUIFrame_SepWndProc($hWnd, $iMsg, $wParam, $lParam) Local $iSubtract, $fAbsolute = False If $iMsg = 0x0111 Then ; WM_COMMAND ; Check if hWnd is a Separator bar For $iIndex = 1 To $aGF_HandleIndex[0][0] If $aGF_HandleIndex[$iIndex][3] = $hWnd Then ExitLoop Next ; If not then pass message on to org WndProc If $iIndex > $aGF_HandleIndex[0][0] Then Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) ; Extract values from array Local $hParent = $aGF_HandleIndex[$iIndex][0] Local $hFirstFrame = $aGF_HandleIndex[$iIndex][1] Local $hSecondFrame = $aGF_HandleIndex[$iIndex][2] Local $hSeparator = $aGF_HandleIndex[$iIndex][3] Local $iFirstMin = $aGF_SizingIndex[$iIndex][0] Local $iSecondMin = $aGF_SizingIndex[$iIndex][1] If $iFirstMin > 1 Or $iSecondMin > 1 Then $fAbsolute = True EndIf Local $iSeparatorSize = $aGF_SettingsIndex[$iIndex][2] ; Get client size of the parent Local $aClientSize = WinGetClientSize($hParent) Local $iWidth = $aClientSize[0] Local $iHeight = $aClientSize[1] ; Get cursor info for the Separator Local $aCInfo = GUIGetCursorInfo($hSeparator) ; Depending on separator orientation If $aGF_SettingsIndex[$iIndex][0] = 0 Then ; Get Separator X-coord $iSubtract = $aCInfo[0] Do ; Get parent X-coord $aCInfo = GUIGetCursorInfo($hParent) Local $iCursorX = $aCInfo[0] ; Determine width of first frame Local $iFirstWidth = $iCursorX - $iSubtract ; And ensure it is at least minimum If $fAbsolute Then If $iFirstWidth < $iFirstMin Then $iFirstWidth = $iFirstMin If $iWidth - $iFirstWidth - $iSeparatorSize < $iSecondMin Then $iFirstWidth = $iWidth - $iSeparatorSize - $iSecondMin Else If $iFirstWidth < $iWidth * $iFirstMin Then $iFirstWidth = $iWidth * $iFirstMin If $iWidth - ($iFirstWidth + $iSeparatorSize) < $iWidth * $iSecondMin Then $iFirstWidth = $iWidth - ($iWidth * $iSecondMin) - $iSeparatorSize EndIf ; Move the GUIs to the correct places WinMove($hFirstFrame, "", 0, 0, $iFirstWidth, $iHeight) WinMove($hSecondFrame, "", $iFirstWidth + $iSeparatorSize, 0, $iWidth - ($iFirstWidth + $iSeparatorSize), $iHeight) WinMove($hSeparator, "", $iFirstWidth, 0, $iSeparatorSize, $iHeight) ; Do until the mouse button is released Until Not _WinAPI_GetAsyncKeyState(0x01) ; Store current separator percentage position $aGF_SizingIndex[$iIndex][6] = $iFirstWidth / $iWidth ElseIf $aGF_SettingsIndex[$iIndex][0] = 1 Then $iSubtract = $aCInfo[1] Do $aCInfo = GUIGetCursorInfo($hParent) Local $iCursorY = $aCInfo[1] Local $iFirstHeight = $iCursorY - $iSubtract If $fAbsolute Then If $iFirstHeight < $iFirstMin Then $iFirstHeight = $iFirstMin If $iHeight - $iFirstHeight - $iSeparatorSize < $iSecondMin Then $iFirstHeight = $iHeight - $iSeparatorSize - $iSecondMin Else If $iFirstHeight < $iHeight * $iFirstMin Then $iFirstHeight = $iHeight * $iFirstMin If $iHeight - ($iFirstHeight + $iSeparatorSize) < $iHeight * $iSecondMin Then $iFirstHeight = $iHeight - ($iHeight * $iSecondMin) - $iSeparatorSize EndIf WinMove($hFirstFrame, "", 0, 0, $iWidth, $iFirstHeight) WinMove($hSecondFrame, "", 0, $iFirstHeight + $iSeparatorSize, $iWidth, $iHeight - ($iFirstHeight + $iSeparatorSize)) WinMove($hSeparator, "", 0, $iFirstHeight, $iWidth, $iSeparatorSize) Until Not _WinAPI_GetAsyncKeyState(0x01) $aGF_SizingIndex[$iIndex][6] = $iFirstHeight / $iHeight EndIf ; Set callback $aGF_HandleIndex[$iIndex][7] = 1 EndIf ; Pass the message on to org WndProc Return _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>_GUIFrame_SepWndProc ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _GUIFrame_SepPassMsg ; Description ...: Passes Msg to frame parent WndProc for action ; Author ........: Kip ; Modified.......: Melba23 ; Remarks .......: This function is used internally by _GUIFrame_SepWndProc ; =============================================================================================================================== Func _GUIFrame_SepPassMsg($hWnd, $iMsg, $wParam, $lParam) For $i = 1 To $aGF_SepProcIndex[0][0] If $aGF_SepProcIndex[$i][0] = $hWnd Then Return _WinAPI_CallWindowProc($aGF_SepProcIndex[$i][1], $hWnd, $iMsg, $wParam, $lParam) Next EndFunc ;==>_GUIFrame_SepPassMsg ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _GUIFrame_Move ; Description ...: Moves and resizes frame elements and separator bars ; Author ........: Kip ; Modified.......: Melba23 ; Remarks .......: This function is used internally by _GUIFrame_SIZE_Handler ; =============================================================================================================================== Func _GUIFrame_Move($iFrame, $iX, $iY, $iWidth = 0, $iHeight = 0) If $iFrame < 1 Or $iFrame > $aGF_HandleIndex[0][0] Then Return 0 Local $fAbsolute = False, $iDimension, $iActual_Size_1, $iActual_Size_2, $iSize Local $iOrientation = $aGF_SettingsIndex[$iFrame][0] Local $iSeparatorSize = $aGF_SettingsIndex[$iFrame][2] ; Set size if not specified If Not $iWidth Then $iWidth = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][0]) If Not $iHeight Then $iHeight = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][0]) ; Move parent WinMove($aGF_HandleIndex[$iFrame][0], "", $iX, $iY, $iWidth, $iHeight) ; Depending on separator orientation get required width/height values If $iOrientation = 1 Then $iDimension = $iHeight $iActual_Size_1 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][1]) $iActual_Size_2 = _WinAPI_GetWindowHeight($aGF_HandleIndex[$iFrame][2]) Else $iDimension = $iWidth $iActual_Size_1 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][1]) $iActual_Size_2 = _WinAPI_GetWindowWidth($aGF_HandleIndex[$iFrame][2]) EndIf ; Check resize type required Switch $aGF_SizingIndex[$iFrame][7] Case 0 ; Determine new size for first frame using separator position percentage $iSize = Int($iDimension * $aGF_SizingIndex[$iFrame][6]) Case 1 ; Get current fixed first frame size $iSize = $iActual_Size_1 Case 2 ; Determine new first frame size with fixed second frame size $iSize = $iDimension - $iSeparatorSize - $iActual_Size_2 EndSwitch ; Set frame min percentages Local $iFirstMin = $aGF_SizingIndex[$iFrame][0] Local $iSecondMin = $aGF_SizingIndex[$iFrame][1] If $iFirstMin > 1 Or $iSecondMin > 1 Then $fAbsolute = True EndIf ; Check for minimum size of first frame Local $iAdjust_Other = True Local $fSep_Adjusted = False ; Adjust first frame size If $fAbsolute Then If $iSize < $iFirstMin Then $iSize = $iFirstMin $iAdjust_Other = False $fSep_Adjusted = True EndIf Else If $iSize < $iDimension * $iFirstMin Then $iSize = $iDimension * $iFirstMin $iAdjust_Other = False $fSep_Adjusted = True EndIf EndIf ; Now adjust second frame if first not adjusted If $iAdjust_Other Then ; Find max available size for this frame Local $iSecondMax = $iDimension - $iFirstMin - $iSeparatorSize If $iSecondMax < $iSecondMin Then $iSecondMin = $iSecondMax EndIf ; Adjust second frame size If $fAbsolute Then If $iActual_Size_2 < $iSecondMin Then $iSize = $iDimension - $iSecondMin - $iSeparatorSize $fSep_Adjusted = True EndIf Else If $iActual_Size_2 < $iDimension * $iSecondMin Then $iSize = $iDimension - ($iDimension * $iSecondMin) - $iSeparatorSize $fSep_Adjusted = True EndIf EndIf EndIf ; If the separator has been moved programatically then reset percentage size of first frame If $fSep_Adjusted Then $aGF_SizingIndex[$iFrame][6] = $iSize / $iDimension EndIf ; Move and resize GUIs according to orientation If $iOrientation = 1 Then WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iWidth, $iSize) WinMove($aGF_HandleIndex[$iFrame][2], "", 0, $iSize + $iSeparatorSize, $iWidth, $iHeight - $iSize - $iSeparatorSize) WinMove($aGF_HandleIndex[$iFrame][3], "", 0, $iSize, $iWidth, $iSeparatorSize) Else WinMove($aGF_HandleIndex[$iFrame][1], "", 0, 0, $iSize, $iHeight) WinMove($aGF_HandleIndex[$iFrame][2], "", $iSize + $iSeparatorSize, 0, $iWidth - $iSize - $iSeparatorSize, $iHeight) WinMove($aGF_HandleIndex[$iFrame][3], "", $iSize, 0, $iSeparatorSize, $iHeight) EndIf EndFunc ;==>_GUIFrame_Move ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: _GUIFrame_Exit() ; Description ...: Deletes all subclassed separator bars to free UDF WndProc and frees registered callback handle ; Author ........: Melba23 ; Remarks .......: Called by OnAutoItExitRegister to delete all subclassed separator bars and to free the UDF created WndProc. ; Example........: Yes ;================================================================================================================================ Func _GUIFrame_Exit() ; Delete all subclassed separator bars For $i = $aGF_HandleIndex[0][0] To 1 Step -1 GUIDelete($aGF_HandleIndex[$i][3]) Next ; Free registered Callback handle DllCallbackFree($hGF_RegCallBack) EndFunc ;==>_GUIFrame_Exit [New] And finally all 5 files in zip format: GUIFrame.zip I hope you find this UDF useful. As always brickbats and bouquets welcomed. M23
    1 point
  16. @Danyfirex, thank you for your reply. I fix some redraws (not all). And you can drag any item from one to another, and left on empty (root). Sometimes it expand the write item, sometimes not. If you begin drag a treeview item, from one to another treeview, if the item stay in the origem treeview, its show with correct name, when it moved to another treeview, the name its wrong, but, when you left, its fixed. This bug is only when you drag a item. I want implement: a] copy a node b] context menu (delete, rename, create) c] define a rule: you can drag(create a copy) from on treeview for another, not inverse This is a new code. ; https://www.autoitscript.com/forum/topic/56411-treeview-drag-drop-reorder-and-edit-example/ #include-once #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GuiTreeView.au3> #include <WinAPI.au3> #include <GuiMenu.au3> #include <FontConstants.au3> #include <WinAPIvkeysConstants.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $TVN_BEGINDRAG Global $TVN_BEGINLABELEDIT Global $TVN_SELCHANGED Global $TVM_EDITLABEL ;Required global constants: Global $bTreeDrag = False, $bTreeEdit = False, $hItemDrag, $hTreeDragImage, $fWhere Global $FROM, $ORIGEM, $TEXT = "" Global $hDummy, $hDummyContext, $hDummyContextMenu Global $hDummy2, $hDummyContext2, $hDummyContextMenu2 Global $hGui = GUICreate("TreeView", 800, 600, 0, 0) Global $label = GUICtrlCreateLabel("*", 10, 500, 780, 20, $SS_SUNKEN) Global $label2 = GUICtrlCreateLabel("", 10, 530, 780, 20, $SS_SUNKEN) #cs $NODES array is used to store graphics elements, as ID, HANDLE, item focus, param item and parent from item In the future, I use others graphic elemnts like listview, not only treeview $NODES id +-eGID-+---eHANDLE--+------eFOCUS--+---ePARAM--+---ePARENT--+ 0 | | |TREEVIEW_FOCUS | | | 1 | 5 | 0x00ABCDEF | | | | 2 | 6 | 0x00ABCDFF | | | | BUGS I use some function called Funcion1...8, becouse sometimes a random funcion is called when you use a keyboard arrows, in this version, that no more happens Context menu pops up, but does not work still, only call funcitions #ce Global Enum $eGID = 0, $eHANDLE, $eFOCUS, $ePARAM, $ePARENT Global $NODES[3][5] = [ _ [0] _ ] $NODES[1][$eGID] = GUICtrlCreateTreeView(10, 10, 320, 480, $TVS_HASBUTTONS + $TVS_HASLINES + $TVS_LINESATROOT + $TVS_EDITLABELS + $TVS_CHECKBOXES) GUICtrlSetFont($NODES[1][$eGID], 12, 400, 0, "Courier New") $NODES[1][$eHANDLE] = GUICtrlGetHandle($NODES[1][$eGID]) GUICtrlSetState($NODES[1][$eGID], $GUI_DROPACCEPTED) $NODES[2][$eGID] = GUICtrlCreateTreeView(340, 10, 320, 480, $TVS_HASBUTTONS + $TVS_HASLINES + $TVS_LINESATROOT + $TVS_EDITLABELS + $TVS_CHECKBOXES) GUICtrlSetFont($NODES[2][$eGID], 12, 400, 0, "Courier New") $NODES[2][$eHANDLE] = GUICtrlGetHandle($NODES[2][$eGID]) GUICtrlSetState($NODES[2][$eGID], $GUI_DROPACCEPTED) Populate() Func Populate() Local $hItem, $hChild1, $hChild2, $tree_view Local $aCores[] = ["amarelo", "vermelho", "branco", "cinza", "azul", "verde", "laranja", "preto"] Local $aTons[] = ["claro", "médio", "escuro"] Local $aSabores[] = ["doce", "salgado", "azedo"] Local $iNext = 1 For $ii = 1 To 2 $tree_view = $NODES[$ii][$eGID] _GUICtrlTreeView_BeginUpdate($tree_view) ConsoleWrite("TREE" & $ii & "[" & $tree_view & "][" & ($ii = 1 ? $NODES[1][$eHANDLE] : $NODES[2][$eHANDLE]) & "]" & @LF) For $jj = 0 To 1 ;UBound($aCores, 1) - 1 $hItem = _GUICtrlTreeView_Add($tree_view, 0, $ii & "." & $aCores[$jj] & "." & $iNext) $iNext += 1 For $kk = 0 To 1 ;UBound($aTons, 1) - 1 $hChild1 = _GUICtrlTreeView_AddChild($tree_view, $hItem, $ii & "." & $aTons[$kk] & "." & $iNext) $iNext += 1 For $ll = 0 To 1 ;UBound($aSabores, 1) - 1 $hChild2 = _GUICtrlTreeView_AddChild($tree_view, $hChild1, $ii & "." & $aSabores[$ll] & "." & $iNext) $iNext += 1 _GUICtrlTreeView_Expand($tree_view, $hChild2, True) Next Next Next _GUICtrlTreeView_EndUpdate($tree_view) Next EndFunc ;==>Populate GUISetOnEvent($GUI_EVENT_CLOSE, "Quit") GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "SysEvents") GUISetOnEvent($GUI_EVENT_PRIMARYUP, "SysEvents") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _CreateDummy($hDummy, $hDummyContext, $hDummyContextMenu, "Add=Context_Add;Rename=Context_Update;Del=Context_Del;Copy=Context_Copy") _CreateDummy($hDummy2, $hDummyContext2, $hDummyContextMenu2, "AddRoot=Context_AddRoot") GUISetState(@SW_SHOW, $hGui) While Sleep(25) ;add Enter, Esc, Delete and Insert key functionality to treeview edit: TreeKeyboardFunc() WEnd Func SysEvents() Local $hTree = $NODES[0][2] Local $hItem, $hItemHover, $aRect, $iTreeY, $focus Switch @GUI_CtrlId Case $GUI_EVENT_PRIMARYUP If $bTreeDrag Then ; Adds a rectangle to the specified window's update region _WinAPI_InvalidateRect($hTree) $bTreeDrag = False ; delete drag image _GUIImageList_Destroy($hTreeDragImage) ; remove DropTarget _SendMessage($hTree, $TVM_SELECTITEM, $TVGN_DROPHILITE, 0) ; remove InsertMark _SendMessage($hTree, $TVM_SETINSERTMARK, 0, 0) ; move item $focus = _GuiCtrlTreeView_GetItemFocus($hTree) ; prevent a $hItemDrag copy to yourself If $hItemDrag <> $focus Then ; copy a treeview item from...to $hItem = TreeItemCopy($FROM, $hItemDrag, $hTree, $focus, $fWhere) If $hItem <> 0 Then ; collapse and expand the $hItem _GUICtrlTreeView_Expand($hTree, $hItem, False) _GUICtrlTreeView_Expand($hTree, $hItem, True) ; select the $hItem _GUICtrlTreeView_SelectItem($hTree, $hItem) ; delete $hItemDrag from $FROM _GUICtrlTreeView_Delete($FROM, $hItemDrag) EndIf EndIf $FROM = 0 EndIf Case $GUI_EVENT_MOUSEMOVE If Not $bTreeDrag Then ContinueCase ; detect drag from to another treeview and update $hTreeDragImage ; destroy some graphics elements from old treeview If Not ($ORIGEM = $hTree) Then _WinAPI_InvalidateRect($ORIGEM) ; delete drag image _GUIImageList_Destroy($hTreeDragImage) ; remove DropTarget _SendMessage($ORIGEM, $TVM_SELECTITEM, $TVGN_DROPHILITE, 0) ; remove InsertMark _SendMessage($ORIGEM, $TVM_SETINSERTMARK, 0, 0) ;~ $hItemDrag = _GuiCtrlTreeView_GetItemFocus($hTree) $hTreeDragImage = TreeCreateDragImage($hTree, $hItemDrag) $ORIGEM = $hTree EndIf $hItemHover = _GuiCtrlTreeView_GetItemFocus($hTree) If $hItemHover = 0 Then ;meh Else $aRect = _GUICtrlTreeView_DisplayRect($hTree, $hItemHover) $iTreeY = _WinAPI_GetMousePosY(True, $hTree) Switch $iTreeY Case $aRect[1] To $aRect[1] + Int(($aRect[3] - $aRect[1]) / 4) ; remove DropTarget _SendMessage($hTree, $TVM_SELECTITEM, $TVGN_DROPHILITE, 0) ; add InsertMark before item _SendMessage($hTree, $TVM_SETINSERTMARK, 0, $hItemHover) $fWhere = -1 Case 1 + $aRect[1] + Int(($aRect[3] - $aRect[1]) / 3) To $aRect[1] + Int(($aRect[3] - $aRect[1]) * 2 / 3) ; remove InsertMark _SendMessage($hTree, $TVM_SETINSERTMARK, 0, 0) ; add DropTarget _SendMessage($hTree, $TVM_SELECTITEM, $TVGN_DROPHILITE, $hItemHover) $fWhere = 0 Case 1 + $aRect[1] + Int(($aRect[3] - $aRect[1]) * 2 / 3) To $aRect[3] ; remove DropTarget _SendMessage($hTree, $TVM_SELECTITEM, $TVGN_DROPHILITE, 0) ; add InsertMark after item _SendMessage($hTree, $TVM_SETINSERTMARK, 1, $hItemHover) $fWhere = 1 EndSwitch EndIf DrawDragImage($hTree, $hTreeDragImage) _GUICtrlTreeView_SetSelected($hTree, _GUICtrlTreeView_GetSelection($hTree), True) EndSwitch EndFunc ;==>SysEvents ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GuiCtrlTreeView_GetItemFocus ; Description ...: ; Syntax ........: _GuiCtrlTreeView_GetItemFocus($hTreeView) ; Parameters ....: $hTreeView - a handle value. ; Return values .: None ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: Returns handle of tree item under mouse: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GuiCtrlTreeView_GetItemFocus($hTreeView) Local $tMPos = _WinAPI_GetMousePos(True, $hTreeView) Return _GUICtrlTreeView_HitTestItem($hTreeView, DllStructGetData($tMPos, 1), DllStructGetData($tMPos, 2)) EndFunc ;==>_GuiCtrlTreeView_GetItemFocus ; TreeItemCopy() ; Copies tree item $hItemSource and all its children to an item $hItemTarget, depending on $fDirection ; $fDirection: ; -1 = before $hItemTarget ; 0 = inside $hItemTarget ; 1 = after $hItemTarget Func TreeItemCopy($hTreeSource, $hItemSource, $hTreeTarget, $hItemTarget, $fDirection) ConsoleWrite("TreeItemCopy( $hTreeSource=" & $hTreeSource & ", $hItemSource=" & $hItemSource & ", $hTreeTarget=" & $hTreeTarget & ",$hItemTarget=" & $hItemTarget & ", $fDirection=" & $fDirection & " )" & @LF) ;making sure parent can't be dropped onto one of its descendants: Local $hPrev, $hNew, $iChildCount, $hRecSource ;create new item at determined position Local $sText = _GUICtrlTreeView_GetText($hTreeSource, $hItemSource) Local $hParent = _GUICtrlTreeView_GetParentHandle($hTreeSource, $hItemTarget) If $hItemTarget Then Switch $fDirection Case -1 $hPrev = _GUICtrlTreeView_GetPrevSibling($hTreeSource, $hItemTarget) If $hPrev = 0 Then $hNew = _GUICtrlTreeView_AddFirst($hTreeSource, $hItemTarget, $sText) Else $hNew = _GUICtrlTreeView_InsertItem($hTreeSource, $sText, $hParent, $hPrev) EndIf Case 0 $hNew = _GUICtrlTreeView_InsertItem($hTreeSource, $sText, $hItemTarget) Case 1 $hNew = _GUICtrlTreeView_InsertItem($hTreeSource, $sText, $hParent, $hItemTarget) Case Else ;~ Return 0 EndSwitch Else ; if $hItemTarget is 0, it is a root treeview $hNew = _GUICtrlTreeView_Add($hTreeTarget, 0, $sText) EndIf ;save item state and checkbox image if there is such _GUICtrlTreeView_SetState($hTreeSource, $hNew, _GUICtrlTreeView_GetState($hTreeSource, $hItemSource)) If _GUICtrlTreeView_GetStateImageList($hTreeSource) <> 0 Then _GUICtrlTreeView_SetStateImageIndex($hTreeSource, $hNew, _GUICtrlTreeView_GetStateImageIndex($hTreeSource, $hItemSource)) EndIf ;save icon/selected image indexes If _GUICtrlTreeView_GetNormalImageList($hTreeSource) <> 0 Then _GUICtrlTreeView_SetImageIndex($hTreeSource, $hNew, _GUICtrlTreeView_GetImageIndex($hTreeSource, $hItemSource)) _GUICtrlTreeView_SetSelectedImageIndex($hTreeSource, $hNew, _GUICtrlTreeView_GetSelectedImageIndex($hTreeSource, $hItemSource)) EndIf ;recurse through descendants: $iChildCount = _GUICtrlTreeView_GetChildCount($hTreeSource, $hItemSource) Local $arr[2] = [$hTreeSource, $hNew] If $iChildCount > 0 Then For $i = 0 To $iChildCount - 1 $hRecSource = _GUICtrlTreeView_GetItemByIndex($hTreeSource, $hItemSource, $i) TreeItemCopy($hTreeSource, $hRecSource, $hTreeTarget, $hNew, 0) Next EndIf Return $hNew EndFunc ;==>TreeItemCopy Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) $NODES[0][1] = $wParam Switch $wParam Case $NODES[1][$eGID] $NODES[0][2] = $NODES[1][$eHANDLE] Local $tNMHDR = DllStructCreate("hwnd hTree;uint;int code", $lParam) Local $iCode = DllStructGetData($tNMHDR, "code") Local $hTree = $NODES[1][$eHANDLE] ; HWnd(DllStructGetData($tNMHDR, "hTree")) Switch $iCode Case $TVN_BEGINDRAG, $TVN_BEGINDRAGW $ORIGEM = $NODES[1][$eHANDLE] $FROM = $NODES[1][$eHANDLE] $bTreeDrag = True $hItemDrag = _GuiCtrlTreeView_GetItemFocus($hTree) ;~ _GUICtrlTreeView_SelectItem($hTree, $hItemDrag) ;~ _GUICtrlTreeView_SetSelected($hTree, _GUICtrlTreeView_GetSelection($hTree), False) $hTreeDragImage = TreeCreateDragImage($hTree, $hItemDrag) DrawDragImage($hTree, $hTreeDragImage) Case $TVN_BEGINLABELEDIT, $TVN_BEGINLABELEDITW $bTreeEdit = True ;~ $hTreeEdit = _SendMessage($hTree, $TVM_GETEDITCONTROL, 0, 0) Case $TVN_ENDLABELEDITW, $TVN_ENDLABELEDITW $bTreeEdit = False Return 1 Case $TVN_SELCHANGED, $TVN_SELCHANGEDW ;~ ;Local $hSel = _GUICtrlTreeView_GetSelection($hTree) ;~ Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) ;~ Local $hSel = DllStructGetData($tNMTREEVIEW, "NewhItem") ;~ Local $sTxt = "Currently selected: " & _GUICtrlTreeView_GetText($hTree, $hSel) & " (item handle " & $hSel & ")" ;~ GUICtrlSetData($label2, $sTxt) Case $NM_RCLICK ; set focus to treeview 1 SET_FOCUS(1, 1) Local $hSel = _GUICtrlTreeView_GetSelection($NODES[1][$eHANDLE]) _SendMessage($NODES[1][$eHANDLE], $TVM_SELECTITEM, $TVGN_CARET, $hSel) _GUICtrlMenu_TrackPopupMenu($NODES[1][$eFOCUS] = -1 ? $hDummyContextMenu2 : $hDummyContextMenu, $hGui) Return 0 ; zero to allow the default processing Case Else EndSwitch Case $NODES[2][$eGID] $NODES[0][2] = $NODES[2][$eHANDLE] Local $tNMHDR = DllStructCreate("hwnd hTree;uint;int code", $lParam) Local $iCode = DllStructGetData($tNMHDR, "code") Local $hTree = HWnd(DllStructGetData($tNMHDR, "hTree")) Switch $iCode Case $TVN_BEGINDRAG, $TVN_BEGINDRAGW $ORIGEM = $NODES[2][$eHANDLE] $FROM = $NODES[2][$eHANDLE] $bTreeDrag = True $hItemDrag = _GuiCtrlTreeView_GetItemFocus($hTree) ;~ _GUICtrlTreeView_SelectItem($hTree, $hItemDrag) ;~ _GUICtrlTreeView_SetSelected($hTree, _GUICtrlTreeView_GetSelection($hTree), False) $hTreeDragImage = TreeCreateDragImage($hTree, $hItemDrag) DrawDragImage($hTree, $hTreeDragImage) Case $TVN_BEGINLABELEDIT, $TVN_BEGINLABELEDITW $bTreeEdit = True ;~ $hTreeEdit = _SendMessage($hTree, $TVM_GETEDITCONTROL, 0, 0) Case $TVN_ENDLABELEDITW, $TVN_ENDLABELEDITW $bTreeEdit = False Return 1 Case $TVN_SELCHANGED, $TVN_SELCHANGEDW ;~ ;Local $hSel = _GUICtrlTreeView_GetSelection($hTree) ;~ Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) ;~ Local $hSel = DllStructGetData($tNMTREEVIEW, "NewhItem") ;~ Local $sTxt = "Currently selected: " & _GUICtrlTreeView_GetText($hTree, $hSel) & " (item handle " & $hSel & ")" ;~ GUICtrlSetData($label2, $sTxt) Case $NM_RCLICK ; set focus to treeview 2 SET_FOCUS(2, 1) Local $hSel = _GUICtrlTreeView_GetSelection($NODES[2][$eHANDLE]) _SendMessage($NODES[2][$eHANDLE], $TVM_SELECTITEM, $TVGN_CARET, $hSel) _GUICtrlMenu_TrackPopupMenu($NODES[2][$eFOCUS] = -1 ? $hDummyContextMenu2 : $hDummyContextMenu, $hGui) Return 0 ; zero to allow the default processing Case Else EndSwitch EndSwitch EndFunc ;==>WM_NOTIFY ; #FUNCTION# ==================================================================================================================== ; Name ..........: SET_FOCUS ; Description ...: ; Syntax ........: SET_FOCUS($index[, $iMode = 0]) ; Parameters ....: $index - an integer value. The treeview's ID/line number in NODES array ; $iMode - [optional] an integer value. Default is 0. ; if 1, set focus in $hItem when conext menu is clicked ; Return values .: None ; Author ........: Luigi ; Modified ......: If you click any hItem inside treeview, some parameters (focus, parent and param) was catch en set in NODES ; If you click on empty/none item, all values are set with -1 ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func SET_FOCUS($index, $iMode = 0) Local $hItem = _GuiCtrlTreeView_GetItemFocus($NODES[$index][$eHANDLE]) ; set focus on treeview's item If $iMode Then _SendMessage($NODES[$index][$eHANDLE], $TVM_SELECTITEM, $TVGN_CARET, $hItem) If $hItem Then If $hItem <> $NODES[$index][$eFOCUS] Then $NODES[$index][$eFOCUS] = $hItem $NODES[$index][$ePARAM] = _GUICtrlTreeView_GetItemParam($NODES[$index][$eHANDLE], $NODES[$index][$eFOCUS]) $NODES[$index][$ePARENT] = _GUICtrlTreeView_GetParentHandle($NODES[$index][$eHANDLE], $NODES[$index][$eFOCUS]) $NODES[$index][$ePARENT] = $NODES[$index][$ePARENT] ? $NODES[$index][$ePARENT] : 0 ;~ _SendMessage($ARR[$eHANDLE], $TVM_SELECTITEM, $TVGN_CARET, $hItem) EndIf Else $NODES[$index][$eFOCUS] = -1 $NODES[$index][$ePARAM] = -1 $NODES[$index][$ePARENT] = -1 ;~ _SendMessage($ARR[$eHANDLE], $TVM_SELECTITEM, $TVGN_CARET, 0) EndIf EndFunc ;==>SET_FOCUS Func KeyPressed($iHexKey) Local $aRet = DllCall("user32.dll", "int", "GetAsyncKeyState", "int", $iHexKey) ;~ If BitAND($aRet[0], 0x8000) Or BitAND($aRet[0], 1) Then Return 1 If BitAND($aRet[0], 1) Then Return 1 Return 0 EndFunc ;==>KeyPressed Func TreeKeyboardFunc() If $bTreeDrag Then Return Local $hWnd = $NODES[0][2] If $bTreeEdit Then If KeyPressed($VK_RETURN) Then _SendMessage($hWnd, $TVM_ENDEDITLABELNOW, 0, 0) EndIf If KeyPressed($VK_ESCAPE) Then _SendMessage($hWnd, $TVM_ENDEDITLABELNOW, 1, 0) EndIf EndIf Local $aRet = DllCall("user32.dll", "hwnd", "GetFocus") If $aRet[0] = $hWnd Then If KeyPressed($VK_INSERT) Then _GUICtrlTreeView_Add($hWnd, _GUICtrlTreeView_GetSelection($hWnd), "New Item") EndIf If KeyPressed($VK_DELETE) Then _GUICtrlTreeView_Delete($hWnd, _GUICtrlTreeView_GetSelection($hWnd)) EndIf If KeyPressed($VK_RETURN) Then _SendMessage($hWnd, $TVM_EDITLABEL, 0, _GUICtrlTreeView_GetSelection($hWnd)) EndIf EndIf EndFunc ;==>TreeKeyboardFunc Func TreeCreateDragImage($hWnd, $hItem) ConsoleWrite("TreeCreateDragImage( $hWnd=" & $hWnd & ", $hItem=" & $hItem & ")" & @LF) If Not $hWnd Or Not $hItem Then Return ;if treeview has imagelist, use image from it If _GUICtrlTreeView_GetNormalImageList($hWnd) <> 0 Then Return _GUICtrlTreeView_CreateDragImage($hWnd, $hItem) EndIf ;if not, create a bitmap of dragitem's text rectangle and put it into imagelist. Local $aItemRect = _GUICtrlTreeView_DisplayRect($hWnd, $hItem, True) Local $iImgW = $aItemRect[2] - $aItemRect[0] Local $iImgH = $aItemRect[3] - $aItemRect[1] Local $hTreeDC = _WinAPI_GetDC($hWnd) Local $hMemDC = _WinAPI_CreateCompatibleDC($hTreeDC) Local $hMemBmp = _WinAPI_CreateCompatibleBitmap($hTreeDC, $iImgW, $iImgH) Local $hMemBmpOld = _WinAPI_SelectObject($hMemDC, $hMemBmp) _WinAPI_BitBlt($hMemDC, 0, 0, $iImgW, $iImgH, $hTreeDC, $aItemRect[0], $aItemRect[1], $SRCCOPY) _WinAPI_SelectObject($hMemDC, $hMemBmpOld) _WinAPI_ReleaseDC($hWnd, $hTreeDC) _WinAPI_DeleteDC($hMemDC) Local $hImgList = _GUIImageList_Create($iImgW, $iImgH, 6) _GUIImageList_Add($hImgList, $hMemBmp) _WinAPI_DeleteObject($hMemBmp) ConsoleWrite("TreeCreateDragImage.$hImgList=" & $hImgList & @LF) Return $hImgList EndFunc ;==>TreeCreateDragImage ; #FUNCTION# ==================================================================================================================== ; Name ..........: DrawDragImage ; Description ...: ; Syntax ........: DrawDragImage(Byref $hControl, Byref $aDrag) ; Parameters ....: $hControl - [in/out] a handle value. ; $aDrag - [in/out] an array of unknowns. ; Return values .: None ; Author ........: Gary Frost ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func DrawDragImage(ByRef $hControl, ByRef $hImageList) ConsoleWrite("DrawDragImage( $hControl=" & $hControl & ", $hImageList=" & $hImageList & ")" & @LF) Local $tPoint, $hDC $hDC = _WinAPI_GetWindowDC($hControl) $tPoint = _WinAPI_GetMousePos(True, $hControl) _WinAPI_InvalidateRect($hControl) _GUIImageList_Draw($hImageList, 0, $hDC, DllStructGetData($tPoint, "X") - 10, DllStructGetData($tPoint, "Y") - 8) _WinAPI_ReleaseDC($hControl, $hDC) EndFunc ;==>DrawDragImage ; sometimes I see a bug, the random function is called ; this function exist to detect this bug Func Function1() ConsoleWrite("Function1" & @LF) EndFunc ;==>Function1 Func Function2() ConsoleWrite("Function2" & @LF) EndFunc ;==>Function2 Func Function3() ConsoleWrite("Function3" & @LF) EndFunc ;==>Function3 Func Function4() ConsoleWrite("Function4" & @LF) EndFunc ;==>Function4 Func Function5() ConsoleWrite("Function5" & @LF) EndFunc ;==>Function5 Func Function6() ConsoleWrite("Function6" & @LF) EndFunc ;==>Function6 Func Function7() ConsoleWrite("Function7" & @LF) EndFunc ;==>Function7 Func Function8() ConsoleWrite("Function8" & @LF) EndFunc ;==>Function8 Func OnExit() GUISetState($hGui, @SW_HIDE) GUIDelete($hGui) EndFunc ;==>OnExit Func Quit() Exit EndFunc ;==>Quit #Region _DUMMY Func _CreateDummy(ByRef $dummy, ByRef $context, ByRef $menu, $cmd) Local $aDummy[1][3] _ArrayAdd($aDummy, $cmd, Default, "=", ";") $dummy = GUICtrlCreateDummy() $context = GUICtrlCreateContextMenu($dummy) $menu = GUICtrlGetHandle($context) For $ii = 1 To UBound($aDummy, 1) - 1 $aDummy[$ii][2] = GUICtrlCreateMenuItem($aDummy[$ii][0], $context) If $aDummy[$ii][1] Then GUICtrlSetOnEvent($aDummy[$ii][2], $aDummy[$ii][1]) Next EndFunc ;==>_CreateDummy #EndRegion _DUMMY Func Context_Add() ConsoleWrite("Context_Add" & @LF) EndFunc ;==>Context_Add Func Context_AddRoot() ConsoleWrite("Context_AddRoot" & @LF) EndFunc ;==>Context_AddRoot Func Context_Update() ConsoleWrite("Context_Update" & @LF) EndFunc ;==>Context_Update Func Context_Del() ConsoleWrite("Context_Del" & @LF) EndFunc ;==>Context_Del Func Context_Copy() ConsoleWrite("Context_Copy" & @LF) EndFunc ;==>Context_Copy
    1 point
  17. #Include <GUIConstantsEx.au3> #Include <GUIImageList.au3> #Include <GUITreeView.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm, $hTreeView, $hImageList, $hItem, $hNext, $hSelect = 0, $hInput, $Input, $Dummy Global $sPath, $sRoot = @HomeDrive $hForm = GUICreate('MyGUI', 600, 600) $Input = GUICtrlCreateInput('', 20, 20, 560, 19) $hInput = GUICtrlGetHandle(-1) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateTreeView(20, 50, 560, 530, -1, $WS_EX_CLIENTEDGE) $hTreeView = GUICtrlGetHandle(-1) $Dummy = GUICtrlCreateDummy() If _WinAPI_GetVersion() >= '6.0' Then _WinAPI_SetWindowTheme($hTreeView, 'Explorer') EndIf $hImageList = _GUIImageList_Create(16, 16, 5, 1) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 3) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 4) _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImageList) $sRoot = StringRegExpReplace($sRoot, '\\+\Z', '') $sPath = StringRegExpReplace($sRoot, '^.*\\', '') If StringInStr($sPath, ':') Then $sRoot &= '\' $sPath &= '\' EndIf ;_GUICtrlTreeView_BeginUpdate($hTreeView) _TVUpdate($hTreeView, _GUICtrlTreeView_AddChild($hTreeView, 0, $sPath, 0, 0)) ;_GUICtrlTreeView_EndUpdate($hTreeView) GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') GUISetState() _GUICtrlTreeView_Expand($hTreeView, _GUICtrlTreeView_GetFirstItem($hTreeView)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Dummy GUISetCursor(1, 1) $hItem = _GUICtrlTreeView_GetFirstChild($hTreeView, GUICtrlRead($Dummy)) If $hItem Then While $hItem $hNext = _GUICtrlTreeView_GetNextSibling($hTreeView, $hItem) If Not _TVUpdate($hTreeView, $hItem) Then _GUICtrlTreeView_Delete($hTreeView, $hItem) EndIf $hItem = $hNext WEnd _WinAPI_RedrawWindow($hTreeView) EndIf GUISetCursor(2, 0) EndSwitch WEnd Func _TVGetPath($hTV, $hItem, $sRoot) Local $Path = StringRegExpReplace(_GUICtrlTreeView_GetTree($hTV, $hItem), '([|]+)|(\\[|])', '\\') If Not $Path Then Return '' EndIf If Not StringInStr($Path, ':') Then Return StringRegExpReplace($sRoot, '(\\[^\\]*(\\|)+)\Z', '\\') & $Path EndIf Return $Path EndFunc ;==>_TVGetPath Func _TVSetPath($hTV, $hItem, $sRoot) GUICtrlSetData($Input, _WinAPI_PathCompactPath($hInput, _TVGetPath($hTV, $hItem, $sRoot), 554)) $hSelect = $hItem EndFunc ;==>_TVSetPath Func _TVUpdate($hTV, $hItem) Local $hImageList = _SendMessage($hTV, $TVM_GETIMAGELIST) Local $Path = StringRegExpReplace(_TVGetPath($hTV, $hItem, $sRoot), '\\+\Z', '') Local $hSearch, $hIcon, $Index, $File $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then If Not @error Then If FileExists($Path) Then ; If _WinAPI_PathIsDirectory($Path) Then ; ; Access denied ; EndIf Else Return 0 EndIf EndIf Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If @extended Then _GUICtrlTreeView_AddChild($hTV, $hItem, $File, 0, 0) EndIf WEnd FileClose($hSearch) EndIf Return 1 EndFunc ;==>_TVUpdate Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Local $hItem = DllStructGetData($tNMTREEVIEW, 'NewhItem') Local $iState = DllStructGetData($tNMTREEVIEW, 'NewState') Local $hTV = DllStructGetData($tNMTREEVIEW, 'hWndFrom') Local $ID = DllStructGetData($tNMTREEVIEW, 'Code') Local $tTVHTI, $tPoint Switch $hTV Case $hTreeView Switch $ID Case $TVN_ITEMEXPANDEDW If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) If BitAND($iState, $TVIS_SELECTED) Then _TVSetPath($hTV, _GUICtrlTreeView_GetSelection($hTV), $sRoot) EndIf Else If Not BitAND($iState, $TVIS_EXPANDED) Then _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 0) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 0) Else _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 1) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 1) If Not _GUICtrlTreeView_GetItemParam($hTV, $hItem) Then _GUICtrlTreeView_SetItemParam($hTV, $hItem, 0x7FFFFFFF) GUICtrlSendToDummy($Dummy, $hItem) EndIf EndIf EndIf Case $TVN_SELCHANGEDW If BitAND($iState, $TVIS_SELECTED) Then If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
    1 point
  18. #Include <GUIConstantsEx.au3> #Include <GUIImageList.au3> #Include <GUITreeView.au3> #Include <TreeViewConstants.au3> #Include <WindowsConstants.au3> #Include <WinAPIEx.au3> Opt('MustDeclareVars', 1) Global $hForm, $hTreeView, $hImageList, $hItem = 0, $hSelect = 0, $hInput, $Input, $Dummy Global $sPath, $sRoot = @HomeDrive $hForm = GUICreate('MyGUI', 600, 600) $Input = GUICtrlCreateInput('', 20, 20, 560, 19) $hInput = GUICtrlGetHandle(-1) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateTreeView(20, 50, 560, 530, -1, $WS_EX_CLIENTEDGE) $hTreeView = GUICtrlGetHandle(-1) $Dummy = GUICtrlCreateDummy() If _WinAPI_GetVersion() >= '6.0' Then _WinAPI_SetWindowTheme($hTreeView, 'Explorer') EndIf $hImageList = _GUIImageList_Create(16, 16, 5, 1) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 3) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 4) _GUIImageList_AddIcon($hImageList, @SystemDir & '\shell32.dll', 51) _GUICtrlTreeView_SetNormalImageList($hTreeView, $hImageList) $sRoot = StringRegExpReplace(FileGetLongName($sRoot), '\\+\Z', '') $sPath = StringRegExpReplace($sRoot, '^.*\\', '') If StringInStr($sPath, ':') Then $sRoot &= '\' $sPath &= '\' EndIf If _WinAPI_PathIsDirectory($sRoot) Then $hItem = _GUICtrlTreeView_AddChild($hTreeView, 0, $sPath, 0, 0) If FileClose(FileFindFirstFile($sRoot & '\*')) Then _GUICtrlTreeView_AddChild($hTreeView, $hItem, '', 2, 2) EndIf EndIf GUIRegisterMsg($WM_NOTIFY, 'WM_NOTIFY') GUISetState() If $hItem Then _GUICtrlTreeView_Expand($hTreeView, $hItem) EndIf While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Dummy GUISetCursor(1, 1) _TVUpdate($hTreeView, GUICtrlRead($Dummy)) GUISetCursor(2, 0) EndSwitch WEnd Func _TVGetPath($hTV, $hItem, $sRoot) Local $Path = StringRegExpReplace(_GUICtrlTreeView_GetTree($hTV, $hItem), '([|]+)|(\\[|])', '\\') If Not $Path Then Return '' EndIf If Not StringInStr($Path, ':') Then Return StringRegExpReplace($sRoot, '(\\[^\\]*(\\|)+)\Z', '\\') & $Path EndIf Return $Path EndFunc ;==>_TVGetPath Func _TVSetPath($hTV, $hItem, $sRoot) GUICtrlSetData($Input, _WinAPI_PathCompactPath($hInput, _TVGetPath($hTV, $hItem, $sRoot), 554)) $hSelect = $hItem EndFunc ;==>_TVSetPath Func _TVUpdate($hTV, $hItem) Local $hImageList = _SendMessage($hTV, $TVM_GETIMAGELIST) Local $Path = StringRegExpReplace(_TVGetPath($hTV, $hItem, $sRoot), '\\+\Z', '') Local $hIcon, $hSearch, $hSubitem Local $Index, $File _WinAPI_LockWindowUpdate($hTV) _GUICtrlTreeView_Delete($hTV, _GUICtrlTreeView_GetFirstChild($hTV, $hItem)) $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then If Not @error Then If FileExists($Path) Then ; If _WinAPI_PathIsDirectory($Path) Then ; ; Access denied ; EndIf Else _GUICtrlTreeView_Delete($hTV, $hItem) _WinAPI_LockWindowUpdate(0) Return 0 EndIf EndIf Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If @extended Then $hSubItem = _GUICtrlTreeView_AddChild($hTV, $hItem, $File, 0, 0) If FileClose(FileFindFirstFile($Path & '\' & $File & '\*')) Then _GUICtrlTreeView_AddChild($hTV, $hSubItem, '', 2, 2) EndIf EndIf WEnd FileClose($hSearch) EndIf #cs $hSearch = FileFindFirstFile($Path & '\*') If $hSearch = -1 Then Else While 1 $File = FileFindNextFile($hSearch) If @error Then ExitLoop EndIf If Not @extended Then $hIcon = _WinAPI_ShellExtractAssociatedIcon($Path & '\' & $File, 1) $Index = _GUIImageList_ReplaceIcon($hImageList, -1, $hIcon) _GUICtrlTreeView_AddChild($hTV, $hItem, $File, $Index, $Index) _WinAPI_DestroyIcon($hIcon) EndIf WEnd FileClose($hSearch) EndIf #ce _GUICtrlTreeView_SetItemParam($hTV, $hItem, 0x7FFFFFFF) _WinAPI_LockWindowUpdate(0) Return 1 EndFunc ;==>_TVUpdate Func _WinAPI_LockWindowUpdate($hWnd) Local $Ret = DllCall('user32.dll', 'int', 'LockWindowUpdate', 'hwnd', $hWnd) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==>_WinAPI_LockWindowUpdate Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) Local $tNMTREEVIEW = DllStructCreate($tagNMTREEVIEW, $lParam) Local $hItem = DllStructGetData($tNMTREEVIEW, 'NewhItem') Local $iState = DllStructGetData($tNMTREEVIEW, 'NewState') Local $hTV = DllStructGetData($tNMTREEVIEW, 'hWndFrom') Local $ID = DllStructGetData($tNMTREEVIEW, 'Code') Local $tTVHTI, $tPoint Switch $hTV Case $hTreeView Switch $ID Case $TVN_ITEMEXPANDEDW If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) If BitAND($iState, $TVIS_SELECTED) Then _TVSetPath($hTV, _GUICtrlTreeView_GetSelection($hTV), $sRoot) EndIf Else If Not BitAND($iState, $TVIS_EXPANDED) Then _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 0) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 0) Else _GUICtrlTreeView_SetSelectedImageIndex($hTV, $hItem, 1) _GUICtrlTreeView_SetImageIndex($hTV, $hItem, 1) If Not _GUICtrlTreeView_GetItemParam($hTV, $hItem) Then GUICtrlSendToDummy($Dummy, $hItem) EndIf EndIf EndIf Case $TVN_SELCHANGEDW If BitAND($iState, $TVIS_SELECTED) Then If Not FileExists(_TVGetPath($hTV, $hItem, $sRoot)) Then _GUICtrlTreeView_Delete($hTV, $hItem) $hItem = _GUICtrlTreeView_GetSelection($hTV) EndIf If $hItem <> $hSelect Then _TVSetPath($hTV, $hItem, $sRoot) EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
    1 point
  19. myspacee

    file not exists

    Not for my task. This is part of my production code: if StringRight(StringReplace($file_no_ext, ".bmp", ""), 2) <> "01" and Not FileExists($sDir & "\" & StringReplace($file, StringRight($file, 6), "") & "01.bmp") then do elseif .... simple way often isn't best way. Bye and thank you all. m.
    1 point
×
×
  • Create New...