Jump to content
Sign in to follow this  
rawrr

Help me..

Recommended Posts

So heres my script..

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("WoW", 30, 30, 80, 32, 23)
$btn2 = IconButton("Firefox", 300, 30, 80, 32, 23)
$btn3 = IconButton("Aim", 165, 30, 70, 32, 23)
$btn4 = Iconbutton("Limewire", 90, 90, 100, 32, 23)
$btn5 = Iconbutton("Photoshop", 230, 90, 100, 32, 23)
$btn6 = Iconbutton("Websites", 165, 150, 100, 32, 23)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then run ("C:\Program Files\World Of Warcraft\Wow.exe")
    If $msg = $btn2 Then run ("C:\Program Files\Mozilla Firefox\firefox.exe")
    If $msg = $btn3 Then run ("C:\Program Files\AIM\aim.exe")
    If $msg = $btn4 Then run ("C:\Program Files\Limewire\Limewire.exe")
    If $msg = $btn5 Then run ("C:\Program Files\Adobe\Adobe Photoshop CS3\Photoshop.exe")
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
    
Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

I'm making easy access to some of my stuff.. I need help because I want button 6.. "Websites" to open up another GUI so I can list some cool websites for easy access.. I know this is probably done somewhere, but I wanted to give it a shot.

Thanks in advance.

EDIT: Oh! I'm sorry, I think this is supposed to be in GUI help.. =( Sorry..

Edited by rawrr

Share this post


Link to post
Share on other sites

Something like this?

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("WoW", 30, 30, 80, 32, 23)
$btn2 = IconButton("Firefox", 300, 30, 80, 32, 23)
$btn3 = IconButton("Aim", 165, 30, 70, 32, 23)
$btn4 = Iconbutton("Limewire", 90, 90, 100, 32, 23)
$btn5 = Iconbutton("Photoshop", 230, 90, 100, 32, 23)
$btn6 = Iconbutton("Websites", 165, 150, 100, 32, 23)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then run ("C:\Program Files\World Of Warcraft\Wow.exe")
    If $msg = $btn2 Then run ("C:\Program Files\Mozilla Firefox\firefox.exe")
    If $msg = $btn3 Then run ("C:\Program Files\AIM\aim.exe")
    If $msg = $btn4 Then run ("C:\Program Files\Limewire\Limewire.exe")
    If $msg = $btn5 Then run ("C:\Program Files\Adobe\Adobe Photoshop CS3\Photoshop.exe")
    If $msg = $btn6 Then _CreateChild()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
    
Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

Func _CreateChild()
    GUISetState(@SW_DISABLE,$mywin)
    $Child=GUICreate("Websites",200,200,-1,-1,-1,-1,$mywin)
    GUISetState()
    While 1
        $msg1 = GUIGetMsg()
        Switch $msg1
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($Child)
    GUISetState(@SW_ENABLE,$mywin)
    
    Return
EndFunc

Share this post


Link to post
Share on other sites

Something like this?

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("WoW", 30, 30, 80, 32, 23)
$btn2 = IconButton("Firefox", 300, 30, 80, 32, 23)
$btn3 = IconButton("Aim", 165, 30, 70, 32, 23)
$btn4 = Iconbutton("Limewire", 90, 90, 100, 32, 23)
$btn5 = Iconbutton("Photoshop", 230, 90, 100, 32, 23)
$btn6 = Iconbutton("Websites", 165, 150, 100, 32, 23)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then run ("C:\Program Files\World Of Warcraft\Wow.exe")
    If $msg = $btn2 Then run ("C:\Program Files\Mozilla Firefox\firefox.exe")
    If $msg = $btn3 Then run ("C:\Program Files\AIM\aim.exe")
    If $msg = $btn4 Then run ("C:\Program Files\Limewire\Limewire.exe")
    If $msg = $btn5 Then run ("C:\Program Files\Adobe\Adobe Photoshop CS3\Photoshop.exe")
    If $msg = $btn6 Then _CreateChild()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
    
Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

