Jump to content

Open A new Window?


Recommended Posts

Hello,

I'm new to AutoIt and I decided yesterday that I would try it out as it seems like a great program to work with.

I'm currently making a program that launches various things: WoW, WoW Site, TS, Vent, About.

My question is, How can I make it so that when people click on the "About" button it opens up a new window with the info, etc. on it?

I have done the GUI using the GUIBuilder. Below Is my main window.

CODE
#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

$mainwindow = GuiCreate("Launcher v0.1 BETA", 282, 259,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$LauncherPic = GuiCtrlCreatePic("Launcher.jpg", 50, 20, 180, 40) ; Picture

$LaunchWoW = GuiCtrlCreateButton("Launch WoW", 50, 80, 190, 20) ; Launch World of Warcraft

$WoWSite = GuiCtrlCreateButton("WoW Site", 50, 110, 190, 20) ; Launch www.worldofwarcraft.com

$LaunchVent = GuiCtrlCreateButton("Launch Vent", 50, 140, 190, 20) ; Laumch Ventrillo if you have it

$LaunchTS = GuiCtrlCreateButton("Launch TS", 50, 170, 190, 20) ; Launch TeamSpeak if you have it

$About = GuiCtrlCreateButton("About", 50, 200, 190, 20) ; Launch the about window with information on this program

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

And this is my About window.

CODE
#region --- GuiBuilder code Start ---

; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

GuiCreate("About", 296, 180,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Label_1 = GuiCtrlCreateLabel("Launcher is a small program that is designed to make launching World Of Warcraft and Other related programs easier. ", 20, 50, 250, 50)

$Pic_2 = GuiCtrlCreatePic("About.jpg", 80, 10, 140, 40)

$Label_3 = GuiCtrlCreateLabel("Copyright © 2006 alien13 All Rights reserved.", 40, 120, 270, 20)

$Button_4 = GuiCtrlCreateButton("Email", 90, 140, 120, 20)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

I also have a couple other questions. How do I get it to open the Programs mentioned above? I know how to make it open them but where do I put the code?

Thanks, alien13 (n00b)

Link to comment
Share on other sites

Here is my updated code:

Main Window:

CODE
#include <GuiConstants.au3>

GuiCreate("Launcher v0.2", 303, 294,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Launcher = GuiCtrlCreatePic("Launcher 0.2.jpg", 65, 10, 180, 40) ; Logo

$LaunchWoW = GuiCtrlCreateButton("Launch WoW", 70, 70, 170, 20) ; Launch World of Warcraft

$WoWSiteFF = GuiCtrlCreateButton("WoW Site - FF", 70, 100, 170, 20) ; Launch www.worldofwarcraft.com in FireFox

$WoWSiteIE = GuiCtrlCreateButton("WoW Site - IE", 70, 130, 170, 20) ; Launch www.worldofwarcraft.com in Internet Explorer

$Vent = GuiCtrlCreateButton("Launch Vent", 70, 160, 170, 20) ; Laumch Ventrilo if you have it

$TS = GuiCtrlCreateButton("Launch TS", 70, 190, 170, 20) ; Launch TeamSpeak if you have it

$About = GuiCtrlCreateButton("About", 70, 220, 170, 20) ; Launch the about window with information on Launcher

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

About Window:

CODE
#include <GUIConstants.au3>

GuiCreate("About", 296, 180,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Info = GuiCtrlCreateLabel("Launcher is a small program that is designed to make launching World Of Warcraft and Other related programs easier. ", 20, 50, 250, 50)

$Logo = GuiCtrlCreatePic("About.jpg", 80, 10, 140, 40)

$CR = GuiCtrlCreateLabel("Copyright © 2006 alien13 All Rights reserved.", 40, 120, 270, 20)

$About = GuiCtrlCreateButton("Email", 90, 140, 120, 20)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $ABout

MsgBox(0, "Email", "jimbeam14@gmail.com")

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0, "Thank you", "Feel free to email me about any bugs you may find, or if you have something you would like to see added to the program, Thanks.")

ExitLoop

EndSelect

WEnd

How do I get it to launch the Programs listed?

Thanks, alien13

Link to comment
Share on other sites

I dont have AUtoIt on this comp, but I beleive that should work... just fill in the path variables I commented where to (under ur controls)

CODE
#include <GuiConstants.au3>

GuiCreate("Launcher v0.2", 303, 294,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Launcher = GuiCtrlCreatePic("Launcher 0.2.jpg", 65, 10, 180, 40) ; Logo

$LaunchWoW = GuiCtrlCreateButton("Launch WoW", 70, 70, 170, 20) ; Launch World of Warcraft

$WoWSiteFF = GuiCtrlCreateButton("WoW Site - FF", 70, 100, 170, 20) ; Launch www.worldofwarcraft.com in FireFox

$WoWSiteIE = GuiCtrlCreateButton("WoW Site - IE", 70, 130, 170, 20) ; Launch www.worldofwarcraft.com in Internet Explorer

$Vent = GuiCtrlCreateButton("Launch Vent", 70, 160, 170, 20) ; Laumch Ventrilo if you have it

$TS = GuiCtrlCreateButton("Launch TS", 70, 190, 170, 20) ; Launch TeamSpeak if you have it

$About = GuiCtrlCreateButton("About", 70, 220, 170, 20) ; Launch the about window with information on Launcher

;Define your path variables here

$IEPath=""

$FFPath=""

$WoWPath=""

$VentPath=""

$TeamSpeakPath=""

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg=$WoWSiteIE

run($IEPath & " http://www.worldofwarcraft.com")

Case $msg=$WoWSiteFF

run($FFPath & " http://www.worldofwarcraft.com")

Case $msg=$LaunchWoW

run($WoWPath)

Case $msg=$Vent

run($VentPath)

Case $msg=$TS

run($TeamSpeakPath)

Case $msg=$About

GuiCreate("About", 296, 180,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Info = GuiCtrlCreateLabel("Launcher is a small program that is designed to make launching World Of Warcraft and Other related programs easier. ", 20, 50, 250, 50)

$Logo = GuiCtrlCreatePic("About.jpg", 80, 10, 140, 40)

$CR = GuiCtrlCreateLabel("Copyright © 2006 alien13 All Rights reserved.", 40, 120, 270, 20)

$About = GuiCtrlCreateButton("Email", 90, 140, 120, 20)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $ABout

MsgBox(0, "Email", "jimbeam14@gmail.com")

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0, "Thank you", "Feel free to email me about any bugs you may find, or if you have something you would like to see added to the program, Thanks.")

ExitLoop

EndSelect

WEnd

EndSelect

WEnd

Exit

[sup]Psibernetic[/sup]My Creations:X-HideSecuracy

Link to comment
Share on other sites

Cool, Thanks for the help.

This is just what i wanted. Thanks so much =)

alien13

[Edit]: With the about window, when I go to close it off, the Contact me window shows, I click OK and then it goes back to the about window, then when I go to close it it closes everything off.

What part do I edit to stop it from doing this? (Just a hint if possible)

Thanks again alien13

Edited by alien13
Link to comment
Share on other sites

Ok, I have made my program a little better looking. But I also have a new question now.

Is it possible to have the USER enter the location of the programs on his computer through an input box? (seeing as how not everyone has them under C:\Program Files\ )

I tried something but it didn't work. This is what I tried. (at the time I thought the possiblilty of this working was about 10%)

Here it is.

CODE
#include <GuiConstants.au3>

#include <Skins\XSkin.au3>

$Skin_Folder = @ScriptDir & "\Skins\Sleek" ; Skin Folder

$Icon_Folder = @ScriptDir & "\Skins\Sleek" ; icon folder

$A = True

$B = True

$C = True

$D = True

$E = True

$F = True

FileCreateShortcut(@ScriptDir & "\Launcher v0.3.1b.exe",@DesktopDir & "\Launcher.lnk",@ScriptDir, "Shortcut to Launcher")

$XSkinGui = XSkinGuiCreate("Launcher v0.3.1b", 342, 310, $Skin_Folder)

$XIcon = XSkinIcon($XSkinGui, 2)

$Logo = GuiCtrlCreatePic("Images\Launcher 0.3.1b.jpg", 65, 35, 220, 40) ; Logo

$LaunchWoW = GuiCtrlCreateButton("Launch WoW", 80, 80, 190, 20) ; Launch World of Warcraft

$WoWSiteFF = GuiCtrlCreateButton("WoW Site - FF", 80, 110, 190, 20) ; Launch www.worldofwarcraft.com in FireFox

$WoWSiteIE = GuiCtrlCreateButton("WoW Site - IE", 80, 140, 190, 20) ; Launch www.worldofwarcraft.com in Internet Explorer

$Vent = GuiCtrlCreateButton("Launch Vent", 80, 170, 190, 20) ; Launch Ventrilo if you have it

$TS = GuiCtrlCreateButton("Launch TS", 80, 200, 190, 20) ; Launch TeamSpeak if you have it

$Location = GUICtrlCreateButton("Define Program Locations", 80, 230, 190, 20) ; Define where the above programs are located

$About = GuiCtrlCreateButton("About", 80, 260, 190, 20) ; Launch the about window with information on Launcher

;Define your path variables for A here

If $A = True then $IEPath="C:\internet explorer\iexplore.exe"

If $A = True then $FFPath="C:\Mozilla Firefox\firefox.exe"

If $A = True then $WoWPath="C:\World of Warcraft\Launcher.exe"

If $A = True then $VentPath="C:\Ventrilo\Ventrilo.exe"

If $A = True then $TeamSpeakPath="C:\Teamspeak2_RC2\TeamSpeak.exe"

;Define your path variables for B here

If $B = True then $IEPath="C:\Program Files\internet explorer\iexplore.exe"

If $B = True then $FFPath="C:\Program Files\Mozilla Firefox\firefox.exe"

If $B = True then $WoWPath="C:\Program Files\World of Warcraft\Launcher.exe"

If $B = True then $VentPath="C:\Program Files\Ventrilo\Ventrilo.exe"

If $B = True then $TeamSpeakPath="C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"

;Define your path variables for C here

If $C = True then $IEPath="D:\internet explorer\iexplore.exe"

If $C = True then $FFPath="D:\Mozilla Firefox\firefox.exe"

If $C = True then $WoWPath="D:\World of Warcraft\Launcher.exe"

If $C = True then $VentPath="D:\Ventrilo\Ventrilo.exe"

If $C = True then $TeamSpeakPath="D:\Teamspeak2_RC2\TeamSpeak.exe"

;Define your path variables for D here

If $D = True then $IEPath="D:\Program Files\internet explorer\iexplore.exe"

If $D = True then $FFPath="D:\Program Files\Mozilla Firefox\firefox.exe"

If $D = True then $WoWPath="D:\Program Files\World of Warcraft\Launcher.exe"

If $D = True then $VentPath="D:\Program Files\Ventrilo\Ventrilo.exe"

If $D = True then $TeamSpeakPath="D:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"

;Define your path variables for E here

If $E = True then $IEPath="E:\internet explorer\iexplore.exe"

If $E = True then $FFPath="E:\Mozilla Firefox\firefox.exe"

If $E = True then $WoWPath="E:\World of Warcraft\Launcher.exe"

If $E = True then $VentPath="E:\Ventrilo\Ventrilo.exe"

If $E = True then $TeamSpeakPath="D:\Teamspeak2_RC2\TeamSpeak.exe"

;Define your path variables for F here

If $F = True then $IEPath="E:\Program Files\internet explorer\iexplore.exe"

If $F = True then $FFPath="E:\Program Files\Mozilla Firefox\firefox.exe"

If $F = True then $WoWPath="E:\Program Files\World of Warcraft\Launcher.exe"

If $F = True then $VentPath="E:\Program Files\Ventrilo\Ventrilo.exe"

If $F = True then $TeamSpeakPath="E:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $XIcon[1]

Exit

Case $msg = $XIcon[2]

GUISetState(@SW_MINIMIZE)

Case $msg=$WoWSiteIE

run($IEPath & " http://www.worldofwarcraft.com")

Case $msg=$WoWSiteFF

run($FFPath & " http://www.worldofwarcraft.com")

Case $msg=$LaunchWoW

run($WoWPath)

Case $msg=$Vent

run($VentPath)

Case $msg=$TS

run($TeamSpeakPath)

Case $msg=$Location

$XSkinGUI = XSkinGuiCreate("Program Locations", 332, 230, $Skin_Folder)

$XIcon = XSkinIcon($XSkinGui, 2)

$A = GUICtrlCreateButton("C:\", 90, 60, 140, 20)

$B = GUICtrlCreateButton("C:\Program Files\", 90, 80, 140, 20)

$C = GUICtrlCreateButton("D:\", 90, 100, 140, 20)

$D = GUICtrlCreateButton("D:\Program Files\", 90, 120, 140, 20)

$E = GUICtrlCreateButton("E:\", 90, 140, 140, 20)

$F = GUICtrlCreateButton("E:\Program Files\", 90, 160, 140, 20)

GUISetState(@SW_SHOW)

Case $msg=$About

$XSkinGui = XSkinGuiCreate("About", 300, 180, $Skin_Folder)

$XIcon = XSkinIcon($XSkinGui, 2)

$Logo = GuiCtrlCreatePic("Images\About.jpg", 100, 35, 93, 39)

$Info = GuiCtrlCreateLabel("Launcher is a small program that is designed to make launching World Of Warcraft and Other related programs easier. ", 40, 75, 230, 50)

$CR = GuiCtrlCreateLabel("Copyright © 2007 alien13 All Rights reserved.", 40, 120, 230, 20)

$Email = GuiCtrlCreateButton("Email", 90, 140, 120, 20)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $XIcon[1]

Exit

Case $msg = $XIcon[2]

GUISetState(@SW_MINIMIZE)

Case $msg = $Email

$XSkinGUI = XSkinGuiCreate("Email", 267, 96, $Skin_Folder)

$XIcon = XSkinIcon($XSkinGui, 2)

$Email = GuiCtrlCreateLabel("Email: jimbeam14@gmail.com", 70, 45, 150, 20)

GUISetState(@SW_SHOW)

ExitLoop

EndSelect

WEnd

EndSelect

WEnd

Exit

It didn't work =( Is there a way to do this?

Thanks, alien13.

Also here is the latest release with everything working. (I had to use the one on my site as its too big to attach =( )

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...