Craberos Posted May 18, 2010 Posted May 18, 2010 hi allthanks in advance ........i am a noob at this therefore i would like some one to help me pleaseI have 4 text files with the names mentioned below the code is working great but .... now i want a msgbox with 4 buttons EARTH, FIRE, AIR, WATER so when i click that particular button for example EARTH i want this function to work WinActivate ("EARTH") which will bring the particular window front can anyone help me please thanks CraberosOpt("WinTitleMatchMode", 2)While 1WinActivate ("EARTH")Sleep (5000)WinActivate ("FIRE")Sleep (5000)WinActivate ("AIR")Sleep (5000)WinActivate ("WATER")Sleep (5000)WEnd
hawky358 Posted May 18, 2010 Posted May 18, 2010 (edited) Look at the help for these functions GUICreate() GUICtrlCreateButton() Since you are a "noob" it would be best to read the help file. The example script in the GUICtrlCreateButton() section in the help already has a two button menu, just work off that. I don't think anyone will help you with this since there should be hundreds of examples on the forums already as well. Edited May 18, 2010 by hawky358
Yoriz Posted May 18, 2010 Posted May 18, 2010 Hi, welcome to the forum. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Earth") GUISetState(@SW_SHOW) GUICreate("Fire") GUISetState(@SW_SHOW) GUICreate("Air") GUISetState(@SW_SHOW) GUICreate("Water") GUISetState(@SW_SHOW) $aWindowPos = WinGetPos("Water") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("", 138, 75, $aWindowPos[0]-145, -1) $Button1 = GUICtrlCreateButton("Earth", 8, 8, 59, 25) $Button2 = GUICtrlCreateButton("Fire", 72, 8, 59, 25) $Button3 = GUICtrlCreateButton("Air", 8, 40, 59, 25) $Button4 = GUICtrlCreateButton("Water", 72, 40, 59, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _ActiveWindow("Earth") Case $Button2 _ActiveWindow("Fire") Case $Button3 _ActiveWindow("Air") Case $Button4 _ActiveWindow("Water") EndSwitch WEnd Func _ActiveWindow($sWindowName) WinActivate($sWindowName) EndFunc GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Craberos Posted May 18, 2010 Author Posted May 18, 2010 (edited) Hi, welcome to the forum. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Earth") GUISetState(@SW_SHOW) GUICreate("Fire") GUISetState(@SW_SHOW) GUICreate("Air") GUISetState(@SW_SHOW) GUICreate("Water") GUISetState(@SW_SHOW) $aWindowPos = WinGetPos("Water") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("", 138, 75, $aWindowPos[0]-145, -1) $Button1 = GUICtrlCreateButton("Earth", 8, 8, 59, 25) $Button2 = GUICtrlCreateButton("Fire", 72, 8, 59, 25) $Button3 = GUICtrlCreateButton("Air", 8, 40, 59, 25) $Button4 = GUICtrlCreateButton("Water", 72, 40, 59, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _ActiveWindow("Earth") Case $Button2 _ActiveWindow("Fire") Case $Button3 _ActiveWindow("Air") Case $Button4 _ActiveWindow("Water") EndSwitch WEnd Func _ActiveWindow($sWindowName) WinActivate($sWindowName) EndFunc thanks a lot bro for the welcome and also for the code thanks a lot yoriz Edited May 18, 2010 by Craberos
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