Jump to content
Sign in to follow this  
bang

a function on button and input

Recommended Posts

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 1276, 947,(@DesktopWidth-1276)/2, (@DesktopHeight-947)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Button_1 = GuiCtrlCreateButton("msn", 40, 60, 90, 80)

$Input_2 = GuiCtrlCreateInput("Input2", 40, 20, 130, 20)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd

Exit

help i need a function on button (then open a feks notepad.exe) and then open then

and this same with input need then will open a exe program!!

plz help me

Share this post


Link to post
Share on other sites

maybe this can help... not "sure" what you wanted

#include <GuiConstants.au3>

;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GUICreate("MyGUI");, 1276, 947,(@DesktopWidth-1276)/2, (@DesktopHeight-947)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Button_1 = GUICtrlCreateButton("msn", 40, 60, 90, 80)
$Input_2 = GUICtrlCreateInput("Input2", 40, 20, 130, 20)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            Run_Program()
        Case Else
        ;;;
    EndSelect
WEnd
Exit

; ---------- Functions -----------

Func Run_Program()
    
    $Prog_name = GUICtrlRead($Input_2)
    Run("notepad.exe")
    WinWait('')
    Send($Prog_name)
EndFunc

8)

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  

×
×
  • Create New...