Jump to content

Maximizing


Recommended Posts

How do I allow the user to maximize/resize a gui and keep the controls the right distance/size apart? I'm making a chat client and I only want 2 controls to ever move...

EDIT: I didn't say that very clearly, I want to know how to make the controls stay at the same distance apart, and how to make 2 of my controls resize with the window... if that makes any more sense

Edited by VindicatorOmega

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Wow this is alot more difficult than I thought it would be. I can't get the right controls to stretch, and some controls don't do anything no matter what is added to them.

Okay, suppose I have a bunch of input boxes on the top right of my GUI, and I want that to ALWAYS be stuck to the top right of my gui, no resizing, nothing, only MOVING to stick to the top right corner. but I have this big edit box that I want to resize as much as it needs to still be touching the inputboxes, the left,top, AND bottom edges of the GUI. How would I go on doing this?

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

Wow this is alot more difficult than I thought it would be. I can't get the right controls to stretch, and some controls don't do anything no matter what is added to them.

Okay, suppose I have a bunch of input boxes on the top right of my GUI, and I want that to ALWAYS be stuck to the top right of my gui, no resizing, nothing, only MOVING to stick to the top right corner. but I have this big edit box that I want to resize as much as it needs to still be touching the inputboxes, the left,top, AND bottom edges of the GUI. How would I go on doing this?

Something like this (but you need to post your GUI example for more clear solution):

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

$GUI = GUICreate("Resizing Example", 500, 200, -1, -1, $WS_OVERLAPPEDWINDOW)

$Edit = GUICtrlCreateEdit("", 10, 20, 320, 160)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM))

$Input1 = GUICtrlCreateInput("", 380, 20, 100, 20)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))

$Input2 = GUICtrlCreateInput("", 380, 50, 100, 20)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))

