Jump to content
Sign in to follow this  
karanmoonlight

Assign two different programs to two buttons

Recommended Posts

karanmoonlight

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

Share this post


Link to post
Share on other sites
karanmoonlight

can anyone please post an example how can i assign my program to one button???

Share this post


Link to post
Share on other sites
karanmoonlight

hi john.

thanks for ur time.... i have used the below logic and its working fine for me :thumbsup:

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

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  

×