Sign in to follow this  
Followers 0
nKiNG121

GUI Buttons

7 posts in this topic

#1 ·  Posted (edited)

Hi Guys , I am totally new and I need help..,.

I created a simple GUI using Koda and I created two buttons .I added the script into Scite . Now how do I program the buttons .

I want button1 to download a file to C:/new/    and the button2 to extract the downloaded zip file in that folder and run the extracted file. How do i do that.I know how to download files using AutoIT but i don't know how to change download directory . It never downloads to my selected directory . But i don't know how to add the command to a button . Pls help

Edited by nKiNG121

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

Can you please post the code you have so far? Makes helping you much easier ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Downloader", 360, 220, 313, 246)
GUISetFont(8, 400, 0, "Myriad Hebrew")
$Button1 = GUICtrlCreateButton("Download", 48, 56, 241, 41)
$Button2 = GUICtrlCreateButton("Install", 48, 120, 241, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
 
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
 
Case $Button2
EndSwitch
WEnd
Edited by nKiNG121

Share this post


Link to post
Share on other sites

The help file is your friend :) Check function GUICtgrlCreateButton. At the end you will find an example.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Okay thanks,.,. but how do I change the download location to c:/new

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

#include <GUIConstantsEx.au3>
 
Download()
 
Func Download()
    Local $Button_1, $Button_2, $msg
GUICreate("Downloader", 360, 220, 313, 246)
GUISetFont(8, 400, 0, "Myriad Hebrew")
    Opt("GUICoordMode", 2)
    $Button1 = GUICtrlCreateButton("Download", 48, 56, 241, 41)
$Button2 = GUICtrlCreateButton("Instal",  -240, 40,241, 41)
 
    GUISetState()
 
       While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case $msg = $Button_1
InetGet("example.com","win32.zip")
EndSelect
    WEnd
EndFunc   
 
 
 
++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
This script downloads the file to the desktop but how to change it to C:/New.
 
 
Also How can I make a progress bar to show download progress and also edit Inetget so that if the file already exists then it shows a message box
Edited by nKiNG121

Share this post


Link to post
Share on other sites

The example in the Help file for InetGet is pretty clear.

Are you using the Helpfile?

Are you using SciTE to make using the Help file even easier?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0