Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/11/2017 in all areas

  1. There's probably a better way but this is my attempt #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <TreeViewConstants.au3> #include <WindowsConstants.au3> #include <guitreeview.au3> Opt('GUIOnEventMode', 1) GUICreate("Form1", 528, 298) GUISetOnEvent($GUI_EVENT_CLOSE, 'ProgramClose') Global $h_Next = 0 Global $i_TreeViewID = GUICtrlCreateTreeView(8, 8, 505, 193) Global $i_SearchInputID = GUICtrlCreateInput("Type the name to search", 184, 216, 153, 21) GUICtrlCreateButton("Search", 184, 248, 155, 25) GUICtrlSetOnEvent(-1, 'FindSelectedItem') LoadTreeView() ; load the treeview GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func FindSelectedItem() Local $h_SearchItem = _GUICtrlTreeView_FindItem($i_TreeViewID, GUICtrlRead($i_SearchInputID), True, $h_Next) _GUICtrlTreeView_SelectItem($i_TreeViewID, $h_SearchItem) _GUICtrlTreeView_EnsureVisible($i_TreeViewID, $h_SearchItem) If Not $h_SearchItem Then $h_Next = 0 MsgBox(0, 'That''s All Folks', 'All search strings found') Else $h_Next = _GUICtrlTreeView_GetNext($i_TreeViewID, $h_SearchItem) EndIf EndFunc ;==>FindSelectedItem Func LoadTreeView() _GUICtrlTreeView_BeginUpdate($i_TreeViewID) Local $i_ParentID = GUICtrlCreateTreeViewItem("First", $i_TreeViewID) For $i = 1 To 15 GUICtrlCreateTreeViewItem($i, $i_ParentID) GUICtrlSetOnEvent(-1, 'UpdateSearchBox') Next $i_ParentID = GUICtrlCreateTreeViewItem("Second", $i_TreeViewID) For $i = 16 To 30 GUICtrlCreateTreeViewItem($i, $i_ParentID) GUICtrlSetOnEvent(-1, 'UpdateSearchBox') Next _GUICtrlTreeView_EndUpdate($i_TreeViewID) EndFunc ;==>LoadTreeView Func UpdateSearchBox() If Not $h_Next Then GUICtrlSetData($i_SearchInputID, _GUICtrlTreeView_GetText($i_TreeViewID, GUICtrlRead($i_TreeViewID))) EndFunc ;==>UpdateSearchBox Func ProgramClose() Exit EndFunc ;==>ProgramClose
    1 point
  2. It worked for me when no other instance of IE was loaded. If you have other active tabs, then you will need to adjust the _IEAttach or come up with another way to get the reference to the correct IE instance.
    1 point
  3. Looks like you'll need to use _IEAttach to get a valid reference to the created IE instance. Here's one way to do it -- #include <IE.au3> #include <MsgBoxConstants.au3> _IECreate("C:\Users\april\Documents\Logo\JRB\AutoIt\AutoBOT\AWD10\sampleAWD10.html",0,1,0) Local $oIE = _IEAttach("", "instance", 1) _IELoadWait($oIE) Local $oLastName = _IEGetObjByName($oIE, "Text4") Local $oGetItem = _IEGetObjByName($oIE, "getitem") _IEAction($oGetItem, "click") MsgBox($MB_SYSTEMMODAL, "Form Element Value", _IEFormElementGetValue($oGetItem))
    1 point
  4. pintas, This simple example works for me: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Global $aList[5] = [1, 2, 3, 4, 5] $hGUI = GUICreate("Test", 500, 500) $cCombo = GUICtrlCreateCombo("", 8, 16, 153, 25) ; The required styles are included by default _FillCombo() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cCombo _ActionCombo(GUICtrlRead($cCombo)) EndSwitch WEnd Func _ActionCombo($sChoice) ; Get index of choice in array $iIndex = _ArraySearch($aList, $sChoice) ; And delete it _ArrayDelete($aList, $iIndex) ; Refill combo _FillCombo() MsgBox($MB_SYSTEMMODAL, "Combo reloaded", "You selected " & $sChoice & @CRLF & " which has now been removed from the combo") EndFunc Func _FillCombo() $sData = "" For $i = 0 To UBound($aList) - 1 $sData &= "|" & $aList[$i] Next GUICtrlSetData($cCombo, $sData) EndFunc Much easier to work with the original array rather than the combo. M23
    1 point
  5. 10 bucks a line, I haven't heard prices like that since college.
    1 point
  6. Just made a big release (v0.1.5), where I've gotten more IntelliSense features working Added in function signature helpers (parameter info) See it in action AutoIt commands and keybindings now only show/activate in AutoIt files Debug MsgBoxes and Debug Consoles now match the indent of the line that they're generated from Marketplace Link
    1 point
  7. colish65

    RoboCopy GUI

    I have used robocopy but sorry I cant try another version of it. Yes its good that you have made a GUI version of it, earlier it felt like hacking or something. It does not provide long path name support. I started to look for other software and found that GS Richcopy works very well and it is simple to use, no reading manuals to use a software. It provides NTFS support, multi threaded file transfer, long path name support, email notification when transfer is done, and above all it does not require you to read a manual first then start using it like robocopy does! Hope it helped you all!
    1 point
  8. Valuater

    Autoit Wrappers

    Faldo.... Please start your question in the "Support" forum or PM the Author ; Get the execuatble path of a window ; Author gafrost $path = _WinGetPath() MsgBox(0,WinGetTitle(""),$path) Func _WinGetPath($Title="", $strComputer='localhost') $win = WinGetTitle($Title) $pid = WinGetProcess($win) $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE ProcessId = " & $pid, "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) Then For $objItem In $colItems If $objItem.ExecutablePath Then Return $objItem.ExecutablePath Next EndIf EndFunc 8)
    1 point
×
×
  • Create New...