Jump to content

Simmy

Active Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by Simmy

  1. HI guys hope you are all well. You kind people have helped me learn how to keep a form on top of all other windows with $WS_EX_TOPMOST What Id like to be able to do now, is that for any message boxes that come up due to actions in the script, that those message boxes be "on top" of the main form, which has the $WS_EX_TOPMOST set. Currently, if you select an item from the combo box, the message box is fired, but is hidden by the main form because the main form has the extended style set to $WS_EX_TOPMOST. Is there a way to say that any windows that pop up as a result of this form, or clicking on something that generates a window such as a msgbox from this form, that those windows be on top, and thus not hidden from view because they are behind the main form? Here is my code: #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; you need to include this one to use the $WS_EX_TOPMOST style _Main() Func _Main() Local $hCombo, $iCombo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Output the exe list to a text file. Skip the echo is on line, by using skip=1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $listpath = @ScriptDir & '\apps\*.exe' RunWait(@ComSpec & ' /c for /f "tokens=* delims=\ skip=1" %a in (''dir /S /B ' & $listpath & ' /A-D'') do @echo %a >> grplist.txt','',@SW_HIDE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a form. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;guicreate("title",width,height,left,top,style,exstyle) ;GUICreate('Executables', 500, 300) ; GUICreate('Executables', 500, 300,,$WS_EX_TOPMOST) GUICreate("", 500, 500, -1, -1, -1, $WS_EX_TOPMOST) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a combo to hold the data. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) ;Don't put a title in as this will create an entry in the combo box. ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) $iCombo = GUICtrlCreateCombo("", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a button to press. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Button1 = GUICtrlCreateButton("Run ", 10, 30, 100) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Open the file in order to read it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileOpen = FileOpen('grplist.txt', 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Add error-handling for file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If $FileOpen = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the data of the combo by looping through the file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $line = FileReadLine($FileOpen) If $line = "" Then ExitLoop If @error = -1 Then ExitLoop GUICtrlSetData($iCombo,$line) Wend ;_FileReadToArray ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the default visible entry in the combobox with this function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Close the file to free resources. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FileClose($FileOpen) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Show the form since forms are hidden by default. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Keep the form open until you close it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Do ;Until GUIGetMsg() = $GUI_EVENT_CLOSE While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $programLocation = GUICtrlRead($iCombo) MsgBox(0, "Error", $programLocation) ;Run ("Notepad") Run ($programLocation) EndSwitch WEnd EndFunc ;==>_Main Any help greatly appreciated.
  2. Thanks Guinness. Champion.
  3. Thanks guiness. Im getting an error when I use this: D:\test\test.au3(23,58) : WARNING: $WS_EX_TOPMOST: possibly used before declaration. GUICreate('Executables', 500, 300, $WS_EX_TOPMOST) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ D:\test\test.au3(23,58) : ERROR: $WS_EX_TOPMOST: undeclared global variable. The includes I have at the top of the script are: #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3>
  4. Hi guys, I have tried to use your logic sleepy and guiness. Thank you so much guys. The code working is below. #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> _Main() Func _Main() Local $hCombo, $iCombo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Output the exe list to a text file. Skip the echo is on line, by using skip=1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $listpath = @ScriptDir & '\apps\*.exe' RunWait(@ComSpec & ' /c for /f "tokens=* delims=\ skip=1" %a in (''dir /S /B ' & $listpath & ' /A-D'') do @echo %a >> grplist.txt','',@SW_HIDE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a form. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICreate('Executables', 500, 300) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a combo to hold the data. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) ;Don't put a title in as this will create an entry in the combo box. ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) $iCombo = GUICtrlCreateCombo("", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a button to press. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Button1 = GUICtrlCreateButton("Run ", 10, 30, 100) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Open the file in order to read it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileOpen = FileOpen('grplist.txt', 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Add error-handling for file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If $FileOpen = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the data of the combo by looping through the file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $line = FileReadLine($FileOpen) If $line = "" Then ExitLoop If @error = -1 Then ExitLoop GUICtrlSetData($iCombo,$line) Wend ;_FileReadToArray ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the default visible entry in the combobox with this function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Close the file to free resources. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FileClose($FileOpen) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Show the form since forms are hidden by default. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Keep the form open until you close it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Do ;Until GUIGetMsg() = $GUI_EVENT_CLOSE While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $programLocation = GUICtrlRead($iCombo) MsgBox(0, "Error", $programLocation) ;Run ("Notepad") Run ($programLocation) EndSwitch WEnd EndFunc ;==>_Main
  5. Thanks again guinness and sleepydvdr. I will try these things out.
  6. Hi Sleepydvdr, That's awesome thank you mate.
  7. Hi guys, Id like to be able to keep the form on top of other windows. Is there a parameter with GUICreate to do this? Thanks in advance.
  8. Hi guys hope you are well. I have the following code, which I would like to add to. What I would like to do is explained in the attached snippet, but briefly, I would like to add a button to the form, which when clicked, would fire off whatever is selected in the combo box. Any help greatly appreciated. #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> _Main() Func _Main() Local $hCombo, $iCombo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Output the exe list to a text file. Skip the echo is on line, by using skip=1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $listpath = @ScriptDir & '\apps\*.exe' RunWait(@ComSpec & ' /c for /f "tokens=* delims=\ skip=1" %a in (''dir /S /B ' & $listpath & ' /A-D'') do @echo %a >> grplist.txt','',@SW_HIDE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a form. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICreate('Executables', 500, 300) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a combo to hold the data. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) ;Don't put a title in as this will create an entry in the combo box. ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) $iCombo = GUICtrlCreateCombo("", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Open the file in order to read it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileOpen = FileOpen('grplist.txt', 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Add error-handling for file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If $FileOpen = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the data of the combo by looping through the file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $line = FileReadLine($FileOpen) If $line = "" Then ExitLoop If @error = -1 Then ExitLoop GUICtrlSetData($iCombo,$line) Wend ;_FileReadToArray ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the default visible entry in the combobox with this function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Close the file to free resources. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FileClose($FileOpen) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Show the form since forms are hidden by default. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Keep the form open until you close it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main
  9. Thanks somdcomputerguy much appreciated.
  10. Hi guys hope you are all well and can help. Guys hopefully you can clarify if what Im needing here is to understand more about the following" ...What constitutes multi-dimensional arrays versus single arrays . ...How you get different data appearing on the same line in a delimited format as opposed to starting a new line. Im not entirely sure, but ill try and explain what im trying to do and hopefully you kind gurus will shed light on what you do in similar circumstances. ================================================ Scenario 1: Gettting a file list ================================================ Let's say I want to get a list of files from a folder and do the same thing...write this information to a file, so it looks like below: ============================= data.txt d:\test\file1.txt d:\test\file2.txt d:\test\file3.txt How would you write that information so that each new entry, was actually on the same line, so it would look like below: ============================= data.txt d:\test\file1.txt, d:\test\file2.txt, d:\test\file3.txt Also, would this be called on 1 dimensional array, since we are only talking about the "dimension" - filelist? ================================================ Scenario 2: Gettting cpu, memory etc in a list ================================================ Let's say I want to audit a machine, and get information about cpu, memory, etc, and write this information to a file. Instead of each type of data eg.cpu, memory, appearing on its own line, I wanted that data to appear comma-delimited on a single line, so maybe something like below: ============================= data.txt cpu, 2GHz, memory, 1024MB Sorry if im a bit vague here, and probably asking more than one question in the same one. Im trying to understand moreso, how you typically build or format data into a text file when you are talking about multiple types of information. I know this would vary for what your end goal is, but any help or examples would be of great help to myself and greatly appreciated.
  11. Hi guys, thanks so much for your help. I did try Joon to use Melbas _RecFileListToArray.au3, but because Im a newbie or just plain thick, I just could not get it to work. I could not work out the right parameters to use with it. Should I post another question about how to use that?
  12. Guinness, for all the help you guys do on here, never a need to apologize. Thank you mate.
  13. Hi guys hope you are all well. I have the following script that works nearly as I would like it, but not quite. What it does is read a list of .exe files in subfolders. It does this by using the dir command with a /B and /S switch and writes to a text file the file names. That file is then read one line at a time and fed into the combo box with GUICtrlSetData. What I would like to do now is to: a) When I click on one of the entries in the list, I want to fire off the exe that has been selected. If I close that particular exe selected, I want the original form to remain there so I can select another in the list. Any help greatly appreciated. #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> _Main() Func _Main() Local $hCombo, $iCombo ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Output the exe list to a text file. Skip the echo is on line, by using skip=1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RunWait(@ComSpec & ' /c for /f "tokens=* delims=\ skip=1" %a in (''dir apps /B /S .exe'') do @echo %a >> grplist.txt','',@SW_HIDE) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a form. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICreate('Executables', 500, 300) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Create a combo to hold the data. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;$iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) ;Don't put a title in as this will create an entry in the combo box. $iCombo = GUICtrlCreateCombo("", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Open the file in order to read it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileOpen = FileOpen('grplist.txt', 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Add error-handling for file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If $FileOpen = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the data of the combo by looping through the file. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $line = FileReadLine($FileOpen) If $line = "" Then ExitLoop If @error = -1 Then ExitLoop GUICtrlSetData($iCombo,$line) Wend ;_FileReadToArray ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Set the default visible entry in the combobox with this function. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Close the file to free resources. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FileClose($FileOpen) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Show the form since forms are hidden by default. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUISetState(@SW_SHOW) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Keep the form open until you close it. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main
  14. Thank you guinness and BrewManNH. Ive been working on this, but taking a different approach. Thanks so much.
  15. Trying to get the files inside of Test\Apps\<subfolders> Eg. Test\Apps\app1 Test\Apps\app2 Test\Apps\app3
  16. Hi Guinness, Ive given it a go, but not getting the result I thought I would. Here is what I have so far: #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> #include "RecFileListToArray.au3" _Main() Func _Main() Local $aFileList, $hCombo, $iCombo, $sString ;$aFileList = _FileListToArray(@ScriptDir, "*.*", 1) ;$aFileList = _RecFileListToArray(@ScriptDir & "\apps\", "*") $aFileList = _RecFileListToArray(@ScriptDir & "\apps\", "*", 1, 1, 1, 1, "") If @error Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf For $A = 1 To $aFileList[0] $sString &= _GetFilename($aFileList[$A]) & "|" Next GUICreate('Example Combo', 500, 300) $iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) GUICtrlSetData($iCombo, "|" & $sString) _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func _GetFilename($sFilePath) ; Returns Example $sFilePath = Example.txt Local $iPosition = StringInStr($sFilePath, ".", 0, -1) If $iPosition = 0 Then Return SetError(1, 0, 0) EndIf Return StringLeft($sFilePath, $iPosition - 1) EndFunc ;==>_GetFilename
  17. Hi Guinness, sorry I cant find your example. Im pretty new to this forum. I dont know where to look in your signature for _BinaryBin()
  18. Hi Guiness, thanks for that. I ran your code, and that gives the filenames in the CURRENT directory, but not in the subfolders. For example, d:\test\test.au3 d:\test\app.exe d:\test\appa.exe d:\test\appb.exe This will return in the combo box, app appa appb But it wont get: d:\test\apps\app1\app1.exe d:\test\apps\app2\app2.exe d:\test\apps\app3\app3.exe d:\test\apps\app4\app4.exe
  19. Hi Guiness, I used $aFileList = _FileListToArray(@ScriptDir & "\apps", "*.exe", 1) and found I needed to specify the full path to A folder eg. $aFileList = _FileListToArray(@ScriptDir & "\apps\app1", "*.exe", 1) But that lists on the exes inside app1. I want to list all the exes inside every subfolder, eg.app1, app2, app3 of @ScriptDir & "\apps Would I need to: $aFileList = _FileListToArray(@ScriptDir & "\apps\app1", "*.exe", 1) $aFileList = _FileListToArray(@ScriptDir & "\apps\app2", "*.exe", 1) $aFileList = _FileListToArray(@ScriptDir & "\apps\app3", "*.exe", 1) etc for every subfolder, or, would I need to somehow loop through each? or use a dir like DIR @ScriptDir\apps\*.exe /S /B > FileList.txt and then somehow read this list into an array? DIR C:\Target\*.* /S /B > FileList.txt" and then parse the file (this actually turns out to be faster than many scripted
  20. Guiness you are amazing, I will do now.
  21. Hi guys, hope you are all well and can assist. A guru on here has helped me with the following code, which works great. #include <Array.au3> #include <File.au3> #include <GUIComboBox.au3> #include <GUIConstantsEx.au3> _Main() Func _Main() Local $aFileList, $hCombo, $iCombo $aFileList = _FileListToArray(@ScriptDir & "\apps", "*.*", 2) If @error Then MsgBox(0, "", "No Files\Folders Found.") Exit EndIf GUICreate('SOMETITLE', 500, 300) $iCombo = GUICtrlCreateCombo("Select A Folder", 30, 75, 220, 200) $hCombo = GUICtrlGetHandle(-1) GUICtrlSetData($iCombo, "|" & _ArrayToString($aFileList, "|", 1)) _GUICtrlComboBox_SetEditText($hCombo, "Select A Folder") GUISetState(@SW_SHOW) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main What the above does is list the folders underneath @ScriptDir & "\apps", and show them in a combo box. So, for example: In the combobox, you have: app1 app2 app3 Which are subfolders of d:\test\apps Instead of listing the subfolders in the combo box, I would like to list the exes (filenames only minus ".exe") inside each of these subfolders in the combo box. So, for example: Currently -------------------------------------------> What I would like app1 app1.exe (which is inside d:\test\apps\app1) app2 app2.exe (which is inside d:\test\apps\app2) app3 app3.exe (which is inside d:\test\apps\app3) So, I think I need to loop through each of these subfolders, scanning for *.exe and then populate the combo box. Would really appreciate your guys help. I have attached a screenshot.
  22. Awesome guiness. Thank you again. I hope its okay to post questions on here. I am new to autoit but really love learning it and learning off you kind gurus.
  23. Hi Guiness, Thank you so much. That is brilliant! There is only one thing Id like modified in this example, and that is, Im trying to work out how to remove the entry in the dropdown for the count of elements in the array. Ive attached a screendump of what I mean. Thanks so much for your great help.
  24. Hi guys, I hope you are all well and can help. I have the following code, which simply lists folders in a combo box. What Id like it to do, is when you load the form, have the combo box have a message in the textbox area of the combo box, to indicate what to do. I currently DO have this. It says "test". But, it also lists "test" as a selection in the combo box, which I dont want. Is there a way guys, to list it just in the textbox area of the combo box, but not listed as an option in the dropdown? Ive attached a screenshot. Any help greatly appreciated. #Include <File.au3> #Include <Array.au3> #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> $FileList=_FileListToArray(@DesktopDir,"*.*", 2) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf GUICreate('SOMETITLE', 500, 300) $combo = GuiCtrlCreateCombo("Select a folder",30, 75, 220, 200) GuiCtrlSetData($combo, "|" & _ArrayToString($FileList)) $iIndex = _GUICtrlComboBox_AddString($combo, "test") _GUICtrlComboBox_SetCurSel($combo, $iIndex) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE
  25. Thanks Guiness really appreciate it mate.
×
×
  • Create New...