rawrr Posted December 14, 2007 Share Posted December 14, 2007 (edited) 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 December 14, 2007 by rawrr Link to comment Share on other sites More sharing options...
DjDeep00 Posted December 14, 2007 Share Posted December 14, 2007 @rawrr...Look in the helpfile for an example of "GUISwitch"... Link to comment Share on other sites More sharing options...
Nahuel Posted December 14, 2007 Share Posted December 14, 2007 Something like this? expandcollapse popup; 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 Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 Something like this? expandcollapse popup; 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 =). Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 (edited) 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 December 14, 2007 by rawrr Link to comment Share on other sites More sharing options...
Nahuel Posted December 14, 2007 Share Posted December 14, 2007 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") Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 (edited) 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 December 14, 2007 by rawrr Link to comment Share on other sites More sharing options...
Nahuel Posted December 14, 2007 Share Posted December 14, 2007 haha, yes they do. Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 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. Link to comment Share on other sites More sharing options...
Nahuel Posted December 14, 2007 Share Posted December 14, 2007 Would you mind using this and telling me if the message box appears? if $msg = $btn11 then MsgBox(0,"","Yup, the button works") Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 (edited) No. It does not. Edited December 14, 2007 by rawrr Link to comment Share on other sites More sharing options...
Nahuel Posted December 14, 2007 Share Posted December 14, 2007 Try this. There's clearly something wrong in yuor code, not in mine. expandcollapse popup; 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 Link to comment Share on other sites More sharing options...
rawrr Posted December 14, 2007 Author Share Posted December 14, 2007 Thanks a lot. It worked! 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