beanwi Posted November 25, 2008 Share Posted November 25, 2008 I'm trying to set my 3rd GUI (File GUI) to show up where the mouse is when the @SW_Show command is in... expandcollapse popup;Including Necessary Files #include <WindowsConstants.au3> ;Creating GUIs,Styles, snd Buttons ;Main GUI $Main_GUI = GUICreate("TIMMY", 400, 400) GUISetStyle($WS_Caption) $FileButton = GUICtrlCreateButton("File", 1, 1, 60, 20) $HelpButton = GUICtrlCreateButton("HELP FILE", 61, 1, 60, 20) $ExitButton = GUICtrlCreateButton("Exit", 121, 1, 60, 20) GUISetState() ;Help GUI $Help_GUI = GUICreate("2ndwindow", 200, 200) GUISetStyle($WS_Caption) $HelpExitButton = GUICtrlCreateButton("Exit", 1, 1, 60, 20) GUISetState(@SW_HIDE, $Help_GUI) ;File GUI $File_GUI = GUICreate("",250,200, MouseGetPos[1],MouseGetPos[0]) GUISetStyle($WS_Border) GUISetState(@SW_Hide) ;Setting Button Parameters While 1 $Msg = GUIGetMsg() Select Case $Msg = $FileButton GUISetState(@SW_Show, $File_GuI) Case $Msg = $HelpButton GUISetState(@SW_SHOW, $Help_GUI) Case $Msg = $HelpExitButton GUISetState(@SW_HIDE, $Help_GUI) Case $Msg = $ExitButton ExitLoop EndSelect WEnd ;Closing Statement MsgBox(0, "Thank You", "Thank you for playing") but it just shows up where the cursor was before the code started...and i dont know how to set a variable for a window that has already been created Link to comment Share on other sites More sharing options...
Valuater Posted November 25, 2008 Share Posted November 25, 2008 (edited) expandcollapse popup;Including Necessary Files #include <WindowsConstants.au3> ;Creating GUIs,Styles, snd Buttons ;Main GUI $Main_GUI = GUICreate("TIMMY", 400, 400) GUISetStyle($WS_Caption) $FileButton = GUICtrlCreateButton("File", 1, 1, 60, 20) $HelpButton = GUICtrlCreateButton("HELP FILE", 61, 1, 60, 20) $ExitButton = GUICtrlCreateButton("Exit", 121, 1, 60, 20) GUISetState() ;Help GUI $Help_GUI = GUICreate("2ndwindow", 200, 200) GUISetStyle($WS_Caption) $HelpExitButton = GUICtrlCreateButton("Exit", 1, 1, 60, 20) GUISetState(@SW_HIDE, $Help_GUI) ;File GUI $Pos = MouseGetPos() $File_GUI = GUICreate("", 250, 200, $Pos[0], $Pos[1]) GUISetStyle($WS_Border) GUISetState(@SW_HIDE) ;Setting Button Parameters While 1 $Msg = GUIGetMsg() Select Case $Msg = $FileButton $Pos = MouseGetPos() WinMove( $File_GUI, "", $Pos[0], $Pos[1]) GUISetState(@SW_SHOW, $File_GUI) Case $Msg = $HelpButton GUISetState(@SW_SHOW, $Help_GUI) Case $Msg = $HelpExitButton GUISetState(@SW_HIDE, $Help_GUI) Case $Msg = $ExitButton ExitLoop EndSelect WEnd ;Closing Statement MsgBox(0, "Thank You", "Thank you for playing") EDIT:... Fixed minor error 8) Edited November 25, 2008 by Valuater Link to comment Share on other sites More sharing options...
beanwi Posted November 25, 2008 Author Share Posted November 25, 2008 expandcollapse popup;Including Necessary Files #include <WindowsConstants.au3> ;Creating GUIs,Styles, snd Buttons ;Main GUI $Main_GUI = GUICreate("TIMMY", 400, 400) GUISetStyle($WS_Caption) $FileButton = GUICtrlCreateButton("File", 1, 1, 60, 20) $HelpButton = GUICtrlCreateButton("HELP FILE", 61, 1, 60, 20) $ExitButton = GUICtrlCreateButton("Exit", 121, 1, 60, 20) GUISetState() ;Help GUI $Help_GUI = GUICreate("2ndwindow", 200, 200) GUISetStyle($WS_Caption) $HelpExitButton = GUICtrlCreateButton("Exit", 1, 1, 60, 20) GUISetState(@SW_HIDE, $Help_GUI) ;File GUI $Pos = MouseGetPos() $File_GUI = GUICreate("", 250, 200, $Pos[0], $Pos[1]) GUISetStyle($WS_Border) GUISetState(@SW_HIDE) ;Setting Button Parameters While 1 $Msg = GUIGetMsg() Select Case $Msg = $FileButton $Pos = MouseGetPos() WinMove( $File_GUI, "", $Pos[0], $Pos[1]) GUISetState(@SW_SHOW, $File_GUI) Case $Msg = $HelpButton GUISetState(@SW_SHOW, $Help_GUI) Case $Msg = $HelpExitButton GUISetState(@SW_HIDE, $Help_GUI) Case $Msg = $ExitButton ExitLoop EndSelect WEnd ;Closing Statement MsgBox(0, "Thank You", "Thank you for playing") EDIT:... Fixed minor error 8) Wow thanks a whole bunch, everyone on this forum is so helpful i needa take a better look around the help file,...i can never seem to find the right commands, thanks tho Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now