Jump to content

Programs Problem!


alien13
 Share

Recommended Posts

Hi,

I'm working on a little program called "Launcher" and I am having a couple of problems.

1. I can't get the Programs to launch once the user has pressed the button.

and

2. I'm not sure how to use the ini commands.

Here is my code for the first problem:

CODE
#include <GuiConstants.au3>

#include <Skins\XSkin.au3>

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

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

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

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

$XIcon = XSkinIcon($XSkinGui, 2)

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

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

$Websites = GuiCtrlCreateButton("Websites", 80, 120, 190, 20) ; Launch the Websites Window

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

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

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

;Define your path variables here

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

$FFPath="C:\Program Files\Mozilla Firefox\firefox.exe"

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

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

$TeamSpeakPath="D:\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=$LaunchWoW

run($WoWPath)

Case $msg=$Vent

run($VentPath)

Case $msg=$TS

run($TeamSpeakPath)

Case $msg = $Websites

$XSkin = XSkinGuiCreate("Websites", 358, 314, $Skin_Folder)

$XIcon = XSkinIcon($XSkinGui, 2)

$WoWSiteFF = GuiCtrlCreateButton("WoW Site FireFox", 70, 50, 220, 20)

$WoWSiteIE = GuiCtrlCreateButton("WoW Site Internet Explorer", 70, 80, 220, 20)

$warSiteFF = GuiCtrlCreateButton("WorldofWar.net FireFox", 70, 110, 220, 20)

$warSiteIE = GuiCtrlCreateButton("WorldofWar.net Internet Explorer", 70, 140, 220, 20)

$CurseFF = GuiCtrlCreateButton("Curse-Gaming FireFox", 70, 170, 220, 20)

$CurseIE = GuiCtrlCreateButton("Curse-Gaming Internet Explorer", 70, 200, 220, 20)

$GoogleFF = GuiCtrlCreateButton("Google FireFox", 70, 230, 220, 20)

