Sign in to follow this  
Followers 0
cation

create gui from another gui

14 posts in this topic

I apology if its already asked but i like to ask, is that possible that if i first create GUI, then i create button which create another GUI and when i close that second, it will close only second not that first GUI.

What i have already tried, it wont work on me :/ or i did it work

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi Cation,

It is possible by using functions, have a look at the below.

#include 
#include 

Main()

Func Main()
GUICreate("Main", 300, 300)
$next = GUICtrlCreateButton("Show Second GUI", 20, 20, 100, 20)

GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $next
Second()
EndSelect
WEnd
EndFunc

Func Second()
$second = GUICreate("Second", 300, 300)
$exit = GUICtrlCreateButton("Exit", 20, 20, 100, 20)

GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $exit
GUIDelete($second)
ExitLoop
EndSelect
WEnd
EndFunc

Fraser

Edited by Fraser

Share this post


Link to post
Share on other sites

Thanks a lot, Fraser, i appreciate this :)

Share this post


Link to post
Share on other sites

Glad to be of assistance

Fraser

Share this post


Link to post
Share on other sites

i noticed that when i open that second gui, those buttons on first gui wont work, do you have any solutions for it?

Share this post


Link to post
Share on other sites

Check this tutorial from the Wiki.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

doesn't work :/ i think i understand how those works, but i can get it work :(

Share this post


Link to post
Share on other sites

If it doesn't work then you're doing it wrong, and you don't understand the tutorial. Post your code so we can see where you went wrong.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Here is my source code and it wont affect anyhow to any game :)

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:UsersJarnoDesktopfavicon.ico
#AutoIt3Wrapper_Outfile=..UG server connection.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include 
#include 
#include 

Opt("GUIOnEventMode", 1)

Global $servu = "small", $form1, $pieni, $iso = 9999

Global $aTitle[11] = [11, "Zombie 1", "Zombie 2", "iSnipe", "Rust/Skidrow FFA", "Terminal HC", "Highrise HC", _
"FFA 2000xp", "TDM 50000xp", "Gun Game", "Servers"]
Global $aButton[11]

main()

