Sign in to follow this  
Followers 0
Arclite86

how to close a window

2 posts in this topic

i have this window created but when i click the x (right, top) it isnt responding

#include <Buttonconstants.au3>
#include <Editconstants.au3>
#include <Guiconstantsex.au3>
#include <staticConstants.au3>
#include <windowsConstants.au3>
#include <IE.au3>
#include <String.au3>

#Region ### START Koda GUI section ### Form=
$GUIT1 = GUICreate  ("hoihallo", 286, 223, 338, 185)
$labelHallo = GUICtrlCreateLabel ("hallo,,,,", 32, 24, 217, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$Input = GUICtrlCreateInput("", 48,80,185,21)
$Button = GUICtrlCreateButton("zoek volgers", 64,120,145,49,$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("guioneventmode",1)



While 1
    GUICtrlSetOnEvent($Button, "Test")
WEnd



func Test()
    $name = GUIctrlread($Input)
    $Button = _IECreate("http://tweepi.com/auth/login")
     MsgBox(0,"","hoi" &$name)




    GUICtrlSetData($labelHallo,("number",$name)

    EndFunc

i am tryed this but...

#include <Buttonconstants.au3>
#include <Editconstants.au3>
#include <Guiconstantsex.au3>
#include <staticConstants.au3>
#include <windowsConstants.au3>
#include <IE.au3>
#include <String.au3>

#Region ### START Koda GUI section ### Form=
$GUIT1 = GUICreate  ("hoihallo", 286, 223, 338, 185)
$labelHallo = GUICtrlCreateLabel ("hallo,,,,", 32, 24, 217, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$Input = GUICtrlCreateInput("", 48,80,185,21)
$Button = GUICtrlCreateButton("zoek volgers", 64,120,145,49,$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("guioneventmode",1)



While 1
    GUICtrlSetOnEvent($Button1, "volg")
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1

    EndSwitch
WEnd



func Test()
    $name = GUIctrlread($Input)
    $Button = _IECreate("http://tweepi.com/auth/login")
     MsgBox(0,"","hoi" &$name)




    GUICtrlSetData($labelHallo,("number",$name)

    EndFunc

but then its not working at all, please help

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Here ya go,

Taken from the help file example for:

GUISetOnEvent  :rolleyes:

#include <Buttonconstants.au3>
#include <Editconstants.au3>
#include <Guiconstantsex.au3>
#include <staticConstants.au3>
#include <windowsConstants.au3>
#include <IE.au3>
#include <String.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
$GUIT1 = GUICreate  ("hoihallo", 286, 223, 338, 185)
$labelHallo = GUICtrlCreateLabel ("hallo,,,,", 32, 24, 217, 28)
GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif")
$Input = GUICtrlCreateInput("", 48,80,185,21)
$Button = GUICtrlCreateButton("zoek volgers", 64,120,145,49,$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("guioneventmode",1)



While 1
    GUICtrlSetOnEvent($Button, "Test")

    GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
    GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
    GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

WEnd

Func SpecialEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            MsgBox($MB_SYSTEMMODAL, "Close Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)
            Exit

        Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
            MsgBox($MB_SYSTEMMODAL, "Window Minimized", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

        Case @GUI_CtrlId = $GUI_EVENT_RESTORE
            MsgBox($MB_SYSTEMMODAL, "Window Restored", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)

    EndSelect
EndFunc   ;==>SpecialEvents

func Test()
    $name = GUIctrlread($Input)
    $Button = _IECreate("http://tweepi.com/auth/login")
     MsgBox(0,"","hoi" & $name)




    GUICtrlSetData($labelHallo, "number",$name)

    EndFunc
Edited by l3ill

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