Jump to content

Buttons


Recommended Posts

ok im making an Oblivion help Program...

and im having some trubbles with rembring how to make an other GUI pop up when a button is pressed can anyone help...

Or it would be good if it just change the GUI to say the info... and there was a back button to take it back to the main info!!!

Also if anyone can tell me how i can make stuff better that would help...

Here is my script so far:

#include <GuiDragable.au3>
#include <Guiconstants.au3>

Dim $LeftPos

$GuihWnd = _GuiDragableCreate("Oblivion Helper", 350, 500, -1, -1)
GUISetBkColor(0xffffff)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
GUICtrlSetColor(-1, 0xDD0000)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
GUICtrlSetColor(-1, 0xDD0000)



GUICtrlCreateGroup("Oblivion", 200, 34, 120, 50)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok1 = GUICtrlCreateButton("Run", 210, 48, 95, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")


GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 300)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")


$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok6 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10)
GUISetState()

While 1
    Sleep(10)
WEnd

and can i change the animation when closed!!!

here are ths files you need to open it!!!:

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

try this example

#include <Constants.au3>
#include <GUIConstants.au3>

$main = GUICreate("TEST", 100, 70)
$info = GUICtrlCreateButton ("info",20,20,60,30)
GUISetState()

$secon = GUICreate("TEST", 200, 140)
GUICtrlCreateLabel ("this is a test",20,20)
$ok = GUICtrlCreateButton ("close",20,50,60,30)
GUISetState (@SW_HIDE)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $info Then
        GUISetState (@SW_HIDE,$main)
        GUISetState (@SW_SHOW,$secon)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$main)
        GUISetState (@SW_HIDE,$secon)
    EndIf
WEnd

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

Ok tryed and didnt work.. i want to use the script i all ready have as my first GUI... and i want to me be dragable... so the GUIdragble.au3 needs to work with it as well...

SO any help...

Or can sone of u just tell me how to tell a button to open a child gui... that i can put into the script i allready have

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

#include <Constants.au3>
#include <Guiconstants.au3>

$GuihWnd = GUICreate("Oblivion Helper", 350, 500, -1, -1)
GUISetBkColor(0xffffff)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
GUICtrlSetColor(-1, 0xDD0000)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
GUICtrlSetColor(-1, 0xDD0000)



GUICtrlCreateGroup("Oblivion", 200, 34, 120, 50)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok1 = GUICtrlCreateButton("Run", 210, 48, 95, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")


GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 300)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")


$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok6 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10)
GUISetState()
$info = GUICreate ("test",200,200)
$ok = GUICtrlCreateButton ("close",40,40)
GUISetState (@SW_HIDE)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $ok6 Then
        GUISetState (@SW_HIDE,$GuihWnd)
        GUISetState (@SW_SHOW,$info)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$GuihWnd)
        GUISetState (@SW_HIDE,$info)
    EndIf
WEnd

????

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

Ok tryed and didnt work.. i want to use the script i all ready have as my first GUI... and i want to me be dragable... so the GUIdragble.au3 needs to work with it as well...

SO any help...

Or can sone of u just tell me how to tell a button to open a child gui... that i can put into the script i allready have

I think the example I've put above is very simple

anyways

just create a GUI with what ever u want to put inside

use the [ GuiSetState ] to set it to [ @sw_hide ]

put info button in the main GUI

after that Assign the info button to do the following

1- set the main GUI to either [ @sw_hide ] or [ @sw_disable ]

2- set the new GUI witch was in the [ @sw_hide ] state to [ @sw_show ]

just put a button in the child GUI to do the oppsite of what the info button does to return to the main GUI

hope this helped u

see ya

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

yea it helped but cant i have it with the dragable affects because i like the title bar when it is dragable....

repost current code and say what your problem is the best you can.

... cleaned up the code and made it look better in my mind..

#include <Guiconstants.au3>

