ReconX Posted April 20, 2014 Share Posted April 20, 2014 (edited) I am a beginner to AutoIt. I am trying to get "InetGet" to work with a Checkbox when a button is clicked. This is what I have so far. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <InetConstants.au3> $hGUI = GUICreate("FixIt GUI", 650, 650, -1, -1) $hTab = GUICtrlCreateTab(5, 5, 640, 640) GUICtrlCreateTabItem("Virus Removal Software ") $hButton = GUICtrlCreateButton("Download Selected", 220, 590, 270, 40) $hCheckbox = GUICtrlCreateCheckbox("ComboFix", 270, 140, 130, 30) GUICtrlSetFont(-1, 9, 800, 0) GUICtrlCreateTabItem("") $hCheckbox2 = GUICtrlCreateCheckbox("Eset", 270, 178, 130, 30) GUICtrlSetFont(-1, 8.5, 800, 0) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton If GUICtrlRead($hCheckbox) = $GUI_CHECKED Then Local $dDirCreate DirCreate(@DesktopCommonDir & "\Virus Removal\") DirCreate(@DesktopCommonDir & "\Virus Removal\1- Combofix\") Local $sDownload EndIf EndSwitch WEnd Help would be appreciated. xD Edited April 20, 2014 by ReconX Link to comment Share on other sites More sharing options...
rcmaehl Posted April 21, 2014 Share Posted April 21, 2014 Just add: InetGet("Http://www.urlhe.re/subdirectory/file.exe", @DesktopCommonDir & "\Virus Removal\1- Combofix\file.exe") After Local $sDownload This will download file.exe...Or is there something else you're trying to attempt? My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
Palestinian Posted April 21, 2014 Share Posted April 21, 2014 What rcmaehl said If GUICtrlRead($hCheckBox) = 1 Then InetGet("Http://www.urlhe.re/subdirectory/file.exe", @DesktopCommonDir & "\Virus Removal\1- Combofix\file.exe") EndIf Link to comment Share on other sites More sharing options...
mikell Posted April 21, 2014 Share Posted April 21, 2014 For Checkbox, Radio control several states can be returned. So use i.e. BitAND(GUICtrlRead($Item), $GUI_CHECKED) to test if the control is checked. Thus saith the helpfile Link to comment Share on other sites More sharing options...
BrewManNH Posted April 21, 2014 Share Posted April 21, 2014 (edited) For Checkbox, Radio control several states can be returned. So use i.e. BitAND(GUICtrlRead($Item), $GUI_CHECKED) to test if the control is checked. Thus saith the helpfile It's not necessary to do that, the help file is mistaken in this reference. A checkbox has 3 returns, and it only ever returns one of them at a time. Using GUICtrlGetState it might be that way, but not with GUICtrlRead. The three possible results of using GUICtrlRead on a checkbox are $GUI_CHECKED, $GUI_UNCHECKED and $GUI_INDETERMINATE. BTW, the help file example for GUICtrlGetState uses GUICtrlRead($n) for the checkbox example ($n is the checkbox control ID). Edited April 21, 2014 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
mikell Posted April 21, 2014 Share Posted April 21, 2014 Then it would be a good idea to update the GuiCtrlRead page in the helpfile Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 21, 2014 Moderators Share Posted April 21, 2014 mikell, For Checkbox and Radio controls only the checked, unchecked or indeterminate states are returned - so the value can be used directly.Happy with that text? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
guinness Posted April 21, 2014 Share Posted April 21, 2014 What about adding the constants in parenthesis as well e.g. checked ($GUI_CHECKED), unchecked ($GUI_UNCHECKED) etc..? Just an idea I had. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 21, 2014 Moderators Share Posted April 21, 2014 Guinness, For Checkbox and Radio controls only the $GUI_CHECKED (1), $GUI_UNCHECKED (4) or $GUI_INDETERMINATE (2) states are returned so the value can be used directly.In that case I feel we ought to add some magic numbers as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
guinness Posted April 21, 2014 Share Posted April 21, 2014 I just threw it in my mouth! Thanks Melba23. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 21, 2014 Moderators Share Posted April 21, 2014 All done. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mikell Posted April 21, 2014 Share Posted April 21, 2014 (edited) Melba, it's wonderful Edited April 21, 2014 by mikell Link to comment Share on other sites More sharing options...
ReconX Posted April 22, 2014 Author Share Posted April 22, 2014 I appreciate the help, but I can't seem to get it to work still. I have the code as follows: #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <InetConstants.au3> $hGUI = GUICreate("FixIt GUI", 650, 650, -1, -1) $hTab = GUICtrlCreateTab(5, 5, 640, 640) GUICtrlCreateTabItem("Virus Removal Software ") $hCheckbox = GUICtrlCreateCheckbox("ComboFix", 270, 140, 130, 30) $hButton = GUICtrlCreateButton("Download Selected", 220, 590, 270, 40) GUICtrlSetFont(-1, 9, 800, 0) GUICtrlCreateTabItem("") $hCheckbox2 = GUICtrlCreateCheckbox("Eset", 270, 178, 130, 30) GUICtrlSetFont(-1, 8.5, 800, 0) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton If GUICtrlRead($hCheckbox) = 1 Then InetGet("http://download.bleepingcomputer.com/dl/a1e7b60ed7d85c7f08c6c44d854584b4/5356044d/windows/security/anti-virus/c/combofix/ComboFix.exe", @DesktopCommonDir & "\Combo.exe") Local $sDownload EndIf EndSwitch WEnd From what I am understanding is that this is supposed to download the "ComboFix.exe" from the link to my desktop when the Combofix checkbox is checked, and the button is clicked. Am I not doing something right, or am I just not understanding. What I am trying to do is, when you select the program you want to download, via the check boxes, and click the download button, it downloads from the specified link into whatever directory that was specified. Link to comment Share on other sites More sharing options...
ripdad Posted April 22, 2014 Share Posted April 22, 2014 From: download.bleepingcomputer.com The Download link has expired! The links to our downloads expire after 10 minutes. You will be redirected in three seconds to the proper page to download the program. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
rcmaehl Posted April 23, 2014 Share Posted April 23, 2014 Try downloading from a site that doesn't constantly change it's download pages, that'll fix your problem. My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
t0nZ Posted June 19, 2014 Share Posted June 19, 2014 I don't want to resume a old (?) thread but me too I have to download files (and combofix !) from temporary links. For Combofix I have found in this forum: http://www.bleepingcomputer.com/forums/t/356979/ftpwget-download-combofix/ this advice : it is a variable type "Content from URL (start/end)" on the URL "http://www.bleepingcomputer.com/download/anti-virus/combofix" on the pages code I have marked it out as follows: [start]<td width='20%'><b>BleepingComputer Mirror:</b></td> <td width='25%'><a href="[/start]http://download.bleepingcomputer.com/protected/3351decec84cca5d9acf5f8df74576e7/4d4c1d2e/ComboFix.exe [end]" class="goodurl">ComboFix Download Link</a></td>[/end] select the text in between the [start] brackets for the start marker, and select the text in-between the [end] brackets for the end marker. How to adapt this in AutoIt ? Maybe something from #include <IE.au3> ? Link to comment Share on other sites More sharing options...
t0nZ Posted June 24, 2014 Share Posted June 24, 2014 GOT IT ! See my post: '?do=embed' frameborder='0' data-embedContent>> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now