rm4453

File Open Keeps Repeating Itself.

2 posts in this topic

#1 ·  Posted (edited)

I have a problem with my code where the File Open keeps opening itself... This gui is not fully functional. I am trying to allow the user to select an image for each of the image buttons, when they do all I want to grab is the full file path ex: C:\windows\user\username\images\image.jpg to a variable. "I am just diving into guis myself and have used Koda for most of this form generation. The custom code I have either written myself " most of it " or got help for it on here or the help files. I have searched for at least an hour now and can't seem to figure out what is causing the infinite loop where the file open box continually opens... I am sure its something simple like changing the state of the button that was clicked back to not clicked however I can't figure out how to do that or if that is even the answer... Here is all of the code I can share "This is an NDA project so I will have to take some parts out that are non pertinent etc...."  (ANY * are edits to protect the NDA any missing lines are as well.... :D)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <***Login.au3>

$section = "Test"
$Item_Wanted = "false"
$For_Sale = "true"
$Business_Listing = "false"
$Private_Listing = "true"
$Posts = 0
$Submit = 0
$SaveListingSettings = 0
$Image1_Description = 0
$Image2_Description = 0
$Image3_Description = 0
$Image4_Description = 0
$Image5_Description = 0
$Image6_Description = 0
$Description1 = 0
$Description2 = 0
$Description3 = 0
$Description4 = 0
$Image1_Pressed = 0

; AutoItSetOption ("GUIOnEventMode", 1)

Func ReadIni()

;Login Info
Global $Email_ini = IniRead("Settings.ini", $section, "Email", "Email")
Global $Password_ini = IniRead("Settings.ini", $section, "Password", "Password")

;Listing Info
Global $Price_ini = IniRead("Settings.ini", $section, "Price", "0")
Global $Title_ini = IniRead("Settings.ini", $section, "Title", "Title Example")

  ;Listing Type
Global $For_Sale_ini = IniRead("Settings.ini", $section, "For_Sale", "True")
Global $Item_Wanted_ini = IniRead("Settings.ini", $section, "Item_Wanted", "False")

If $For_Sale_ini = "false" Then
    GUICtrlSetState($Item_Wanted, 1)
Else
    If $For_Sale_ini = "true" Then
        GUICtrlSetState($For_Sale, 1)
    EndIf
EndIf


  ;Business Or Private
Global $Business_Listing_ini = IniRead("Settings.ini", $section, "Business_Listing", "False")
Global $Private_Listing_ini = IniRead("Settings.ini", $section, "Private_Listing", "True")

If $Private_Listing_ini = "false" Then
    GUICtrlSetState($Business_Listing, 1)
Else
    If $Private_Listing_ini = "true" Then
        GUICtrlSetState($Private_Listing, 1)
    EndIf
EndIf


  ;Image FilePaths and Descriptions
Global $Image1_ini = IniRead("Settings.ini", $section, "Image1", "C:\image1.jpg")
Global $Image1_Description_ini = IniRead("Settings.ini", $section, "Image1_Description", "Default Descrip")
Global $Image2_ini = IniRead("Settings.ini", $section, "Image2", "C:\image2.jpg")
Global $Image2_Description_ini = IniRead("Settings.ini", $section, "Image2_Description", "Default Descrip")
Global $Image3_ini = IniRead("Settings.ini", $section, "Image3", "C:\image3.jpg")
Global $Image3_Description_ini = IniRead("Settings.ini", $section, "Image3_Description", "Default Descrip")
Global $Image4_ini = IniRead("Settings.ini", $section, "Image4", "C:\image4.jpg")
Global $Image4_Description_ini = IniRead("Settings.ini", $section, "Image4_Description", "Default Descrip")
Global $Image5_ini = IniRead("Settings.ini", $section, "Image5", "C:\image5.jpg")
Global $Image5_Description_ini = IniRead("Settings.ini", $section, "Image5_Description", "Default Descrip")
Global $Image6_ini = IniRead("Settings.ini", $section, "Image6", "C:\image6.jpg")
Global $Image6_Description_ini = IniRead("Settings.ini", $section, "Image6_Description", "Default Descrip")

  ;Listing Descriptions
Global $Description1_ini = IniRead("Settings.ini", $section, "Description1", "Default Descrip")
Global $Description2_ini = IniRead("Settings.ini", $section, "Description2", "Default Descrip")
Global $Description3_ini = IniRead("Settings.ini", $section, "Description3", "Default Descrip")
Global $Description4_ini = IniRead("Settings.ini", $section, "Description4", "Default Descrip")

  ;Contact Info