Opt("GuiOnEventMode", 1)
Global $GUIHWND, $TITLE_LABEL
Dim $LeftPos, $ExampleLabel, $GuihWnd, $LeftPos, $ok1, $ok2, $ok3, $ok4, $ok5, $ok6
$GuihWnd = _GuiDragableCreate("Oblivion Helper", 235, 400, -1, -1)
    GUISetBkColor(0xffffff)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
    GUICtrlSetColor(-1, 0xDD0000)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetColor(-1, 0xDD0000)
    GUICtrlCreateGroup("Oblivion", 60, 335, 110, 50)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok1 = GUICtrlCreateButton("Run", 70, 350, 90, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 250)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetState ($ok1, $GUI_FOCUS)
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit", $GuihWnd)

While 1
    Sleep(100)
WEnd
Func _GuiDragableCreate($Title="", $Width=300, $Height=200, $Left=-1, $Top=-1, $Style=-1, $exStyle=-1, $Parent=0)
    Local $SetStyle = $WS_POPUPWINDOW+$Style, $SetExStyle = $WS_EX_DLGMODALFRAME+$exStyle
    If $Style = -1 Then $SetStyle = $WS_POPUPWINDOW
    If $exStyle = -1 Then $SetExStyle = $WS_EX_DLGMODALFRAME
    Local $hWnd = GUICreate($Title, $Width, $Height, $Left, $Top, $SetStyle, $SetexStyle, $Parent)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragEvent")
    
    $Title_Label = GUICtrlCreateLabel($Title, 0, 0, 235, 22, $SS_CENTER)
        GUICtrlSetState(-1, $GUI_DISABLE)
        GUICtrlSetResizing(-1, 512)
        GUICtrlSetFont(-1, 12, 700, 0, "Daedric")
        GUICtrlSetBkColor(-1, 0xCCCCCC)

    Local $X_Button = GUICtrlCreateButton(" X ", 213, 0, 22, 22)
        GUICtrlSetFont(-1, 10, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "Quit")

    Local $Mim_Button = GUICtrlCreateButton(" - ", 0, 0, 22, 22)
        GUICtrlSetFont(-1, 13, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MimimizeGui")

    Local $Max_Button = GUICtrlCreateButton(CHR(152), 310, 0, 22, 22)
        GUICtrlSetFont(-1, 9, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MaximizeGui")
        
    If Not BitAND($SetStyle, $WS_MAXIMIZEBOX) Then GUICtrlSetState(-1, $GUI_DISABLE)
    Return $hWnd
EndFunc
Func DragEvent()
    DragWindow($GuihWnd)
EndFunc
Func DragWindow($hWnd)
    Local $MousePos = MouseGetPos()
    Local $hWndPos = WinGetPos($hWnd)
    Local $WinPos[2], $IsPressed[1], $OpenDll, $GuiCurInfo[5]
    $WinPos[0] = $MousePos[0]-$hWndPos[0]
    $WinPos[1] = $MousePos[1]-$hWndPos[1]
    $OpenDll = DllOpen("user32.dll")
    $GuiCurInfo = GUIGetCursorInfo($hWnd)
    If $OpenDll <> -1 And ($GuiCurInfo[4] = 0 Or $GuiCurInfo[4] = $Title_Label) Then
        Do
            $hWndPos = MouseGetPos()
            WinMove($hWnd, '', $hWndPos[0]-$WinPos[0], $hWndPos[1]-$WinPos[1])
            Sleep(20)
            $IsPressed = DllCall($OpenDll, "int", "GetAsyncKeyState", "int", '0x01')
        Until @error Or BitAND($IsPressed[0], 0x8000) <> 0x8000
    EndIf
    DllClose($OpenDll)
EndFunc
Func MaximizeGui()
    If BitAND(WinGetState($GuihWnd), 32) Then
        GUISetState(@SW_RESTORE, $GuihWnd)
    Else
        GUISetState(@SW_MAXIMIZE, $GuihWnd)
    EndIf
EndFunc
Func MimimizeGui()
    GUISetState(@SW_MINIMIZE, $GuihWnd)
EndFunc
Func Quit()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
    Exit
EndFunc

and who ever made this "GuiDragable.au3" did a bad job of it. or its still in beta. there was a bunch of problems with it and it can not be called from outside the script.. there is no way to change the size of stuff with out editing the "GuiDragable.au3" code.

Edited by Golbez
Link to comment
Share on other sites

ok here is my current code:

#include <Constants.au3>
#include <Guiconstants.au3>
#include <GuiDragable.au3>

$GuihWnd = GUICreate("Oblivion Helper", 350, 500, -1, -1)
GUISetBkColor(0xffffff)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
GUICtrlSetColor(-1, 0xDD0000)

$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 250, 20)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
GUICtrlSetColor(-1, 0xDD0000)

GUICtrlCreateGroup("Oblivion", 200, 34, 120, 50)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok1 = GUICtrlCreateButton("Run", 210, 48, 95, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 300)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

$ok7 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")

DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10)

