Sign in to follow this  
Followers 0
RandomGuest

Creating a new window when pushing a button (dont need more help)

13 posts in this topic

#1 ·  Posted (edited)

How can I make, so when I push the options button a new window will come?

I've read a bit and looked at a another script wich is nearly like mine, but I cant get it to work

Im might too stupid xD ...What should I write in the Case $button_2 thing?

Edit: I want the new window to be like the old one, but with other stuff on it, but I'll fix that myself, just so you know what I mean...

Oh well, heres my script:

#include <GUIConstants.au3>

GUICreate("I AM SIMIAN!")

GUISetBkColor (0xE0FFFF)

Opt("GUICoordMode",5)

$button_2 = GUICtrlCreateButton ("Options", 60, 30, 60)

$button_1 = GUICtrlCreateButton ("SIMIAN", 0, -1, 60)

GUISetState ()

While 1

$msg = GUIGetMsg()

Switch $msg

Case $GUI_EVENT_CLOSE

ExitLoop

Case $button_1

Run("C:\Program\Mozilla Firefox\firefox.exe")

Sleep(4500)

MouseMove(675,65)

MouseClick("left")

Sleep(1500)

Send("http://www.youtube.com/")

Send("{ENTER}")

Sleep(1500)

MouseMove(525,212)

MouseClick("left")

Sleep(2000)

Send("NOBODY KNOWS SIMIAN")

Send("{ENTER}")

Sleep(1000)

MouseMove(369,340)

MouseClick("left")

Sleep(1000)

MouseMove(593,860)

Exit

Case $button_2

EndSwitch

Wend

Edited by RandomGuest

Share this post


Link to post
Share on other sites



Make a function, with GuiCreate.

If you mean:

Case $button_2

GUICreate("I AM SIMIAN 2!")

it doesnt work..

Share this post


Link to post
Share on other sites

You need to specifiy a height and width.

Case $button_3

GUICreate ("Test", 800, 600,)

Still not working

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

GUICreate ("Test", 800, 600,)

Still do not work

GUICreate ("Test", 800, 600)

Edit: Shouldnt it be ''child'' or ''parent'' or something? Or am I lost? :)

Edited by RandomGuest

Share this post


Link to post
Share on other sites

Hhmmm.....sooo...? xD

Share this post


Link to post
Share on other sites

Uuhm... try the script on your computer, and you'll see it does not work...

Share this post


Link to post
Share on other sites

Firsty:

Run("C:\Program\Mozilla Firefox\firefox.exe")

Should be Run("C:\Program Files\Mozilla Firefox\firefox.exe")

Now:

#include <GUIConstants.au3>

GUICreate("I AM SIMIAN!")

GUISetBkColor(0xE0FFFF)

Opt("GUICoordMode", 5)

$button_2 = GUICtrlCreateButton("Options", 60, 30, -1, -1)

$button_1 = GUICtrlCreateButton("SIMIAN", 0, -1, 60)

GUISetState()
While 1
    $msg = GUIGetMsg()

    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $button_1
            Run("C:\Program Files\Mozilla Firefox\firefox.exe")
            Sleep(4500)
            MouseMove(675, 65)
            MouseClick("left")
            Sleep(1500)
            Send("http://www.youtube.com/")
            Send("{ENTER}")
            Sleep(1500)
            MouseMove(525, 212)
            MouseClick("left")
            Sleep(2000)
            Send("NOBODY KNOWS SIMIAN")
            Send("{ENTER}")
            Sleep(1000)
            MouseMove(369, 340)
            MouseClick("left")
            Sleep(1000)
            MouseMove(593, 860)
            Exit

        Case $button_2
            New()
    EndSwitch
WEnd

Func New()
    $newgui = GUICreate("NEW WINDOW")
    GUISetBkColor(0xE0FFFF)
    
    GUISetState()
    
    While WinExists($newgui)
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                GUIDelete($newgui)
        EndSwitch
    WEnd
EndFunc   ;==>New

Share this post


Link to post
Share on other sites

Uuhm... try the script on your computer, and you'll see it does not work...

#include <GUIConstants.au3>

GUICreate("I AM SIMIAN!")

GUISetBkColor (0xE0FFFF)

Opt("GUICoordMode",5)

$button_2 = GUICtrlCreateButton ("Options", 60, 30, 60)

$button_1 = GUICtrlCreateButton ("SIMIAN", 0, -1, 60)

GUISetState ()
While 1
    $msg = GUIGetMsg()

    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop

        Case $button_2
            make2()
            
            

    EndSwitch
Wend


Func Make2()
    
    GUICreate("sim2")
    $button3 = GUICtrlCreateButton("exit Sim 2",50,50,140,30)
    GUISetState()
    While 1
        $msg2 = GUIGetMsg()

        Switch $msg2
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $button3
                ExitLoop
        EndSwitch
    WEnd

    GUIDelete("sim2")
    
EndFunc

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks! <3 Much appreciated :) .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0