Leaderboard
Popular Content
Showing content with the highest reputation on 03/07/2023 in all areas
-
I remember this old thread about non-blocking functions using volatile, a small example inside... https://www.autoitscript.com/forum/topic/158598-dllcallbackregister-with-non-freezing-gui-volatile-example/?tab=comments#comment-1150646 ..also an incomplete attempt at MoveFileWithProgress by jaberwacky.1 point
-
is it possible the get the mouse moving speed and return its speed value?
jacky998877 reacted to rudi for a topic
Even though you already marked @mistersquirrle answer as solution: In case you would like to look up the settings for "mouse speed" "Cursor accelleration" and others (start -> run -> main.cpl) you can read them from the Registry values in the key HKEY_CURRENT_USER\Control Panel\Mouse1 point -
error unir pdfs - (Moved)
argumentum reacted to bdr529 for a topic
"c:\Program Files\PDF24\pdf24-Doctool.exe" -noProgress -profile ""default/good"" -join 1.pdf 2.pdf -outputFile 3.pdf1 point -
Midi UDF
MattyD reacted to PeterVerbeek for a topic
Just great Matty I'll look into it and integrate it in the next Peace version. The moving of the Window message registration to _midi_Startup seems logical. Thanks. And the chms look very nice, very clean. Great work!1 point -
error unir pdfs - (Moved)
argumentum reacted to stiv for a topic
@Danp2 I validated spaces and quotes and it didn't work for me, if I went without finding the error. however I found a useful script that unifies them. Run("pdftk.exe C:\Users\jpelayo\Documents\prueba\cuota.pdf C:\Users\jpelayo\Documents\prueba\reporte.pdf cat output C:\Users\jpelayo\Documents\prueba\archivo_unificado.pdf") I would have liked to do it with pdf24.1 point -
Here an example how - to read treeview items from file or save to. - Move treeview items up/down - left/right Enjoy, Reinhard edit: Inserted _GUICtrlTreeView_Begin../..EndUpdate($hTree) ;; ReFran (3.2.12.1) ;; Move treeview items up/down - left/right ;; Read treeview items from file or save to. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUITreeView.au3> #include <StaticConstants.au3> DIM $Childs DIM $TvFileNm = @scriptDir &"\" &"TvItems.txt" $hMain = GUICreate("Treeview", 342, 183, 341, 278, -1798701056, 256) $hTree = GUICtrlCreateTreeView(6, 6, 200, 150, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $generalitem = GUICtrlCreateTreeViewItem("General", $hTree) $aboutitem = GUICtrlCreateTreeViewItem("About", $generalitem) $compitem = GUICtrlCreateTreeViewItem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewItem("User", $generalitem) $useritem1 = GUICtrlCreateTreeViewItem("1.User", $useritem) $useritem2 = GUICtrlCreateTreeViewItem("2.User", $useritem) $compitem3 = GUICtrlCreateTreeViewItem("Schmuser", $generalitem) $compitem4 = GUICtrlCreateTreeViewItem("Looser", $generalitem) $displayitem = GUICtrlCreateTreeViewItem("Display", $hTree) $resitem = GUICtrlCreateTreeViewItem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewItem("Other", $displayitem) $Btn_TvToFile = GUICtrlCreateButton("To file", 240, 10, 50, 25) $Btn_TvClear = GUICtrlCreateButton("Clear", 240, 37, 50, 25) $Btn_TvFromFile = GUICtrlCreateButton("From file", 240, 65, 50, 25) $Btn_up = GUICtrlCreateButton("Up", 240, 110, 25, 25) $Btn_dn = GUICtrlCreateButton("Dn", 270, 110, 25, 25) $Btn_left = GUICtrlCreateButton("<-", 240, 140, 25, 25) $Btn_right = GUICtrlCreateButton("->", 270, 140, 25, 25) GUICtrlSetState($generalitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "General"-item and paint in bold GUICtrlSetState($displayitem, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ; Expand the "Display"-item and paint in bold GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit ;; TV Read from / Write to example Case $Btn_TvToFile $item = _GUICtrlTreeView_GetFirstItem($hTree) If $item = 0 Then MsgBox(64, "Treeview", "No item in TV") Else TV_Save() endif Case $Btn_TvClear _GuiCtrlTreeView_DeleteAll($hTree) Case $Btn_TvFromFile TV_ReadData() ;; TV move items example Case $Btn_Up TV_ItemMove("up") Case $Btn_Dn TV_ItemMove("dn") Case $Btn_left TV_ItemMove("left") Case $Btn_right TV_ItemMove("right") EndSwitch Sleep(10) WEnd #Region TVMoveItems Func TV_ItemMove($dir);;; Moves Treeview Items $item = _GuiCtrlTreeView_GetSelection($hTree) If $item = 0 Then MsgBox(64, "Treeview", "No item currently selected") Return;;==> return from function Endif $itemText = _GuiCtrlTreeView_GetText($htree,$item) $itemPA = _GUICtrlTreeView_GetParentHandle($hTree, $item) ;; check and prepare to move up if $dir = "up" then ;;new UdF - item will be inserted after, so get prev of prev $itemToPrev = _GuiCtrlTreeView_GetPrevSibling($hTree, $item) $itemTo = _GuiCtrlTreeView_GetPrevSibling($hTree, $itemToPrev) if $itemPa = 0 then;; get the first sibiling item $itemFirstSib = _GUICtrlTreeView_GetFirstItem($hTree) Else $itemFirstSib = _GUICtrlTreeView_GetFirstChild($hTree,$itemPA) endif if $itemFirstSib = $item Then;; first item can not moved up msgbox(0,"","Moving up is not possible") Return;;==> return from function EndIf endif ;; check and prepare to move down if $dir = "dn" then; item will be inserted after, so get next $itemTo = _GuiCtrlTreeView_GetNextSibling($hTree,$item) $itemToNext = _GuiCtrlTreeView_GetNextSibling($hTree,$item) $itemLastSib =_GuiCtrlTreeView_GetLastChild($hTree,$itemPA) if $itemLastSib = $item or $itemto = 0 Then msgbox(0,"","Moving down not possible") return;;==> return from function endif endif ;; check and prepare to move left if $dir = "left" then $itemLevel = _GuiCtrlTreeView_Level($hTree, $item) $itemLevelPa = $itemLevel - 1 if $itemLevel = 0 then msgbox(0,"","Not possible") return;;==> return from function endif $itemTo = $itemPa endif ;; check and prepare to move right if $dir = "right" then $itemLevel = _GuiCtrlTreeView_Level($hTree, $item) if $itemlevel = 0 then $itemFirstSib = _GUICtrlTreeView_GetFirstItem($hTree) Else $itemFirstSib = _GUICtrlTreeView_GetFirstChild($hTree,$itemPa) endif if $item = $itemFirstSib Then msgbox(0,"","Not possible") return;;==> return from function endif $itemTo = _GuiCtrlTreeView_GetPrevSibling($hTree,$item) endif ;;check for children and get it $itemIsParent = _GUICtrlTreeView_GetChildCount($hTree, $item);0 = no childs if $itemIsParent > 0 then $itemLevel = _GuiCtrlTreeView_Level($hTree, $item) $Childs = GetTree($item,$itemLevel,$itemText) endif ;; start to move if $dir = "dn" and $itemToNext = $itemLastSib then $itemInsert = _GuiCtrlTreeView_Add($hTree, $item, $itemText) elseif $dir = "up" and $itemToPrev = $itemFirstSib then $itemInsert = _GuiCtrlTreeView_AddFirst($hTree, $itemtoPrev, $itemText) elseif $dir = "right" then $itemInsert = _GuiCtrlTreeView_AddChild($hTree,$itemto,$itemtext) elseif $dir = "left" and $itemLevelPa > 0 Then $itemPaPa = _GUICtrlTreeView_GetParentHandle($hTree, $itemPA) $itemInsert = _GUICtrlTreeView_InsertItem($htree,$itemText,$itemPaPa,$itemPA) else if $dir = "left" then $itemPa = 0 $itemInsert = _GUICtrlTreeView_InsertItem($htree,$itemText,$itemPA,$itemTo) endif _GuiCtrlTreeView_Delete($htree,$item) ;; add Childs from selected Item to Inserted Item if $itemIsParent > 0 then ;msgbox(0,"",$childs) Dim $hNode[50] $aChilds = StringSplit($Childs, ";") for $i = 1 to $achilds[0]-1 $level = $aChilds[$i] $itemText = $aChilds[$i+1] if $level = $itemLevel then $hNode[$level] = $itemInsert else $hNode[$level]= _GuiCtrlTreeView_AddChild($hTree, $hNode[$level-1],$itemText ) endif $i +=1 next $Childs="" endif _GuiCtrlTreeView_SelectItem($hTree, $itemInsert) EndFunc func GetTree($item,$itemLevel,$itemText);; Get the Tree for Children $itemLevelPa = $itemLevel Do $Childs &= $itemLevel &";" &$itemText &";"; &@lf $item = _GuiCtrlTreeView_GetNext($hTree, $item) $itemLevel = _GuiCtrlTreeView_Level($hTree, $item) $itemText = _GuiCtrlTreeView_GetText($htree,$item) until $itemLevel <= $itemLevelPa; or $itemText = 0 ;MsgBox(0,"",$Childs) return $childs endfunc #EndRegion TVMoveItems #Region TvReadWrite ;;;; Save Treeview Items to file;;;;; func TV_Save();;# added for better reading, one space is added for level $item = _GUICtrlTreeView_GetFirstItem($hTree) $TvList = "" Do $itemText = _GuiCtrlTreeView_GetText($htree, $item) $itemlevel = _GuiCtrlTreeView_Level($htree, $item) $itemSpace = stringleft(" ",$itemlevel) $TvList &= $itemSpace &"#" & $itemText &@LF $item = _GuiCtrlTreeView_GetNext($htree, $item) until $item = 0 msgBox(0,$TvFileNM,$TvList) $FileId = Fileopen($TvFileNM,2) FileWrite($FileId,StringstripWS($TvList,2)) FileClose($FileId) endfunc;;=> TVSave ;;;; Read Treeview Items from file;;;;; ;; # is used as start sign (will not diplayed), space is used for level;; Func TV_ReadData();; Read Data from a TvFile (# as start sign, space for level if not FileExists($TvFileNm) Then MsgBox(0,"","File with TV-Items don't exists!") EndIf Dim $aTree = StringSplit(FileRead($TvFileNM, FileGetSize($TvFileNM)), @LF) TV_Display($aTree) endFunc Func TV_Display($aTree);; Read from variable to TV Dim $hNode[50];Keep Parent on Level _GUICtrlTreeView_BeginUpdate($hTree) For $i = 1 to $aTree[0] $line = StringStripCR($aTree[$i]) ;msgbox(0,"",$line) $level = StringInStr($line, "#") if $level = 0 then exitloop if $level = 1 then $hNode[$level] =_GuiCtrlTreeView_Add($hTree, 0, StringMid($line, $level+1)) Else $hNode[$level]= _GuiCtrlTreeView_AddChild($hTree, $hNode[$level-1], StringMid($line, $level+1)) Endif Next _GUICtrlTreeView_EndUpdate($hTree) EndFunc;;==>End of TV_ReadData #endRegion TvReadWrite1 point