GUISetState()
$info = GUICreate ("test",200,200)
$ok = GUICtrlCreateButton ("close",40,40)
GUISetState (@SW_HIDE)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $ok2 Then
        GUISetState (@SW_HIDE,$GuihWnd)
        GUISetState (@SW_SHOW,$info)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$GuihWnd)
        GUISetState (@SW_HIDE,$info)
    EndIf
WEnd

So far i have managed to make the first button called' how to increase your Level work... but only when #include <GuiDragable.au3> is removed can any make the rest work as well and make the gui dragable work..

By the way u can edit the size of the title bar and stuff if u edit the GuiDragable.au3 file i did.. it used to be smaller

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

ok here is my current code:

So far i have managed to make the first button called' how to increase your Level work... but only when #include <GuiDragable.au3> is removed can any make the rest work as well and make the gui dragable work..

By the way u can edit the size of the title bar and stuff if u edit the GuiDragable.au3 file i did.. it used to be smaller

here use this.. i personal think its better then your current code..

dont have the #include GuiDragable there.. just put the code into your program.. it works better :)

its also alot easyer to chage the location of it with out having to open another file.

#include <Constants.au3>
#include <Guiconstants.au3>

Opt("GuiOnEventMode", 1)
Global $GUIHWND, $TITLE_LABEL
Dim $LeftPos, $ExampleLabel, $GuihWnd, $LeftPos, $ok, $ok1, $ok2, $ok3, $ok4, $ok5, $ok6, $info
$GuihWnd = _GuiDragableCreate("Oblivion Helper", 235, 400, -1, -1)
    GUISetBkColor(0xffffff)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
    GUICtrlSetColor(-1, 0xDD0000)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetColor(-1, 0xDD0000)
    GUICtrlCreateGroup("Oblivion", 30, 335, 110, 50)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok = GUICtrlCreateButton ("Close", 160, 350, 60, 30)
    GUICtrlSetOnEvent(-1, "Quit")
$ok1 = GUICtrlCreateButton("Run", 40, 350, 90, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 250)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetState ($ok1, $GUI_FOCUS)
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit", $GuihWnd)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $ok2 Then
        GUISetState (@SW_HIDE,$GuihWnd)
        GUISetState (@SW_SHOW,$info)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$GuihWnd)
        GUISetState (@SW_HIDE,$info)
    EndIf
    Sleep(100)