Global $Phone1_ini = IniRead("Settings.ini", $section, "Phone1", "888")
Global $Phone2_ini = IniRead("Settings.ini", $section, "Phone2", "999")
Global $Phone3_ini = IniRead("Settings.ini", $section, "Phone3", "9090")
Global $Address_ini = IniRead("Settings.ini", $section, "Address", "491 S 231 E")
Global $City_ini = IniRead("Settings.ini", $section, "City", "Sandy")
Global $State_ini = IniRead("Settings.ini", $section, "State", "WA")
Global $Zip_ini = IniRead("Settings.ini", $section, "Zip", "84119")

  ;Post Interval in Minutes
Global $Post_Interval_In_Minutes_ini = IniRead("Settings.ini", $section, "Post_Interval_In_Minutes", "10")

EndFunc

Func Gui()
$***AutoPoster = GUICreate("*** Auto Poster", 615, 437, 340, 172)
$LoginInfo = GUICtrlCreateGroup("Login Info", 8, 8, 177, 113)
$Submit = GUICtrlCreateButton("Submit", 58, 84, 75, 25)


GUICtrlSetTip(-1, "Verify Login Information")
Global $Email = GUICtrlCreateInput($Email_ini, 23, 31, 145, 21)
GUICtrlSetTip(-1, "*** Email")
Global $Password = GUICtrlCreateInput($Password_ini, 23, 57, 145, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
GUICtrlSetTip(-1, "*** Password")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $ListingInfo = GUICtrlCreateGroup("Listing Info", 200, 8, 401, 417)
Global $Price = GUICtrlCreateInput($Price_ini, 232, 40, 137, 21)
GUICtrlSetTip(-1, "Asking Price For Listing")
Global $Title = GUICtrlCreateInput($Title_ini, 232, 72, 137, 21)
GUICtrlSetTip(-1, "Title Of Listing")
Global $ListingType = GUICtrlCreateGroup("Listing Type", 376, 24, 193, 81)
Global $For_Sale = GUICtrlCreateRadio("For Sale", 384, 39, 193, 21)
GUICtrlSetTip(-1, "Is Item For Sale")
Global $Item_Wanted = GUICtrlCreateRadio("Item Wanted", 384, 71, 193, 21)
GUICtrlSetTip(-1, "Are You Looking For Item")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Business_or_Private = GUICtrlCreateGroup("Business or Private", 232, 112, 337, 65)
Global $Business_Listing = GUICtrlCreateRadio("Business Listing", 248, 136, 137, 25)
GUICtrlSetTip(-1, "Is This A Business Listing")
Global $Private_Listing = GUICtrlCreateRadio("Private Listing", 408, 136, 137, 25)
GUICtrlSetTip(-1, "Is This A Private Listing")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $ContactInfo = GUICtrlCreateGroup("Contact Info", 232, 312, 337, 73)
Global $Phone1 = GUICtrlCreateInput($Phone1_ini, 237, 330, 33, 21)
GUICtrlSetTip(-1, "Phone Number Area Code")
Global $Phone3 = GUICtrlCreateInput($Phone3_ini, 317, 330, 33, 21)
GUICtrlSetTip(-1, "Last 4 Numbers Of Phone Number")
Global $Phone2 = GUICtrlCreateInput($Phone2_ini, 277, 330, 33, 21)
GUICtrlSetTip(-1, "First 3 Numbers Of Phone Number")
Global $Address = GUICtrlCreateInput($Address_ini, 360, 328, 201, 21)
GUICtrlSetTip(-1, "Address For Listing")
Global $City = GUICtrlCreateInput($City_ini, 360, 352, 49, 21)
GUICtrlSetTip(-1, "City For Listing")
Global $State = GUICtrlCreateInput($State_ini, 416, 352, 97, 21)
GUICtrlSetTip(-1, "State For Listing (Only Use Abrieviations)")
Global $Zip = GUICtrlCreateInput($Zip_ini, 520, 352, 41, 21)
GUICtrlSetTip(-1, "Zip Code For Listing")
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $SaveListingSettings = GUICtrlCreateButton("Save Listing Settings", 456, 392, 114, 25)


GUICtrlSetTip(-1, "Save Listing Settings")
Global $Post_Interval_In_Minutes = GUICtrlCreateInput($Post_Interval_In_Minutes_ini, 232, 392, 209, 21)
GUICtrlSetTip(-1, "How Often Program Should Auto Post (Will Be Randomized Somewhat For Validity)")
Global $Description1_Button = GUICtrlCreateButton($Description1_ini, 232, 189, 145, 49)


Global $Description2_Button = GUICtrlCreateButton($Description2_ini, 426, 189, 145, 49)


Global $Description3_Button = GUICtrlCreateButton($Description3_ini, 232, 252, 145, 49)


Global $Description4_Button = GUICtrlCreateButton($Description4_ini, 426, 252, 145, 49)


GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Select_Images = GUICtrlCreateGroup("Select Images", 8, 136, 177, 89)
Global $Image1 = GUICtrlCreateButton($Image1_ini, 16, 160, 41, 25)


Global $Image2 = GUICtrlCreateButton($Image2_ini, 69, 160, 41, 25)


Global $Image3 = GUICtrlCreateButton($Image3_ini, 128, 160, 41, 25)


Global $Image4 = GUICtrlCreateButton($Image4_ini, 17, 192, 41, 25)


Global $Image5 = GUICtrlCreateButton($Image5_ini, 69, 192, 41, 25)


Global $Image6 = GUICtrlCreateButton($Image6_ini, 129, 192, 41, 25)


GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $PostCounter = GUICtrlCreateGroup("Post Counter", 8, 240, 177, 65)
Global $TotalPosts = GUICtrlCreateLabel("Total Posts", 32, 267, 57, 18)
Global $PostCount = GUICtrlCreateLabel($Posts, 104, 267, 50, 18)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $ListingSelection = GUICtrlCreateGroup("Listing Selection", 8, 312, 177, 113)
Global $SelectListing = GUICtrlCreateButton("Select Listing", 24, 336, 145, 33)


Global $BeginSubmission = GUICtrlCreateButton("Begin Submission", 24, 376, 145, 33)


GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
EndFunc


Func OpenImages()
    $message = "Please Find and Select Your Image."
    $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.gif)")
    FileChangeDir(@ScriptDir)
    Global $imagePath = $var
    ;$filepathmsg = MsgBox("Path","Here is File Path", $imagePath)
