Jump to content
Sign in to follow this  
maqleod

Can $GUI_DROPACCEPTED work with a button on a gui with $WS_EX_ACCEPTFILES?

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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...