WEnd
Func _GuiDragableCreate($Title="", $Width=300, $Height=200, $Left=-1, $Top=-1, $Style=-1, $exStyle=-1, $Parent=0)
    Local $SetStyle = $WS_POPUPWINDOW+$Style, $SetExStyle = $WS_EX_DLGMODALFRAME+$exStyle
    If $Style = -1 Then $SetStyle = $WS_POPUPWINDOW
    If $exStyle = -1 Then $SetExStyle = $WS_EX_DLGMODALFRAME
    Local $hWnd = GUICreate($Title, $Width, $Height, $Left, $Top, $SetStyle, $SetexStyle, $Parent)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragEvent")
    
    $Title_Label = GUICtrlCreateLabel($Title, 0, 0, 235, 22, $SS_CENTER)
        GUICtrlSetState(-1, $GUI_DISABLE)
        GUICtrlSetResizing(-1, 512)
        GUICtrlSetFont(-1, 12, 700, 0, "Daedric")
        GUICtrlSetBkColor(-1, 0xCCCCCC)

    Local $X_Button = GUICtrlCreateButton(" X ", 213, 0, 22, 22)
        GUICtrlSetFont(-1, 10, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "Quit")

    Local $Mim_Button = GUICtrlCreateButton(" - ", 0, 0, 22, 22)
        GUICtrlSetFont(-1, 13, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MimimizeGui")

    Local $Max_Button = GUICtrlCreateButton(CHR(152), 310, 0, 22, 22)
        GUICtrlSetFont(-1, 9, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MaximizeGui")
        
    If Not BitAND($SetStyle, $WS_MAXIMIZEBOX) Then GUICtrlSetState(-1, $GUI_DISABLE)
    Return $hWnd
EndFunc
Func DragEvent()
    DragWindow($GuihWnd)
EndFunc
Func DragWindow($hWnd)
    Local $MousePos = MouseGetPos()
    Local $hWndPos = WinGetPos($hWnd)
    Local $WinPos[2], $IsPressed[1], $OpenDll, $GuiCurInfo[5]
    $WinPos[0] = $MousePos[0]-$hWndPos[0]
    $WinPos[1] = $MousePos[1]-$hWndPos[1]
    $OpenDll = DllOpen("user32.dll")
    $GuiCurInfo = GUIGetCursorInfo($hWnd)
    If $OpenDll <> -1 And ($GuiCurInfo[4] = 0 Or $GuiCurInfo[4] = $Title_Label) Then
        Do
            $hWndPos = MouseGetPos()
            WinMove($hWnd, '', $hWndPos[0]-$WinPos[0], $hWndPos[1]-$WinPos[1])
            Sleep(20)
            $IsPressed = DllCall($OpenDll, "int", "GetAsyncKeyState", "int", '0x01')
        Until @error Or BitAND($IsPressed[0], 0x8000) <> 0x8000
    EndIf
    DllClose($OpenDll)
EndFunc
Func MaximizeGui()
    If BitAND(WinGetState($GuihWnd), 32) Then
        GUISetState(@SW_RESTORE, $GuihWnd)
    Else
        GUISetState(@SW_MAXIMIZE, $GuihWnd)
    EndIf
EndFunc
Func MimimizeGui()
    GUISetState(@SW_MINIMIZE, $GuihWnd)
EndFunc
Func Quit()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
    Exit
EndFunc
Link to comment
Share on other sites

here use this.. i personal think its better then your current code..

dont have the #include GuiDragable there.. just put the code into your program.. it works better :)

its also alot easyer to chage the location of it with out having to open another file.

#include <Constants.au3>
#include <Guiconstants.au3>

Opt("GuiOnEventMode", 1)
Global $GUIHWND, $TITLE_LABEL
Dim $LeftPos, $ExampleLabel, $GuihWnd, $LeftPos, $ok, $ok1, $ok2, $ok3, $ok4, $ok5, $ok6, $info
$GuihWnd = _GuiDragableCreate("Oblivion Helper", 235, 400, -1, -1)
    GUISetBkColor(0xffffff)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 23, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
    GUICtrlSetColor(-1, 0xDD0000)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 5, 46, 230, 20)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetColor(-1, 0xDD0000)
    GUICtrlCreateGroup("Oblivion", 30, 335, 110, 50)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok = GUICtrlCreateButton ("Close", 160, 350, 60, 30)
    GUICtrlSetOnEvent(-1, "Quit")
$ok1 = GUICtrlCreateButton("Run", 40, 350, 90, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlCreateGroup("Oblivion Help Files", 0, 80, 235, 250)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetState ($ok1, $GUI_FOCUS)
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 5, 95, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok3 = GUICtrlCreateButton("Advantages of Leveling", 5, 135, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok4 = GUICtrlCreateButton("Raising Attributes", 5, 175, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 5, 215, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Overcoming TLP", 5, 255, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok6 = GUICtrlCreateButton("Additional info about leveling", 5, 295, 225, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit", $GuihWnd)

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $ok2 Then
        GUISetState (@SW_HIDE,$GuihWnd)
        GUISetState (@SW_SHOW,$info)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$GuihWnd)
        GUISetState (@SW_HIDE,$info)
    EndIf
    Sleep(100)
WEnd
Func _GuiDragableCreate($Title="", $Width=300, $Height=200, $Left=-1, $Top=-1, $Style=-1, $exStyle=-1, $Parent=0)
    Local $SetStyle = $WS_POPUPWINDOW+$Style, $SetExStyle = $WS_EX_DLGMODALFRAME+$exStyle
    If $Style = -1 Then $SetStyle = $WS_POPUPWINDOW
    If $exStyle = -1 Then $SetExStyle = $WS_EX_DLGMODALFRAME
    Local $hWnd = GUICreate($Title, $Width, $Height, $Left, $Top, $SetStyle, $SetexStyle, $Parent)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragEvent")
    
    $Title_Label = GUICtrlCreateLabel($Title, 0, 0, 235, 22, $SS_CENTER)
        GUICtrlSetState(-1, $GUI_DISABLE)
        GUICtrlSetResizing(-1, 512)
        GUICtrlSetFont(-1, 12, 700, 0, "Daedric")
        GUICtrlSetBkColor(-1, 0xCCCCCC)

    Local $X_Button = GUICtrlCreateButton(" X ", 213, 0, 22, 22)
        GUICtrlSetFont(-1, 10, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "Quit")

    Local $Mim_Button = GUICtrlCreateButton(" - ", 0, 0, 22, 22)
        GUICtrlSetFont(-1, 13, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MimimizeGui")

    Local $Max_Button = GUICtrlCreateButton(CHR(152), 310, 0, 22, 22)
        GUICtrlSetFont(-1, 9, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MaximizeGui")
        
    If Not BitAND($SetStyle, $WS_MAXIMIZEBOX) Then GUICtrlSetState(-1, $GUI_DISABLE)
    Return $hWnd
EndFunc
Func DragEvent()
    DragWindow($GuihWnd)
EndFunc
Func DragWindow($hWnd)
    Local $MousePos = MouseGetPos()
    Local $hWndPos = WinGetPos($hWnd)
    Local $WinPos[2], $IsPressed[1], $OpenDll, $GuiCurInfo[5]
    $WinPos[0] = $MousePos[0]-$hWndPos[0]
    $WinPos[1] = $MousePos[1]-$hWndPos[1]
    $OpenDll = DllOpen("user32.dll")
    $GuiCurInfo = GUIGetCursorInfo($hWnd)
    If $OpenDll <> -1 And ($GuiCurInfo[4] = 0 Or $GuiCurInfo[4] = $Title_Label) Then
        Do
            $hWndPos = MouseGetPos()
            WinMove($hWnd, '', $hWndPos[0]-$WinPos[0], $hWndPos[1]-$WinPos[1])
            Sleep(20)
            $IsPressed = DllCall($OpenDll, "int", "GetAsyncKeyState", "int", '0x01')
        Until @error Or BitAND($IsPressed[0], 0x8000) <> 0x8000
    EndIf
    DllClose($OpenDll)
EndFunc
Func MaximizeGui()
    If BitAND(WinGetState($GuihWnd), 32) Then
        GUISetState(@SW_RESTORE, $GuihWnd)
    Else
        GUISetState(@SW_MAXIMIZE, $GuihWnd)
    EndIf
EndFunc
Func MimimizeGui()
    GUISetState(@SW_MINIMIZE, $GuihWnd)
EndFunc
Func Quit()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
    Exit
EndFunc

ok thanks... can u now do waht i asked in the first place and make the other GUi's when the buttons are pressed... And when 'Run' is pressed it will rune oblivion.exe... and if cannot be found the msgbox saygin cannont find oblivion...

Plz

Oh yea and why have you added a close button on the main GUI...

By the way i wasn't ennoyed or shoting eirlyer in this post...

(Sorry about poor spelling,, im 14 and have the spelling age of a 9 year old... i have spelling disabilty)

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

ok thanks... can u now do waht i asked in the first place and make the other GUi's when the buttons are pressed... And when 'Run' is pressed it will rune oblivion.exe... and if cannot be found the msgbox saygin cannont find oblivion...

Plz

Oh yea and why have you added a close button on the main GUI...

By the way i wasn't ennoyed or shoting eirlyer in this post...

(Sorry about poor spelling,, im 14 and have the spelling age of a 9 year old... i have spelling disabilty)

yes what you want can be done now.. look on the fourms for examples and stuff like that..

if you need more help ill be willing but its your turn to try first

Link to comment
Share on other sites

Added:

1) Minamize animation...

2) Quit hotkey( with animation)

3) maxmize button (working)

4) A run button (next to maxaminze button)

