maqleod Posted September 25, 2007 Share Posted September 25, 2007 I want to make a button retrieve the path of an .exe and write the path to an .ini file. The purpose is to use that info from the .ini to set the button's image to the icon of the .exe and the tip to the path. [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
JustinReno Posted September 25, 2007 Share Posted September 25, 2007 If I understand you, then: CODE ;Put this code the EXE you want the path info from, unless it is not Autoit Iniwrite(@HomeDrive&"\retrieveEXEinfo.ini", "Info", "Path, @ScriptFullPath) CODE ;Put this in your app $readexepath = IniRead(@HomeDrive&"\retrieveEXEinfo.ini", "Info", "Path", "") Link to comment Share on other sites More sharing options...
maqleod Posted September 25, 2007 Author Share Posted September 25, 2007 If I understand you, then:CODE;Put this code the EXE you want the path info from, unless it is not AutoitIniwrite(@HomeDrive&"\retrieveEXEinfo.ini", "Info", "Path, @ScriptFullPath)CODE;Put this in your app$readexepath = IniRead(@HomeDrive&"\retrieveEXEinfo.ini", "Info", "Path", "")it is for any .exe, not just autoit, I need a universal way to return the path of the exe when dragged onto a button and the method for how to poll for that event to take the actions I want to take [u]You can download my projects at:[/u] Pulsar Software Link to comment Share on other sites More sharing options...
JustinReno Posted September 25, 2007 Share Posted September 25, 2007 OOOH, that was a better explanation, I'll look, just a couple of minutes Link to comment Share on other sites More sharing options...
Siao Posted September 25, 2007 Share Posted September 25, 2007 (edited) Read help file, GUICtrlSetState(). Especially the last paragraph that starts with "If $GUI_DROPACCEPTED is set to a visible control..." Edited September 25, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
maqleod Posted September 25, 2007 Author Share Posted September 25, 2007 (edited) Read help file, GUICtrlSetState(). Especially the last paragraph that starts with "If $GUI_DROPACCEPTED is set to a visible control..." thx, it seems I was looking in the wrong place in the help file EDIT: It worked as intended, so, for the sake of completion, here's an example that illustrates the point: #include <GUIConstants.au3> $parent = GUICreate("test",200,200,-1,-1,-1,$WS_EX_ACCEPTFILES) $button1 = GuiCtrlCreateButton("Test",10,10,75,25,$BS_ICON) GuiCtrlSetState($button1,$GUI_DROPACCEPTED) GUISetState() Do $msg = GUIGetMsg() if $msg = $GUI_EVENT_DROPPED then MsgBox(0,"Test",@GUI_DROPID & " " & @GUI_DRAGFILE) endif Until $msg = $GUI_EVENT_CLOSE GuiDelete($parent) Edited September 25, 2007 by maqleod [u]You can download my projects at:[/u] Pulsar Software 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