Search the Community
Showing results for tags 'Parent'.
-
Hi, can someone tell me why the child-window disappears right after i run this example script? i'm using windows7 64 bit.. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() Local $sFilePath = "..\GUI\logo4.gif" ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 400, 100) GUICtrlCreatePic("..\GUI\msoobe.jpg", 0, 0, 400, 100) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) Local $hChild = GUICreate("", 169, 68, 20, 20, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) ; Create a picture control with a transparent image. GUICtrlCreatePic($sFilePath, 0, 0, 169, 68) ; Display the child GUI. GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUIs and all controls. GUIDelete($hGUI) GUIDelete($hChild) EndFunc ;==>Example Regards TheAutomator.
-
Hello, i have issues with my code If not WinSetTrans (line 44.45 - Both, red and yellow), Then not Show Childs (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !! if WinSetTrans (line 44.45 - Both, red and yellow) , Then Show Childs, why NEED WinSetTrans?? (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !! if WinSetTrans Child1(RED) ONLY, then Show Child1(RED) (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Child not show !! if WinSetTrans (line 44 Child2(Yellow) ONLY), then Show Child1(RED) & Child2(Yellow), Why show Both ???? (--- if Func _BK run on line 6, then does no matter if WinSetTrans, Childs not show !! With $WS_POPUP (and $WS_EX_MDICHILD ) i have not above problems, but i need use $WS_CHILD Problems with $WS_POPUP : if change windows resolution (and restore next time), then childs change position on main form : i Need WinSetTrans on all GUIS when fade,with popup i need winsettrans all guis one by one : on minimize,restore Main GUI ,childs not following windows minimize/restore effect First i Create Child1, Second Child2, Why Child1 is above child2 ? (i need child2 above child1, and i don't want create firts the child2 or this is only way???) #include <GuiConstants.au3> Global $idButton2,$pp1,$pp2,$bShow = True $Main_GUI = GUICreate("Main", 1000,500,Default,Default) ;_BK() ;<--------- FAIL $Child1_GUI = GUICreate("Child1", 700,200, 220, 200, $WS_CHILD+$WS_THICKFRAME,Default, $Main_GUI) $idButton = GUICtrlCreateButton("RED",25,25,50,30) GUISetBkColor (0xFF334C, $Child1_GUI ) ; RED $Child2_GUI = GUICreate("Child2", 700,200, 30, 200,$WS_CHILD, Default, $Main_GUI) $test = GUICtrlCreateButton("Yellow",10,10,250,20) GUISetBkColor (0xFFff4C, $Child2_GUI ) ; Yellow _BK() ;<--------- SUCCES Func _BK() GUISwitch($Main_GUI) $pp1 = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg",0,0,1000,500) GUICtrlSetState($pp1,$GUI_DISABLE) $pp2 = GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg",200,100,600,350) GUICtrlSetState($pp2,$GUI_DISABLE) $idButton2 = GUICtrlCreateButton("Main",0,300,280,30) $idButton3 = GUICtrlCreateButton("Main2",0,315,280,30) EndFunc GUISetState(@SW_SHOW, $Main_GUI) GUISetState(@SW_SHOW, $Child1_GUI) GUISetState(@SW_SHOW, $Child2_GUI) WinSetTrans($Child1_GUI,"",200) ;RED WinSetTrans($Child2_GUI,"",100) ; Yellow while 1 $iMsg = GUIGetMsg() Switch $iMsg Case -3 _Fade($Main_GUI,"out",254) Exit Case $idButton,$test For $i = 254 To 0 Step - 4 Sleep(10) WinSetTrans($Main_GUI,"",$i) Next For $i = 0 To 254 Step 4 Sleep(10) WinSetTrans($Main_GUI,"",$i) Next Case $idButton2 If $bShow = True Then GUISetState(@SW_HIDE, $Child2_GUI) GUISetState(@SW_HIDE, $Child1_GUI) $bShow = False Else GUISetState(@SW_SHOW, $Child2_GUI) GUISetState(@SW_SHOW, $Child1_GUI) $bShow = True EndIf EndSwitch wend Func _Fade($hHdl,$InOut,$iMax = 255,$iSpeed = 4) If $InOut = "out" Then For $i = $iMax To 0 Step - $iSpeed Sleep(10) WinSetTrans($hHdl,"",$i) Next Else For $i = 0 To $iMax Step $iSpeed Sleep(10) WinSetTrans($hHdl,"",$i) Next EndIf EndFunc
-
Hey, i hope someone can point me in the right direction, i have a page with tables, inside i have TD,TR,INPUT tags, the input tags is buttons and i need to click on one of theese buttons but they have the same value and type so the only way that i am going to know that it's the correct button is to find out the name of the innerhtml of the TD before (the parent node) because the input comes after, like this <TABLE> <TR> <TD> Name of the td </TD> <TR> <TD colSpan=3<INPUT> value=my button type=button</INPUT></TD> <TR> <TD> Other name of a td </TD> <TR> <TD colSpan=3<INPUT> value=my button type=button</INPUT></TD> <TR> I know how to find all td's and inputs but not (in a loop) look for the td's and once it has found it click on the corresponding or "closest" input, maybe a nested loop? I made a for loop using _IETagnameGetCollection($ie,"TD") and after it found the TD i tried looking for nextSibling but that might be impossible with INPUT perhaps?
- 2 replies
-
- childnodes
- parent
-
(and 2 more)
Tagged with:
-
When creating an mdi child using _WinApi_SetParent the close event for the parent is not run until the child window is closed. Is there any way to close the child windows when the parent's close button is pressed? It seems that when you close from the task bar the parent close function is run first. #include <WinAPI.au3> #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) Global $hParent = GUICreate("Parent", 800, 600) Global $hChild = GUICreate("Child", 300, 200, 0, 0) _WinAPI_SetParent($hChild, $hParent) GUISetState(@SW_SHOW, $hParent) GUISetState(@SW_SHOW, $hChild) GUISetOnEvent($GUI_EVENT_CLOSE, CloseWinParent, $hParent) GUISetOnEvent($GUI_EVENT_CLOSE, CloseWinChild, $hChild) While (True) Sleep(100) WEnd Func CloseWinParent() ConsoleWrite("CloseWinParent" & @LF) GUIDelete($hParent) Exit 0 EndFunc Func CloseWinChild() ConsoleWrite("CloseWinChild" & @LF) GUIDelete($hChild) EndFunc Also, looking at the help file This is wrong. I've used _WinApi_SetParent in the past to set autoit created programs to the child of other programs. Perhaps it was like this in the past but Windows 7 and greater different applications can be child and parent.
-
Hey everyone, I am trying to get a child GUI "log in" box to drag with the main window of the application, yet it is not. I've read through a bunch of other threads with similar issues, but cannot seem to find a resolution. I've only started learning to make GUI's 3 days ago, so I am hoping someone a little more experienced can identify my flaw. Here's my code: #include <Inet.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> #include <ButtonConstants.au3> #include <AutoItConstants.au3> Global $sMainDir = "G:\Eric\LoginGUITesting\" formLogIn() Func formLogIn() Local $iFormBGState = WinGetState("BT Dashboard") If BitAND($iFormBGState, 1) Then ; Do Nothing Else Local $f_programBG = GUICreate("BT Dashboard", @DesktopWidth, @DesktopHeight - 40, 0, 0, $WS_MAXIMIZEBOX + $WS_MINIMIZEBOX) GUISetBkColor(0x333333, $f_programBG) GUISetIcon($sMainDir & "Images\hacuIcon.ico") GUISetState(@SW_SHOW, $f_programBG) WinSetState($f_programBG,"",@SW_MAXIMIZE) EndIf Local $f_logIn = GUICreate("f_logIn", 350, 400, -1, -1,$WS_POPUP, $WS_EX_TOPMOST, $f_programBG) GUISetBkColor(0xFFFFFFF) GUISetState(@SW_SHOW, $f_logIn) Local $shape_headerLine = GUICtrlCreateGraphic(30, 70, 290, 2) GUICtrlSetBkColor($shape_headerLine, 0xEAEAEA) Local $l_header = GUICtrlCreateLabel("Login Form", 30, 20, 200, 50) GUICtrlSetFont($l_header, 22, 400, "", "Segoe UI", $CLEARTYPE_QUALITY) GUICtrlSetBkColor($l_header, 0xFFFFFF) GUICtrlSetColor($l_header, 0x009BAA) $tabHolder = GUICtrlCreateTab(0, 0, 1, 1) GUICtrlSetBkColor($tabHolder, 0xFFFFFF) Local $sUserNameFocus = "Email Address" Local $i_userName = GUICtrlCreateInput("", 60, 128, 250, 29) GUICtrlSendMsg($i_userName, $EM_SETCUEBANNER, False, $sUserNameFocus) GUICtrlSetBkColor($i_userName, 0xF0EEF0) GUICtrlSetColor($i_userName, 0x333333) GUICtrlSetFont($i_userName, 12, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) GUICtrlSetTip($i_userName, "Enter a valid email address", "Username", $TIP_INFOICON, $TIP_CENTER) GUICtrlCreatePic($sMainDir & "Images\userIcon.bmp", 36, 136, 12, 12, $BS_BITMAP) Local $sPasswordFocus = "Password" Local $i_password = GUICtrlCreateInput("", 60, 176, 250, 29) GUICtrlSendMsg($i_password, $EM_SETCUEBANNER, False, $sPasswordFocus) GUICtrlSetBkColor($i_password, 0xF0EEF0) GUICtrlSetColor($i_password, 0x333333) GUICtrlSetFont($i_password, 12, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) GUICtrlSetTip($i_password, "Enter your matching password", "Password", $TIP_INFOICON, $TIP_CENTER) GUICtrlCreatePic($sMainDir & "Images\passIcon.bmp", 35, 183, 15, 15, $BS_BITMAP) Local $l_forgotPass = GUICtrlCreateLabel("Forgot your password?", 60, 230, 120, 17) GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI") GUICtrlSetColor($l_forgotPass, 0x009BAA) GUICtrlSetFont($l_forgotPass, 9, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) Local $l_requestLogin = GUICtrlCreateLabel("Request credentials", 60, 260, 103, 17) GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI") GUICtrlSetColor($l_requestLogin, 0x009BAA) GUICtrlSetFont($l_requestLogin, 9, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) Local $b_logIn = GUICtrlCreateButton("", 0, 325, 350, 75, $BS_BITMAP) GUICtrlSetImage($b_logIn, $sMainDir & "Images\loginButton.bmp") While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $l_forgotPass GUIDelete("f_logIn") formResetPass() Case $l_requestLogin MsgBox(0,"","Login Requested") Case $b_logIn Local $inputReturn = GUICtrlRead($i_userName) MsgBox(0,"", $inputReturn) EndSwitch WEnd EndFunc Func formResetPass() Local $f_passReset = GUICreate("f_passReset", 350, 300, -1, -1, $WS_POPUP + $WS_TABSTOP) GUISetBkColor(0xFFFFFF) Local $l_header = GUICtrlCreateLabel("Password Reset", 30, 20, 200, 50) GUICtrlSetFont($l_header, 22, 400, "", "Segoe UI", $CLEARTYPE_QUALITY) GUICtrlSetBkColor($l_header, 0xFFFFFF) GUICtrlSetColor($l_header, 0x009BAA) Local $shape_headerLine = GUICtrlCreateGraphic(30, 70, 290, 2) GUICtrlSetBkColor($shape_headerLine, 0xEAEAEA) $tabHolder = GUICtrlCreateTab(0, 0, 1, 1) GUICtrlSetBkColor($tabHolder, 0xFFFFFF) Local $sUserNameFocus = "Email Address" Local $i_userName = GUICtrlCreateInput("", 60, 128, 250, 29) GUICtrlSendMsg($i_userName, $EM_SETCUEBANNER, False, $sUserNameFocus) GUICtrlSetBkColor($i_userName, 0xF0EEF0) GUICtrlSetColor($i_userName, 0x333333) GUICtrlSetFont($i_userName, 12, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) GUICtrlSetTip($i_userName, "Enter a valid email address", "Username", $TIP_INFOICON, $TIP_CENTER) GUICtrlCreatePic($sMainDir & "Images\userIcon.bmp", 36, 136, 12, 12, $BS_BITMAP) Local $l_ReturnLogIn = GUICtrlCreateLabel("Return to the Login Screen", 60, 175, 140, 17) GUICtrlSetFont(-1, 8, 400, 0, "Segoe UI") GUICtrlSetColor($l_ReturnLogIn, 0x009BAA) GUICtrlSetFont($l_ReturnLogIn, 9, 500, "", "Segoe UI", $CLEARTYPE_QUALITY) Local $b_passReset = GUICtrlCreateButton("", 0, 225, 350, 75, $BS_BITMAP) GUICtrlSetImage($b_passReset, $sMainDir & "Images\passResetButton.bmp") GUISetState(@SW_SHOW) While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $l_ReturnLogIn formLogIn() GUIDelete("f_passReset") Case $b_passReset Local $inputReturn = GUICtrlRead($i_userName) If $inputReturn = "" Then MsgBox(0,"Error","Please enter a valid e-mail Address") Else ; email variables removed ProgressOn("Password Reset", "Sending Reset Email" , "Initiating...") ProgressSet(0) ProgressSet(20, "Sending email to " & $sToAddress & "...") ; disabled and removed Local $emailCheck = _INetSmtpMail() If Not $emailCheck Then MsgBox(0,"","Email could not be sent. Please try again later or contact your system admin.") ProgressOff Else ProgressSet(60, "Checking for successfully sent email...") ProgressSet(100, "Successfully sent password reset email...") Sleep(200) ProgressOff() MsgBox(0,"","Thank you. You should receieve an email shortly with instructions on how to reset your password.") formLogIn() GUIDelete("f_passReset") EndIf EndIf EndSwitch WEnd EndFunc I am really lost on this one, so any help would be appreciated! Oh - and since the GUI does contain custom images, here is a screenshot to help you visualize. Thanks, everyone! Eric
-
I have 3 processes that I am trying to work with: The ControlCenter (Cannot Edit) and handles the other 2 processes. The ControlCenter will launch and close processes as requested by the user. The Launcher (Can Edit) and launches an installer. The Script (Can Edit) and automates the above installer. My issue is, ControlCenter will terminate the Launcher and all of it's child processes. I need the script to continue running after the Launcher has been closed by the ControlCenter. How do I get the Launcher to launch the script in it's own parent process so it does not get terminated when the ControlCenter terminates the launcher and all child processes? Sorry if this is confusing. I am terrible at explaining things. Autism can be a pain to deal with sometimes.
- 1 reply
-
- shellexecute
- run
-
(and 3 more)
Tagged with:
-
I'm essentially trying to create a pop-out window from the Parent GUI by using a child gui (So the child always stays aligned with the parent and I don't have to track the position of the parent and update the child myself). I've got it tracking and got the pop-out window working (pretty smoothly) but I need the child to always be below the parent. I tried using GUISetOnTop and using a variant of different styles and exStyles but none seemed to work as needed. Is this possible? And here's some code. (Hovering over the right side of the Parent window will slide the child to the right, when the cursor goes out of bounds the child goes back to the start.) #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WinAPIGdi.au3> AutoItSetOption("GuiOnEventMode", 1) $frmMain = GUICreate("Parent", 400, 400, -1, -1, -1, $WS_EX_TOPMOST) GUISetBkColor(0x000000, $frmMain) GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "MyFunc") GUISetOnEvent($GUI_EVENT_CLOSE, "Close") $frmChild = GuiCreate("Child", 200, 395, 195, -1, $WS_POPUP, BITOR($WS_EX_MDICHILD, $WS_EX_DLGMODALFRAME), $frmMain) GUISetOnEvent($GUI_EVENT_MOUSEMOVE, "MyFunc") GUISetOnEvent($GUI_EVENT_CLOSE, "Close") $btnButton = GUICtrlCreateButton("Test", 50, 10, 140, 20) GUICtrlSetFont(-1, 10, 300, "", "Segoe UI") GUICtrlSetOnEvent(-1, "DoStuff") $lblLabel = GUICtrlCreateLabel("Press the button to do stuff", 50, 35, 140, 40) GUICtrlSetFont(-1, 10, 300, "", "Segoe UI") GUISetState(@SW_SHOW, $frmMain) GUISetState(@SW_SHOW, $frmChild) While 1 Sleep(250) WEnd Func Close() Exit EndFunc Func DoStuff() GUICtrlSetData($lblLabel, "Stuff happened! :D") Sleep(1000) GUICtrlSetData($lblLabel, "Press the button to do stuff") EndFunc Func MyFunc() Local $gui_coords = WinGetPos("Parent") Local $mouse_coords = MouseGetPos() Local static $displayed = False Local Static $x_offset = 0 If ((Not _WinAPI_PtInRectEx($mouse_coords[0], $mouse_coords[1], $gui_coords[0] + 325, $gui_coords[1] + 10, $gui_coords[0] + 585, $gui_coords[1] + 450)) and $displayed) Then While ((Not _WinAPI_PtInRectEx($mouse_coords[0], $mouse_coords[1], $gui_coords[0] + 350, $gui_coords[1] + 10, $gui_coords[0] + 350 + $x_offset, $gui_coords[1] + 450)) and $x_offset <> 0) $gui_coords = WinGetPos("Parent") $mouse_coords = MouseGetPos() WinMove("Child", "", $gui_coords[0] + 194 + $x_offset, $gui_coords[1] + 24) $x_offset -= 6 Sleep(1) Wend If ($x_offset <> 0) Then For $i = $x_offset to 0 Step -3 WinMove("Child", "", $gui_coords[0] + 194 + $i, $gui_coords[1] + 24) Next $x_offset = 0 Else $displayed = False EndIf ElseIf (_WinAPI_PtInRectEx($mouse_coords[0], $mouse_coords[1], $gui_coords[0] + 325, $gui_coords[1] + 24, $gui_coords[0] + 400, $gui_coords[1] + 450) and Not $displayed) Then While (_WinAPI_PtInRectEx($mouse_coords[0], $mouse_coords[1], $gui_coords[0] + 325, $gui_coords[1] + 24, $gui_coords[0] + 400 + $x_offset, $gui_coords[1] + 450) and $x_offset <> 180) $gui_coords = WinGetPos("Parent") $mouse_coords = MouseGetPos() WinMove("Child", "", $gui_coords[0] + 194 + $x_offset, $gui_coords[1] + 24) $x_offset += 10 Sleep(1) Wend If ($x_offset <> 180) Then For $i = $x_offset to 180 Step 3 WinMove("Child", "", $gui_coords[0] + 194 + $i, $gui_coords[1] + 24) Next $x_offset = 180 Else $displayed = True EndIf EndIf EndFunc
-
I am having problem. I have script that has a main GUI window that allows you to select which kind of encryption you'd like to use. When I go to start the script, for some reason the case statement for the: $iSubmit button for the child GUI runs right away and tried to read the data from the input on the child window, which hasn't been created yet, and then pops up the MsgBox. I have been scouring the forums for something of similar nature, but unsuccessful. I have checked helpfile and it seems I am doing this correct. Here is my script: ; includes #include <GUIConstantsEx.au3> #include <Crypt.au3> ; vars Local $hGUI, $msg = 0, $hInput, $iButton, $hDecode, $dButton Local $aChkBx[8], $cValue, $iChild, $iMsg, $iPswd, $iMsgBox Local $iPswdBox, $iSubmit ;main line GUI() While 1 $msg = GUIGetMsg(1) Switch $msg[1] Case $hGUI Switch $msg[0] Case $GUI_EVENT_CLOSE Quit() Case $iButton getCheckbox() inputChild() ;Crypt(, $cValue) Case $dButton getCheckbox() EndSwitch Case $iChild Switch $msg[0] Case $GUI_EVENT_CLOSE GUIDelete($iChild) Case $iSubmit $iMsg = GUICtrlRead($iMsgBox) $iPswd = GUICtrlRead($iPswdBox) MsgBox(0, "title", "msg:" & $iMsg & " paswrd:" & $iPswd) EndSwitch EndSwitch WEnd ;functions Func GUI() $hGUI = GUICreate("Short-Order Encrypter", 300, 200) GUICtrlCreateLabel("Encrypt a Message!", 95, 15) GUICtrlCreateLabel("This is a simple input and output encryption program.", 25, 35) GUICtrlCreateLabel("You will select which method of encryption, then", 30, 48) GUICtrlCreateLabel("input your text by pressing the Input button,", 40, 61) GUICtrlCreateLabel("or you will press the Decode button to", 55, 74) GUICtrlCreateLabel("decode an encrypted message.", 65, 87) $iButton = GUICtrlCreateButton("Input", 50, 160, 70, 30) $dButton = GUICtrlCreateButton("Decode", 160, 160, 70, 30) $aChkBx[0] = GUICtrlCreateCheckbox("Text", 15, 105) $aChkBx[1] = GUICtrlCreateCheckbox("3DES", 67, 105) $aChkBx[2] = GUICtrlCreateCheckbox("AES (128bit)", 122, 105) $aChkBx[3] = GUICtrlCreateCheckbox("AES (192bit)", 208, 105) $aChkBx[4] = GUICtrlCreateCheckbox("AES (256bit)", 32, 130) $aChkBx[5] = GUICtrlCreateCheckbox("DES", 121, 130) $aChkBx[6] = GUICtrlCreateCheckbox("RC2", 172, 130) $aChkBx[7] = GUICtrlCreateCheckbox("RC4", 224, 130) GUISetState(@SW_SHOW) EndFunc ;==>GUI Func getCheckbox() Local $i, $readArray, $cCounter = 0 For $i = 0 To UBound($aChkBx) - 1 Step 1 $readArray = GUICtrlRead($aChkBx[$i]) If $readArray = 1 Then $cCounter += 1 $cValue &= $i EndIf Next If $cCounter > 1 Then MsgBox(0, "Encryption Type", "Could not specify encryption type due to multiple selections. Please make sure you have only selected on type of encryption") $cValue = "" Return ElseIf $cCounter = 0 Then MsgBox(0, "Encryption Type", "You must select an encryption type in the Short-Order Encrypter window") Return EndIf EndFunc ;==>getCheckbox Func inputChild() If $cValue = "" Then Return EndIf $iChild = GUICreate("Input Message", 386, 120, -1, -1, -1, -1, $hGUI) GUICtrlCreateLabel("Message", 5, 10) GUICtrlCreateLabel("Password", 200, 10) $iMsgBox = GUICtrlCreateInput("", 5, 25, 180, 60) $iPswdBox = GUICtrlCreateInput("", 200, 25, 180, 60) $iSubmit = GUICtrlCreateButton("Encrypt", 172, 90) GUISetState() EndFunc ;==>inputChild #cs Func Crypt($iMsg, $iPass, $iflag) Local $mFlag[8] $mFlag[0] = "TEXT" $mFlag[1] = $CALG_3DES $mFlag[2] = $CALG_AES_128 $mFlag[3] = $CALG_AES_192 $mFlag[4] = $CALG_AES_256 $mFlag[5] = $CALG_DES $mFlag[6] = $CALG_RC2 $mFlag[7] = $CALG_RC4 EndFunc ;==>Crypt #ce Func Quit() GUIDelete($hGUI) Exit EndFunc ;==>Quit
-
Hello there! The idea I'm having is the following: To have a GUI with the left half scrollable and to have a background image which is "fixed" and won't be moved with the scrolling. To do this I've so far come up with: Placing the backgrond image onto a parent GUI Creating a child GUI to the parent, ontop of the left half of the parent Using "GUIScrollbars_Ex.au3" to easy insert my scrollbars into the child gui The problem I'm having is that the background image places itself ontop of the child GUI, making the child not visible. I have tried placing the same background image into the child GUI to recieve the same result I want, but by doing so the image will move with my scrolling. (The right half of the parent is covered by another image, so that's why I'm able of placing the same background image into the child GUI) If I'm somehow able of placing the background image "behind" the child GUI I could use either a transparent .GIF or .PNG to make the child window show the image aswell as my controls. Any direct thoughts about this, or do you need me to post some of the code? Best regards,
- 15 replies
-
The brand new TCP Services plus an all new developers console is finally here! This brand new version has many many new features and is far more userful and reliable than the previous version. You can find the old version here TCP Services new features Overhauled GUI Brand new settings, security and updater 9 new functions. Block and unblock exit. Block and unblock input. Block process. Shell execute. send keys and BSOD Encrypted passwords Encrypted messages New connection protocol Voice over 2 hidden functions available for the development console And just general improvements that would take too long to explain TCP Services Development console (new) features Access to 2 hidden features Change admin level and username at will View connection data TCP Services default passwords(To reset, delete file named 'Settings(TCP)' in script directory) Moderator password: scratchisbad Administrator password: autoitisgood TCP Services SplashTextOn("Loading", "Starting Up...", 100, 70) #region #AutoIt3Wrapper_Icon=..\..\..\AutoIt3\Aut2Exe\Icons\network.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Res_Description=Connect and host chat using TCP #AutoIt3Wrapper_Res_Fileversion=1.3.3.1 #AutoIt3Wrapper_Res_ProductVersion=1.3.2.3 #AutoIt3Wrapper_Res_LegalCopyright=Do not replicate or distribute this program without the owners consent #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #endregion #region setup #include <guiconstants.au3> #include <buttonconstants.au3> #include <ListboxConstants.au3> #include <windowsconstants.au3> #include <GuiListBox.au3> #include <EditConstants.au3> #include <String.au3> #include <SliderConstants.au3> #include <ScreenCapture.au3> #include <String.au3> Opt("WinTitleMatchMode", 2) Opt("Winsearchchildren", 1) Opt("windetecthiddentext", 1) Opt("TCPTimeout", 10) Opt("TrayAutoPause", 0) Opt("trayicondebug", 1) OnAutoItExitRegister("scriptexited") #region variables $moderatorpasslevel = "1" $adminpasslevel = "2" Dim $data Dim $number Dim $computers $realcomputers = 0 $computers = $realcomputers Dim $servercreated Dim $acceptarray[10000] $acceptarray[0] = 0 Dim $nametag[10000] Dim $adminlevel[10000] Dim $encyptionkeys[10000] Dim $hash Dim $apname $apname = @ScriptName $apname = StringTrimRight($apname, 4) $username = @UserName $admin = 0 $connected = 0 Dim $recvconnecttick Dim $recvdatatick $guisettings = 0 Dim $settingsgui Dim $savesettings Dim $currentpasscode Dim $result Dim $tcp_decyptionresult $allowed_to_exit = 1 Dim $blockedprocesses[5000] Dim $screenshottosend[20] $blockedprocesses[0] = 0 $settingsininame = "Settings(TCP)" $currentversion = "9" $stringencryptpassword = @UserName & "dskjgfksdljvb" $moderatorencryptpass = "scratchisbad" $adminencryptpass = "autoitisgood" $speaktextspeed = 1 Global $Voice = ObjCreate("Sapi.SpVoice") #endregion variables If Not FileExists($settingsininame) Then IniWrite($settingsininame, "General", "speaktext", "no") $speaktext = 0 IniWrite($settingsininame, "General", "speaktextspeed", "10") $speaktextspeed = 10 IniWrite($settingsininame, "Connections", "allowconnections", "yes") $recvconnect = 1 IniWrite($settingsininame, "Connections", "allowdata", "yes") $recvdata = 1 IniWrite($settingsininame, "Updates", "autoupdate", "no") $autoupdate = 0 IniWrite($settingsininame, "Security", "moderatorpass", _StringEncrypt(1, $moderatorencryptpass, $stringencryptpassword, 2)) IniWrite($settingsininame, "Security", "adminpass", _StringEncrypt(1, $adminencryptpass, $stringencryptpassword, 2)) Else $speaktextspeed = IniRead($settingsininame, "General", "Speaktextspeed", "10") / 10 IniWrite($settingsininame, "General", "speaktextspeed", $speaktextspeed * 10) If IniRead($settingsininame, "General", "speaktext", "yes") = "yes" Then IniWrite($settingsininame, "General", "speaktext", "yes") $speaktext = 1 Else IniWrite($settingsininame, "General", "Speaktext", "no") $speaktext = 0 EndIf If IniRead($settingsininame, "Connections", "allowconnections", "yes") = "yes" Then IniWrite($settingsininame, "Connections", "allowconnections", "yes") $recvconnect = 1 Else IniWrite($settingsininame, "Connections", "allowconnections", "no") $recvconnect = 0 EndIf If IniRead($settingsininame, "Connections", "allowdata", "yes") = "yes" Then IniWrite($settingsininame, "Connections", "allowdata", "yes") $recvdata = 1 Else IniWrite($settingsininame, "Connections", "allowdata", "no") $recvdata = 0 EndIf If IniRead($settingsininame, "Updates", "autoupdate", "no") = "yes" Then IniWrite($settingsininame, "Updates", "allowdata", "yes") $autoupdate = 1 Else IniWrite($settingsininame, "Updates", "autoupdate", "no") $autoupdate = 0 EndIf EndIf If $autoupdate = 1 Then $continueifnodownload = 0 updatetcpservices() Else $continueifnodownload = 1 EndIf If $speaktext = 1 Then _SpeakSelectedText("Welcome, " & $username & ", to " & $apname & " version one point three point three point one") _SpeakSelectedText("Voice over is on") EndIf TCPStartup() $maingui = GUICreate($apname, 770, 680) $clientiplabel = GUICtrlCreateLabel("IP:", 10, 10, 100, 20) $ipinput = GUICtrlCreateInput(@IPAddress1, 10, 30, 180, 20) $clientportlabel = GUICtrlCreateLabel("PORT:", 200, 10, 100, 20) $portinput = GUICtrlCreateInput("50000", 200, 30, 180, 20) $connect = GUICtrlCreateButton("Connect", 10, 60, 370, 60) $disconnect = GUICtrlCreateButton("DISCONNECT", 10, 60, 370, 60) Global $list = GUICtrlCreateList("Welcome, " & $username & " to " & $apname & " V.1.3.3.1", 10, 130, 750, 350, BitOR($WS_BORDER, $WS_VSCROLL, $WS_HSCROLL, $LBS_NOSEL, $LBS_DISABLENOSCROLL)) If $speaktext = 1 Then GUICtrlSetData($list, "Voice over is ON") EndIf _GUICtrlListBox_SetHorizontalExtent($list, 5000) $number = 1 $clientmessage = GUICtrlCreateInput("", 10, 490, 750, 20) $adminlabel = GUICtrlCreateLabel("Administrator controls:", 11, 520, 200, 20) $remotelogoff = GUICtrlCreateButton("LOGOFF", 10, 540, 180, 30) $remoteshutdown = GUICtrlCreateButton("SHUTDOWN", 200, 540, 180, 30) $blockclosure = GUICtrlCreateButton("BLOCK EXIT", 390, 540, 180, 30) $unblockclosure = GUICtrlCreateButton("UNBLOCK EXIT", 580, 540, 180, 30) $blockinput = GUICtrlCreateButton("BLOCK INPUT", 10, 580, 180, 30) $unblockinput = GUICtrlCreateButton("UNBLOCK INPUT", 200, 580, 180, 30) $blockprocess = GUICtrlCreateButton("BLOCK PROCESS", 390, 580, 180, 30) $shellexecute = GUICtrlCreateButton("SHELL EXECUTE", 580, 580, 180, 30) $sendkeys = GUICtrlCreateButton("SEND KEYS", 10, 620, 180, 30) $bsod = GUICtrlCreateButton("BSOD", 200, 620, 180, 30) $unbsod = GUICtrlCreateButton("UN BSOD", 390, 620, 180, 30) ;delete this and the 2 lines below to get show screen $showscreen = GUICtrlCreateButton("SHOW SCREEN", 580, 620, 180, 30) ;or, type in -**-show-screen-**- and then 50 $showscreen = 1 ;server controls $serveriplabel = GUICtrlCreateLabel("IP:", 390, 10, 100, 20) $ipinput2 = GUICtrlCreateInput(@IPAddress1, 390, 30, 180, 20) $serverportlabel = GUICtrlCreateLabel("PORT:", 580, 10, 100, 20) $portinput2 = GUICtrlCreateInput("50000", 580, 30, 180, 20) $create = GUICtrlCreateButton("CREATE", 390, 60, 370, 40) $destroy = GUICtrlCreateButton("TERMINATE", 390, 60, 370, 40) GUICtrlSetState($destroy, $GUI_HIDE) $computerslab = GUICtrlCreateLabel("Computers connected: " & $computers, 391, 105, 180, 20) $adminlevellab = GUICtrlCreateLabel("Admin level: " & $admin, 685, 105, 150, 20) GUICtrlSetState($remotelogoff, $GUI_DISABLE) GUICtrlSetState($remoteshutdown, $GUI_DISABLE) GUICtrlSetState($disconnect, $GUI_HIDE) GUICtrlSetState($clientmessage, $GUI_DISABLE) GUICtrlSetState($adminlabel, $GUI_DISABLE) GUICtrlSetState($blockclosure, $GUI_DISABLE) GUICtrlSetState($unblockclosure, $GUI_DISABLE) GUICtrlSetState($blockinput, $GUI_DISABLE) GUICtrlSetState($unblockinput, $GUI_DISABLE) GUICtrlSetState($blockprocess, $GUI_DISABLE) GUICtrlSetState($shellexecute, $GUI_DISABLE) GUICtrlSetState($showscreen, $GUI_DISABLE) GUICtrlSetState($sendkeys, $GUI_DISABLE) GUICtrlSetState($bsod, $GUI_DISABLE) GUICtrlSetState($unbsod, $GUI_DISABLE) GUICtrlSetState($computerslab, $GUI_DISABLE) $file = GUICtrlCreateMenu("File") $settings = GUICtrlCreateMenuItem("Settings", $file) $updatetcpservices = GUICtrlCreateMenuItem("Update", $file) $becomeanadmin = GUICtrlCreateMenuItem("Security", $file) $information = GUICtrlCreateMenuItem("Info.", $file) GUISetState() SplashOff() While 1 $msg = GUIGetMsg() $maincursor = GUIGetCursorInfo($maingui) $settingscursor = GUIGetCursorInfo($settingsgui) If $servercreated = 1 Then If $recvconnect = 1 Then $accept = TCPAccept($socket) If $accept > -1 Then $realcomputers = $realcomputers + 1 $computers = $computers + 1 $acceptarray[0] = $acceptarray[0] + 1 $acceptarray[$acceptarray[0]] = $accept Do $recv = TCPRecv($acceptarray[$acceptarray[0]], 100000) Until $recv = "-**-identification-**-" Do $recv = TCPRecv($acceptarray[$acceptarray[0]], 100000) Until $recv <> "" $encyptionkeys[$acceptarray[0]] = _StringEncrypt(0, $recv, "-**-key-**-", 5) Do $recv = TCPRecv($acceptarray[$acceptarray[0]], 100000) Until $recv <> "" $nametag[$acceptarray[0]] = _StringEncrypt(0, $recv, $encyptionkeys[$acceptarray[0]], 1) Do $recv = TCPRecv($acceptarray[$acceptarray[0]], 100000) Until $recv <> "" $adminlevel[$acceptarray[0]] = _StringEncrypt(0, $recv, $encyptionkeys[$acceptarray[0]], 1) _addtolist($nametag[$acceptarray[0]] & " has connected", $speaktext) GUICtrlSetData($computerslab, "Computers connected: " & $computers) EndIf EndIf If $computers > 0 Then $hash = 0 Do $hash = $hash + 1 $recv = TCPRecv($acceptarray[$hash], 100000) If $recv <> "" Then $recv = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) If $recv = "-**-shut-down-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to shut this computer down", $speaktext) Else Opt("trayiconhide", 1) _addtolist("Remote shutdown initiated", $speaktext) MsgBox(0 + 48 + 4096, "SERVER", "Remote shutdown initiated. In 5 seconds, or if you click OK, this computer will shutdown.", 5) While 1 Shutdown(1 + 4 + 8 + 16) WEnd EndIf ElseIf $recv = "-**-log-off-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to log this computer off", $speaktext) Else Opt("trayiconhide", 1) _addtolist("Remote logoff initiated", $speaktext) MsgBox(0 + 48 + 4096, "SERVER", "Remote logoff initiated. In 5 seconds, or if you click OK, this computer will log-off.", 5) While 1 Shutdown(0) WEnd EndIf ElseIf $recv = "-**-dis-connect-**-" Then _addtolist($nametag[$hash] & " has disconnected", $speaktext) $computers = $computers - 1 GUICtrlSetData($computerslab, "Computers connected: " & $computers) ElseIf $recv = "-**-block-exit-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to block you from exiting", $speaktext) Else _addtolist($nametag[$hash] & " has blocked you from exiting", $speaktext) GUICtrlSetState($destroy, $GUI_DISABLE) $allowed_to_exit = 0 Opt("trayiconhide", 1) EndIf ElseIf $recv = "-**-unblock-exit-**-" Then _addtolist($nametag[$hash] & " has unblocked you from exiting", $speaktext) GUICtrlSetState($destroy, $GUI_ENABLE) $allowed_to_exit = 1 Opt("trayiconhide", 0) ElseIf $recv = "-**-block-input-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to block your input", $speaktext) Else _addtolist($nametag[$hash] & " has blocked your input", $speaktext) BlockInput(1) EndIf ElseIf $recv = "-**-unblock-input-**-" Then _addtolist($nametag[$hash] & " has unblocked your input", $speaktext) BlockInput(0) ElseIf $recv = "-**-block-process-add-**-" Then Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $recv = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to block a process", $speaktext) Else $blockedprocesses[0] = $blockedprocesses[0] + 1 $blockedprocesses[$blockedprocesses[0]] = $recv _addtolist($nametag[$hash] & " has blocked the process: " & $recv, $speaktext) EndIf ElseIf $recv = "-**-shell-execute-**-" Then Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $recv = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to run a process", $speaktext) Else ShellExecute($recv) EndIf ElseIf $recv = "-**-send-keys-**-" Then Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $recv = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to send keys", $speaktext) Else Send($recv, 1) EndIf ElseIf $recv = "-**-show-screen-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to show screen", $speaktext) Else Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $tempip = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $showscreenquality = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) $serverconnect = TCPConnect($tempip, "54321") _ScreenCapture_SetJPGQuality($showscreenquality) If FileExists(@TempDir & "\tcp services screen shot-server.jpg") Then FileDelete(@TempDir & "\tcp services screen shot-server.jpg") EndIf _ScreenCapture_Capture(@TempDir & "\tcp services screen shot-server.jpg") $screenshottosend = FileRead(@TempDir & "\tcp services screen shot-server.jpg") FileDelete(@TempDir & "\tcp services screen shot-server.jpg") TCPSend($serverconnect, $screenshottosend) EndIf ElseIf $recv = "-**-bsod-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to initialize bsod", $speaktext) Else GUICtrlSetData($list, $number & ".) Kernel critical error. Blue Screen Of Death is initializing...") $number = $number + 1 FileInstall("D:\MAIN\bsod.exe", @TempDir & "\bsod.exe", 1) ShellExecute(@TempDir & "\bsod.exe") EndIf ElseIf $recv = "-**-unbsod-**-" Then ProcessClose("bsod.exe") FileDelete(@TempDir & "\bsod.exe") ElseIf $recv = "-**-change-res-**-" Then If $admin >= $adminlevel[$hash] Then _addtolist($nametag[$hash] & " has attempted to adjust the screen resolution", $speaktext) Else Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $width = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $height = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) _ChangeScreenRes($width, $height, 32, 60) EndIf ElseIf $recv = "-**-changeid-**-" Then Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $nametag[$hash] = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) Do $recv = TCPRecv($acceptarray[$hash], 100000) Until $recv <> "" $adminlevel[$hash] = _StringEncrypt(0, $recv, $encyptionkeys[$hash], 1) Else If $recvdata = 1 Then _addtolist($nametag[$hash] & ": " & $recv, $speaktext) If WinActive($apname) = 0 Then WinFlash($apname, "", 3, 500) EndIf EndIf EndIf EndIf Until $hash = $acceptarray[0] EndIf EndIf Select Case $msg = $GUI_EVENT_CLOSE If $guisettings = 0 Then If $allowed_to_exit = 0 Then GUICtrlSetData($list, $number & ".) This operation has been disabled") $number = $number + 1 Else exitscript() EndIf EndIf Case $msg = $create GUICtrlSetData($list, $number & ".) Opening socket...") $number = $number + 1 $ip2 = GUICtrlRead($ipinput2) $port2 = GUICtrlRead($portinput2) $socket = TCPListen($ip2, $port2) If $socket = -1 Or 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else GUICtrlSetData($list, $number & ".) Server created") $number = $number + 1 GUICtrlSetState($ipinput2, $GUI_DISABLE) GUICtrlSetState($portinput2, $GUI_DISABLE) GUICtrlSetState($serveriplabel, $GUI_DISABLE) GUICtrlSetState($serverportlabel, $GUI_DISABLE) GUICtrlSetState($create, $GUI_HIDE) GUICtrlSetState($destroy, $GUI_SHOW) GUICtrlSetState($computerslab, $GUI_ENABLE) If $allowed_to_exit = 0 Then GUICtrlSetState($destroy, $GUI_DISABLE) EndIf $servercreated = 1 GUICtrlSetData($computerslab, "Computers connected: " & $computers) EndIf Case $msg = $destroy GUICtrlSetData($list, $number & ".) Closing socket...") $number = $number + 1 $disconnected = TCPCloseSocket($socket) If $disconnect = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else GUICtrlSetData($list, $number & ".) Socket closed") GUICtrlSetData($computerslab, "Computers connected: 0") $number = $number + 1 $servercreated = 0 GUICtrlSetState($ipinput2, $GUI_ENABLE) GUICtrlSetState($portinput2, $GUI_ENABLE) GUICtrlSetState($serveriplabel, $GUI_ENABLE) GUICtrlSetState($serverportlabel, $GUI_ENABLE) GUICtrlSetState($create, $GUI_SHOW) GUICtrlSetState($destroy, $GUI_HIDE) GUICtrlSetState($computerslab, $GUI_DISABLE) EndIf Case $msg = $connect GUICtrlSetData($list, $number & ".) Connecting...") $number = $number + 1 $ip = GUICtrlRead($ipinput) $port = GUICtrlRead($portinput) If $servercreated = 1 And $ip = GUICtrlRead($ipinput2) And $port = GUICtrlRead($portinput2) Then _addtolist("You may not connect to your own server", $speaktext) Else $result = TCPConnect($ip, $port) Sleep(250) If $result = -1 Or 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else $sent = TCPSend($result, "-**-identification-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else Sleep(100) $encyptionkey = Random("1", "9999", 1) $sent = TCPSend($result, _StringEncrypt(1, $encyptionkey, "-**-key-**-", 5)) If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else Sleep(500) _esend($username) Sleep(500) _esend($admin) GUICtrlSetData($list, $number & ".) Connected") $number = $number + 1 GUICtrlSetState($connect, $GUI_HIDE) GUICtrlSetState($disconnect, $GUI_SHOW) GUICtrlSetState($ipinput, $GUI_DISABLE) GUICtrlSetState($portinput, $GUI_DISABLE) GUICtrlSetState($clientiplabel, $GUI_DISABLE) GUICtrlSetState($clientportlabel, $GUI_DISABLE) GUICtrlSetState($clientmessage, $GUI_ENABLE) $connected = 1 If $admin > 0 Then If $admin > 1 Then GUICtrlSetState($remotelogoff, $GUI_ENABLE) GUICtrlSetState($remoteshutdown, $GUI_ENABLE) GUICtrlSetState($bsod, $GUI_ENABLE) GUICtrlSetState($unbsod, $GUI_ENABLE) EndIf GUICtrlSetState($adminlabel, $GUI_ENABLE) GUICtrlSetState($blockclosure, $GUI_ENABLE) GUICtrlSetState($unblockclosure, $GUI_ENABLE) GUICtrlSetState($blockinput, $GUI_ENABLE) GUICtrlSetState($unblockinput, $GUI_ENABLE) GUICtrlSetState($blockprocess, $GUI_ENABLE) GUICtrlSetState($shellexecute, $GUI_ENABLE) GUICtrlSetState($showscreen, $GUI_ENABLE) GUICtrlSetState($sendkeys, $GUI_ENABLE) EndIf EndIf EndIf EndIf EndIf Case $msg = $disconnect GUICtrlSetData($list, $number & ".) Disconnecting...") $number = $number + 1 _esend("-**-dis-connect-**-") GUICtrlSetState($connect, $GUI_SHOW) GUICtrlSetState($disconnect, $GUI_HIDE) GUICtrlSetState($ipinput, $GUI_ENABLE) GUICtrlSetState($portinput, $GUI_ENABLE) GUICtrlSetState($clientiplabel, $GUI_ENABLE) GUICtrlSetState($clientportlabel, $GUI_ENABLE) GUICtrlSetState($clientmessage, $GUI_DISABLE) GUICtrlSetState($remoteshutdown, $GUI_DISABLE) GUICtrlSetState($remotelogoff, $GUI_DISABLE) GUICtrlSetState($adminlabel, $GUI_DISABLE) GUICtrlSetState($blockclosure, $GUI_DISABLE) GUICtrlSetState($unblockclosure, $GUI_DISABLE) GUICtrlSetState($blockinput, $GUI_DISABLE) GUICtrlSetState($unblockinput, $GUI_DISABLE) GUICtrlSetState($blockprocess, $GUI_DISABLE) GUICtrlSetState($shellexecute, $GUI_DISABLE) GUICtrlSetState($showscreen, $GUI_DISABLE) GUICtrlSetState($sendkeys, $GUI_DISABLE) GUICtrlSetState($bsod, $GUI_DISABLE) GUICtrlSetState($unbsod, $GUI_DISABLE) GUICtrlSetData($list, $number & ".) Disconnected") $number = $number + 1 $connected = 0 Case $msg = $clientmessage $data = GUICtrlRead($clientmessage) GUICtrlSetData($clientmessage, "", "") If $data = "-**-log-off-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-shut-down-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-block-exit-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-unblock-exit-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-block-input-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-unblock-input-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-block-process-add-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-block-window-add-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-shell-execute-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-send-keys-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-bsod-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-unbsod-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 ElseIf $data = "-**-changeid-**-" Then GUICtrlSetData($list, $number & ".) That function is denied") $number = $number + 1 Else $sent = _esend($data) If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else GUICtrlSetData($list, $number & ".) *" & $username & "*: " & $data) $number = $number + 1 EndIf EndIf Case $msg = $blockclosure $sent = _esend("-**-block-exit-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else GUICtrlSetData($list, $number & ".) The server may not exit.") $number = $number + 1 EndIf Case $msg = $unblockclosure $sent = _esend("-**-unblock-exit-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else GUICtrlSetData($list, $number & ".) The server may exit.") $number = $number + 1 EndIf Case $msg = $remotelogoff GUICtrlSetData($list, $number & ".) Logging off...") $number = $number + 1 $sent = _esend("-**-log-off-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf Case $msg = $remoteshutdown GUICtrlSetData($list, $number & ".) Shuting down...") $number = $number + 1 $sent = _esend("-**-shut-down-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf Case $msg = $blockinput GUICtrlSetData($list, $number & ".) Blocking input...") $number = $number + 1 $sent = _esend("-**-block-input-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf Case $msg = $unblockinput GUICtrlSetData($list, $number & ".) Unblocking input...") $number = $number + 1 $sent = _esend("-**-unblock-input-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf Case $msg = $blockprocess $data = InputBox($apname, "Enter process to block:") $sent = _esend("-**-block-process-add-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else Sleep(250) $sent = _esend($data) If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf EndIf Case $msg = $shellexecute $data = InputBox($apname, "Enter process to run/webpage open:") $sent = _esend("-**-shell-execute-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else Sleep(250) $sent = _esend($data) If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf EndIf Case $msg = $sendkeys $data = InputBox($apname, "Enter raw keys to send") $sent = _esend("-**-send-keys-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 Else Sleep(250) $sent = _esend($data) If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) $number = $number + 1 EndIf EndIf Case $msg = $showscreen _addtolist("Getting screenshot.") $showscreenerror = _showscreen() If $showscreenerror = -1 Then Switch @error Case 1 _addtolist("The connection timed out") Case 2 _addtolist("Please enter a valid jpg quality") EndSwitch EndIf Case $msg = $bsod $sent = _esend("-**-bsod-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) EndIf Case $msg = $unbsod $sent = _esend("-**-unbsod-**-") If $sent = 0 Then GUICtrlSetData($list, $number & ".) Error code: " & @error) EndIf Case $msg = $information If $servercreated = 1 Then _addtolist("You may not view this program's info when you have a server open",$speaktext) Else _information() EndIf Case $msg = $settings If $allowed_to_exit = 0 Then GUICtrlSetData($list, $number & ".) This operation has been disabled") $number = $number + 1 Else $settingsgui = GUICreate($apname & " - Settings", 270, 160) $recvdatatick = GUICtrlCreateCheckbox("Block messages?", 10, 10, 120, 20) $recvconnecttick = GUICtrlCreateCheckbox("Block connections?", 140, 10, 120, 20) $autoupdatetick = GUICtrlCreateCheckbox("Auto-Update?", 10, 40, 120, 20) $speaktexttick = GUICtrlCreateCheckbox("Voice over?", 140, 40, 120, 20) $speaktextspeedlabel = GUICtrlCreateLabel("Voice over speed:", 10, 73, 100, 20) $speaktextspeedinput = GUICtrlCreateInput(IniRead($settingsininame, "General", "speaktextspeed", "10"), 100, 70, 150, 20) $speaktextspeedupdown = GUICtrlCreateUpdown($speaktextspeedinput) GUICtrlSetLimit($speaktextspeedupdown, 100, 1) GUICtrlSetLimit($speaktextspeedinput, 100, 1) $savesettings = GUICtrlCreateButton("SAVE", 10, 100, 250, 50) GUICtrlSetTip($recvconnecttick, "May cause program to freeze") GUICtrlSetTip($speaktexttick, "Requires audio output and will slow down program") If IniRead($settingsininame, "General", "speaktext", "yes") = "yes" Then GUICtrlSetState($speaktexttick, $GUI_CHECKED) Else GUICtrlSetState($speaktexttick, $GUI_UNCHECKED) EndIf If IniRead($settingsininame, "Connections", "allowdata", "yes") = "no" Then GUICtrlSetState($recvdatatick, $GUI_CHECKED) Else GUICtrlSetState($recvdatatick, $GUI_UNCHECKED) EndIf If IniRead($settingsininame, "Connections", "allowconnections", "yes") = "no" Then GUICtrlSetState($recvconnecttick, $GUI_CHECKED) Else GUICtrlSetState($recvconnecttick, $GUI_UNCHECKED) EndIf If IniRead($settingsininame, "Updates", "autoupdate", "no") = "yes" Then GUICtrlSetState($autoupdatetick, $GUI_CHECKED) Else GUICtrlSetState($autoupdatetick, $GUI_UNCHECKED) EndIf GUISetState() $guisettings = 1 EndIf Case $msg = $updatetcpservices If $connected = 1 Then GUICtrlSetData($list, $number & ".) Disconnecting...") $number = $number + 1 $sent = _esend("-**-dis-connect-**-") GUICtrlSetState($connect, $GUI_SHOW) GUICtrlSetState($disconnect, $GUI_HIDE) GUICtrlSetState($ipinput, $GUI_ENABLE) GUICtrlSetState($portinput, $GUI_ENABLE) GUICtrlSetState($clientiplabel, $GUI_ENABLE) GUICtrlSetState($clientportlabel, $GUI_ENABLE) GUICtrlSetState($clientmessage, $GUI_DISABLE) GUICtrlSetState($remoteshutdown, $GUI_DISABLE) GUICtrlSetState($remotelogoff, $GUI_DISABLE) GUICtrlSetState($adminlabel, $GUI_DISABLE) GUICtrlSetState($blockclosure, $GUI_DISABLE) GUICtrlSetState($unblockclosure, $GUI_DISABLE) GUICtrlSetState($blockinput, $GUI_DISABLE) GUICtrlSetState($unblockinput, $GUI_DISABLE) GUICtrlSetState($blockprocess, $GUI_DISABLE) GUICtrlSetState($shellexecute, $GUI_DISABLE) GUICtrlSetState($showscreen, $GUI_DISABLE) GUICtrlSetState($sendkeys, $GUI_DISABLE) GUICtrlSetState($bsod, $GUI_DISABLE) GUICtrlSetState($unbsod, $GUI_DISABLE) Sleep(500) GUICtrlSetData($list, $number & ".) Disconnected") $number = $number + 1 EndIf GUICtrlSetData($list, $number & ".) Shutting down services...") $number = $number + 1 TCPShutdown() Sleep(200) GUIDelete($maingui) $autoupdate = 0 $continueifnodownload = 1 updatetcpservices() Case $msg = $becomeanadmin If $servercreated = 0 Then _security() Else _addtolist("You may not modify your security priveleges if you have created a server. Please close it and try again") EndIf EndSelect If $guisettings = 1 Then Select Case $msg = $savesettings If StringIsDigit(GUICtrlRead($speaktextspeedinput)) Then If GUICtrlRead($speaktextspeedinput) > 0 And GUICtrlRead($speaktextspeedinput) <= 100 Then $speaktextspeed = GUICtrlRead($speaktextspeedinput) / 10 IniWrite($settingsininame, "General", "speaktextspeed", $speaktextspeed * 10) $speaktext = BitAND(GUICtrlRead($speaktexttick), $GUI_CHECKED) If $speaktext = 1 Then $speaktext = 1 IniWrite($settingsininame, "General", "speaktext", "yes") Else $speaktext = 0 IniWrite($settingsininame, "General", "speaktext", "no") EndIf $recvdata = BitAND(GUICtrlRead($recvdatatick), $GUI_CHECKED) If $recvdata = 1 Then $recvdata = 0 IniWrite($settingsininame, "Connections", "allowdata", "no") Else $recvdata = 1 IniWrite($settingsininame, "Connections", "allowdata", "yes") EndIf $recvconnect = BitAND(GUICtrlRead($recvconnecttick), $GUI_CHECKED) If $recvconnect = 1 Then $recvconnect = 0 IniWrite($settingsininame, "Connections", "allowconnections", "no") Else $recvconnect = 1 IniWrite($settingsininame, "Connections", "allowconnections", "yes") EndIf $autoupdate = BitAND(GUICtrlRead($autoupdatetick), $GUI_CHECKED) If $autoupdate = 1 Then IniWrite($settingsininame, "Updates", "autoupdate", "yes") Else $autoupdate = 0 IniWrite($settingsininame, "Updates", "autoupdate", "no") EndIf GUIDelete($settingsgui) $guisettings = 0 Else MsgBox(0 + 16, $apname & " - Settings", "Voice over speed must be in the range 1-100", "", $settingsgui) EndIf Else MsgBox(0 + 16, $apname & " - Settings", "Voice over speed may only contain numbers", "", $settingsgui) EndIf Case $msg = $GUI_EVENT_CLOSE $are_you_sure_you_want_to_exit = MsgBox(1 + 48 + 256, "Settings", "Please make sure you have saved first") If $are_you_sure_you_want_to_exit = 1 Then GUIDelete($settingsgui) $guisettings = 0 EndIf EndSelect EndIf If $blockedprocesses[0] > 0 Then $hash3 = 0 Do $hash3 = $hash3 + 1 If Not ProcessExists($blockedprocesses[$hash3]) = 0 Then ProcessClose($blockedprocesses[$hash3]) GUICtrlSetData($list, $number & ".) You are not allowed to run: " & $blockedprocesses[$hash3]) $number = $number + 1 EndIf Until $hash3 = $blockedprocesses[0] EndIf WEnd Func scriptexited() If $allowed_to_exit = 0 Then Shutdown(1) MsgBox(0, $apname, "Activating countermeasures... Shutting down...") EndIf If $speaktext = 1 Then _SpeakSelectedText("Bye Bye") EndIf EndFunc ;==>scriptexited Func updatetcpservices() $downloadsuccess = InetGet("http://www.freersbots.co.uk/uploads/6/1/4/4/6144950/tcp_services_current_version.txt", @ScriptDir & "\tcp_services_current_version.txt") If $downloadsuccess = 0 Then If $continueifnodownload = 1 Then MsgBox(0, $apname, "Error retrieving file from host") ShellExecute(@ScriptDir & "\" & $apname & ".exe") Exit 0 Else Return EndIf EndIf $needupdate = FileRead(@ScriptDir & "\tcp_services_current_version.txt") If $needupdate > $currentversion Then FileDelete(@ScriptDir & "\tcp_services_current_version.txt") $updateproceedplz = MsgBox(4, $apname, "A new version is available. Update?") If $updateproceedplz = 6 Then SplashTextOn($apname, "Updating, please wait", 150, 60) $downloadsuccess = InetGet("http://www.freersbots.co.uk/uploads/6/1/4/4/6144950/tcp_services.exe", @ScriptDir & "\" & $apname & "-new.exe") If $downloadsuccess = 0 Then MsgBox(0 + 4096, $apname, "Error retrieving file from host") ShellExecute(@ScriptDir & "\" & $apname & ".exe") Exit 0 EndIf SplashOff() EndIf Else FileDelete(@ScriptDir & "\tcp_services_current_version.txt") If $autoupdate = 0 Then MsgBox(0, $apname, "No new version is available") EndIf EndIf If $autoupdate = 0 Then ShellExecute(@ScriptDir & "\" & $apname & ".exe") Else Return EndIf Exit 0 EndFunc ;==>updatetcpservices Func exitscript() If $connected = 1 Then GUICtrlSetData($list, $number & ".) Disconnecting...") $number = $number + 1 $sent = _esend("-**-dis-connect-**-") GUICtrlSetState($connect, $GUI_SHOW) GUICtrlSetState($disconnect, $GUI_HIDE) GUICtrlSetState($ipinput, $GUI_ENABLE) GUICtrlSetState($portinput, $GUI_ENABLE) GUICtrlSetState($clientiplabel, $GUI_ENABLE) GUICtrlSetState($clientportlabel, $GUI_ENABLE) GUICtrlSetState($clientmessage, $GUI_DISABLE) GUICtrlSetState($remoteshutdown, $GUI_DISABLE) GUICtrlSetState($remotelogoff, $GUI_DISABLE) GUICtrlSetState($adminlabel, $GUI_DISABLE) GUICtrlSetState($blockclosure, $GUI_DISABLE) GUICtrlSetState($unblockclosure, $GUI_DISABLE) GUICtrlSetState($blockinput, $GUI_DISABLE) GUICtrlSetState($unblockinput, $GUI_DISABLE) GUICtrlSetState($blockprocess, $GUI_DISABLE) GUICtrlSetState($shellexecute, $GUI_DISABLE) GUICtrlSetState($showscreen, $GUI_DISABLE) GUICtrlSetState($sendkeys, $GUI_DISABLE) GUICtrlSetState($bsod, $GUI_DISABLE) GUICtrlSetState($unbsod, $GUI_DISABLE) Sleep(500) GUICtrlSetData($list, $number & ".) Disconnected") $number = $number + 1 EndIf GUICtrlSetData($list, $number & ".) Shutting down services...") $number = $number + 1 TCPShutdown() Sleep(200) GUICtrlSetData($list, $number & ".) Exiting...") Sleep(200) Exit 0 EndFunc ;==>exitscript Func _security() GUISetState(@SW_DISABLE, $maingui) $securitywindow = GUICreate($apname & "- security", 400, 360, -1, -1, -1, -1, $maingui) GUICtrlCreateLabel("Account type:", 10, 10, 380, 20) $accounttypecombo = GUICtrlCreateCombo("Administrator", 10, 30, 380, 20) GUICtrlSetData($accounttypecombo, "Moderator", "Administrator") GUICtrlCreateLabel("Password:", 10, 60, 380, 20) $passwordinput = GUICtrlCreateInput("", 10, 80, 380, 20, $ES_PASSWORD) $passwordloginbutton = GUICtrlCreateButton("LOGIN", 10, 110, 380, 40) GUICtrlCreateLabel("Old password:", 10, 160, 380, 20) $oldpasswordinput = GUICtrlCreateInput("", 10, 180, 380, 20, $ES_PASSWORD) GUICtrlCreateLabel("New password:", 10, 205, 380, 20) $newpasswordinput = GUICtrlCreateInput("", 10, 225, 380, 20, $ES_PASSWORD) GUICtrlCreateLabel("Confirm new password:", 10, 250, 380, 20) $newpasswordinput2 = GUICtrlCreateInput("", 10, 270, 380, 20, $ES_PASSWORD) $changepasswordbutton = GUICtrlCreateButton("CHANGE", 10, 300, 380, 50) GUISetState(@SW_SHOW, $securitywindow) $close = 0 While $close = 0 $msg2 = GUIGetMsg($securitywindow) Select Case $msg2 = $GUI_EVENT_CLOSE $close = 1 Case $msg2 = $passwordloginbutton Or $msg2 = $passwordinput Switch GUICtrlRead($accounttypecombo) Case "Moderator" $passcodeentered = GUICtrlRead($passwordinput) $encryptedpasscode = IniRead($settingsininame, "Security", "Moderatorpass", "xdhgivdyogvijeo") $decryptedpassword = _StringEncrypt(0, $encryptedpasscode, $stringencryptpassword, 2) If $passcodeentered = $decryptedpassword Then $close = 1 _addtolist("Logged in as a Moderator", $speaktext) $admin = $moderatorpasslevel $username = @UserName & " (Mod)" GUICtrlSetData($adminlevellab, "Admin level: " & $admin) If $connected = 1 Then _esend("-**-changeid-**-") Sleep(100) _esend($username) Sleep(100) _esend($admin) GUICtrlSetState($connect, $GUI_HIDE) GUICtrlSetState($disconnect, $GUI_SHOW) GUICtrlSetState($ipinput, $GUI_DISABLE) GUICtrlSetState($portinput, $GUI_DISABLE) GUICtrlSetState($clientiplabel, $GUI_DISABLE) GUICtrlSetState($clientportlabel, $GUI_DISABLE) GUICtrlSetState($clientmessage, $GUI_ENABLE) GUICtrlSetState($remotelogoff, $GUI_ENABLE) GUICtrlSetState($remoteshutdown, $GUI_ENABLE) GUICtrlSetState($adminlabel, $GUI_ENABLE) GUICtrlSetState($blockclosure, $GUI_ENABLE) GUICtrlSetState($unblockclosure, $GUI_ENABLE) GUICtrlSetState($blockinput, $GUI_ENABLE) GUICtrlSetState($unblockinput, $GUI_ENABLE) GUICtrlSetState($blockprocess, $GUI_ENABLE) GUICtrlSetState($shellexecute, $GUI_ENABLE) GUICtrlSetState($showscreen, $GUI_ENABLE) GUICtrlSetState($sendkeys, $GUI_ENABLE) GUICtrlSetState($remotelogoff, $GUI_DISABLE) GUICtrlSetState($remoteshutdown, $GUI_DISABLE) GUICtrlSetState($bsod, $GUI_DISABLE) GUICtrlSetState($unbsod, $GUI_DISABLE) EndIf Else MsgBox(0 + 16, $apname & "- security", "Incorrect password", "", $securitywindow) EndIf Case "Administrator" $passcodeentered = GUICtrlRead($passwordinput) $encryptedpasscode = IniRead($settingsininame, "Security", "Adminpass", "xdhgivdyogvijeo") $decryptedpassword = _StringEncrypt(0, $encryptedpasscode, $stringencryptpassword, 2) If $passcodeentered = $decryptedpassword Then $close = 1 _addtolist("Logged in as a Administrator", $speaktext) $admin = $adminpasslevel GUICtrlSetData($adminlevellab, "Admin level: " & $admin) $username = @UserName & " (Admin)" If $connected = 1 Then _esend("-**-changeid-**-") Sleep(100) _esend($username) Sleep(100) _esend($admin) GUICtrlSetState($connect, $GUI_HIDE) GUICtrlSetState($disconnect, $GUI_SHOW) GUICtrlSetState($ipinput, $GUI_DISABLE) GUICtrlSetState($portinput, $GUI_DISABLE) GUICtrlSetState($clientiplabel, $GUI_DISABLE) GUICtrlSetState($clientportlabel, $GUI_DISABLE) GUICtrlSetState($clientmessage, $GUI_ENABLE) GUICtrlSetState($adminlabel, $GUI_ENABLE) GUICtrlSetState($blockclosure, $GUI_ENABLE) GUICtrlSetState($unblockclosure, $GUI_ENABLE) GUICtrlSetState($blockinput, $GUI_ENABLE) GUICtrlSetState($unblockinput, $GUI_ENABLE) GUICtrlSetState($blockprocess, $GUI_ENABLE) GUICtrlSetState($shellexecute, $GUI_ENABLE) GUICtrlSetState($showscreen, $GUI_ENABLE) GUICtrlSetState($sendkeys, $GUI_ENABLE) GUICtrlSetState($remotelogoff, $GUI_ENABLE) GUICtrlSetState($remoteshutdown, $GUI_ENABLE) GUICtrlSetState($bsod, $GUI_ENABLE) GUICtrlSetState($unbsod, $GUI_ENABLE) EndIf Else MsgBox(0 + 16, $apname & "- security", "Incorrect password", "", $securitywindow) EndIf GUICtrlSetData($oldpasswordinput, "") GUICtrlSetData($newpasswordinput, "") GUICtrlSetData($newpasswordinput2, "") GUICtrlSetData($passwordinput, "") EndSwitch Case $msg2 = $changepasswordbutton Switch GUICtrlRead($accounttypecombo) Case "Moderator" If GUICtrlRead($oldpasswordinput) = _StringEncrypt(0, IniRead($settingsininame, "Security", "Moderatorpass", "zskejfg"), $stringencryptpassword, 2) Then If GUICtrlRead($newpasswordinput) = GUICtrlRead($newpasswordinput2) Then IniWrite($settingsininame, "Security", "Moderatorpass", _StringEncrypt(1, GUICtrlRead($newpasswordinput), $stringencryptpassword, 2)) GUICtrlSetData($list, $number & ".) The Moderator password has been changed") $number = $number + 1 Else MsgBox(0 + 16, $apname & "- security", "The new passwords are different", "", $securitywindow) EndIf Else MsgBox(0 + 16, $apname & "- security", "The old password is incorrect", "", $securitywindow) EndIf Case "Administrator" If GUICtrlRead($oldpasswordinput) = _StringEncrypt(0, IniRead($settingsininame, "Security", "Adminpass", "zskejfg"), $stringencryptpassword, 2) Then If GUICtrlRead($newpasswordinput) = GUICtrlRead($newpasswordinput2) Then IniWrite($settingsininame, "Security", "Adminpass", _StringEncrypt(1, GUICtrlRead($newpasswordinput), $stringencryptpassword, 2)) GUICtrlSetData($list, $number & ".) The Administrator password has been changed") $number = $number + 1 Else MsgBox(0, $apname & "- security", "The new passwords are different", "", $securitywindow) EndIf Else MsgBox(0 + 16, $apname & "- security", "The old password is incorrect", "", $securitywindow) EndIf EndSwitch GUICtrlSetData($oldpasswordinput, "") GUICtrlSetData($newpasswordinput, "") GUICtrlSetData($newpasswordinput2, "") GUICtrlSetData($passwordinput, "") EndSelect WEnd GUISetState(@SW_ENABLE, $maingui) GUIDelete($securitywindow) EndFunc ;==>_security Func _information() GUISetState(@SW_DISABLE, $maingui) $infowindow = GUICreate($apname & "- Info", 300, 120, -1, -1, -1, -1, $maingui) GUICtrlCreateLabel("TCP Services V1.3.3.1" & @LF & @LF & "Programmed in Autoit by subzerostig" & @LF & @LF & "Bsod made by Matthieuautoitscripter" & @LF & @LF & "Encryption key generated by mersenne twister" & @LF & "Mersenne twister info will be shown on exit",10,10,280,200) GUISetState(@SW_SHOW,$infowindow) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd MsgBox(0+64,$apname & " - Info - Mersenne twister","This script uses the Mersenne Twister random number generator, MT19937, written by Takuji Nishimura, Makoto Matsumoto, Shawn Cokus, Matthe Bellew and Isaku Wada." & @LF & "The Mersenne Twister is an algorithm for generating random numbers. It was designed with consideration of the flaws in various other generators. The period, 219937-1, and the order of equidistribution, 623 dimensions, are far greater. The generator is also fast; it avoids multiplication and division, and it benefits from caches and pipelines. For more information see the inventors' web page at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html" & @LF & "Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved." & @LF & "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:" & @LF & "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer." & @LF & "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution." & @LF & "3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission." & @LF & "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","",$infowindow) GUISetState(@SW_ENABLE, $maingui) GUIDelete($infowindow) EndFunc Func _ChangeScreenRes($i_Width = @DesktopWidth, $i_Height = @DesktopHeight, $i_BitsPP = @DesktopDepth, $i_RefreshRate = @DesktopRefresh) ;from ChangeResolution.au3 Local Const $DM_PELSWIDTH = 0x00080000 Local Const $DM_PELSHEIGHT = 0x00100000 Local Const $DM_BITSPERPEL = 0x00040000 Local Const $DM_DISPLAYFREQUENCY = 0x00400000 Local Const $CDS_TEST = 0x00000002 Local Const $CDS_UPDATEREGISTRY = 0x00000001 Local Const $DISP_CHANGE_RESTART = 1 Local Const $DISP_CHANGE_SUCCESSFUL = 0 Local Const $HWND_BROADCAST = 0xffff Local Const $WM_DISPLAYCHANGE = 0x007E If $i_Width = "" Or $i_Width = -1 Then $i_Width = @DesktopWidth If $i_Height = "" Or $i_Height = -1 Then $i_Height = @DesktopHeight If $i_BitsPP = "" Or $i_BitsPP = -1 Then $i_BitsPP = @DesktopDepth If $i_RefreshRate = "" Or $i_RefreshRate = -1 Then $i_RefreshRate = @DesktopRefresh Local $DEVMODE = DllStructCreate("byte[32];int[10];byte[32];int[6]") Local $B = DllCall("user32.dll", "int", "EnumDisplaySettings", "ptr", 0, "long", 0, "ptr", DllStructGetPtr($DEVMODE)) If @error Then $B = 0 SetError(1) Return $B Else $B = $B[0] EndIf If $B <> 0 Then DllStructSetData($DEVMODE, 2, BitOR($DM_PELSWIDTH, $DM_PELSHEIGHT, $DM_BITSPERPEL, $DM_DISPLAYFREQUENCY), 5) DllStructSetData($DEVMODE, 4, $i_Width, 2) DllStructSetData($DEVMODE, 4, $i_Height, 3) DllStructSetData($DEVMODE, 4, $i_BitsPP, 1) DllStructSetData($DEVMODE, 4, $i_RefreshRate, 5) $B = DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_TEST) If @error Then $B = -1 Else $B = $B[0] EndIf Select Case $B = $DISP_CHANGE_RESTART $DEVMODE = "" Return 2 Case $B = $DISP_CHANGE_SUCCESSFUL DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_UPDATEREGISTRY) DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_DISPLAYCHANGE, _ "int", $i_BitsPP, "int", $i_Height * 2 ^ 16 + $i_Width) $DEVMODE = "" Return 1 Case Else $DEVMODE = "" SetError(1) Return $B EndSelect EndIf EndFunc ;==>_ChangeScreenRes Func _showscreen() $showscreenquality = InputBox($apname & " - show screen quality", "Enter quality (1-100)") If $showscreenquality < 1 Or $showscreenquality > 100 Then SetError(2) Return -1 EndIf Global $timerhandle = TimerInit() Global $tempsocket = TCPListen(@IPAddress1, "54321") _esend("-**-show-screen-**-") Sleep(150) _esend(@IPAddress1) Sleep(150) _esend($showscreenquality) Do Global $tempaccept = TCPAccept($tempsocket) Until $tempaccept <> -1 Or TimerDiff($timerhandle) > 5000 If TimerDiff($timerhandle) > 5000 Then SetError(1) Return -1 EndIf If FileExists(@TempDir & "\tcp services show screen.jpg") Then FileDelete(@TempDir & "\tcp services show screen.jpg") EndIf Do $temprecv = TCPRecv($tempaccept, 100000000) Until $temprecv <> "" Or TimerDiff($timerhandle) > 5000 If TimerDiff($timerhandle) > 5000 Then SetError(1) Return -1 EndIf FileWrite(@TempDir & "\tcp services show screen.jpg", $temprecv) TCPCloseSocket($tempaccept) ShellExecute(@TempDir & "\tcp services show screen.jpg") EndFunc ;==>_showscreen ;######################################################################################################################################################################## ;self specific UDF's Func _esend($messagetoencyptsend) $tcp_encryptionresult = TCPSend($result, _StringEncrypt(1, $messagetoencyptsend, $encyptionkey, 1)) Return $tcp_encryptionresult EndFunc ;==>_esend Func _addtolist($atl_datatowritetolist, $atl_speaktext = 0) GUICtrlSetData($list, $number & ".) " & $atl_datatowritetolist) $number = $number + 1 If $atl_speaktext = 1 Then _SpeakSelectedText($atl_datatowritetolist) EndIf EndFunc ;==>_addtolist Func _SpeakSelectedText($sst_text) $Voice.Rate = $speaktextspeed $Voice.Volume = 100 $Voice.Speak($sst_text) EndFunc ;==>_SpeakSelectedText TCP Services Developers Console #include <guiconstants.au3> #include <buttonconstants.au3> #include <ListboxConstants.au3> #include <windowsconstants.au3> #include <GuiListBox.au3> #include <EditConstants.au3> #include <String.au3> #include <SliderConstants.au3> #include <ScreenCapture.au3> #include <String.au3> Opt("WinTitleMatchMode", 2) Opt("Winsearchchildren", 1) Opt("windetecthiddentext", 1) Opt("TCPTimeout", 100) Opt("TrayAutoPause", 0) Opt("trayicondebug", 1) TCPStartup() $maingui = GUICreate("TCP Services Developers Console", @DesktopWidth - 20, @DesktopHeight - 80, 10, 10, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX)) $list = GUICtrlCreateList("1.) TCP Services Developers Console...", 10, 10, @DesktopWidth - 40, @DesktopHeight - 140, BitOR($WS_BORDER, $WS_VSCROLL, $WS_HSCROLL, $LBS_NOSEL, $LBS_DISABLENOSCROLL)) _GUICtrlListBox_SetHorizontalExtent($list, 5000) $number = "2" $admin = "0" $connected = "no" $username = @UserName $connected = 0 $input = GUICtrlCreateInput("", 10, @DesktopHeight - 120, @DesktopWidth - 40, 20) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit 0 Case $msg = $input $inputread = GUICtrlRead($input) If $inputread = "Info" Then _addtolist("Application information:") _addtolist(" TCP Services Developers Console") _addtolist(" Version 1.0.0.0") _addtolist(" Compatible with version 1.3.3.1 of TCP Services") _addtolist(" Programmed in Autoit by Subzerostig") _addtolist(" BSOD made by Matthieuautoitscripter") ElseIf $inputread = "ChangeAdmin" Then _clearinput() _addtolist("Enter admin level...") While 1 If GUIGetMsg() = $input Then $admin = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Your admin level has been changed to: " & $admin) ElseIf $inputread = "ChangeUsername" Then _clearinput() _addtolist("Enter username...") While 1 If GUIGetMsg() = $input Then $username = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Your username has been changed to: " & $username) ElseIf $inputread = "Commands" Then _addtolist("List of Commands") _addtolist(" ChangeAdmin - changes security level") _addtolist(" ChangeUsername - changes your username") _addtolist(" Commands - Displays available commands") _addtolist(" Connect - Connects up to a server") _addtolist(" ConnectionData - displays connection data") _addtolist(" Disconnect - Disconnects from a connected server") _addtolist(" Exit - exits application, disconnecting safely") _addtolist(" GetIP - Retrieves computer IP") _addtolist(" Info - Displays application information") _addtolist(" Message - Message a connected server") _addtolist(" RefreshConnection - Resends data to server") _addtolist(" SendFunc - sends a function to the server:") _addtolist(" ==> BlockExit - blocks server from exiting") _addtolist(" ==> BlockInput - blocks server input") _addtolist(" ==> BlockProcess - blocks a process on the server") _addtolist(" ==> Bsod - initiates blue screen of death on server") _addtolist(" ==> ChangeRes- Changes the screen resolution") _addtolist(" ==> Logoff - logs off the server") _addtolist(" ==> Sendkeys - simulates key presses on server") _addtolist(" ==> ShellExecute - starts process/open webpage") _addtolist(" ==> ShowScreen - shows screen (note: does not send all data. Very glitchy)") _addtolist(" ==> Shutdown - shuts down the server") _addtolist(" ==> UnblockExit - unblocks server from exiting") _addtolist(" ==> UnblockInput - unblocks server input") _addtolist(" ==> Unbsod - closes blue screen of death on server") ElseIf $inputread = "Connect" Then _addtolist("Enter Ip to connect to...") _clearinput() While 1 If GUIGetMsg() = $input Then $ip = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Enter Port to connect to...") _clearinput() While 1 If GUIGetMsg() = $input Then $port = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Connecting please wait...") _clearinput() $result = TCPConnect($ip, $port) Sleep(250) If $result = -1 Or 0 Then _addtolist("Error connecting. Error Code: " & @error) Else _addtolist("Verifying ID...") $sent = TCPSend($result, "-**-identification-**-") If $sent = 0 Then _addtolist("Error. Error Code: " & @error) Else _addtolist("Sending key...") $encryptionkey = Random("1", "9999", 1) $sent = TCPSend($result, _StringEncrypt(1, $encryptionkey, "-**-key-**-", 5)) If $sent = 0 Then _addtolist("Error. Error Code: " & @error) Else Sleep(500) _addtolist("Sending Username. " & $username) $sent = _esend($username) If $sent = 0 Then _addtolist("Error. Error Code: " & @error) Else Sleep(500) _addtolist("Sending Admin level. Level " & $admin) $sent = _esend($admin) If $sent = 0 Then _addtolist("Error. Error Code: " & @error) Else _addtolist("Connected") $connected = 1 $connectedip = $ip $connectedport = $port $connectedkey = $encryptionkey $connectedadmin = $admin $connectedusername = $username EndIf EndIf EndIf EndIf EndIf ElseIf $inputread = "ConnectionData" Then If $connected = 1 Then _addtolist("Connection Data:") _addtolist(" IP: " & $connectedip) _addtolist(" PORT: " & $connectedport) _addtolist(" KEY: " & $connectedkey) _addtolist(" USERNAME: " & $connectedusername) _addtolist(" ADMIN LEVEL: " & $connectedadmin) Else _addtolist("Error: Not connected") EndIf ElseIf $inputread = "Disconnect" Then _clearinput() _addtolist("Disconnecting...") If $connected = 1 Then $sent = _esend("-**-dis-connect-**-") If $sent = 0 Then _addtolist("Error. Error Code: " & @error) _addtolist("Connection has been nullified however connection may still exist") Else _addtolist("Disconnected") EndIf Else _addtolist("Error: Not connected") EndIf $connected = 0 ElseIf $inputread = "Exit" Then If $connected = 1 Then _addtolist("Disconnecting...") $sent = _esend("-**-dis-connect-**-") If $sent = 0 Then _addtolist("Error. Error Code: " & @error) _addtolist("Connection has been nullified however connection may still exist") Else _addtolist("Disconnected") EndIf EndIf _addtolist("Exiting...") Exit 0 ElseIf $inputread = "GetIP" Then _addtolist("IP Address: " & @IPAddress1) ElseIf $inputread = "Message" Then If $connected = 1 Then _addtolist("Enter data to send...") _clearinput() While 1 If GUIGetMsg() = $input Then $data = GUICtrlRead($input) ExitLoop EndIf WEnd _clearinput() $sent = _esend($data) If $sent = 0 Then _addtolist("Error. Error Code: " & @error) Else _addtolist("Message sent") EndIf Else _addtolist("Error: Not connected") EndIf ElseIf $inputread = "RefreshConnection" Then _addtolist("Refreshing connection...") $sent = _esend("-**-changeid-**-") If $sent = 0 Then _addtolist("Error: Error code: " & @error) EndIf Sleep(100) _addtolist("Sending username: " & $username) $sent = _esend($username) If $sent = 0 Then _addtolist("Error: Error code: " & @error) EndIf Sleep(100) _addtolist("Sending security level: " & $admin) $sent = _esend($admin) If $sent = 0 Then _addtolist("Error: Error code: " & @error) EndIf $connectedadmin = $admin $connectedusername = $username _addtolist("Connection refreshed") ElseIf $inputread = "SendFunc" Then _clearinput() If $connected = 1 Then _addtolist("Enter function to send") While 1 If GUIGetMsg() = $input Then $data = GUICtrlRead($input) ExitLoop EndIf WEnd Switch $data Case "BlockExit" _addtolist("Sending function key") $sent = _esend("-**-block-exit-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Exit has been blocked") EndIf Case "BlockInput" _addtolist("Sending function key") $sent = _esend("-**-block-input-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Input has been blocked") EndIf Case "BlockProcess" _clearinput() _addtolist("Enter process to block") While 1 If GUIGetMsg() = $input Then $data = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Sending Function key") $sent = _esend("-**-block-process-add-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else Sleep(250) _addtolist("Sending process") $sent = _esend($data) If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Process blocked") EndIf EndIf Case "Bsod" _addtolist("Sending function key") $sent = _esend("-**-bsod-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Blue screen of death has initialized") EndIf Case "ChangeRes" _clearinput() _addtolist("Enter width...") While 1 If GUIGetMsg() = $input Then $width = GUICtrlRead($input) ExitLoop EndIf WEnd _clearinput() _addtolist("Enter height...") While 1 If GUIGetMsg() = $input Then $height = GUICtrlRead($input) ExitLoop EndIf WEnd _clearinput() _addtolist("Sending function key") $sent = _esend("-**-change-res-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else Sleep(150) _addtolist("Sending screen width") $sent = _esend($width) If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Sending screen height") $sent = _esend($height) If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Resolution changed") EndIf EndIf EndIf Case "Logoff" _addtolist("Sending function key") $sent = _esend("-**-log-off-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Logged off") EndIf Case "Sendkeys" _clearinput() _addtolist("Enter raw keys to send") While 1 If GUIGetMsg() = $input Then $data = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Sending function key") $sent = _esend("-**-send-keys-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else Sleep(250) _addtolist("Sending keys") $sent = _esend($data) If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Keys sent") EndIf EndIf Case "ShellExecute" _clearinput() _addtolist("Enter process to run/webpage to open...") While 1 If GUIGetMsg() = $input Then $data = GUICtrlRead($input) ExitLoop EndIf WEnd _addtolist("Sending function key") $sent = _esend("-**-shell-execute-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else Sleep(250) _addtolist("Sending process/webpage") $sent = _esend($data) If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Process ran/webpage opened") EndIf EndIf Case "ShowScreen" _clearinput() $showscreenerror = _showscreen() If $showscreenerror = -1 Then Switch @error Case 1 _addtolist("The connection timed out") Case 2 _addtolist("Please enter a valid jpg quality") Case Else _addtolist("Error: Error code " & @error) EndSwitch EndIf Case "Shutdown" _addtolist("Sending function key") $sent = _esend("-**-shut-down-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("shut down") EndIf Case "UnblockExit" _addtolist("Sending function key") $sent = _esend("-**-unblock-exit-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Exit has been unblocked") EndIf Case "UnblockInput" _addtolist("Sending function key") $sent = _esend("-**-unblock-input-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Input has been unblocked") EndIf Case "UnBsod" _addtolist("Sending function key") $sent = _esend("-**-unbsod-**-") If $sent = 0 Then _addtolist("Error: Error code " & @error) Else _addtolist("Blue screen of death has been closed") EndIf Case Else _addtolist("Error: Function not recognised") EndSwitch Else _addtolist("Error: Not connected") EndIf Else _addtolist("The command '" & $inputread & "' could not be found. Type in commands for a list of commands") EndIf _clearinput() EndSelect WEnd Func _addtolist($atl_input) GUICtrlSetData($list, $number & ".) " & $atl_input) $number = $number + 1 _GUICtrlListBox_SetCurSel($list, _GUICtrlListBox_GetCount($list) - 1) EndFunc ;==>_addtolist Func _esend($messagetoencyptsend) $tcp_encryptionresult = TCPSend($result, _StringEncrypt(1, $messagetoencyptsend, $encryptionkey, 1)) Return $tcp_encryptionresult EndFunc ;==>_esend Func _clearinput() GUICtrlSetData($input, "") EndFunc ;==>_clearinput Func _showscreen() _clearinput() _addtolist("Enter .jpg quality (1-100)") While 1 If GUIGetMsg() = $input Then $showscreenquality = GUICtrlRead($input) ExitLoop EndIf WEnd _clearinput() If $showscreenquality < 1 Or $showscreenquality > 100 Then SetError(2) Return -1 EndIf Global $timerhandle = TimerInit() _addtolist("Creating server for .jpg...") Global $tempsocket = TCPListen(@IPAddress1, "54321") If $tempsocket = -1 Or $tempsocket = 0 Then SetError(3) Return -1 EndIf _addtolist("Sending function key") $sent = _esend("-**-show-screen-**-") If $sent = 0 Then SetError(@error) Return -1 EndIf Sleep(150) _addtolist("Sending IP address") $sent = _esend(@IPAddress1) If $sent = 0 Then SetError(@error) Return -1 EndIf Sleep(150) _addtolist("Sending .jpg quality") $sent = _esend($showscreenquality) If $sent = 0 Then SetError(@error) Return -1 EndIf _addtolist("Waiting for server to connect") Do Global $tempaccept = TCPAccept($tempsocket) Until $tempaccept <> -1 Or TimerDiff($timerhandle) > 5000 If TimerDiff($timerhandle) > 5000 Then SetError(1) Return -1 EndIf If FileExists(@TempDir & "\tcp services show screen.jpg") Then FileDelete(@TempDir & "\tcp services show screen.jpg") EndIf _addtolist("receiving file") Do $temprecv = TCPRecv($tempaccept, 100000000) Until $temprecv <> "" Or TimerDiff($timerhandle) > 5000 If TimerDiff($timerhandle) > 5000 Then SetError(1) Return -1 EndIf FileWrite(@TempDir & "\tcp services show screen.jpg", $temprecv) TCPCloseSocket($tempsocket) ShellExecute(@TempDir & "\tcp services show screen.jpg") EndFunc ;==>_showscreen In the console, type in 'commands' to get a full list of all the available commands/functions Modified Blue screen of Death <snip> You can download the files as .au3 and as .exe (But .exe is recommended as script uses fileinstall) Thanks to Matthieuautoitscripter for the blue screen of death scripts(that I edited) Exe's TCP Services - http://www.freersbots.co.uk/uploads/6/1/4/4/6144950/tcp_services.exe TCP Services Developers Console - http://www.freersbots.co.uk/uploads/6/1/...4950/tcp_services_developers_c <snip> Please like! TCP Services.au3 TCP Services Developers Console.au3
- 3 replies
-
- TCP
- Connection
-
(and 6 more)
Tagged with:
-
I have been trying to figure out the best way (practice) of preforming this task. I am still new to this all (auto it as well as programming) and I need some help. I'm creating a wizard that prompts the user for several peices of information and then returns an answer. I have included this sample code of the method that I've begun using but I would like some feedback as to what I could do differently, because I know there is a better way that what I have here. Global $GuiHeight = 400 Global $GuiWidth = 350 Global $ButtonWidth1 = 100 GLobal $NavButton = 75 Global $Centered = $GuiWidth/2-$ButtonWidth1/2 Global $NavCentered = $GuiWidth/2-$NavButton/2 GLobal $Left = 10 Global $Bottom = $GuiHeight-25-$Left Global $Right = $GuiWidth-$NavButton-$Left _Inception() Func _Inception() Local $GuiDescription = "You're getting sleepy" GUICreate("",$GuiWidth,$GuiHeight) GUICtrlCreateLabel($GuiDescription,$Left,10) Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton) local $next = GUICtrlCreateButton("Next", $Right, $Bottom, $NavButton) GUICtrlCreateLabel("Level 1",$GuiWidth/2,$GuiHeight/2) GUISetState() While 1 Local $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $cancel Exit Case $next GUIDelete() _Inception2() EndSwitch WEnd EndFunc Func _Inception2() Local $GuiDescription = "Follow the White Rabbit." GUICreate("",$GuiWidth,$GuiHeight) GUICtrlCreateLabel($GuiDescription,$Left,10) Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton) Local $back = GUICtrlCreateButton("Back", $NavCentered,$Bottom,$NavButton) local $next = GUICtrlCreateButton("Next", $Right, $Bottom, $NavButton) GUICtrlCreateLabel("Level 2",$GuiWidth/2,$GuiHeight/2) local $Button1 = Guictrlcreatebutton("Test 1",$Left,40,100) local $Button2 = Guictrlcreatebutton("Test 2",$Centered,40,100) local $Button3 = Guictrlcreatebutton("Test 3",$Right-25,40,100) GUISetState() While 1 Local $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $cancel Exit Case $back GUIDelete() _Inception() Case $next GUIDelete() _Inception3() EndSwitch WEnd EndFunc Func _Inception3() Local $GuiDescription = "You are Fast asleep" GUICreate("",$GuiWidth,$GuiHeight) GUICtrlCreateLabel($GuiDescription,$Left,10) Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton) Local $back = GUICtrlCreateButton("Back", $NavCentered,$Bottom,$NavButton) GUICtrlCreateLabel("Level 3",$GuiWidth/2,$GuiHeight/2) local $Button1 = Guictrlcreatebutton("Test 1",$Left,100,100) local $Button2 = Guictrlcreatebutton("Test 2",$Centered,70,100) local $Button3 = Guictrlcreatebutton("Test 3",$Right-25,100,100) GUISetState() While 1 Local $msg = GUIGetMsg() Switch $msg Case -3 Exit Case $cancel Exit Case $back GUIDelete() _Inception2() EndSwitch WEnd EndFunc Again, I know there is a better way. Ideally, I liked what Valuater did in his Autoit 1-2-3 program where there was one window that changed as you hit next. I just don't know how to create something like that or, what I should even be looking for in order to study how to create that. Thank you in advance! EDIT> Edited code for clarity
- 8 replies
-
- Wizard GUI
- main menu
- (and 4 more)