Changed:

1) Animation times

2)size(not much)

3) were stuff is(no much just a few spaces here and there)

4) button sizes

Tryed:

1) to make a GUI which opens when a button is pressed (All failed)

Here is the new script: **updated 20th may 2007 time 01:08 AM**( london time)

#include <Constants.au3>
#include <Guiconstants.au3>


HotKeySet("!{ESC}", "Quit")


Opt("GuiOnEventMode", 1)
Global $GUIHWND, $TITLE_LABEL
Dim $LeftPos, $ExampleLabel, $GuihWnd, $LeftPos, $ok, $ok1, $ok2, $ok3, $ok4, $ok5, $ok6, $info
$GuihWnd = _GuiDragableCreate("Oblivion Helper", 275, 425, -1, -1)
    GUISetBkColor(0xffffff)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 38, 23, 230, 22)
    GUICtrlSetFont(-1, 12, 600, 0, "Daedric")
    GUICtrlSetColor(-1, 0xDD0000)
$ExampleLabel = GUICtrlCreateLabel("Welcome to Oblivion helper ", 40, 46, 230, 22)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetColor(-1, 0xDD0000)
    GUICtrlCreateGroup("Oblivion", 5, 335, 110, 50)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
$ok = GUICtrlCreateButton ("Close", 160, 350, 100, 30)
    GUICtrlSetOnEvent(-1, "Quit")