$GoogleIE = GuiCtrlCreateButton("Google Internet Explorer", 70, 260, 220, 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=$WoWSiteIE

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

Case $msg=$WoWSiteFF

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

Case $msg=$warSiteIE

run($IEPath & " http://www.worldofwar.net")

Case $msg=$warSiteFF

run($FFPath & " http://www.worldofwar.net")

Case $msg=$CurseFF

run($IEPath & " http://www.curse-gaming.com")

Case $msg=$CurseFF

run($FFPath & " http://www.curse-gaming.com")

Case $msg=$GoogleIE

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

Case $msg=$GoogleFF

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

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

I don't think my Websites window is seeing the

Case $msg=$**

run($*** & " www.***.***")

And here is what I tried to do to get the program to read the ini file so users can choose their program directory's:

CODE
*This is added to my main script*

$IEPath = IniRead("Config.ini", "IE", "IE", 0)

$FFPath = IniRead("Config.ini", "FF", "FF", 0)

$WoWPath = IniRead("Config.ini", "WoW", "WoW", 0)

$VentPath = IniRead("Config.ini", "Vent", "Vent", 0)

$TSPath = IniRead("Config.ini", "TS", "TS", 0)

This is my ini file

[iE]

IE = $IEPath="D:\Program Files\internet explorer\iexplore.exe"

[FF]

FF = $FFPath="C:\Program Files\Mozilla Firefox\firefox.exe"

[WoW]

WoW = $WoWPath="D:\Program Files\World of Warcraft\Launcher.exe"

[Vent]

Vent = $VentPath="D:\Program Files\Ventrilo\Ventrilo.exe"

[TS]

TS = $TeamSpeakPath="D:\Program Files\Teamspeak2_RC2\TeamSpeak.exe"

When I open it, it gives the error : (in my Config.ini file)

[iE]

^ ERROR

Error: Unable to parse line.

Any help would be greatly appreciated.

thanks, alien13

Edited by alien13
Link to comment
Share on other sites

maybe this could help also...

#include <GuiConstants.au3>
#include <XSkin.au3>
$Skin_Folder = @ScriptDir & "\Skins\Defacto"
; icon folder
$Icon_Folder = @ScriptDir & "\Skins\Default"


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

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

$XSkinGui = XSkinGuiCreate ("Launcher v0.3.1b", 342, 280, $Skin_Folder)
$XIcon = XSkinIcon ($XSkinGui, 2)
$Logo = GUICtrlCreatePic("Images\Launcher 0.3.1b.jpg", 65, 35, 220, 40) ; Logo
$LaunchWoW = GUICtrlCreateButton("Launch WoW", 80, 90, 190, 20) ; Launch World of Warcraft
$Websites = GUICtrlCreateButton("Websites", 80, 120, 190, 20) ; Launch the Websites Window
$Vent = GUICtrlCreateButton("Launch Vent", 80, 150, 190, 20) ; Launch Ventrilo if you have it
$TS = GUICtrlCreateButton("Launch TS", 80, 180, 190, 20) ; Launch TeamSpeak if you have it
$About = GUICtrlCreateButton("About", 80, 210, 190, 20) ; Launch the about window with information on Launcher

;Define your path variables here
Global $IEPath = "D:\Program Files\internet explorer\iexplore.exe"
Global $FFPath = "C:\Program Files\Mozilla Firefox\firefox.exe"
Global $WoWPath = "D:\Program Files\World of Warcraft\Launcher.exe"
Global $VentPath = "D:\Program Files\Ventrilo\Ventrilo.exe"
Global $TeamSpeakPath = "D:\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 = $LaunchWoW
            Run($WoWPath)
        Case $msg = $Vent
            Run($VentPath)
        Case $msg = $TS
            Run($TeamSpeakPath)
        Case $msg = $Websites
            WebSites()
            
        Case $msg = $About
            About()
            
            
    EndSelect
WEnd
Exit


Func WebSites()
    GUISetState(@SW_HIDE, $XSkinGui)
    
    $XSkin2 = XSkinGuiCreate ("Websites", 358, 320, $Skin_Folder)
    $XIcon2 = XSkinIcon ($XSkin2, 1)
    $WoWSiteFF = GUICtrlCreateButton("WoW Site FireFox", 70, 50, 220, 20)
    $WoWSiteIE = GUICtrlCreateButton("WoW Site Internet Explorer", 70, 80, 220, 20)
    $warSiteFF = GUICtrlCreateButton("WorldofWar.net FireFox", 70, 110, 220, 20)
    $warSiteIE = GUICtrlCreateButton("WorldofWar.net Internet Explorer", 70, 140, 220, 20)
    $CurseFF = GUICtrlCreateButton("Curse-Gaming FireFox", 70, 170, 220, 20)
    $CurseIE = GUICtrlCreateButton("Curse-Gaming Internet Explorer", 70, 200, 220, 20)
    $GoogleFF = GUICtrlCreateButton("Google FireFox", 70, 230, 220, 20)
    $GoogleIE = GUICtrlCreateButton("Google Internet Explorer", 70, 260, 220, 20)
    GUISetState(@SW_SHOW)
    While 2
        $msg2 = GUIGetMsg()
        Select
            Case $msg2 = $XIcon2[1]
                ExitLoop
            Case $msg2 = $WoWSiteIE
                Run($IEPath & " http://www.worldofwarcraft.com")
            Case $msg2 = $WoWSiteFF
                Run($FFPath & " http://www.worldofwarcraft.com")
            Case $msg2 = $warSiteIE
                Run($IEPath & " http://www.worldofwar.net")
            Case $msg2 = $warSiteFF
                Run($FFPath & " http://www.worldofwar.net")
            Case $msg2 = $CurseFF
                Run($IEPath & " http://www.curse-gaming.com")
            Case $msg2 = $CurseFF
                Run($FFPath & " http://www.curse-gaming.com")
            Case $msg2 = $GoogleIE
                Run($IEPath & " http://www.google.com")
            Case $msg2 = $GoogleFF
                Run($FFPath & " http://www.google.com")
        EndSelect
    WEnd
    GUIDelete($XSkin2)
    GUISetState(@SW_SHOW, $XSkinGui)
EndFunc   ;==>WebSites

Func About()
    GUISetState(@SW_HIDE, $XSkinGui)
    $XSkin3 = XSkinGuiCreate ("About", 300, 200, $Skin_Folder)
    $XIcon3 = XSkinIcon ($XSkin3, 1)
    $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 3
        $msg3 = GUIGetMsg()
        Select
            Case $msg3 = $XIcon3[1]
                ExitLoop
            Case $msg3 = $Email
                $XSkin4 = XSkinGuiCreate ("Email", 267, 110, $Skin_Folder)
                $XIcon4 = XSkinIcon ($XSkin4, 1)
                $My_Email = GUICtrlCreateLabel("Email: jimbeam14@gmail.com", 70, 45, 150, 20)
                GUISetState(@SW_SHOW)
                While 4
                    $msg4 = GUIGetMsg()
                    Select
                        Case $msg4 = $XIcon4[1]
                            GUIDelete($XSkin4)
                            ExitLoop
                    EndSelect
                WEnd
        EndSelect
    WEnd
    GUIDelete($XSkin3)
    GUIDelete($XSkin4)
    GUISetState(@SW_SHOW, $XSkinGui)
EndFunc   ;==>About

*********** BTW if you have a skin "sleek" i would love to see it too

if you could please post it in the XSkin.au3 thread and i will nclude you as a designer

8)

NEWHeader1.png

Link to comment
Share on other sites

Cool, thats perfect =D

Now all I need is to be able to Allow the user to define the location of their programs and im set =)

Thanks for the help =)

/me is off to read the INI* section :)

Oh, and the sleek design is by Bigdaddy(?). Once Ive made a fairly stable version of Launcher I will go onto maybe making a skin. If I do I will let you know =)

Link to comment
Share on other sites

Yay. I did it. It took me about 5-10 seconds for the idea to pop into my head and when I tried it, to my amazement ... IT WORKED :)

Later on I will try and add a setup button that allows users to edit the Config.ini file from inside the program =)

Thanks for all the help guys.

If possible could you maybe test it for me? You can get it from my homepage for it here.

Thanks, alien13

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...