Func main()
$form1 = GUICreate("testing", 500, 71)
GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
$MenuItem1 = GUICtrlCreateMenu("Main")
$MenuItem2 = GUICtrlCreateMenu("Server display", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Small", $MenuItem2, "", $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_CHECKED)
$MenuItem3 = GUICtrlCreateMenuItem("Large", $MenuItem2, "", $GUI_CHECKED)
$MenuItem5 = GUICtrlCreateMenuItem("About", $MenuItem1)
$MenuItem6 = GUICtrlCreateMenuItem("Quit", $MenuItem1)

$aButton[1] = GUICtrlCreateButton("Zombie 1", 0, 0, 100, 25)
$aButton[2] = GUICtrlCreateButton("Zombie 2", 100, 0, 100, 25)
$aButton[3] = GUICtrlCreateButton("iSnipe", 200, 0, 100, 25)
$aButton[4] = GUICtrlCreateButton("Rust/Skid FFA", 300, 0, 100, 25)
$aButton[5] = GUICtrlCreateButton("Terminal HC", 0, 25, 100, 25)
$aButton[6] = GUICtrlCreateButton("Highrise HC", 100, 25, 100, 25)
$aButton[7] = GUICtrlCreateButton("FFA 2000xp", 200, 25, 100, 25)
$aButton[8] = GUICtrlCreateButton("TDM 50000xp", 300, 25, 100, 25)
$aButton[9] = GUICtrlCreateButton("Gun Game", 400, 0, 100, 25)
$aButton[10] = GUICtrlCreateButton("Servers", 400, 25, 100, 25)
GUISetOnEvent(-1, "On_Button")


GUISetState(@SW_SHOW)



While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $aButton[1]
MsgBox(0, "", "63.143.46.162:28950")
Case $aButton[2]
MsgBox(0, "", "63.143.46.162:28951")
Case $aButton[3]
MsgBox(0, "", "63.143.46.162:28952")
Case $aButton[4]
MsgBox(0, "", "63.143.46.162:28953")
Case $aButton[5]
MsgBox(0, "", "63.143.46.162:28954")
Case $aButton[6]
MsgBox(0, "", "63.143.46.162:28957")
Case $aButton[7]
MsgBox(0, "", "63.143.46.162:28958")
Case $aButton[8]
MsgBox(0, "", "63.143.46.162:28970")
Case $aButton[9]
MsgBox(0, "", "63.143.46.162:28959")
Case $MenuItem3
If BitAND(GUICtrlRead($MenuItem3), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "large"
Case $MenuItem4
If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "small"
Case $MenuItem6
Exit
Case $MenuItem5
MsgBox(0, "About", "Made by cation{UG}" & @CRLF & @CRLF & "Made for UG members" & @CRLF & @CRLF & "Version 1.1")
EndSwitch
WEnd
EndFunc

Func pienet()

_IEErrorHandlerRegister()

Local $zombie1 = _IECreateEmbedded()
Local $zombie2 = _IECreateEmbedded()
Local $iSnipe = _IECreateEmbedded()
Local $rustskid = _IECreateEmbedded()
Local $terminal = _IECreateEmbedded()
Local $highrise = _IECreateEmbedded()
Local $ffa50 = _IECreateEmbedded()
Local $gungame = _IECreateEmbedded()
Local $tdm50 = _IECreateEmbedded()

$pieni = GUICreate("Small server info", 395, 526, _
0, 0, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($zombie1, 0, 40, 395, 54)
GUICtrlCreateObj($zombie2, 0, 94, 395, 54)
GUICtrlCreateObj($iSnipe, 0, 148, 395, 54)
GUICtrlCreateObj($rustskid, 0, 202, 395, 54)
GUICtrlCreateObj($terminal, 0, 256, 395, 54)
GUICtrlCreateObj($highrise, 0, 310, 395, 54)
GUICtrlCreateObj($ffa50, 0, 364, 395, 54)
GUICtrlCreateObj($gungame, 0, 418, 395, 54)
GUICtrlCreateObj($tdm50, 0, 472, 395, 54)
Local $GUI_Button_Refresh = GUICtrlCreateButton("Refresh", 97, 0, 100, 30)
$quit1 = GUICtrlCreateButton("Quit", 197, 0, 100, 30)

GUISetState() ;Show GUI

_IENavigate($zombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($zombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($iSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($rustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($terminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($highrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($ffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($gungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($tdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_350_20_692108_381007_FFFFFF_000000.png")

While 1
$msg = GUIGetMsg()
If $msg = $GUI_Button_Refresh Then
_IEAction($zombie1, "refresh")
_IEAction($zombie2, "refresh")
_IEAction($iSnipe, "refresh")
_IEAction($rustskid, "refresh")
_IEAction($terminal, "refresh")
_IEAction($highrise, "refresh")
_IEAction($ffa50, "refresh")
_IEAction($gungame, "refresh")
_IEAction($tdm50, "refresh")
EndIf
If $msg = $quit1 Then
GUIDelete($pieni)
ExitLoop
EndIf
WEnd

EndFunc ;==>pienet

Func isot()
_IEErrorHandlerRegister()

Local $zombie1 = _IECreateEmbedded()
Local $zombie2 = _IECreateEmbedded()
Local $iSnipe = _IECreateEmbedded()
Local $rustskid = _IECreateEmbedded()
Local $terminal = _IECreateEmbedded()
Local $highrise = _IECreateEmbedded()
Local $ffa50 = _IECreateEmbedded()
Local $gungame = _IECreateEmbedded()
Local $tdm50 = _IECreateEmbedded()

$iso = GUICreate("Large server info", 1210, 585, _
0, 0, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close")
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($zombie1, 0, 40, 605, 129)
GUICtrlCreateObj($zombie2, 0, 149, 605, 129)
GUICtrlCreateObj($iSnipe, 0, 258, 605, 129)
GUICtrlCreateObj($rustskid, 0, 367, 605, 129)
GUICtrlCreateObj($terminal, 0, 476, 605, 129)
GUICtrlCreateObj($highrise, 605, 40, 605, 129)
GUICtrlCreateObj($ffa50, 605, 149, 605, 129)
GUICtrlCreateObj($gungame, 605, 258, 605, 129)
GUICtrlCreateObj($tdm50, 605, 367, 605, 129)
Local $GUI_Button_Refresh = GUICtrlCreateButton("Refresh", 505, 0, 100, 30)
$quit2 = GUICtrlCreateButton("Quit", 605, 0, 100, 30)

GUISetState() ;Show GUI

_IENavigate($zombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_560_95_1.png")
_IENavigate($zombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_560_95_1.png")
_IENavigate($iSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_560_95_1.png")
_IENavigate($rustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_560_95_1.png")
_IENavigate($terminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_560_95_1.png")
_IENavigate($highrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_560_95_1.png")
_IENavigate($ffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_560_95_1.png")
_IENavigate($gungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_560_95_1.png")
_IENavigate($tdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_560_95_1.png")


While 1
$msg = GUIGetMsg()
If $msg = $GUI_Button_Refresh Then
_IEAction($zombie1, "refresh")
_IEAction($zombie2, "refresh")
_IEAction($iSnipe, "refresh")
_IEAction($rustskid, "refresh")
_IEAction($terminal, "refresh")
_IEAction($highrise, "refresh")
_IEAction($ffa50, "refresh")
_IEAction($gungame, "refresh")
_IEAction($tdm50, "refresh")
EndIf
If $msg = $quit2 Then
GUIDelete($iso)
ExitLoop
EndIf
WEnd


EndFunc ;==>isot

Func On_Close()
Switch @GUI_WinHandle
Case $form1
Exit
Case $pieni
GUIDelete($pieni)
Case $iso
GUIDelete($iso)
EndSwitch
EndFunc


Func On_Button()
Switch @GUI_CtrlId
Case $aButton[10]
GUICtrlSetState($aButton[10], $GUI_DISABLE)
If $servu = "small" Then
pienet()
ElseIf $servu = "large" Then
isot()
EndIf
EndSwitch
EndFunc

I hope you can solve my problem, on that, you cant use any button :/

Share this post


Link to post
Share on other sites

Cation,

It might be worth you having a look at this:

Fraser

Share this post


Link to post
Share on other sites

I'm surprised you got that working at all. You set OnEvent mode, and then you use message loop mode to read everything. That will never work right. Pick one or the other, you can't use them both in the same script without knowing exactly what you're doing.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Cation,

I've had a play with the code to attach a GUI to another (posted by Melba23) and came up with the below.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hGUI_Main = GUICreate("Main", 300, 300, 200, 200)
GUISetBkColor(0xFFCCCC)
$cButton = GUICtrlCreateButton("Show Child", 10, 10, 80, 30)
GUISetState()
$hGUI_Child = GUICreate("Follower", 304, 150, -1, -1, 0, 0, $hGUI_Main)
GUISetBkColor(0xCCFFCC)
GUISetState(@SW_HIDE, $hGUI_Child)
While 1
Switch GUIGetMsg()
     Case $GUI_EVENT_CLOSE
         Exit
     Case $cButton
         Switch GUICtrlRead($cButton)
             Case "Show Child"
                 GUISetState(@SW_SHOW, $hGUI_Child)
                 GUICtrlSetData($cButton, "Hide Child")
                 WinActivate($hGUI_Main)
             Case Else
                 GUISetState(@SW_HIDE, $hGUI_Child)
                 GUICtrlSetData($cButton, "Show Child")
         EndSwitch
EndSwitch
WEnd

====================EDIT====================

Here is one with a button on the second GUI! :)

#region
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#endregion

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI_Main = GUICreate("Main", 300, 300, 200, 200)
GUISetBkColor(0xFFCCCC)
$cButton = GUICtrlCreateButton("Show Child", 10, 10, 80, 30)
GUISetState()

$hGUI_Child = GUICreate("Follower", 304, 150, -1, -1, 0, 0, $hGUI_Main)
GUISetBkColor(0xCCFFCC)
$Bchild1 = GUICtrlCreateButton("EXIT", 10, 10, 80, 30)
GUISetState(@SW_HIDE, $hGUI_Child)

While 1
Switch GUIGetMsg()
  Case $GUI_EVENT_CLOSE
   Exit
  Case $Bchild1
   GUISetState(@SW_HIDE, $hGUI_Child)
   GUICtrlSetData($cButton, "Show Child")
  Case $cButton
   Switch GUICtrlRead($cButton)
    Case "Show Child"
     GUISetState(@SW_SHOW, $hGUI_Child)
     GUICtrlSetData($cButton, "Hide Child")
     WinActivate($hGUI_Main)
    Case Else
     GUISetState(@SW_HIDE, $hGUI_Child)
     GUICtrlSetData($cButton, "Show Child")
   EndSwitch
EndSwitch
WEnd

==================EDIT END==================

I hope this is helpful.

Fraser

Edited by Fraser

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

thanks Fraser, of course these helps but i am looking for that code(s) which separate those [X] buttons on windows and still ofc buttons works on both GUI, i have trying so hard to figure out how i do it with that

Check this tutorial from the Wiki.

but its good complicate for now :( there is that my source code, i just dont know how i put one of those examples to my script

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=C:UsersJarnoDesktopkuviafavicon.ico
#AutoIt3Wrapper_Outfile=..UG server connection1.2.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_File_Add=C:UsersJarnoDesktopkuviaCoDD.bmp
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <IE.au3>

Local $servu = "small"

Global $aTitle[13] = [13, "Zombie 1", "Zombie 2", "iSnipe", "Rust/Skidrow FFA", "Terminal HC", "Highrise HC", _
"FFA 2000xp", "TDM 50000xp", "Gun Game", "Servers", "United Gamerz", "CoDD"]
Global $aButton[13]

$form1 = GUICreate("UG server connection", 500, 186)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)

$MenuItem1 = GUICtrlCreateMenu("Main")
$MenuItem2 = GUICtrlCreateMenu("Server display", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Small", $MenuItem2, "", $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_CHECKED)
$MenuItem3 = GUICtrlCreateMenuItem("Large", $MenuItem2, "", $GUI_CHECKED)
$MenuItem5 = GUICtrlCreateMenuItem("About", $MenuItem1)
$MenuItem6 = GUICtrlCreateMenuItem("Quit", $MenuItem1)

$aButton[1] = GUICtrlCreateButton("Zombie 1", 0, 0, 100, 25)
$aButton[2] = GUICtrlCreateButton("Zombie 2", 100, 0, 100, 25)
$aButton[3] = GUICtrlCreateButton("iSnipe", 200, 0, 100, 25)
$aButton[4] = GUICtrlCreateButton("Rust/Skid FFA", 300, 0, 100, 25)
$aButton[5] = GUICtrlCreateButton("Terminal HC", 0, 25, 100, 25)
$aButton[6] = GUICtrlCreateButton("Highrise HC", 100, 25, 100, 25)
$aButton[7] = GUICtrlCreateButton("FFA 2000xp", 200, 25, 100, 25)
$aButton[8] = GUICtrlCreateButton("TDM 50000xp", 300, 25, 100, 25)
$aButton[9] = GUICtrlCreateButton("Gun Game", 400, 0, 100, 25)
$aButton[10] = GUICtrlCreateButton("Servers", 400, 25, 100, 25)
$aButton[11] = GUICtrlCreateButton("United Gamerz", 0, 50, 500, 25)

$aButton[12] = GUICtrlCreateButton("CoDD", 0, 75, 500, 91, $BS_BITMAP)
GUICtrlSetImage(-1, "c:usersjarnodesktopkuviacodd.bmp")
GUISetState(@SW_SHOW)

Main()

Func Main()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $aButton[1]
MsgBox(0, "", "63.143.46.162:28950")
Case $aButton[2]
MsgBox(0, "", "63.143.46.162:28951")
Case $aButton[3]
MsgBox(0, "", "63.143.46.162:28952")
Case $aButton[4]
MsgBox(0, "", "63.143.46.162:28953")
Case $aButton[5]
MsgBox(0, "", "63.143.46.162:28954")
Case $aButton[6]
MsgBox(0, "", "63.143.46.162:28957")
Case $aButton[7]
MsgBox(0, "", "63.143.46.162:28958")
Case $aButton[8]
MsgBox(0, "", "63.143.46.162:28970")
Case $aButton[9]
MsgBox(0, "", "63.143.46.162:28959")
Case $MenuItem3
If BitAND(GUICtrlRead($MenuItem3), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "large"
Case $MenuItem4
If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "small"
Case $aButton[10]
If $servu = "small" Then
pienet()
ElseIf $servu = "large" Then
isot()
EndIf
Case $MenuItem6
Exit
Case $MenuItem5
#region --- CodeWizard generated code Start ---
#include <Constants.au3>

;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=None, Timeout=4 ss
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox($MB_OK, "About", "Made by cation{UG}" & @CRLF & @CRLF & "Made for UG members" & @CRLF & @CRLF & "Version: 1.2", 4)
Select
Case $iMsgBoxAnswer = -1 ;Timeout

Case Else ;OK

EndSelect
#endregion --- CodeWizard generated code Start ---

Case $aButton[11]
ShellExecute("http://united-gamerz.net/forum.php")
Case $aButton[12]
ShellExecute("http://united-gamerz.net/index.php?pageid=codhome")
EndSwitch
If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
EndFunc ;==>Main

Func pienet()

_IEErrorHandlerRegister()

Local $zombie1 = _IECreateEmbedded()
Local $zombie2 = _IECreateEmbedded()
Local $iSnipe = _IECreateEmbedded()
Local $rustskid = _IECreateEmbedded()
Local $terminal = _IECreateEmbedded()
Local $highrise = _IECreateEmbedded()
Local $ffa50 = _IECreateEmbedded()
Local $gungame = _IECreateEmbedded()
Local $tdm50 = _IECreateEmbedded()

$pieni = GUICreate("Small server info", 395, 526, _
0, 0, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($zombie1, 0, 40, 395, 54)
GUICtrlCreateObj($zombie2, 0, 94, 395, 54)
GUICtrlCreateObj($iSnipe, 0, 148, 395, 54)
GUICtrlCreateObj($rustskid, 0, 202, 395, 54)
GUICtrlCreateObj($terminal, 0, 256, 395, 54)
GUICtrlCreateObj($highrise, 0, 310, 395, 54)
GUICtrlCreateObj($ffa50, 0, 364, 395, 54)
GUICtrlCreateObj($gungame, 0, 418, 395, 54)
GUICtrlCreateObj($tdm50, 0, 472, 395, 54)
Local $GUI_Button_Refresh = GUICtrlCreateButton("Refresh", 97, 0, 100, 30)
$quit1 = GUICtrlCreateButton("Quit", 197, 0, 100, 30)

GUISetState() ;Show GUI

_IENavigate($zombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($zombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($iSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($rustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($terminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($highrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($ffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($gungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($tdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_350_20_692108_381007_FFFFFF_000000.png")

Do
$msg = GUIGetMsg()
If $msg = $GUI_Button_Refresh Then
_IEAction($zombie1, "refresh")
_IEAction($zombie2, "refresh")
_IEAction($iSnipe, "refresh")
_IEAction($rustskid, "refresh")
_IEAction($terminal, "refresh")
_IEAction($highrise, "refresh")
_IEAction($ffa50, "refresh")
_IEAction($gungame, "refresh")
_IEAction($tdm50, "refresh")
EndIf
If $msg = $quit1 Then
GUIDelete($pieni)
ExitLoop
EndIf
Until $msg = $GUI_EVENT_CLOSE

EndFunc ;==>pienet



Func isot()
_IEErrorHandlerRegister()

Local $zombie1 = _IECreateEmbedded()
Local $zombie2 = _IECreateEmbedded()
Local $iSnipe = _IECreateEmbedded()
Local $rustskid = _IECreateEmbedded()
Local $terminal = _IECreateEmbedded()
Local $highrise = _IECreateEmbedded()
Local $ffa50 = _IECreateEmbedded()
Local $gungame = _IECreateEmbedded()
Local $tdm50 = _IECreateEmbedded()

$iso = GUICreate("Large server info", 1210, 585, _
0, 0, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($zombie1, 0, 40, 605, 129)
GUICtrlCreateObj($zombie2, 0, 149, 605, 129)
GUICtrlCreateObj($iSnipe, 0, 258, 605, 129)
GUICtrlCreateObj($rustskid, 0, 367, 605, 129)
GUICtrlCreateObj($terminal, 0, 476, 605, 129)
GUICtrlCreateObj($highrise, 605, 40, 605, 129)
GUICtrlCreateObj($ffa50, 605, 149, 605, 129)
GUICtrlCreateObj($gungame, 605, 258, 605, 129)
GUICtrlCreateObj($tdm50, 605, 367, 605, 129)
Local $GUI_Button_Refresh = GUICtrlCreateButton("Refresh", 505, 0, 100, 30)
$quit2 = GUICtrlCreateButton("Quit", 605, 0, 100, 30)

GUISetState() ;Show GUI

_IENavigate($zombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_560_95_1.png")
_IENavigate($zombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_560_95_1.png")
_IENavigate($iSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_560_95_1.png")
_IENavigate($rustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_560_95_1.png")
_IENavigate($terminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_560_95_1.png")
_IENavigate($highrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_560_95_1.png")
_IENavigate($ffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_560_95_1.png")
_IENavigate($gungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_560_95_1.png")
_IENavigate($tdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_560_95_1.png")


Do
$msg = GUIGetMsg()
If $msg = $GUI_Button_Refresh Then
_IEAction($zombie1, "refresh")
_IEAction($zombie2, "refresh")
_IEAction($iSnipe, "refresh")
_IEAction($rustskid, "refresh")
_IEAction($terminal, "refresh")
_IEAction($highrise, "refresh")
_IEAction($ffa50, "refresh")
_IEAction($gungame, "refresh")
_IEAction($tdm50, "refresh")
EndIf
If $msg = $quit2 Then
GUIDelete($iso)
ExitLoop
EndIf
Until $msg = $GUI_EVENT_CLOSE


EndFunc ;==>isot

i would be so thankful if you could show how i do it, i am just so confused

also i cant figure out how i could get that bmp image to inside exe to $aButton[12], so i dont need that image anywhere on my computer, there is bmp image on $aButton[12]

Edited by cation

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hi cation,

Sorry about the late reply.

Anyway i've just had a quick play with your script and i've come up with this for you, hope it's ok!!! :P

#region
#AutoIt3Wrapper_Run_Tidy=y
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#AutoIt3Wrapper_Icon=C:UsersJarnoDesktopkuviafavicon.ico
#AutoIt3Wrapper_Outfile=..UG server connection1.2.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_File_Add=C:UsersJarnoDesktopkuviaCoDD.bmp
#endregion

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <IE.au3>

Local $servu = "small"
Global $aTitle[13] = [13, "Zombie 1", "Zombie 2", "iSnipe", "Rust/Skidrow FFA", "Terminal HC", "Highrise HC", _
"FFA 2000xp", "TDM 50000xp", "Gun Game", "Servers", "United Gamerz", "CoDD"]
Global $aButton[13]
Global $pieni, $iSnipe, $rustskid, $terminal, $highrise, $ffa50, $gungame, $tdm50, $zombie2, $zombie1, $quit1, $GUI_Button_Refresh
Global $iso, $liSnipe, $lrustskid, $lterminal, $lhighrise, $lffa50, $lgungame, $ltdm50, $lzombie2, $lzombie1, $quit2, $lGUI_Button_Refresh

$form1 = GUICreate("UG server connection", 505, 186, -1, -1, $WS_EX_TOOLWINDOW)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
$MenuItem1 = GUICtrlCreateMenu("Main")
$MenuItem2 = GUICtrlCreateMenu("Server display", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Small", $MenuItem2, "", $GUI_CHECKED)
GUICtrlSetState(-1, $GUI_CHECKED)
$MenuItem3 = GUICtrlCreateMenuItem("Large", $MenuItem2, "", $GUI_CHECKED)
$MenuItem5 = GUICtrlCreateMenuItem("About", $MenuItem1)
$MenuItem6 = GUICtrlCreateMenuItem("Quit", $MenuItem1)
$aButton[1] = GUICtrlCreateButton("Zombie 1", 0, 0, 100, 25)
$aButton[2] = GUICtrlCreateButton("Zombie 2", 100, 0, 100, 25)
$aButton[3] = GUICtrlCreateButton("iSnipe", 200, 0, 100, 25)
$aButton[4] = GUICtrlCreateButton("Rust/Skid FFA", 300, 0, 100, 25)
$aButton[5] = GUICtrlCreateButton("Terminal HC", 0, 25, 100, 25)
$aButton[6] = GUICtrlCreateButton("Highrise HC", 100, 25, 100, 25)
$aButton[7] = GUICtrlCreateButton("FFA 2000xp", 200, 25, 100, 25)
$aButton[8] = GUICtrlCreateButton("TDM 50000xp", 300, 25, 100, 25)
$aButton[9] = GUICtrlCreateButton("Gun Game", 400, 0, 100, 25)
$aButton[10] = GUICtrlCreateButton("Servers", 400, 25, 100, 25)
$aButton[11] = GUICtrlCreateButton("United Gamerz", 0, 50, 500, 25)
$aButton[12] = GUICtrlCreateButton("CoDD", 0, 75, 500, 91, $BS_BITMAP)
GUICtrlSetImage(-1, "c:usersjarnodesktopkuviacodd.bmp")
GUISetState(@SW_SHOW)

$splash = SplashTextOn("Loading", "Loading Please Wiat...", 180, 60, -1, -1)
;============Server List Small============
_IEErrorHandlerRegister()
$zombie1 = _IECreateEmbedded()
$zombie2 = _IECreateEmbedded()
$iSnipe = _IECreateEmbedded()
$rustskid = _IECreateEmbedded()
$terminal = _IECreateEmbedded()
$highrise = _IECreateEmbedded()
$ffa50 = _IECreateEmbedded()
$gungame = _IECreateEmbedded()
$tdm50 = _IECreateEmbedded()
$pieni = GUICreate("Small server info", 395, 526, _
0, 0, _
$WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_EX_TOOLWINDOW, 0, $form1)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($zombie1, 0, 40, 395, 54)
GUICtrlCreateObj($zombie2, 0, 94, 395, 54)
GUICtrlCreateObj($iSnipe, 0, 148, 395, 54)
GUICtrlCreateObj($rustskid, 0, 202, 395, 54)
GUICtrlCreateObj($terminal, 0, 256, 395, 54)
GUICtrlCreateObj($highrise, 0, 310, 395, 54)
GUICtrlCreateObj($ffa50, 0, 364, 395, 54)
GUICtrlCreateObj($gungame, 0, 418, 395, 54)
GUICtrlCreateObj($tdm50, 0, 472, 395, 54)
$GUI_Button_Refresh = GUICtrlCreateButton("Refresh", 97, 0, 100, 30)
$quit1 = GUICtrlCreateButton("Quit", 197, 0, 100, 30)
GUISetState(@SW_HIDE, $pieni)
_IENavigate($zombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($zombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($iSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($rustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($terminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($highrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($ffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($gungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_350_20_692108_381007_FFFFFF_000000.png")
_IENavigate($tdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_350_20_692108_381007_FFFFFF_000000.png")
;============Server List Small End============

;============Server List Large============
_IEErrorHandlerRegister()
Local $lzombie1 = _IECreateEmbedded()
Local $lzombie2 = _IECreateEmbedded()
Local $liSnipe = _IECreateEmbedded()
Local $lrustskid = _IECreateEmbedded()
Local $lterminal = _IECreateEmbedded()
Local $lhighrise = _IECreateEmbedded()
Local $lffa50 = _IECreateEmbedded()
Local $lgungame = _IECreateEmbedded()
Local $ltdm50 = _IECreateEmbedded()
$iso = GUICreate("Large server info", 1210, 585, _
0, 0, _
$WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_EX_TOOLWINDOW, 0, $form1)
GUISetIcon("C:UsersJarnoDesktopUG Connect.exe", -1)
GUICtrlCreateObj($lzombie1, 0, 40, 605, 129)
GUICtrlCreateObj($lzombie2, 0, 149, 605, 129)
GUICtrlCreateObj($liSnipe, 0, 258, 605, 129)
GUICtrlCreateObj($lrustskid, 0, 367, 605, 129)
GUICtrlCreateObj($lterminal, 0, 476, 605, 129)
GUICtrlCreateObj($lhighrise, 605, 40, 605, 129)
GUICtrlCreateObj($lffa50, 605, 149, 605, 129)
GUICtrlCreateObj($lgungame, 605, 258, 605, 129)
GUICtrlCreateObj($ltdm50, 605, 367, 605, 129)
Local $lGUI_Button_Refresh = GUICtrlCreateButton("Refresh", 505, 0, 100, 30)
$quit2 = GUICtrlCreateButton("Quit", 605, 0, 100, 30)
GUISetState(@SW_HIDE, $iso)
_IENavigate($lzombie1, "http://cache.www.gametracker.com/server_info/63.143.46.162:28950/b_560_95_1.png")
_IENavigate($lzombie2, "http://cache.www.gametracker.com/server_info/63.143.46.162:28951/b_560_95_1.png")
_IENavigate($liSnipe, "http://cache.www.gametracker.com/server_info/63.143.46.162:28952/b_560_95_1.png")
_IENavigate($lrustskid, "http://cache.www.gametracker.com/server_info/63.143.46.162:28953/b_560_95_1.png")
_IENavigate($lterminal, "http://cache.www.gametracker.com/server_info/63.143.46.162:28954/b_560_95_1.png")
_IENavigate($lhighrise, "http://cache.www.gametracker.com/server_info/63.143.46.162:28957/b_560_95_1.png")
_IENavigate($lffa50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28958/b_560_95_1.png")
_IENavigate($lgungame, "http://cache.www.gametracker.com/server_info/63.143.46.162:28959/b_560_95_1.png")
_IENavigate($ltdm50, "http://cache.www.gametracker.com/server_info/63.143.46.162:28970/b_560_95_1.png")
;============Server List Large End============
SplashOff()

Main()
Func Main()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $aButton[1]
MsgBox(0, "", "63.143.46.162:28950")
Case $msg = $aButton[2]
MsgBox(0, "", "63.143.46.162:28951")
Case $msg = $aButton[3]
MsgBox(0, "", "63.143.46.162:28952")
Case $msg = $aButton[4]
MsgBox(0, "", "63.143.46.162:28953")
Case $msg = $aButton[5]
MsgBox(0, "", "63.143.46.162:28954")
Case $msg = $aButton[6]
MsgBox(0, "", "63.143.46.162:28957")
Case $msg = $aButton[7]
MsgBox(0, "", "63.143.46.162:28958")
Case $msg = $aButton[8]
MsgBox(0, "", "63.143.46.162:28970")
Case $msg = $aButton[9]
MsgBox(0, "", "63.143.46.162:28959")
Case $msg = $MenuItem3
If BitAND(GUICtrlRead($MenuItem3), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "large"
Case $msg = $MenuItem4
If BitAND(GUICtrlRead($MenuItem4), $GUI_CHECKED) = $GUI_CHECKED Then $servu = "small"
Case $msg = $aButton[10]
If $servu = "small" Then
     GUISetState(@SW_SHOW, $pieni)
     WinActivate($pieni)
ElseIf $servu = "large" Then
     GUISetState(@SW_SHOW, $iso)
     WinActivate($iso)
EndIf
Case $msg = $MenuItem6
Exit
Case $msg = $MenuItem5
#region --- CodeWizard generated code Start ---
#include <Constants.au3>
;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=None, Timeout=4 ss
If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
$iMsgBoxAnswer = MsgBox($MB_OK, "About", "Made by cation{UG}" & @CRLF & @CRLF & "Made for UG members" & @CRLF & @CRLF & "Version: 1.2", 4)
Select
     Case $iMsgBoxAnswer = -1 ;Timeout
     Case Else ;OK
EndSelect
#endregion --- CodeWizard generated code Start ---
Case $msg = $aButton[11]
ShellExecute("http://united-gamerz.net/forum.php")
Case $msg = $aButton[12]
ShellExecute("http://united-gamerz.net/index.php?pageid=codhome")
Case $msg = $GUI_Button_Refresh
_IEAction($zombie1, "refresh")
_IEAction($zombie2, "refresh")
_IEAction($iSnipe, "refresh")
_IEAction($rustskid, "refresh")
_IEAction($terminal, "refresh")
_IEAction($highrise, "refresh")
_IEAction($ffa50, "refresh")
_IEAction($gungame, "refresh")
_IEAction($tdm50, "refresh")
Case $msg = $quit1
GUISetState(@SW_HIDE, $pieni)
Case $msg = $lGUI_Button_Refresh
_IEAction($lzombie1, "refresh")
_IEAction($lzombie2, "refresh")
_IEAction($liSnipe, "refresh")
_IEAction($lrustskid, "refresh")
_IEAction($lterminal, "refresh")
_IEAction($lhighrise, "refresh")
_IEAction($lffa50, "refresh")
_IEAction($lgungame, "refresh")
_IEAction($ltdm50, "refresh")
Case $msg = $quit2
GUISetState(@SW_HIDE, $iso)
EndSelect
If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
EndFunc ;==>Main

Only thing i've noticed that isn't working is the _IEAction Refrech, however i'm not to sure about that (YET) and the icon on the button, i havn't been able to test that as i don't have the image.

I noticed that you are adding the image to the exe with this #AutoIt3Wrapper_Res_File_Add=C:UsersJarnoDesktopkuviaCoDD.bmp, however you seem to be trying to add the image to the button from your desktop, once you add the image to the exe use this to add it to the button GUICtrlSetImage(-1, @ScriptDir & "" & @ScriptName, -5) you may need to go through -0 to -10 to find the image.

Edit: Forgot to say that i removed the Exit buttons from the top right of all the gui's, so you may want to put a exit button on the main gui.

Any question ask and i will try my best to answer them for you!

Regard

Fraser

Edited by Fraser

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