EndFunc

$Save_Section = 1
Func SaveIni()
    IniWrite ( "Settings.ini", $Save_Section, "Email", GUICtrlRead($Email))
    IniWrite ( "Settings.ini", $Save_Section, "Password", GUICtrlRead($Password))
    IniWrite ( "Settings.ini", $Save_Section, "Price", GUICtrlRead($Price))
    IniWrite ( "Settings.ini", $Save_Section, "Title", GUICtrlRead($Title))
    IniWrite ( "Settings.ini", $Save_Section, "For_Sale", GUICtrlRead($For_Sale))
    IniWrite ( "Settings.ini", $Save_Section, "Item_Wanted", GUICtrlRead($Item_Wanted))
    IniWrite ( "Settings.ini", $Save_Section, "Business_Listing", GUICtrlRead($Business_Listing))
    IniWrite ( "Settings.ini", $Save_Section, "Private_Listing", GUICtrlRead($Private_Listing))
    IniWrite ( "Settings.ini", $Save_Section, "Image1", GUICtrlRead($Image1))
    IniWrite ( "Settings.ini", $Save_Section, "Image1_Description", GUICtrlRead($Image1_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Image2", GUICtrlRead($Image2))
    IniWrite ( "Settings.ini", $Save_Section, "Image2_Description", GUICtrlRead($Image2_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Image3", GUICtrlRead($Image3))
    IniWrite ( "Settings.ini", $Save_Section, "Image3_Description", GUICtrlRead($Image3_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Image4", GUICtrlRead($Image4))
    IniWrite ( "Settings.ini", $Save_Section, "Image4_Description", GUICtrlRead($Image4_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Image5", GUICtrlRead($Image5))
    IniWrite ( "Settings.ini", $Save_Section, "Image5_Description", GUICtrlRead($Image5_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Image6", GUICtrlRead($Image6))
    IniWrite ( "Settings.ini", $Save_Section, "Image6_Description", GUICtrlRead($Image6_Description))
    IniWrite ( "Settings.ini", $Save_Section, "Description1", GUICtrlRead($Description1))
    IniWrite ( "Settings.ini", $Save_Section, "Description2", GUICtrlRead($Description2))
    IniWrite ( "Settings.ini", $Save_Section, "Description3", GUICtrlRead($Description3))
    IniWrite ( "Settings.ini", $Save_Section, "Description4", GUICtrlRead($Description4))
    IniWrite ( "Settings.ini", $Save_Section, "Phone1", GUICtrlRead($Phone1))
    IniWrite ( "Settings.ini", $Save_Section, "Phone2", GUICtrlRead($Phone2))
    IniWrite ( "Settings.ini", $Save_Section, "Phone3", GUICtrlRead($Phone3))
    IniWrite ( "Settings.ini", $Save_Section, "Address", GUICtrlRead($Address))
    IniWrite ( "Settings.ini", $Save_Section, "City", GUICtrlRead($City))
    IniWrite ( "Settings.ini", $Save_Section, "State", GUICtrlRead($State))
    IniWrite ( "Settings.ini", $Save_Section, "Zip", GUICtrlRead($Zip))
    IniWrite ( "Settings.ini", $Save_Section, "Post_Interval_In_Minutes", GUICtrlRead($Post_Interval_In_Minutes))
EndFunc


$GuiOpened = 1
$im = 1

While 1 = 1
    If $GuiOpened = 1 Then
        ReadIni()
        Gui()
        ReadIni()
        $GuiOpened = 2
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Submit
            $email = $Email_ini
            $pass = $Password_ini
            Login()
        Case $SaveListingSettings
            $Save_Section = InputBox("Listing Name", "Please Type The Name For Your Listing", "EXAMPLE: Blue Blanket")
            SaveIni()
        Case $Image1
            OpenImages()
            Global $Image1 = $imagePath
            Global $Image1_Description = GUICtrlCreateEdit("Image Description", 615, 437, 50, 40)

    EndSwitch
WEnd

 

Edited by rm4453
Code would not insert so I Posted Topic then added Code

Share this post


Link to post
Share on other sites

rm4453,

The first time you run the script, $Image1 is set the controlID of the button as intended - thus the Switch functions correctly. However, as soon as that button fires, you run the OpenImages functions and reset the variable to what seems to be the string returned from the FileOpenDialog call within the function:

Case $Image1
    OpenImages()
    Global $Image1 = $imagePath

As AutoIt expects a number within the Switch statement it tries to convert that string to a number - which as the string will always start with a letter - will result in $Image1 being set to 0. That is the default return from GUIGetMsg when there are no events to process - and so the $Image1 case fires on every pass.

Solution: Do not reuse variables which refer to ControlIDs.

M23

P.S. That code is, quite frankly, appallingly written - for example, you declare practically every Global variable within a function. I think a complete recast of the code would be a very good idea.

P.P.S Having just seen this line:

GUICtrlSetTip(-1, "How Often Program Should Auto Post (Will Be Randomized Somewhat For Validity)")

I have also decided that this is not a script we are prepared to support. Having to make that sort of statement leads me to believe that the site which you are attempting to spam would not approve of the script being used. Thread closed - PM me if you wish to explain why you feel I should reopen it.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • Valnurat
      By Valnurat
      I have a ComboBox and I want, when I start writting in it, that it will show me what is the first in the list.
      Like, is I start writting:
      "pe" it  should show me "peter" if that is the first in the list.
      How can I do that?
       
      While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClos ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) Local $iIdx = _ArraySearch($aResult,$sComboRead,0,0,0,0,1,1) Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _ArrayDelete($aComputerOwner,0) _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) If IsArray($aComputerOwner) Then For $i = 0 To UBound($aComputerOwner) - 1 GUICtrlCreateListViewItem($aComputerOwner[$i], $idMylist) Next Else GUICtrlSetData($idMylist, "No computer|") EndIf EndSwitch WEnd  
    • Valnurat
      By Valnurat
      Hi.
      I'm trying to add an array to my gui listview, but it fails with
      "C:\Program Files (x86)\AutoIt3\Include\GuiListView.au3" (473) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: DllStructSetData($tBuffer, "Text", $aItems[$iI][0]) DllStructSetData($tBuffer, "Text", ^ ERROR My code is:
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #Include <AD.au3> #include <Array.au3> Opt('MustDeclareVars', 1) Global $aResult[0][2] Local $aNames[4] = ["DKSO","DKKO","SELU","SEES"] Local Const $iWidth = 300, $iHeight = 250, $iW = 85, $iH = 25 Local $hGUI = GUICreate("Find Computer Owner", $iWidth, $iHeight) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("", 2, 2, 296, 20, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL, $CBS_SORT)) ;$WS_VSCROLL Local $idMylist = GUICtrlCreateListView("", 2, 114, 296, 100) Local $idClos = GUICtrlCreateButton("Close", ($iWidth - $iW) / 2, ($iHeight - $iH) - 7 , $iW, $iH) _AD_Open() Local $sFill = "" For $i = 0 to UBound($aNames) -1 Local $aUserInfo = _AD_GetObjectsInOU("OU=Al,DC=ad,DC=al,DC=org","(&(objectCategory=Person)(objectclass=user)(sAMAccountName=" & $aNames[$i] & "*))","","distinguishedName,cn") if @error Then MsgBox(0,@error,@extended) Exit EndIf For $x = $aUserInfo[0][0] To 1 Step -1 If $aUserInfo[$x][0] = "" Or StringInStr($aUserInfo[$x][0], "Resources") > 0 Or StringInStr($aUserInfo[$x][0], "Leavers") > 0 Or StringInStr($aUserInfo[$x][0], "Administration") > 0 Then _ArrayDelete($aUserInfo, $x) EndIf Next _ArrayConcatenate($aResult, $aUserInfo, 1) Next for $i = 0 To UBound($aResult) -1 If $aResult[$i][0] <> "" Then $sFill &= $aResult[$i][1] & "|" EndIf Next _ArrayDisplay($aResult, 'AD ' & UBound($aResult)) $sFill = StringTrimRight($sFill, 1) _GUICtrlComboBox_BeginUpdate($idComboBox) GUICtrlSetData($idComboBox, $sFill, "") _GUICtrlComboBox_EndUpdate($idComboBox) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _GUICtrlListView_AddColumn($idMylist, "Computername", 296) Local $sComboRead = "" ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClos ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) Local $iIdx = _ArraySearch($aResult,$sComboRead,0,0,0,0,1,1) Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _ArrayDelete($aComputerOwner,0) _ArrayDisplay($aComputerOwner) _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) If IsArray($aComputerOwner) Then MsgBox(0,"Test",$sComboRead) _GUICtrlListView_AddArray($idMylist, $aComputerOwner) ; <---- it fails Else GUICtrlSetData($idMylist, "No computer|") EndIf EndSwitch WEnd _AD_Close() ; Delete the previous GUI and all controls. GUIDelete($hGUI) Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $idMylist If Not IsHWnd($idMylist) Then $hWndListView = GUICtrlGetHandle($idMylist) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @CRLF & _ "+======================================================" & @CRLF & _ "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _ "+======================================================" & @CRLF) EndFunc ;==>_DebugPrint Do I do it wrong?
       
      Thank you in advanced.
    • Trisha
      By Trisha
      I tried (using AutoIt) to automate a scenario where i  have to open IE with specific URL on my extranet(Xen Desktop or Citrix ) ,from there i need to download  file and then through WinSCP; I  have to move that file to another location that can be access from my Local system using VMWare.
      I did as far as the above step. Now i want to navigate from my extranet to my local desktop system. But i am not able to move  from there.Mouse click is also not working.Please find the below screenshot highlighted in YELLOW.
       


    • bbk4163
      By bbk4163
      Hi, 
      I am getting "array variable has incorrect number of subscripts dimension range exceeded" error while executing exe. Not sure what is wrong here. 
      #include <MsgBoxConstants.au3> SelectWindowBasedOnTitle() Func SelectWindowBasedOnTitle()     $winList = WinList()     $wTitle = CheckWindows($winList)    IF $wTitle == "Choose File to Upload" Then             IE()    ElseIf $wTitle == "Open" Then             Chrome()    Else             FireFox()    EndIf EndFunc Func CheckWindows($aArray)     For $i = 1 To Ubound($aArray) - 1         If WinActive($aArray[$i][1]) Then $wTitle= $aArray[$i][0] ;MsgBox(0, "Window Check", $aArray[$i][0] & " is active.")     Next     Return $wTitle EndFunc Func Example()     $wText = WinGetText("[ACTIVE]") EndFunc Func IE()     ControlFocus("Choose File to Upload","","Edit1")     ControlSetText("Choose File to Upload","","Edit1",$CmdLine[1])     ControlClick("Choose File to Upload","","Button1") EndFunc Func Chrome()     ControlFocus("Open","","Edit1")     ControlSetText("Open","","Edit1",$CmdLine[1])     ControlClick("Open","","Button1") EndFunc Func FireFox()     ControlFocus("File Upload","","Edit1")     ControlSetText("File Upload","","Edit1",$CmdLine[1])     ControlClick("File Upload","","Button1") EndFunc  
    • TheWizEd
      By TheWizEd
      How do I work with 2D arrays.  I've tried this but get errors.
      Local $aTest[4][4] = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]
      ;$aTest[0][] = [10,11,12]  ; Error at []
      Local $sTest = ""
      For $i = 0 To UBound($aTest)-1
        Local $aExtract = _ArrayExtract($aTest,$i,$i)
        $sTest = $sTest & MyTest($aExtract)
      Next
      Func MyTest($aTemp)
        _ArrayDisplay($aTemp)
        ; Error at    v $aTemp
        Return String($aTemp[0]) & " - " & String($aTemp[1]) & " - " & String($aTemp[2]) & @CRLF
      EndFunc