$ok1 = GUICtrlCreateButton("Run", 10, 350, 90, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "Oblivion")
    GUICtrlCreateGroup("Oblivion Help Files", 5, 80, 265, 250)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetState ($ok1, $GUI_FOCUS)
$ok2 = GUICtrlCreateButton("How to Increase Your Level", 10, 95, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "IncreaseL")
$ok3 = GUICtrlCreateButton("Advantages of Leveling", 10, 135, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "AdvantagesO")
$ok4 = GUICtrlCreateButton("Raising Attributes", 10, 175, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "RaisingA")
$ok5 = GUICtrlCreateButton("The Leveling Problem (TLP)", 10, 215, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "ProblemTLP")
$ok6 = GUICtrlCreateButton("Overcoming TLP", 10, 255, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "OvercomingTLP")
$ok6 = GUICtrlCreateButton("Additional info about leveling", 10, 295, 255, 30)
    GUICtrlSetFont(-1, 12, 600, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "Additionalinfo")
DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 300, "long", 0x10+0x10000)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit", $GuihWnd)





While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $ok2 Then
        GUISetState (@SW_HIDE,$GuihWnd)
        GUISetState (@SW_SHOW,$info)
    EndIf
    If $msg = $ok Then
        GUISetState (@SW_SHOW,$GuihWnd)
        GUISetState (@SW_HIDE,$info)
    EndIf
