Jump to content

Recommended Posts

Posted

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
Posted

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", "")

Posted

  JustinReno said:

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", "")

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
Posted (edited)

Read help file, GUICtrlSetState().

Especially the last paragraph that starts with "If $GUI_DROPACCEPTED is set to a visible control..."

Edited by Siao

"be smart, drink your wine"

Posted (edited)

  Siao said:

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 by maqleod
[u]You can download my projects at:[/u] Pulsar Software

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
  • Recently Browsing   0 members

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