Leaderboard
Popular Content
Showing content with the highest reputation on 07/04/2020 in all areas
-
EasyCodeIt
seadoggie01 and one other reacted to TheDcoder for a file
2 points -
KPScript UDF (KeePass automation)
TheDcoder reacted to seadoggie01 for a topic
This UDF automates KeePass databases through the use of KPScript, a plugin for KeePass that is developed by the original author. This is something I've wanted for a long time. I really like KeePass and I really like using AutoIt, but I feel uncomfortable typing clear text passwords into my scripts. I can only get away with using Send("^!a") to try to get KeePass to input my passwords for me for so long. To download the UDF, head over to GitHub for now (this is easier for me to manage). When I get a release version, I'll update this post with more info and a link to download from the forums. Be sure to read the Notes section, and let me know of any issues, features, or praise you might have!1 point -
A cross-platform implementation of the AutoIt language
argumentum reacted to TheDcoder for a topic
I just finished adding support for all of the leftover types of tokens, and now I have a fully functional tokenizer! The latest code is available on GitHub, and I have also uploaded the latest binary builds here so that you guys can test and give me feedback: There are two files, one each for Windows and Linux, and you guys are smart enough to figure out which is for which Right now the interface is very simple, just download the binary and supply it an .au3 file as the first command-line argument, and it will print out all the tokens. Please report any unknown token errors which occur in valid scripts! Have fun, TheDcoder.1 point -
Wow, @Dan_555, you're awesome! 😎 Once again, I am extremely grateful for your gracious assistance. I was having trouble at first, which appeared to be helped (but not totally solved) by adding a "#forceref" statement, but I no longer think that was necessary because the real problem was where in the code I placed the GUIRegisterMsg() call. My app is now working exactly as I'd hoped, thanks in no small part to you, sir. Hats off!1 point
-
Does RegWrite() require #RequireAdmin?
TheXman reacted to seadoggie01 for a topic
FML. Apparently, $REG_SZ =/= "REG_SZ" and RegWrite doesn't accept the value from AutoItConstants.au3 I don't know why I thought I needed to use the variable, but I did. Please pardon my brain farts. Need more coffee. Edit: But thank you for testing that for me! I really appreciate it1 point -
I'v used the code from picaxe, from here And modified it (with a bit of luck) so that it works with your script: #AutoIt3Wrapper_UseX64=Y ;~ #include "_Dbug.au3" #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <FontConstants.au3> #include <GuiButton.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> AutoItSetOption("MustDeclareVars", 1) AutoItSetOption("GUIOnEventMode", 1) AutoItSetOption("WinTitleMatchMode", 1) AutoItSetOption("GUICloseOnESC", 1 ) ; ; Const $eTitle = "Testing" Local $iFontName = "Courier New", $iFontSize = 12, $iFontWeight = $FW_NORMAL, $iFontAttribs = $GUI_FONTNORMAL Local $dStyle = BitOr($LVS_REPORT, $LVS_ALIGNLEFT, $LVS_SHOWSELALWAYS, $LVS_NOCOLUMNHEADER) Local $dExStyle = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_INFOTIP) Local $iNumWins, $hWin, $iWinClass, $idDummy, $idDummy1, $idDummy2, $aPos[4], $aAcccel[3][2] Local $iMoveThis, $iLeft, $iRight, $bMove, $iMoveTableIndex=10 Global $iNumLVItems Local $sWinTitle, $iThisClassName, $iThisExtStyle, $iThisWinState, $iRetVal Local $idThisID, $dExIndex, $sText, $ig_LVEindx, $hExHdl, $hLViewId ; ; Enter ; Local $idMoveWinGUI = GUICreate("ListView Problems",647,414,-1,-1,BitOr($WS_POPUP,$WS_CAPTION, $WS_SYSMENU, _ $WS_DLGFRAME,$WS_POPUPWINDOW,$WS_VISIBLE),$WS_EX_TOPMOST) Local $idAllBtn = GUICtrlCreateButton("All",188,9,60,30,-1,-1) GUICtrlSetOnEvent(-1,"Ef_All") GUICtrlSetFont(-1,12,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") Local $idNoneBtn = GUICtrlCreateButton("None",360,9,60,30,-1,-1) GUICtrlSetOnEvent(-1,"Ef_None") GUICtrlSetFont(-1,12,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") ;Local $idSizingLabel = GUICtrlCreateLabel("",8,60,602,253,-1,-1) GUICtrlSetBkColor(-1,"-2") Local $idMainRadioBtn = GUICtrlCreateRadio("To Main",208,337,83,20,$BS_CENTER,-1) GUICtrlSetOnEvent(-1,"Ef_ToMain") GUICtrlSetFont(-1,10,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") Local $idLview = GUICtrlCreateListView( "Inventory", 8, 60, 602, 253, $dStyle, $dExStyle) GUIStartGroup() Local $idAltRadioBtn = GUICtrlCreateRadio("To Alt",316,337,83,20,$BS_CENTER,-1) GUICtrlSetOnEvent(-1,"Ef_ToAlt") GUICtrlSetState(-1,BitOr($GUI_UNCHECKED,$GUI_SHOW,$GUI_ENABLE)) GUICtrlSetFont(-1,10,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") Local $idCancelBtn = GUICtrlCreateButton("Cancel",98,336,83,30,-1,-1) GUICtrlSetOnEvent(-1,"Ef_Cancel") GUICtrlSetFont(-1,10,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") GUICtrlSetBkColor(-1,"-2") Local $idOkBtn = GUICtrlCreateButton("OK",459,336,83,30,-1,-1) GUICtrlSetOnEvent(-1,"Ef_OK") GUICtrlSetFont(-1,10,400,0,"Courier New") GUICtrlSetColor(-1,"0x008080") GUICtrlSetBkColor(-1,"-2") GUIStartGroup() ConsoleWrite ($idLview & " - " & @CRLF) GUISetState(@SW_SHOW) GUICtrlSetState( $idMainRadioBtn, $GUI_CHECKED ) GUICtrlSetState( $idAltRadioBtn, $GUI_UNCHECKED ) $hLViewId = ControlGetHandle( $idMoveWinGUI, "", $idLview ) Local $iLViewFont = _WinAPI_CreateFont(14, 6, 0, 0, $FW_NORMAL, False, False, False, $DEFAULT_CHARSET, _ $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $PROOF_QUALITY, $FF_MODERN, "Courier New" ) $iRetVal = GUICtrlSetFont( $idLview, $iFontSize, $iFontWeight, $GUI_FONTNORMAL, $iFontName, $PROOF_QUALITY ) Global $aidListItem[$iMoveTableIndex +1][4] Global $ToolTipText[$iMoveTableIndex +1] $bMove = True _GUICtrlListView_SetColumnWidth( $idLview, 0, 600 ) ; ALWAYS Fails. Why? $iNumLVItems = 0 GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") For $i = 0 To $iMoveTableIndex -1 $sText = "This Is A Somewhat Long String (" & $i & ")" $idThisID = GUICtrlCreateListViewItem( $sText, $idLview ) If ($idThisID = 0) Or ($idThisID = "") Then MsgBox($MB_OK + $MB_TOPMOST, $eTitle, "Error from GUICtrlCreateListViewItem()") Exit -1 EndIf $iRetVal = GUICtrlSetData( $idThisID, $sText ) $iRetVal = GUICtrlSetState( $idThisID, $GUI_SHOW + $GUI_ENABLE ) $iRetVal = GUICtrlSetBkColor( $idThisID, $COLOR_CREAM ) $iRetVal = GUICtrlSetColor( $idThisID, $COLOR_NAVY ) $iRetVal = GUICtrlSetOnEvent( $idThisID, "Ef_ListItemClick" ) ;$iRetVal = GUICtrlSetState( $idThisID, $GUI_ENABLE ) $aidListItem[$i][0]=$idThisID $ToolTipText[$i]="Tooltip text of " & $i $iNumLVItems += 1 Next $idDummy = GUICtrlCreateDummy() $aAcccel[0][0] = "{ENTER}" $aAcccel[0][1] = $idDummy GUICtrlSetOnEvent( $idDummy, "Ef_Accel_Enter" ) $aAcccel[1][0] = "{BACKSPACE}" $aAcccel[1][1] = $idDummy GUICtrlSetOnEvent( $idDummy, "Ef_Accel_SwitchMons" ) $aAcccel[2][0] = "{DELETE}" $aAcccel[2][1] = $idDummy GUICtrlSetOnEvent( $idDummy, "Ef_Accel_SwitchMons" ) GUISetState(@SW_SHOW) $iRetVal = _GUICtrlListView_SetView( $idLview, 1 ) ;GUISetState( @SW_SHOWNORMAL, $idLview ) Local $aSelRow[$iNumLVItems] For $i = 0 To $iNumLVItems -1 $aSelRow[$i] = False Next local $nMSG While True Sleep( 10 ) WEnd Exit 0 Func Ef_SwitchMons() EndFunc Func Ef_ListItemClick() Local $iSelectedRowStr, $iSelectedCtrlID, $iSelectedRowNum, $iVidListIndex, $iFound, $iPrevSelIndex Local $iSelectedVidPath, $iSelectedVidState, $iRetVal, $iColor, $iColorStr, $iPrevSelStr, $iRowNum $iSelectedCtrlID = @GUI_CtrlID $iRowNum = 0 $iFound = False For $i = 0 To $iNumLVItems -1 If $aidListItem[$i][0] = $iSelectedCtrlID Then $iFound = True $iRowNum = $i ExitLoop EndIf Next If Not $iFound Then ;MsgBox($MB_OK + $MB_TOPMOST, $eTitle, "Error - Ef_ListItemClick() was unable to find the list item ID in array!") CW("Error - Ef_ListItemClick() was unable to find the list item ID in array!") return 0 Exit -1 EndIf Local $iSelectedDispRowAra = _GUICtrlListView_GetSelectedIndices( $idLview, True ) If $iSelectedDispRowAra[0] <> 1 Then MsgBox($MB_OK + $MB_TOPMOST, $eTitle, "Gi_ListItemClick(): WIERD - SELECTED ROW COUNT = " & $iSelectedDispRowAra[0]) EndIf ;MsgBox($MB_OK + $MB_TOPMOST, $eTitle, "Gi_ListItemClick(): Selected Row Number = " & $iSelectedDispRowAra[1]) CW("Gi_ListItemClick(): Selected Row Number = " & $iSelectedDispRowAra[1]) $aSelRow[$iRowNum] = True GUICtrlSetBkColor( $iSelectedCtrlID, $COLOR_SKYBLUE ) GUICtrlSetColor( $iSelectedCtrlID, $COLOR_YELLOW ) Return 0 EndFunc Func Ef_ToMain() If Not $bMove Then $bMove = True GUICtrlSetState( $idMainRadioBtn, $GUI_CHECKED ) GUICtrlSetState( $idAltRadioBtn, $GUI_UNCHECKED ) EndIf EndFunc Func Ef_ToAlt() If $bMove Then $bMove = False GUICtrlSetState( $idMainRadioBtn, $GUI_UNCHECKED ) GUICtrlSetState( $idAltRadioBtn, $GUI_CHECKED ) EndIf EndFunc Func Ef_All() ConsoleWrite ($iNumLVItems & " $iNumLVItems " & @CRLF) Local $iD For $i = 0 To $iNumLVItems -1 $iD = $aidListItem[$i][0] $aSelRow[$i] = True GUICtrlSetBkColor( $iD, $COLOR_SKYBLUE ) GUICtrlSetColor( $iD, $COLOR_YELLOW ) Next EndFunc Func Ef_None() Local $iD For $i = 0 To $iNumLVItems -1 $iD = $aidListItem[$i][0] $aSelRow[$i] = False GUICtrlSetBkColor( $iD, $COLOR_CREAM ) GUICtrlSetColor( $iD, $COLOR_NAVY ) Next EndFunc Func Ef_Close() Exit 0 EndFunc Func Ef_Minimize() EndFunc Func Ef_Restore() EndFunc Func Ef_Maximize() EndFunc Func Ef_Cancel() Exit 0 EndFunc Func Ef_Accel_SwitchMons() EndFunc Func Ef_Accel_Enter() Ef_OK() EndFunc Func Ef_OK() MsgBox($MB_OK + $MB_TOPMOST, $eTitle, "Exiting") Exit 0 EndFunc Func CW($txt) ConsoleWrite($txt & @CRLF) EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $iIDFrom Case $idLview Switch $iCode Case $LVN_HOTTRACK Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) Local $iItem = DllStructGetData($tInfo, "Item"), $iSubItem = DllStructGetData($tInfo, "SubItem") If Not ($iItem = -1 Or $iSubItem = -1) Then If $ToolTipText[$iItem] <> "" Then ToolTip($ToolTipText[$iItem]) Else ToolTip("") EndIf Else ToolTip("") EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Copy following to your script: GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") Global $ToolTipText[$iMoveTableIndex +1] Add the tooltip with: $ToolTipText[$i]="Tooltip text of " & $i And, of course the, WM_NOTIFY function.1 point
-
#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> $Form1 = GUICreate("Test", 349, 184, 192, 124) $Input1 = GUICtrlCreateInput("", 40, 24, 161, 21) $Label1 = GUICtrlCreateLabel("", 40, 70, 161, 21) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 $Msg = GUIGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WM_COMMAND($hWinHandle, $iMsg, $wParam, $lParam) If _WinAPI_HiWord($wParam) = $EN_CHANGE And _WinAPI_LoWord($wParam) = $Input1 Then GUICtrlSetData($Label1, GUICtrlRead($Input1)) EndIf EndFunc1 point
-
Hi, Look at the $iMoveTableIndex If you follow the code, there is no definition of how many items it shall hold. and add at least one list view collumn: Local $idLview = GUICtrlCreateListView( "inventory", 8, 60, 602, 253, $dStyle, $dExStyle) and you should move the line: _GUICtrlListView_SetColumnWidth( $idLview, 0, 600 ) ; ALWAYS Fails. Why? before the for loop, and change $idThisID to $idLview And remove Local $idSizingLabel = GUICtrlCreateLabel("",8,60,602,253,-1,-1)1 point
-
$txt = "version 1" & @crlf & _ "nodes" & @crlf & _ "0 ""Bip_Pelvis"" -1" & @crlf & _ @crlf & _ "<...>" & @crlf & _ @crlf & _ "240 ""1FC8040F"" 239" & @crlf & _ "241 ""00000000"" 0" & @crlf & _ "242 ""00000000"" 0" & @crlf & _ "243 ""00000000"" 0" & @crlf & _ "244 ""00000000"" 0" & @crlf & _ "245 ""00000000"" 0" & @crlf & _ "246 ""00000000"" 0" & @crlf & _ "247 ""00000000"" 0" & @crlf & _ "248 ""00000000"" 0" & @crlf & _ "249 ""00000000"" 0" & @crlf & _ "250 ""00000000"" 0" & @crlf & _ "251 ""00000000"" 0" & @crlf & _ "252 ""00000000"" 0" & @crlf & _ "253 ""00000000"" 0" & @crlf & _ "254 ""00000000"" 0" & @crlf & _ "255 ""00000000"" 0" & @crlf & _ "256 ""Bip_BackWind_Helper"" 11" & @crlf & _ "257 ""Bip_UpperArmTwist_R"" 13" & @crlf & _ "258 ""Bip_UpperArmTwist_L"" 17" & @crlf & _ @crlf & _ "<...>" ; Msgbox(0,"", $txt) Local $iReplace = 0, $sOutput = "'" & StringReplace($txt, "'", "''") & "'" $sOutput = Execute ( StringRegExpReplace($sOutput, "(00000000)("")", _ "' & 'Bip_$1' & '_'" & _ " & StringFormat('%02i', Assign(""iReplace"", Eval(""iReplace"")+1) * Eval(""iReplace""))" & _ " & '$2 ' & '") ) MsgBox(0, "", $sOutput) Hmmm. Possibly something simpler exists ...1 point
-
Hi, i had a bit of free time, so i could fix your code to work: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 548, 437, 192, 124) $ListView1 = GUICtrlCreateListView("Name | Description", 15, 10, 255, 377) $Input1 = GUICtrlCreateInput("net", 305, 12, 224, 21) $Button1 = GUICtrlCreateButton("Button1", 309, 72, 55, 27) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $iniFile = "Config.ini" While 1 $nMSG = GUIGetMsg() If $nMSG = $Button1 Then _GUICtrlListView_DeleteAllItems($ListView1) $array = IniReadSectionNames($iniFile) ; Is there anything in the input? $sText = GUICtrlRead($Input1) ; search If StringLen($sText) <> 0 Then ; Create a list of matches Local $aMatch_List[1] = [0] $iStart = 1 For $i = 1 To UBound($array) - 1 $desc = IniRead($iniFile, $array[$i], "Desc", "") ; Look for the match If StringInStr($array[$i], $sText) Then ; Add to list $aMatch_List[0] += 1 ReDim $aMatch_List[$aMatch_List[0] + 1] $aMatch_List[$aMatch_List[0]] = $array[$i] & "|" & $desc ;$ desc[$ i] don't want to work because desc is not an array EndIf Next ; Add matches to ListView _GUICtrlListView_BeginUpdate($ListView1) For $i = 1 To $aMatch_List[0] GUICtrlCreateListViewItem($aMatch_List[$i], $ListView1) Next _GUICtrlListView_EndUpdate($ListView1) Else ; Reload everything ;ContinueCase EndIf EndIf If $nMSG = $GUI_EVENT_CLOSE Then Exit WEnd1 point
-
Basic example: #include <Array.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> Global $g_idListView, $g_idSearch Example() Func Example() GUICreate("listview items", 220, 250) $g_idListView = GUICtrlCreateListView("Section Name|Description", 10, 10, 200, 150) ;,$LVS_SORTDESCENDING) Local $idButton = GUICtrlCreateButton("Search", 75, 170, 70, 20) Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $g_idListView) Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $g_idListView) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $g_idListView) $g_idSearch = GUICtrlCreateInput("", 20, 200, 150) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton _Search() EndSwitch WEnd EndFunc Func _Search() Local $sSearch = GUICtrlRead($g_idSearch) ;~ No Search text added, so return to Gui If StringStripWS($sSearch, 8) = "" Then Return Local $sConfig = @ScriptDir & "\Config.ini" Local $sDesc, $aSectionNames = IniReadSectionNames($sConfig) If @error Then Return ;~ Delete all items from the list view _GUICtrlListView_DeleteAllItems($g_idListView) For $i = 1 To $aSectionNames[0] If StringInStr($aSectionNames[$i], $sSearch) Then $sDesc = IniRead($sConfig, $aSectionNames[$i], "Desc", "") If StringStripWS($sDesc, 8) = "" Then ContinueLoop GUICtrlCreateListViewItem($aSectionNames[$i] & "|" & $sDesc, $g_idListView) EndIf Next EndFunc1 point
-
[SOLVED] Capture active window?
krasnoshtan reacted to Yashied for a topic
$ActiveWindow = WinGetHandle("[active]")1 point