Suppir Posted November 30, 2010 Share Posted November 30, 2010 Hello! User drags & drops some files (or directories) to traymenu of the autoit script. How to get full pathnames of dropped objects? Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 30, 2010 Share Posted November 30, 2010 That's not a trivial problem. The tray icon is just a button in a ToolbarWindow32 control. The control belongs to the desktop, not your AutoIt process, so I don't know that you can register the WM_DROPFILES message you would have to catch. If you look at TraySetOnEvent() in the help file you don't see a $TRAY_EVENT_DROPFILES as one of the supported special IDs. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Suppir Posted December 1, 2010 Author Share Posted December 1, 2010 (edited) Yes, I understand. But I think there is a way exists. Something like: If IsPressed("01") And MouseOverTray() Then GetObjectsPathFromDropFiles() # maybe there is a special dllcall exists to get this data?? Endif Edited December 1, 2010 by Suppir Link to comment Share on other sites More sharing options...
James Posted December 1, 2010 Share Posted December 1, 2010 The tray icon is just a button in a ToolbarWindow32 control. The control belongs to the desktop, not your AutoIt process, so I don't know that you can register the WM_DROPFILES message you would have to catch. If you look at TraySetOnEvent() in the help file you don't see a $TRAY_EVENT_DROPFILES as one of the supported special IDs.If that's the case, how you track right click menus? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 1, 2010 Share Posted December 1, 2010 If that's the case, how you track right click menus? I think the desktop process that owns the control passes notifications to the window associated with the button. The point being that only messages the desktop process is designed to pass will get passed, and DROPFILES (plus the struct that would tell you what was dropped) does not appear to be one of them.I am certainly not an API expert though, and smarter people can/will correct me if I'm wrong. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
James Posted December 1, 2010 Share Posted December 1, 2010 I think the desktop process that owns the control passes notifications to the window associated with the button. The point being that only messages the desktop process is designed to pass will get passed, and DROPFILES (plus the struct that would tell you what was dropped) does not appear to be one of them.I'm not disagreeing with you, there is no default behaviour for tray dropping.I have yet to see an application support it or even say it's possible. Whatever the OP is after is going to cause confusion and be rarely used if distributed to others, bar himself. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Steveiwonder Posted December 1, 2010 Share Posted December 1, 2010 (edited) Hello, I've played around with this before and this is as far as i got. Pops messagebox when the mouse is released on the icon or something is "dropped" onto the icon. Although when you drag files over the icon you get the no entry simple or denied which ever way you look at it. #include <Constants.au3> #NoTrayIcon Opt("TrayMenuMode",1) Opt("TrayOnEventMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "MyFunc") ; register custom func TraySetState() While 1 Sleep(10) ; useless loop WEnd Func MyFunc() MsgBox(32, "Title", "Replace messagebox with some awesome way to get what was in mouse?") EndFunc I'm sure you can register some external DLL to find what files have been selected by the mouse? Steve EDIT: I dont know if this could be of any help, i havent looked just something i found in a text file with the above script http://msdn.microsoft.com/en-us/library/ms742859.aspx#Drag_and_Drop_Events Edited December 1, 2010 by Steveiwonder They call me MrRegExpMan Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 1, 2010 Share Posted December 1, 2010 There are work-arounds to see when the mouse is released on the icon, but nothing I've found goes on to get the file path(s) being dropped. The page you linked to is for .NET DragDrop.Drop Attached Event, which is not much help to AutoIt, and the SysTray toolbar is not a .NET created object anyway. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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