karanmoonlight Posted March 14, 2014 Share Posted March 14, 2014 HI team, I have two different programs and i want to use them using one single message box. For Example If I click on button no A then first program should execute and if i click on button no 2 then my second program should run... Can anyone help me.....how can i write a code..... any help would be appreciated. thanks! Program no 1 Sleep(200) $url = "https://www.google.co.in/?gfe_rd=ctrl&ei=ab8ZU4PrKKrW8gf5lYDgDg&gws_rd=cr" $oIE = _IECreate($url) Sleep(100) _IELoadWait($oIE) Sleep(100) $hIE = _IEPropertyGet($oIE, "hwnd") ; Get Handle of the IE window WinSetState($hIE, "" ,@SW_MAXIMIZE) Sleep(100) Program no 2 Sleep(200) send("#r") ;--------------------to open a folder-------------- Sleep(200) send("C:\LTE Market List{enter}") sleep(200) WinWaitActive("LTE Market List") sleep(200) WinSetState("LTE Market List", "", @SW_MAXIMIZE) sleep(200) WinActivate("LTE Market List") sleep(200) ;---------------------------to click on 1st sheet--------------- MouseClick("left", 249, 128, 1) Sleep(200) EndSwitch Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 Look at the return values of MsgBox in help file. Use If...Then...Else condition with it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
karanmoonlight Posted March 14, 2014 Author Share Posted March 14, 2014 can anyone please post an example how can i assign my program to one button??? Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 If MsgBox(1,0,0) = 1 Then ;your program Else ;your other program EndIf AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
karanmoonlight Posted March 14, 2014 Author Share Posted March 14, 2014 hi john. thanks for ur time.... i have used the below logic and its working fine for me Func ATT() Local $hGUI = GUICreate("ATT", 500, 400) Local $1 = GUICtrlCreateButton("W", 80, 100, 160, 25) Local $1 = GUICtrlCreateButton("L", 80, 150, 160, 25) Local $iExit = GUICtrlCreateButton("Exit", 220, 250, 85, 25) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iexit ExitLoop Case $1 Case $2 Link to comment Share on other sites More sharing options...
JohnOne Posted March 14, 2014 Share Posted March 14, 2014 ace. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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