WEnd

Func _GuiDragableCreate($Title="", $Width=300, $Height=200, $Left=-1, $Top=-1, $Style=-1, $exStyle=-1, $Parent=0)
    Local $SetStyle = $WS_POPUPWINDOW+$Style, $SetExStyle = $WS_EX_DLGMODALFRAME+$exStyle
    If $Style = -1 Then $SetStyle = $WS_POPUPWINDOW
    If $exStyle = -1 Then $SetExStyle = $WS_EX_DLGMODALFRAME
    Local $hWnd = GUICreate($Title, $Width, $Height, $Left, $Top, $SetStyle, $SetexStyle, $Parent)
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "DragEvent")
    
    $Title_Label = GUICtrlCreateLabel($Title, 0, 0, 275, 22, $SS_CENTER)
        GUICtrlSetState(-1, $GUI_DISABLE)
        GUICtrlSetResizing(-1, 512)
        GUICtrlSetFont(-1, 12, 700, 0, "Daedric")
        GUICtrlSetBkColor(-1, 0xCCCCCC)

    Local $X_Button = GUICtrlCreateButton("X ", 253, 0, 22, 22)
        GUICtrlSetFont(-1, 10, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "Quit")

    Local $Mim_Button = GUICtrlCreateButton("~ ", 0, 0, 22, 22)
        GUICtrlSetFont(-1, 13, 700, 0, "Monotype Corsiva")
        GUICtrlSetOnEvent(-1, "MimimizeGui")

    Local $Max_Button = GUICtrlCreateButton("M ", 22, 0, 22, 22)
    GUICtrlSetFont(-1, 9, 700, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "MaximizeGui")

        
        Local $Max_Button = GUICtrlCreateButton("Run", 44, 0, 25, 22)
    GUICtrlSetFont(-1, 5, 700, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "Oblivion")
    
    
        
        Local $Max_Button = GUICtrlCreateButton("Will be avable in next Version", 25, 400, 225, 22)
    GUICtrlSetFont(-1, 9, 700, 0, "Monotype Corsiva")
    GUICtrlSetOnEvent(-1, "Oblivion")
    
    
    If Not BitAND($SetStyle, $WS_MAXIMIZEBOX) Then GUICtrlSetState(-1, $GUI_DISABLE)
    Return $hWnd
EndFunc

Func DragEvent()
    DragWindow($GuihWnd)
EndFunc

Func DragWindow($hWnd)
    Local $MousePos = MouseGetPos()
    Local $hWndPos = WinGetPos($hWnd)
    Local $WinPos[2], $IsPressed[1], $OpenDll, $GuiCurInfo[5]
    $WinPos[0] = $MousePos[0]-$hWndPos[0]
    $WinPos[1] = $MousePos[1]-$hWndPos[1]
    $OpenDll = DllOpen("user32.dll")
    $GuiCurInfo = GUIGetCursorInfo($hWnd)
    If $OpenDll <> -1 And ($GuiCurInfo[4] = 0 Or $GuiCurInfo[4] = $Title_Label) Then
        Do
            $hWndPos = MouseGetPos()
            WinMove($hWnd, '', $hWndPos[0]-$WinPos[0], $hWndPos[1]-$WinPos[1])
            Sleep(20)
            $IsPressed = DllCall($OpenDll, "int", "GetAsyncKeyState", "int", '0x01')
        Until @error Or BitAND($IsPressed[0], 0x8000) <> 0x8000
    EndIf
    DllClose($OpenDll)
