Jump to content
Sign in to follow this  

How to read input path which has enter by user using GUICtrlSetData

Recommended Posts


Dear Team,

I have created the below GUI which take the file path from user inputs .And store the input path into the one variable that i am going to be use in entire script .

Problem is the i am unable to read the input path which has enter by the user please help  .


If the input path is empty scipt should ask the user "Cant be blank message  "

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
Func Idfile()
    $hGUI1 = GUICreate("Lotus Notes Auto Config ", 394, 142, -1, -1)
    $hLabel1 = GUICtrlCreateLabel("Select Notes ID file ", 98, 16, 142, 27)
    GUICtrlSetFont(-1, 10, 800, 0)
    $hButton1 = GUICtrlCreateButton("Browse", 53, 92, 96, 23)
    GUICtrlSetFont(-1, 10, 800, 0)
    $hButton21 = GUICtrlCreateButton("Done", 229, 92, 95, 23)
    GUICtrlSetFont(-1, 8.5, 800, 0)
    $path = GUICtrlCreateInput("", 19, 43, 349, 27)
    $hMsg1 = 0
    While $hMsg1 <> $GUI_EVENT_CLOSE
        $hMsg1 = GUIGetMsg()
            Case $hMsg1 = $hButton1
                $File2open = FileOpenDialog("Browse", "C:\", "ID file  (*.txt)") ;returns the file path
                GUICtrlSetData($path, $File2open) ;set input data
                $test = GUICtrlSetData($path, $File2open)
             Case $hMsg1 = $hButton21
                MsgBox(1,"ID File Location",$test )
 EndFunc   ;==>Idfile

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