Func _CreateChild()
    GUISetState(@SW_DISABLE,$mywin)
    $Child=GUICreate("Websites",200,200,-1,-1,-1,-1,$mywin)
    GUISetState()
    While 1
        $msg1 = GUIGetMsg()
        Switch $msg1
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($Child)
    GUISetState(@SW_ENABLE,$mywin)
    
    Return
EndFunc

Thanks a lot. It helped =).

Share this post


Link to post
Share on other sites

Bumping. Sorry for double post.. But I have another question..

Whats the code to make a site come up?

if $msg = $btn11 then
What goes after "then"? Say I want to open this website..

Can I have the code so that it opens in Internet Explorer

And

Mozilla Firefox, please?

Thanks!!

Edited by rawrr

Share this post


Link to post
Share on other sites

For internet explorer, an option is:

_IECreate("url")

I don't know how to pass an url to Firefox, but if it's your default browser then this will work:

ShellExecute("www.google.com")

Share this post


Link to post
Share on other sites

For internet explorer, an option is:

_IECreate("url")

I don't know how to pass an url to Firefox, but if it's your default browser then this will work:

ShellExecute("www.google.com")

I'm trying now.. Thanks!

EDIT: None of them work..

Edited by rawrr

Share this post


Link to post
Share on other sites

So It would be..

if $msg = $btn11 then _IECreate("www.google.com")

or

if $msg = $btn11 then ShellExecute("www.google.com")

They didn't work like that.

Share this post


Link to post
Share on other sites

Would you mind using this and telling me if the message box appears?

if $msg = $btn11 then MsgBox(0,"","Yup, the button works")

Share this post


Link to post
Share on other sites

Try this. There's clearly something wrong in yuor code, not in mine.

; Icon on Button - (made easy)
; Author - Valuater

#include <GUIConstants.au3>

$mywin = GUICreate("my gui")
$btn1 = IconButton("WoW", 30, 30, 80, 32, 23)
$btn2 = IconButton("Firefox", 300, 30, 80, 32, 23)
$btn3 = IconButton("Aim", 165, 30, 70, 32, 23)
$btn4 = Iconbutton("Limewire", 90, 90, 100, 32, 23)
$btn5 = Iconbutton("Photoshop", 230, 90, 100, 32, 23)
$btn6 = Iconbutton("Websites", 165, 150, 100, 32, 23)
GUISetState()
While 1
    $msg = GUIGetMsg()
    If $msg = $btn1 Then run ("C:\Program Files\World Of Warcraft\Wow.exe")
    If $msg = $btn2 Then run ("C:\Program Files\Mozilla Firefox\firefox.exe")
    If $msg = $btn3 Then run ("C:\Program Files\AIM\aim.exe")
    If $msg = $btn4 Then run ("C:\Program Files\Limewire\Limewire.exe")
    If $msg = $btn5 Then run ("C:\Program Files\Adobe\Adobe Photoshop CS3\Photoshop.exe")
    If $msg = $btn6 Then _CreateChild()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
   
Func IconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum, $BIDLL = "shell32.dll")
    GUICtrlCreateIcon($BIDLL, $BIconNum, $BIleft + 5, $BItop + (($BIheight - 16) / 2), 16, 16)
    GUICtrlSetState( -1, $GUI_DISABLE)
    $XS_btnx = GUICtrlCreateButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $WS_CLIPSIBLINGS)
    Return $XS_btnx
EndFunc

Func _CreateChild()
    GUISetState(@SW_DISABLE,$mywin)
    $Child=GUICreate("Websites",200,200,-1,-1,-1,-1,$mywin)
    $Google=GUICtrlCreateButton("Google",50,50)
    GUISetState()
    While 1
        $msg1 = GUIGetMsg()
        Switch $msg1
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $Google
                ShellExecute("www.google.com")
        EndSwitch
    WEnd
    GUIDelete($Child)
    GUISetState(@SW_ENABLE,$mywin)
   
    Return
EndFunc

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  

×
×
  • Create New...