EndFunc

Func MaximizeGui()
        If BitAND(WinGetState($GuihWnd), 32) Then
        GUISetState(@SW_RESTORE, $GuihWnd)
    Else
        GUISetState(@SW_MAXIMIZE, $GuihWnd)
    EndIf
EndFunc

Func Oblivion()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 1500, "long", 0x10+0x10000)
    run("Oblivion.exe")
EndFunc

Func IncreaseL()
    GUICreate ("How to Increase Your Level",550,65)
EndFunc

Func AdvantagesO()
    GUICreate ("Advantages of Leveling",550,65)
EndFunc

Func RaisingA()
    GUICreate ("Raising Attributes",550,65)
EndFunc

Func ProblemTLP()
    GUICreate ("The Leveling Problem (TLP)",550,65)
EndFunc

Func OvercomingTLP()
    GUICreate ("Overcoming TLP",550,65)
EndFunc

Func Additionalinfo()
    GUICreate ("Additional info about leveling",550,65)
EndFunc


Func MimimizeGui()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 1500, "long", 0x10+0x10000)
    GUISetState(@SW_MINIMIZE, $GuihWnd)
EndFunc

Func Quit()
    DllCall("User32.dll", "long", "AnimateWindow", "hwnd", $GuihWnd, "long", 4500, "long", 0x10+0x10000)
    Exit
EndFunc

thanks for all the help so far but i still cant get the diffrent windows to come up when i prees a cretian button...

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

  • Moderators

(Sorry about poor spelling,, im 14 and have the spelling age of a 9 year old... i have spelling disabilty)

Coding takes proper syntax implementation. If you have the spelling level of a 9 year old, then you probably have the syntax capabilities of a 3 year old, and for that, you should probably wait until you are at least 19 (or just a little less, to reach the 15 year old threshold at your current rate).

FYI: Admitting to a disability that can be easily cured by a ounce of effort, won't get you far on a coding forum.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Coding takes proper syntax implementation. If you have the spelling level of a 9 year old, then you probably have the syntax capabilities of a 3 year old, and for that, you should probably wait until you are at least 19 (or just a little less, to reach the 15 year old threshold at your current rate).

FYI: Admitting to a disability that can be easily cured by a ounce of effort, won't get you far on a coding forum.

hi smoke :)

you havent changed much :D

and salazar if you didnt relize i put a minimize and close button on the top of the screen. a maxamize button is not needed.

Edited by Golbez
Link to comment
Share on other sites

hi smoke :)

you havent changed much :D

and salazar if you didnt relize i put a minimize and close button on the top of the screen. a maxamize button is not needed.

i didnt say i put on in i said i had added an animation to it...

BTW im wroking on it now... and its going brillant

look at post 14 for update... can you try it please

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

just a little but off topic...

Golbez can u do somet for me...

1) make me personal pic

2) a Sig

Oh yea and thanks for all the help so far...

well it loike 1 AM here in england so im going bed...

Ill be on 2morrow and il try and finish it... but if u can plz do the gui when button pressed that would be surburb

c ya 2morrow

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Link to comment
Share on other sites

i didnt say i put on in i said i had added an animation to it...

BTW im wroking on it now... and its going brillant

look at post 14 for update... can you try it please

yes what about it :) i fix the code again

btw heres a hint.. you have to make a new gui to show the information :D

im having fun helping you :D i love scripting stuff but i never know what to script :D

im looking for a game to make a bot for but all the mmos ive played and made something for :D

atm im trying croNous. anyone got any other ideas?

ive played: knights online, silkroad, watermargin i dont reamber others

Link to comment
Share on other sites

try runescape...

I could help you with them.. cus i play it quite a bit..

Btw weres the fixed code u sspoke about.... and plz do the gui when button pressed ... plz...

now im going to bed cus its now 1:16 AM

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

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...