GUISetState(@SW_SHOW, $GUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Okay, I tried that with my script, it mainly works except the "edit" box doesn't change much width wise... Actually, it's not really an edit box, its an embedded IE framything.(its $Textbox in this script)

Here's the super long script, I figured i didn't want to dissect the GUI out, incase you need to run it....

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\pm.ico
#AutoIt3Wrapper_outfile=SRChat.exe
#AutoIt3Wrapper_Res_Comment=Soulraver Chat Client, By Vindicator
#AutoIt3Wrapper_Res_Description=Independent Chat Client
#AutoIt3Wrapper_Res_Fileversion=3.3.0.0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <StaticConstants.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Misc.au3>
#include <String.au3>
$ver = 3.9
$consolerun = False
$consoleopen = False
SplashTextOn("Checking for updates...", "Checking for current version...", 300, 50)
If FileExists("curver.txt") Then FileDelete("curver.txt")
InetGet("http://www.freewebs.com/vindicatoromega/curver.txt", "curver.txt")
Sleep(500)
If FileExists("curver.txt") Then
    If FileRead("curver.txt") > $ver Then
        SplashTextOn("Checking for updates...", "New version found, autoupdating...", 300, 50)
        Sleep(1000)
        If Not (FileExists("autoupdate.exe")) Then FileInstall("autoupdate.exe", "autoupdate.exe")
        Do
            Sleep(500)
        Until FileExists("autoupdate.exe")
        Run("autoupdate.exe")
        Exit
    EndIf
EndIf
SplashOff()
Dim $Bind[20][3]
$Bind[0][0] = 0
$Text = _IECreateEmbedded()
$Msg = _IECreateEmbedded()
$Logins = _IECreateEmbedded()
$AW_SLIDE_IN = 0x00040001
$AW_SLIDE_OUT = 0x00050002
$lastsize = 0
$last = ""
$dll = DllOpen("user32.dll")
$tempname = IniRead("conf.ini", "LastLogin", "name", "Username")
$temppass = IniRead("conf.ini", "LastLogin", "pass", "Password")
$winbg = IniRead("conf.ini", "Settings", "winbg", 0xBEBEBE)
$chatbg = IniRead("conf.ini", "Settings", "chatbg", "dbdbdb")
$autolog = IniRead("conf.ini", "Settings", "autolog", 0)
$flash = IniRead("conf.ini", "Settings", "flash", 0)
$sound = IniRead("conf.ini", "Settings", "sound", 0)
$LoginMessage = IniRead("conf.ini", "Settings", "loginmsg", "")
$LogoffMessage = IniRead("conf.ini", "Settings", "logoffmsg", "")
#Region === Extremely long lines of HTML that SRChat replaces with the default HTML in chat
$title = "Soulraver Chat v" & $ver
$PortalText = '<body bgcolor="#dbdbdb" scroll="no"><div id="div_chat" style="height: 100%; width: 100%; overflow: auto; background-color: #' & $chatbg
$PortalText &= '; font-family: Comic Sans MS; font-size: 15;">'
$PortalText &= 'Welcome to Vindicators SoulRaver Chat Client!<br /><br />'
$PortalText &= 'Version ' & $ver & '<br />'
$PortalText &= 'Updates for this version:<br />'
$PortalText &= '-The ENTER and UP hotkeys now shouldnt affect other progs<br />'
$PortalText &= '-Pressing UP will enter your last message into the box<br />'
$PortalText &= '-Now pressing DOWN will open the context menu at your mouse<br />'
$PortalText &= '-You can right click the input box (if you are typing in it)<br />'
$PortalText &= '-A status bar has been added<br />'
$PortalText &= '-SRBot commands added to dropdown menu<br />'
$PortalText &= 'Thanks for using!<br />'
$PortalText &= '</div></font>'
#EndRegion === Extremely long lines of HTML that SRChat replaces with the default HTML in chat
$Run = False
HotKeySet("`", "Console")
$Form1 = GUICreate($title, 755, 470, -1, -1,$WS_MAXIMIZEBOX)
GUISetBkColor($winbg)
$Group1 = GUICtrlCreateGroup("Chat", 8, 8, 505, 433)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM))
$Textbox = GUICtrlCreateObj($Text, 16, 32, 489, 369)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM))
_IENavigate($Text, "http://www.freewebs.com/vindicatoromega/Default.html")
$Preset = GUICtrlCreateCombo("|", 16, 408, 50, 21)
GUICtrlSetData(-1, "/msg ")
GUICtrlSetData(-1, "/r ")
GUICtrlSetData(-1, "/me ")
GUICtrlSetData(-1, "<b> ")
GUICtrlSetData(-1, "<i> ")
GUICtrlSetData(-1, "<u> ")
GUICtrlSetData(-1, "/say ")
GUICtrlSetData(-1, "/listen ")
GUICtrlSetData(-1, "@shoot ")
GUICtrlSetData(-1, '@say "')
$Input1 = GUICtrlCreateInput("", 66, 408, 407, 21)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
$Button1 = GUICtrlCreateButton("Go", 472, 408, 33, 21, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Context = GUICtrlCreateContextMenu($Button1)
Dim $ContextButton[8]
$ContextButton1 = GUICtrlCreateMenuItem("Copy All", $Context)
GUICtrlCreateMenuItem("", $Context)
$SubMenu = GUICtrlCreateMenu("Send To", $Context)
$ContextButton[1] = GUICtrlCreateMenuItem("Macro 1", $SubMenu)
$ContextButton[2] = GUICtrlCreateMenuItem("Macro 2", $SubMenu)
$ContextButton[3] = GUICtrlCreateMenuItem("Macro 3", $SubMenu)
$ContextButton[4] = GUICtrlCreateMenuItem("Macro 4", $SubMenu)
$ContextButton[5] = GUICtrlCreateMenuItem("Macro 5", $SubMenu)
$ContextButton[6] = GUICtrlCreateMenuItem("Macro 6", $SubMenu)
GUICtrlCreateMenuItem("", $Context)
$SubMenu4 = GUICtrlCreateMenu("Chat Commands", $Context)
$ContextButton2 = GUICtrlCreateMenuItem("/clear", $SubMenu4)
$ContextButton3 = GUICtrlCreateMenuItem("/who", $SubMenu4)
$ContextButton9 = GUICtrlCreateMenuItem("/c", $SubMenu4)
$ContextButton10 = GUICtrlCreateMenuItem("/listen", $SubMenu4)
$ContextButton11 = GUICtrlCreateMenuItem("/say", $SubMenu4)
$ContextButton12 = GUICtrlCreateMenuItem("/msg", $SubMenu4)
$ContextButton13 = GUICtrlCreateMenuItem("/ignore", $SubMenu4)
$ContextButton14 = GUICtrlCreateMenuItem("/unignore", $SubMenu4)
GUICtrlCreateMenuItem("", $SubMenu4)
$ContextButton15 = GUICtrlCreateMenuItem("/ban", $SubMenu4)
$ContextButton16 = GUICtrlCreateMenuItem("/unban", $SubMenu4)
GUICtrlCreateMenuItem("", $Context)
$SubMenu3 = GUICtrlCreateMenu("Font", $Context)
$SubMenu5 = GUICtrlCreateMenu("Types", $SubMenu3)
Dim $FontType[10]
$FontType[1] = GUICtrlCreateMenuItem("Arial", $SubMenu5)
$FontType[2] = GUICtrlCreateMenuItem("Arial Black", $SubMenu5)
$FontType[3] = GUICtrlCreateMenuItem("Comic Sans MS", $SubMenu5)
$FontType[4] = GUICtrlCreateMenuItem("Georgia", $SubMenu5)
$FontType[5] = GUICtrlCreateMenuItem("Impact", $SubMenu5)
$FontType[6] = GUICtrlCreateMenuItem("Lucidia Console", $SubMenu5)
$FontType[7] = GUICtrlCreateMenuItem("Tahoma", $SubMenu5)
$FontType[8] = GUICtrlCreateMenuItem("Trebuchet MS", $SubMenu5)
$FontType[9] = GUICtrlCreateMenuItem("Custom...", $SubMenu5)
$SubMenu6 = GUICtrlCreateMenu("Sizes", $SubMenu3)
Dim $FontSize[10]
$FontSize[1] = GUICtrlCreateMenuItem("8", $SubMenu6)
$FontSize[2] = GUICtrlCreateMenuItem("9", $SubMenu6)
$FontSize[3] = GUICtrlCreateMenuItem("10", $SubMenu6)
$FontSize[4] = GUICtrlCreateMenuItem("12", $SubMenu6)
$FontSize[5] = GUICtrlCreateMenuItem("14", $SubMenu6)
$FontSize[6] = GUICtrlCreateMenuItem("16", $SubMenu6)
$FontSize[7] = GUICtrlCreateMenuItem("18", $SubMenu6)
$FontSize[8] = GUICtrlCreateMenuItem("24", $SubMenu6)
$FontSize[9] = GUICtrlCreateMenuItem("Custom...", $SubMenu6)
GUICtrlCreateMenuItem("", $Context)
$SubMenu2 = GUICtrlCreateMenu("Misc", $Context)
$ContextButton6 = GUICtrlCreateMenuItem("Reverse", $SubMenu2)
$ContextButton7 = GUICtrlCreateMenuItem("Caps", $SubMenu2)
$ContextButton8 = GUICtrlCreateMenuItem("Lower", $SubMenu2)
$Group2 = GUICtrlCreateGroup("Login", 520, 8, 225, 105)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input2 = GUICtrlCreateInput($tempname, 528, 24, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input3 = GUICtrlCreateInput($temppass, 528, 56, 209, 21, $ES_PASSWORD)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Login = GUICtrlCreateButton("Login", 528, 80, 100, 22, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Settings = GUICtrlCreateButton("Settings", 637, 80, 100, 22, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Macros", 520, 120, 225, 321)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
Dim $Button[7]
Dim $Input[7]
$Input[1] = GUICtrlCreateInput("", 528, 144, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[1] = GUICtrlCreateButton("Send", 672, 168, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[2] = GUICtrlCreateInput("", 528, 192, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[2] = GUICtrlCreateButton("Send", 672, 216, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[3] = GUICtrlCreateInput("", 528, 240, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[3] = GUICtrlCreateButton("Send", 672, 264, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[4] = GUICtrlCreateInput("", 528, 288, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[4] = GUICtrlCreateButton("Add", 672, 312, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[6] = GUICtrlCreateInput("", 528, 384, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[6] = GUICtrlCreateButton("Add", 672, 408, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[5] = GUICtrlCreateInput("", 528, 336, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[5] = GUICtrlCreateButton("Add", 672, 360, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$MsgBox = GUICtrlCreateObj($Msg, 0, 500, 500, 200)
$LoginsBox = GUICtrlCreateObj($Logins, 355, 500, 338, 200)
GUISetState(@SW_SHOW)
If $autolog = 1 Then
    Sleep(500)
    ControlClick($title, "", $Login)
EndIf
If $sound = 1 Then
    If Not (FileExists("notify.wav")) Then FileInstall("notify.wav", "notify.wav")
EndIf
$timer = TimerInit()
While 1
    If TimerDiff($timer) > 5000 Then
        TextGet()
        $timer = TimerInit()
    EndIf
    $nMsg = GUIGetMsg()
    For $i = 1 To 6
        If $nMsg = $ContextButton[$i] Then
            GUICtrlSetData($Input[$i], GUICtrlRead($Input1))
        EndIf
    Next
    For $i = 4 To 6
        If $nMsg = $Button[$i] Then
            GUICtrlSetData($Input1, GUICtrlRead($Input1) & GUICtrlRead($Input[$i]))
        EndIf
    Next
    For $i = 1 To 3
        If $nMsg = $Button[$i] Then
            MacroSend(GUICtrlRead($Input[$i]))
        EndIf
    Next
    If _IsPressed(26,$dll) Then GUICtrlSetData($Input1, $last)
    If _IsPressed(28,$dll) Then
        If WinActive($title) Then
        ControlClick($title,"",$Button1,"RIGHT")
        Sleep(200)
        EndIf
    EndIf
    If _IsPressed(02,$dll) Then
        If WinActive($title) Then
            If ControlGetFocus($title) = "Edit2" Then
                ControlClick($title,"",$Button1,"RIGHT")
                Sleep(200)
            EndIf
        EndIf
    EndIf
    If _IsPressed("0D",$dll) Then
        If WinActive($title) Then
        TextSend()
        Sleep(500)
        EndIf
    EndIf
    Switch $nMsg
        Case $Settings
            If Not (_IsPressed(12, $dll)) Then
                Settings()
            Else
                GUIDelete($Form1)
                MsgBox(48, "Debug Mode", "Debug mode entered.")
                $Form1 = GUICreate($title, 755, 660, -1, -1)
                GUISetBkColor($winbg)
                $Group1 = GUICtrlCreateGroup("Chat", 8, 8, 505, 433)
                $Textbox = GUICtrlCreateObj($Text, 16, 32, 489, 369)
                _IENavigate($Text, "http://www.freewebs.com/vindicatoromega/Default.html")
                $Input1 = GUICtrlCreateInput("", 16, 408, 457, 21)
                $Button1 = GUICtrlCreateButton("Go", 472, 408, 33, 21, 0)
                GUICtrlSetState(-1, $GUI_DISABLE)
                GUICtrlCreateGroup("", -99, -99, 1, 1)
                $Group2 = GUICtrlCreateGroup("Login", 520, 8, 225, 105)
                $Input2 = GUICtrlCreateInput($tempname, 528, 24, 209, 21)
                $Input3 = GUICtrlCreateInput($temppass, 528, 56, 209, 21, $ES_PASSWORD)
                $Login = GUICtrlCreateButton("Login", 528, 80, 100, 22, 0)
                $Settings = GUICtrlCreateButton("Settings", 637, 80, 100, 22, 0)
                GUICtrlCreateGroup("", -99, -99, 1, 1)
                $Group3 = GUICtrlCreateGroup("Macros", 520, 120, 225, 321)
                Dim $Button[7]
                Dim $Input[7]
                $Input[1] = GUICtrlCreateInput("", 528, 144, 209, 21)
                $Button[1] = GUICtrlCreateButton("Send", 672, 168, 65, 20, 0)
                $Input[2] = GUICtrlCreateInput("", 528, 192, 209, 21)
                $Button[2] = GUICtrlCreateButton("Send", 672, 216, 65, 20, 0)
                $Input[3] = GUICtrlCreateInput("", 528, 288, 209, 21)
                $Button[3] = GUICtrlCreateButton("Send", 672, 312, 65, 20, 0)
                $Input[4] = GUICtrlCreateInput("", 528, 240, 209, 21)
                $Button[4] = GUICtrlCreateButton("Send", 672, 264, 65, 20, 0)
                $Input[5] = GUICtrlCreateInput("", 528, 336, 209, 21)
                $Button[5] = GUICtrlCreateButton("Send", 672, 360, 65, 20, 0)
                $Input[6] = GUICtrlCreateInput("", 528, 384, 209, 21)
                $Button[6] = GUICtrlCreateButton("Send", 672, 408, 65, 20, 0)
                GUICtrlCreateGroup("", -99, -99, 1, 1)
                $MsgBox = GUICtrlCreateObj($Msg, 0, 460, 350, 200)
                $LoginsBox = GUICtrlCreateObj($Logins, 355, 460, 338, 200)
                GUISetState(@SW_SHOW)
            EndIf
        Case $Login
            If $Run = True Then _IENavigate($Logins, "http://www.soulraver.net/logout.php")
            _IENavigate($Logins, "http://www.soulraver.net/")
            _IELoadWait($Logins)
            $oForm = _IEFormGetObjByName($Logins, "Login")
            $Name = _IEFormElementGetCollection($oForm, 0)
            _IEFormElementSetValue($Name, GUICtrlRead($Input2))
            $Pass = _IEFormElementGetCollection($oForm, 1)
            _IEFormElementSetValue($Pass, GUICtrlRead($Input3))
            $Enter = _IEFormElementGetCollection($oForm, 2)
            _IEAction($Enter, "click")
            _IELoadWait($Logins)
            If Not (_IEPropertyGet($Logins, "locationurl") = "http://www.soulraver.net/main.php") Then
                MsgBox(48, "Unsucessful!", "Login failed." & @CRLF & "Incorrect username or password.")
                _IENavigate($Text, "http://www.freewebs.com/vindicatoromega/Default.html")
            Else
                _IENavigate($Msg, "http://www.soulraver.net/chat.php")
                _IENavigate($Text, "http://www.soulraver.net/newchat.html")
                _IEBodyWriteHTML($Text, $PortalText)
                GUICtrlSetState($Button1, $GUI_ENABLE)
                $Run = True
                IniWrite("conf.ini", "LastLogin", "name", GUICtrlRead($Input2))
                IniWrite("conf.ini", "LastLogin", "pass", GUICtrlRead($Input3))
                MacroSend($LoginMessage)
                MacroSend("/who")
            EndIf
        Case $ContextButton1
            ClipPut(GUICtrlRead($Input1))
        Case $ContextButton2
            GUICtrlSetData($Input1, "/clear")
            TextSend()
        Case $ContextButton3
            GUICtrlSetData($Input1, "/who")
            TextSend()
        Case $ContextButton9
            GUICtrlSetData($Input1, "/c")
        Case $ContextButton10
            GUICtrlSetData($Input1, "/listen")
        Case $ContextButton11
            GUICtrlSetData($Input1, "/say")
        Case $ContextButton12
            GUICtrlSetData($Input1, "/msg")
        Case $ContextButton13
            GUICtrlSetData($Input1, "/ignore")
        Case $ContextButton14
            GUICtrlSetData($Input1, "/unignore")
        Case $ContextButton15
            GUICtrlSetData($Input1, "/ban")
        Case $ContextButton16
            GUICtrlSetData($Input1, "/unban")
        Case $FontSize[1]
            ChangeSize(8)
        Case $FontSize[2]
            ChangeSize(9)
        Case $FontSize[3]
            ChangeSize(10)
        Case $FontSize[4]
            ChangeSize(12)
        Case $FontSize[5]
            ChangeSize(14)
        Case $FontSize[6]
            ChangeSize(16)
        Case $FontSize[7]
            ChangeSize(18)
        Case $FontSize[8]
            ChangeSize(24)
        Case $FontSize[9]
            $f_size = InputBox("Custom Size","Enter a font size less than 40 and more than 6:")
            If $f_size < 40 And $f_size > 6 Then
            ChangeSize($f_size)
            Else
            MsgBox(16,"Error","Font size must be a number between 6 and 40.")
            EndIf
        Case $FontType[1]
            ChangeFont("Arial")
        Case $FontType[2]
            ChangeFont("Arial Black")
        Case $FontType[3]
            ChangeFont("Comic Sans MS")
        Case $FontType[4]
            ChangeFont("Georgia")
        Case $FontType[5]
            ChangeFont("Impact")
        Case $FontType[6]
            ChangeFont("Lucidia Console")
        Case $FontType[7]
            ChangeFont("Tahoma")
        Case $FontType[8]
            ChangeFont("Trebuchet MS")
        Case $FontType[9]
            ChangeFont(InputBox("Custom Font","Please type a font name or family:","Comic Sans MS"))
        Case $ContextButton6
            GUICtrlSetData($Input1, _StringReverse(GUICtrlRead($Input1)))
        Case $ContextButton7
            GUICtrlSetData($Input1, StringUpper(GUICtrlRead($Input1)))
        Case $ContextButton8
            GUICtrlSetData($Input1, StringLower(GUICtrlRead($Input1)))
        Case $Button1
        TextSend()
        Case $GUI_EVENT_MAXIMIZE
        GUICtrlSetState($Preset,$GUI_HIDE)
        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE)
            MacroSend($LogoffMessage)
            Sleep(1000)
            Exit
    EndSwitch
WEnd

Func TextSend()
    HotKeySet("{ENTER}")
    If WinActive($title) Then
        $texts = GUICtrlRead($Input1)
        For $z = 1 To $Bind[0][0]
            If $Bind[$z][0] = $texts Then
                Action($Bind[$z][1])
                GUICtrlSetData($Input1,"")
            EndIf
        Next
        If Not (GUICtrlRead($Preset) = "|") Then
            $texts = GUICtrlRead($Preset) & GUICtrlRead($Input1)
        Else
            $texts = GUICtrlRead($Input1)
        EndIf
        $last = $texts
        If $texts = "/clear" or $texts = "/fix" Then
            _IENavigate($Text, "http://www.soulraver.net/newchat.html")
            _IEBodyWriteHTML($Text, $PortalText)
            $texts = "/clear"
        ElseIf StringInStr($texts, "/font") Then
            $texts = StringReplace($texts, "/font ", "")
            _IEBodyWriteHTML($Text, StringReplace($PortalText, "Comic Sans MS", $texts))
            $texts = ""
        ElseIf StringInStr($texts, "/size") Then
            $texts = StringReplace($texts, "/size ", "")
            _IEBodyWriteHTML($Text, StringReplace($PortalText, "15", $texts))
            $texts = ""
        EndIf
        If StringInStr($texts, "<")Then
            $texts = StringReplace($texts, "<i>", "[i]")
            $texts = StringReplace($texts, "</i>", "[/i]")
            $texts = StringReplace($texts, "<b>", "[b]")
            $texts = StringReplace($texts, "</b>", "[/b]")
            $texts = StringReplace($texts, "<s>", "[s]")
            $texts = StringReplace($texts, "</s>", "[/s]")
            $texts = StringReplace($texts, "<u>", "[u]")
            $texts = StringReplace($texts, "</u>", "[/u]")
            $texts = StringReplace($texts, "<", "<")
            $texts = StringReplace($texts, "[", "<")
            $texts = StringReplace($texts, "]", ">")
        EndIf
        GUICtrlSetData($Input1, "")
        $oForm = _IEFormGetObjByName($Msg, "shazam")
        $oChatBox = _IEFormElementGetObjByName($oForm, "message")
        $oSend = _IEFormElementGetCollection($oForm, 1)
        _IEFormElementSetValue($oChatBox, $texts)
        _IEAction($oSend, "click")
        _IELoadWait($Msg)
        ControlClick($title, "", "Edit2")
        ControlFocus($title, "", "Edit2")
    Else
        Send("{ENTER}")
    EndIf
    HotKeySet("{ENTER}", "TextSend")
    ControlClick($title, "", $Input1)
EndFunc   ;==>TextSend
Func ActSend($texts)
        $last = $texts
        If $texts = "/clear" or $texts = "/fix" Then
            _IENavigate($Text, "http://www.soulraver.net/newchat.html")
            _IEBodyWriteHTML($Text, $PortalText)
            $texts = "/clear"
        ElseIf StringInStr($texts, "/font") Then
            $texts = StringReplace($texts, "/font ", "")
            _IEBodyWriteHTML($Text, StringReplace($PortalText, "Comic Sans MS", $texts))
            $texts = ""
        ElseIf StringInStr($texts, "/size") Then
            $texts = StringReplace($texts, "/size ", "")
            _IEBodyWriteHTML($Text, StringReplace($PortalText, "15", $texts))
            $texts = ""
        EndIf
        If StringInStr($texts, "<")Then
            $texts = StringReplace($texts, "<i>", "[i]")
            $texts = StringReplace($texts, "</i>", "[/i]")
            $texts = StringReplace($texts, "<b>", "[b]")
            $texts = StringReplace($texts, "</b>", "[/b]")
            $texts = StringReplace($texts, "<s>", "[s]")
            $texts = StringReplace($texts, "</s>", "[/s]")
            $texts = StringReplace($texts, "<u>", "[u]")
            $texts = StringReplace($texts, "</u>", "[/u]")
            $texts = StringReplace($texts, "<", "<")
            $texts = StringReplace($texts, "[", "<")
            $texts = StringReplace($texts, "]", ">")
        EndIf
        GUICtrlSetData($Input1, "")
        $oForm = _IEFormGetObjByName($Msg, "shazam")
        $oChatBox = _IEFormElementGetObjByName($oForm, "message")
        $oSend = _IEFormElementGetCollection($oForm, 1)
        _IEFormElementSetValue($oChatBox, $texts)
        _IEAction($oSend, "click")
        _IELoadWait($Msg)
        ControlClick($title, "", "Edit2")
        ControlFocus($title, "", "Edit2")
    ControlClick($title, "", $Input1)
EndFunc   ;==>TextSend
Func MacroSend($s_Macro)
    If $Run = True Then
        $oForm = _IEFormGetObjByName($Msg, "shazam")
        $oChatBox = _IEFormElementGetObjByName($oForm, "message")
        $oSend = _IEFormElementGetCollection($oForm, 1)
        _IEFormElementSetValue($oChatBox, $s_Macro)
        _IEAction($oSend, "click")
    EndIf
EndFunc   ;==>MacroSend
Func Settings()
    $Form2 = GUICreate("Settings", 185, 250, 193, 125)
    $Group12 = GUICtrlCreateGroup("Colors", 8, 8, 169, 81)
    $Button12 = GUICtrlCreateButton("Window Background", 16, 32, 153, 22, 0)
    $Button22 = GUICtrlCreateButton("Chat Background", 16, 56, 153, 22, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group22 = GUICtrlCreateGroup("Login", 8, 96, 169, 49)
    $Button32 = GUICtrlCreateButton("Autologin: off", 16, 112, 153, 22, 0)
    $Group32 = GUICtrlCreateGroup("Notifications", 8, 155, 169, 100)
    $Button42 = GUICtrlCreateButton("Flash: off", 16, 170, 153, 22, 0)
    $Button52 = GUICtrlCreateButton("Sound: off", 16, 197, 153, 22, 0)
    $Button62 = GUICtrlCreateButton("Edit login/off message", 16, 223, 153, 22, 0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    If $autolog = 1 Then
        GUICtrlSetData($Button32, "Autologin: on")
    Else
        GUICtrlSetData($Button32, "Autologin: off")
    EndIf
    If $flash = 1 Then
        GUICtrlSetData($Button42, "Flash: on")
    Else
        GUICtrlSetData($Button42, "Flash: off")
    EndIf
    If $sound = 1 Then
        GUICtrlSetData($Button52, "Sound: on")
    Else
        GUICtrlSetData($Button52, "Sound: off")
    EndIf
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $Button62
                $LoginMessage = InputBox("Login Messages", "Enter LOGIN message:", $LoginMessage, Default, 400, 100)
                $LogoffMessage = InputBox("Logoff Messages", "Enter LOGOFF message:", $LogoffMessage, Default, 400, 100)
                IniWrite("conf.ini", "Settings", "loginmsg", $LoginMessage)
                IniWrite("conf.ini", "Settings", "logoffmsg", $LogoffMessage)
            Case $Button12
                $winbg = _ChooseColor(2, $winbg)
                IniWrite("conf.ini", "Settings", "winbg", $winbg)
                GUISetBkColor($winbg, $Form1)
            Case $Button22
                $chatbg = _ChooseColor(2, $chatbg)
                $chatbg = StringTrimLeft($chatbg, 2)
                IniWrite("conf.ini", "Settings", "chatbg", $chatbg)
                If $Run = True Then _IEBodyWriteHTML($Text, $PortalText)
            Case $Button32
                If $autolog = 0 Then
                    $autolog = 1
                    IniWrite("conf.ini", "Settings", "autolog", $autolog)
                    GUICtrlSetData($Button32, "Autologin: on")
                Else
                    $autolog = 0
                    IniWrite("conf.ini", "Settings", "autolog", $autolog)
                    GUICtrlSetData($Button32, "Autologin: off")
                EndIf
            Case $Button42
                If $flash = 0 Then
                    $flash = 1
                    IniWrite("conf.ini", "Settings", "flash", $autolog)
                    GUICtrlSetData($Button42, "Flash: on")
                Else
                    $flash = 0
                    IniWrite("conf.ini", "Settings", "flash", $autolog)
                    GUICtrlSetData($Button42, "Flash: off")
                EndIf
            Case $Button52
                If $sound = 0 Then
                    $sound = 1
                    IniWrite("conf.ini", "Settings", "sound", $sound)
                    GUICtrlSetData($Button52, "Sound: on")
                Else
                    $sound = 0
                    IniWrite("conf.ini", "Settings", "sound", $sound)
                    GUICtrlSetData($Button52, "Sound: off")
                EndIf
            Case $GUI_EVENT_CLOSE
                GUIDelete($Form2)
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Settings
Func _WinAnimate($v_gui, $i_mode, $i_duration = 1000)
    If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2000" Then
        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", WinGetHandle($v_gui), "int", $i_duration, "long", $i_mode)
        Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError')
        If $ai_gle[0] <> 0 Then
            SetError(1)
            Return 0
        EndIf
        Return 1
    EndIf
EndFunc   ;==>_WinAnimate
Func CharMap()
    Run("charmap.exe")
EndFunc   ;==>CharMap
Func TextGet()
    $oTextBox = _IEGetObjById($Text, "div_chat")
    $raw = _IEPropertyGet($oTextBox, "innertext")
    If Not ($lastsize = StringLen($raw)) Then
        $lastsize = StringLen($raw)
        If $flash = 1 And Not (WinActive($title)) Then WinFlash($title)
        If $sound = 1 Then SoundPlay("notify.wav")
    EndIf
EndFunc   ;==>TextGet
Func ChangeSize($s_size)
$iMsgBoxAnswer = MsgBox(52,"Change","Changing the font requires clearing chat!" & @CRLF & "Are you sure?")
Select
    Case $iMsgBoxAnswer = 6 ;Yes
        _IEBodyWriteHTML($Text, StringReplace($PortalText, "15", $s_size))
    Case $iMsgBoxAnswer = 7 ;No

EndSelect
EndFunc
Func ChangeFont($s_family)
    $iMsgBoxAnswer = MsgBox(52,"Change","Changing the font requires clearing chat!" & @CRLF & "Are you sure?")
Select
    Case $iMsgBoxAnswer = 6 ;Yes
        _IEBodyWriteHTML($Text, StringReplace($PortalText, "Comic Sans MS", $s_family))
    Case $iMsgBoxAnswer = 7 ;No

EndSelect
EndFunc
Func Console()
    If $consolerun = False Then
        #include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Global $Form4
$Form4 = GUICreate("SRCHATCONSOLE", 625, 438, -1,-1,$WS_POPUP,$WS_EX_TOOLWINDOW)
GUISetBkColor(0x000000)
$Drag = GUICtrlCreateLabel("SRChat Command Console",0,0,625,25,$SS_CENTER)
GUICtrlSetColor(-1, 0xF0F0F0)
GUICtrlSetBkColor(-1,0x191970)
$Editz = GUICtrlCreateEdit("", 0, 25, 625, 392, BitOR($ES_AUTOVSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetData(-1, "SRChat Console")
GUICtrlSetColor(-1, 0xF0F0F0)
GUICtrlSetBkColor(-1, 0x000000)
$Inputz = GUICtrlCreateInput("", 0, 416, 561, 21)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0xF0F0F0)
$Buttonz = GUICtrlCreateButton("ENTER", 560, 416, 65, 21, 0)
WinSetTrans("SRCHATCONSOLE","",200)
GUISetState(@SW_SHOW)
$consolerun = True
$consoleopen = True
While 1
    $nMsg = GUIGetMsg()
    If $consolerun = False Then ExitLoop
    Switch $nMsg
        Case $Buttonz
            $RAWInput = GUICtrlRead($Inputz)
            $Com = StringSplit($RAWInput,":")
            $IntText = GUICtrlRead($Editz) & @CRLF
            If $Com[0] > 0 Then
            If $Com[1] = "NewAct" Then
                If $Com[0] > 1 Then
                FileWrite($Com[2]&".act","ACT.NAME:Script Name" & @CRLF & "ACT.DESCRIPTION:Script Purpose")
                GUICtrlSetData($Editz,$IntText & "Action File Created: "&$Com[2]&".act")
                EndIf
            ElseIf $Com[1] = "OpenAct" Then
                If $Com[0] > 1 Then
                Run("notepad.exe "& $Com[2])
                GUICtrlSetData($Editz,$IntText & "Opening Action File: "&$Com[2]&".act")
            EndIf
            ElseIf $Com[1] = "RunAct" Then
                If $Com[0] > 1 Then
                Action($Com[2])
                EndIf
            ElseIf $Com[1] = "ReadAct" Then
                If $Com[0] > 1 Then
                $file = FileRead($Com[2])
                GUICtrlSetData($Editz,$IntText & $file)
            EndIf
            ElseIf $Com[1] = "BindAct" Then
                If $Com[0] > 2 Then
                    $ScriptName = StringSplit(FileReadLine($Com[3],1),":")
                    $ScriptName = $ScriptName[2]
                    $Desc = StringSplit(FileReadLine($Com[3],2),":")
                    $Desc = $Desc[2]
                    GUICtrlSetData($Editz,$IntText & "Bind " & $Com[2] & " to " & $Com[3] & @CRLF & "Script Name: " & $ScriptName & @CRLF & "Description: " & $Desc)
                    $Bind[0][0] += 1
                    $Bind[$Bind[0][0]][0] = $Com[2]
                    $Bind[$Bind[0][0]][1] = $Com[3]
                EndIf
            ElseIf $Com[1] = "Wintrans" Then
                If $Com[0] > 1 Then
                WinSetTrans($title,"",$Com[2])
                EndIf
            EndIf
            EndIf
        Case $Drag
            Drag($Form4)
    EndSwitch
WEnd
Else
    GUIDelete($Form4)
    $consolerun = False
EndIf
EndFunc
Func Drag($Form)
    DllCall("user32.dll", "int", "ReleaseCapture")
    DllCall("user32.dll", "int", "SendMessage", "hWnd", $Form, "int", $WM_NCLBUTTONDOWN, "int", $HTCAPTION, "int", 0)
EndFunc   ;==>Drag
Func Action($a_file)
    $ScriptRaw = FileRead($a_file)
    $z = 1
    $fin = 0
    $var = ""
    Do
        If Not(StringInStr($ScriptRaw,"!END")) Then
            MsgBox(0,"ERROR","ACTION ERROR: "&$a_file&@CRLF&"No !END command")
            ExitLoop
        EndIf
        $LineRaw = FileReadLine($a_file,$z)
        If @error = 1 Then
            MsgBox(16,"ERROR","Invalid Line Read: Line "&$z)
            $LineRaw = 0
        EndIf
        $Er = $LineRaw
        $LineRaw = StringReplace($LineRaw,"$Input",GUICtrlRead($Input1))
        $LineRaw = StringReplace($LineRaw,"$var",$var)
        $Com = StringSplit($LineRaw,":")
        If $Com[0] > 1 Then
        If $Com[1] = "send" Then
            ActSend($Com[2])
        ElseIf $Com[1] = "setmacro" Then
            GUICtrlSetData($Input[$Com[2]],$Com[3])
        ElseIf $Com[1] = "setinput" Then
            GUICtrlSetData($Input1,$Com[2])
        ElseIf $Com[1] = "addinput" Then
            GUICtrlSetData($Input1,GUICtrlRead($Input1) & $Com[2])
        ElseIf $Com[1] = "msgbox" Then
            MsgBox($Com[2],$Com[3],$Com[4])
        ElseIf $Com[1] = "msgprompt" Then
            If $Com[0] > 3 Then 
            $iMsgBoxAnswer = MsgBox(36,$Com[2],$Com[3])
            Select
                Case $iMsgBoxAnswer = 6 ;Yes
                    $z = Number($Com[4] - 1)
                Case $iMsgBoxAnswer = 7 ;No
                    $z = Number($Com[5] - 1)
            EndSelect
        Else
            MsgBox(16,"ERROR",'Line "'&$Er&'" in '&$a_file& @CRLF & "Missing parameters!")
        EndIf
    ElseIf $Com[1] = "setvar" Then
        $var = $Com[2]
    ElseIf $Com[1] = "promptvar" Then
        $var = InputBox($Com[2],$Com[3])
        ElseIf $Com[1] = "setfont" Then
            ActSend("/font "&$Com[2])
        ElseIf $Com[1] = "setsize" Then
            ActSend("/size "&$Com[2])
        ElseIf $Com[1] = "reload" Then
            ActSend("/fix")
        ElseIf $Com[1] = "sendreverse" Then
            GUICtrlSetData($Input1,_StringReverse($Com[2]))
        ElseIf $Com[1] = "setwinbg" Then
        GUISetBkColor($winbg, $Com[2])
        ElseIf $Com[1] = "goto" Then
        $z = Number($Com[2] - 1)
        ElseIf $Com[1] = "settrans" Then
        WinSetTrans($title,"",$Com[2])
    ElseIf $Com[1] = "sleep" Then
        Sleep($Com[2])
        ElseIf $Com[1] = "fin" Then
        $fin += 1
        If $fin = $Com[2] Then ExitLoop
        ElseIf $Com[1] = "BindAct" Then
            If $Com[0] > 2 Then
                $ScriptName = StringSplit(FileReadLine($Com[3],1),":")
                $ScriptName = $ScriptName[2]
                $Desc = StringSplit(FileReadLine($Com[3],2),":")
                $Desc = $Desc[2]
                MsgBox(64,"ACTION "&$a_file,"Binding " & $Com[2] & " to " & $Com[3])
                $Bind[0][0] += 1
                $Bind[$Bind[0][0]][0] = $Com[2]
                $Bind[$Bind[0][0]][1] = $Com[3]
            EndIf
        ElseIf $Com[1] = "ACT.NAME" Then
        ElseIf $Com[1] = "ACT.DESCRIPTION" Then
        ElseIf StringInStr($Com[1], ";") Then
        Else
            MsgBox(16,"ERROR",'Line "'&$Er&'" in '&$a_file& @CRLF & "Invalid command or parameters.")
        EndIf
        EndIf
        $z+=1
    Until $Com[1] = "!END"
EndFunc
Edited by VindicatorOmega

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

First of all, it would be better if you posted an example with GUI part only, and also your window is not resizable :mellow:

You can do something like this:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ComboConstants.au3>
#include <StaticConstants.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Misc.au3>
#include <String.au3>
$ver = 3.9
$consolerun = False
$consoleopen = False

Dim $Bind[20][3]
$Bind[0][0] = 0
$Text = _IECreateEmbedded()
$Msg = _IECreateEmbedded()
$Logins = _IECreateEmbedded()
$AW_SLIDE_IN = 0x00040001
$AW_SLIDE_OUT = 0x00050002
$lastsize = 0
$last = ""
$dll = DllOpen("user32.dll")
$tempname = IniRead("conf.ini", "LastLogin", "name", "Username")
$temppass = IniRead("conf.ini", "LastLogin", "pass", "Password")
$winbg = IniRead("conf.ini", "Settings", "winbg", 0xBEBEBE)
$chatbg = IniRead("conf.ini", "Settings", "chatbg", "dbdbdb")
$autolog = IniRead("conf.ini", "Settings", "autolog", 0)
$flash = IniRead("conf.ini", "Settings", "flash", 0)
$sound = IniRead("conf.ini", "Settings", "sound", 0)
$LoginMessage = IniRead("conf.ini", "Settings", "loginmsg", "")
$LogoffMessage = IniRead("conf.ini", "Settings", "logoffmsg", "")
#Region === Extremely long lines of HTML that SRChat replaces with the default HTML in chat
$title = "Soulraver Chat v" & $ver
$PortalText = '<body bgcolor="#dbdbdb" scroll="no"><div id="div_chat" style="height: 100%; width: 100%; overflow: auto; background-color: #' & $chatbg
$PortalText &= '; font-family: Comic Sans MS; font-size: 15;">'
$PortalText &= 'Welcome to Vindicators SoulRaver Chat Client!<br /><br />'
$PortalText &= 'Version ' & $ver & '<br />'
$PortalText &= 'Updates for this version:<br />'
$PortalText &= '-The ENTER and UP hotkeys now shouldnt affect other progs<br />'
$PortalText &= '-Pressing UP will enter your last message into the box<br />'
$PortalText &= '-Now pressing DOWN will open the context menu at your mouse<br />'
$PortalText &= '-You can right click the input box (if you are typing in it)<br />'
$PortalText &= '-A status bar has been added<br />'
$PortalText &= '-SRBot commands added to dropdown menu<br />'
$PortalText &= 'Thanks for using!<br />'
$PortalText &= '</div></font>'
#EndRegion === Extremely long lines of HTML that SRChat replaces with the default HTML in chat
$Run = False

;Changed (added $WS_SIZEBOX)
$Form1 = GUICreate($title, 755, 470, -1, -1, $WS_MAXIMIZEBOX+$WS_SIZEBOX)
GUISetBkColor($winbg)
$Group1 = GUICtrlCreateGroup("Chat", 8, 8, 505, 433)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM))
$Textbox = GUICtrlCreateObj($Text, 16, 32, 489, 369)

;Changed (commented next line)
;GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM))

_IENavigate($Text, "http://www.freewebs.com/vindicatoromega/Default.html")
$Preset = GUICtrlCreateCombo("|", 16, 408, 50, 21)
GUICtrlSetData(-1, "/msg ")
GUICtrlSetData(-1, "/r ")
GUICtrlSetData(-1, "/me ")
GUICtrlSetData(-1, "<b> ")
GUICtrlSetData(-1, "<i> ")
GUICtrlSetData(-1, "<u> ")
GUICtrlSetData(-1, "/say ")
GUICtrlSetData(-1, "/listen ")
GUICtrlSetData(-1, "@shoot ")
GUICtrlSetData(-1, '@say "')
$Input1 = GUICtrlCreateInput("", 66, 408, 407, 21)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
$Button1 = GUICtrlCreateButton("Go", 472, 408, 33, 21, 0)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Context = GUICtrlCreateContextMenu($Button1)
Dim $ContextButton[8]
$ContextButton1 = GUICtrlCreateMenuItem("Copy All", $Context)
GUICtrlCreateMenuItem("", $Context)
$SubMenu = GUICtrlCreateMenu("Send To", $Context)
$ContextButton[1] = GUICtrlCreateMenuItem("Macro 1", $SubMenu)
$ContextButton[2] = GUICtrlCreateMenuItem("Macro 2", $SubMenu)
$ContextButton[3] = GUICtrlCreateMenuItem("Macro 3", $SubMenu)
$ContextButton[4] = GUICtrlCreateMenuItem("Macro 4", $SubMenu)
$ContextButton[5] = GUICtrlCreateMenuItem("Macro 5", $SubMenu)
$ContextButton[6] = GUICtrlCreateMenuItem("Macro 6", $SubMenu)
GUICtrlCreateMenuItem("", $Context)
$SubMenu4 = GUICtrlCreateMenu("Chat Commands", $Context)
$ContextButton2 = GUICtrlCreateMenuItem("/clear", $SubMenu4)
$ContextButton3 = GUICtrlCreateMenuItem("/who", $SubMenu4)
$ContextButton9 = GUICtrlCreateMenuItem("/c", $SubMenu4)
$ContextButton10 = GUICtrlCreateMenuItem("/listen", $SubMenu4)
$ContextButton11 = GUICtrlCreateMenuItem("/say", $SubMenu4)
$ContextButton12 = GUICtrlCreateMenuItem("/msg", $SubMenu4)
$ContextButton13 = GUICtrlCreateMenuItem("/ignore", $SubMenu4)
$ContextButton14 = GUICtrlCreateMenuItem("/unignore", $SubMenu4)
GUICtrlCreateMenuItem("", $SubMenu4)
$ContextButton15 = GUICtrlCreateMenuItem("/ban", $SubMenu4)
$ContextButton16 = GUICtrlCreateMenuItem("/unban", $SubMenu4)
GUICtrlCreateMenuItem("", $Context)
$SubMenu3 = GUICtrlCreateMenu("Font", $Context)
$SubMenu5 = GUICtrlCreateMenu("Types", $SubMenu3)
Dim $FontType[10]
$FontType[1] = GUICtrlCreateMenuItem("Arial", $SubMenu5)
$FontType[2] = GUICtrlCreateMenuItem("Arial Black", $SubMenu5)
$FontType[3] = GUICtrlCreateMenuItem("Comic Sans MS", $SubMenu5)
$FontType[4] = GUICtrlCreateMenuItem("Georgia", $SubMenu5)
$FontType[5] = GUICtrlCreateMenuItem("Impact", $SubMenu5)
$FontType[6] = GUICtrlCreateMenuItem("Lucidia Console", $SubMenu5)
$FontType[7] = GUICtrlCreateMenuItem("Tahoma", $SubMenu5)
$FontType[8] = GUICtrlCreateMenuItem("Trebuchet MS", $SubMenu5)
$FontType[9] = GUICtrlCreateMenuItem("Custom...", $SubMenu5)
$SubMenu6 = GUICtrlCreateMenu("Sizes", $SubMenu3)
Dim $FontSize[10]
$FontSize[1] = GUICtrlCreateMenuItem("8", $SubMenu6)
$FontSize[2] = GUICtrlCreateMenuItem("9", $SubMenu6)
$FontSize[3] = GUICtrlCreateMenuItem("10", $SubMenu6)
$FontSize[4] = GUICtrlCreateMenuItem("12", $SubMenu6)
$FontSize[5] = GUICtrlCreateMenuItem("14", $SubMenu6)
$FontSize[6] = GUICtrlCreateMenuItem("16", $SubMenu6)
$FontSize[7] = GUICtrlCreateMenuItem("18", $SubMenu6)
$FontSize[8] = GUICtrlCreateMenuItem("24", $SubMenu6)
$FontSize[9] = GUICtrlCreateMenuItem("Custom...", $SubMenu6)
GUICtrlCreateMenuItem("", $Context)
$SubMenu2 = GUICtrlCreateMenu("Misc", $Context)
$ContextButton6 = GUICtrlCreateMenuItem("Reverse", $SubMenu2)
$ContextButton7 = GUICtrlCreateMenuItem("Caps", $SubMenu2)
$ContextButton8 = GUICtrlCreateMenuItem("Lower", $SubMenu2)
$Group2 = GUICtrlCreateGroup("Login", 520, 8, 225, 105)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input2 = GUICtrlCreateInput($tempname, 528, 24, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input3 = GUICtrlCreateInput($temppass, 528, 56, 209, 21, $ES_PASSWORD)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Login = GUICtrlCreateButton("Login", 528, 80, 100, 22, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Settings = GUICtrlCreateButton("Settings", 637, 80, 100, 22, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Macros", 520, 120, 225, 321)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
Dim $Button[7]
Dim $Input[7]
$Input[1] = GUICtrlCreateInput("", 528, 144, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[1] = GUICtrlCreateButton("Send", 672, 168, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[2] = GUICtrlCreateInput("", 528, 192, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[2] = GUICtrlCreateButton("Send", 672, 216, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[3] = GUICtrlCreateInput("", 528, 240, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[3] = GUICtrlCreateButton("Send", 672, 264, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[4] = GUICtrlCreateInput("", 528, 288, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[4] = GUICtrlCreateButton("Add", 672, 312, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[6] = GUICtrlCreateInput("", 528, 384, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[6] = GUICtrlCreateButton("Add", 672, 408, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Input[5] = GUICtrlCreateInput("", 528, 336, 209, 21)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
$Button[5] = GUICtrlCreateButton("Add", 672, 360, 65, 20, 0)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKSIZE, $GUI_DOCKTOP, $GUI_DOCKRIGHT))
GUICtrlCreateGroup("", -99, -99, 1, 1)

;Changed (commented next 2 lines)
;$MsgBox = GUICtrlCreateObj($Msg, 0, 500, 500, 200)
;$LoginsBox = GUICtrlCreateObj($Logins, 355, 500, 338, 200)

GUISetState(@SW_SHOW)

;Added this line
GUIRegisterMsg(0x0005, "WM_SIZE") ;$WM_SIZE = 0x0005

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE ;Added these events
            ControlsSetResizing()
    EndSwitch
WEnd

;Added function
Func WM_SIZE($hWndGUI, $MsgID, $WParam, $LParam)
    If $hWndGUI <> $Form1 Then Return $GUI_RUNDEFMSG
    
    ControlsSetResizing()
EndFunc

;Added function
Func ControlsSetResizing()
    Local $aInput_Pos = ControlGetPos($Form1, "", $Input[1])
    Local $aGUI_Pos = WinGetPos($Form1)
    
    GUICtrlSetPos($Group1, 8, 8, $aInput_Pos[0]-25, $aGUI_Pos[3]-43)
    GUICtrlSetPos($Textbox, 16, 32, $aInput_Pos[0]-40, $aGUI_Pos[3]-105)
    GUICtrlSetPos($Preset, 16, $aGUI_Pos[3]-63, 50, 21)
    GUICtrlSetPos($Input1, 66, $aGUI_Pos[3]-63, $aInput_Pos[0]-122, 21)
    GUICtrlSetPos($Button1, $aInput_Pos[0]-55, $aGUI_Pos[3]-63, 33, 21)
EndFunc

This is a cuted-off version, just follow the comments, you will see the changes.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...