Jump to content

Problem with shortcut path


Recommended Posts

I got a problem here, can you guys help me out?

I got 1 app, example: D\study\english.exe, and its shortcut: D:\eng.lnk

Every time I use FileOpenDialog to choose eng.lnk, and use guictrlsetdata to get its path to input1, the result always be: D\study\english.exe

Is there a way to get only shortcut path D:\eng.lnk to input1? because i will use shellexecute later

Link to comment
Share on other sites

Got that, I used the wrong file extension :mellow:

thank you bbb

GUICreate("My GUI Button") 
$Button3 = GUICtrlCreateButton("path", 10, 80,100)
$input1 = GUICtrlCreateInput("path", 10,120,250)
GUISetState(@SW_SHOW)

    While 1
        $nmsg = GUIGetMsg()
        Select
            Case $nmsg = $GUI_EVENT_CLOSE
                ExitLoop            
        Case $nmsg = $Button3
    path()
        EndSelect
    WEnd

Func path() 
    local $Folder = "@WorkingDir"
    $file = FileOpenDialog("Load Setting", $Folder, "Shortcut (*.lnk)", 1 + 2, "")  
        if @error Then          
            GUICtrlSetData($input1,"You haven't select yet")
        Else
            GUICtrlSetData($input1,$file)   
        EndIf   
 
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...