Code: Select all
q::
vPath = %A_Desktop%\MyFile.ext
PostMessage, 0x233, % JEE_DropCreate(vPath), 0,, A ;WM_DROPFILES := 0x233
return
;get 'JEE_DropCreate' from:
;notepad get/set path (get/set text file path) - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=30050
- Notepad/WordPad/MS Paint (e.g. Windows XP and 7)
- Media Player Classic
- Excel/Word (tested on MS Office 2007) (but it opens the file in a new window, note: you can use COM)
- Notepad2, Resource Hacker, WinDjView, WinMerge
Programs it doesn't work with:
- Adobe Reader (but then, it appears that you can't *manually* drag-and-drop a file onto Adobe Reader either)
- Internet Explorer (you can use COM, note: manual drag-and-drop to IE does work)
- Explorer (you can use COM)
- Google Chrome, LibreOffice Writer/LibreOffice Calc, Mozilla Firefox
I found one example where a manual drag-and-drop *does* work, but where the technique above *doesn't* work:
Open selected file in SPEK - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=34754
So I was wondering if people had any other ideas re. drag-and-drop, or perhaps to invoke the Open dialog, but somehow keep it hidden, and open the file that way. (Btw one hack that I did consider at one point in the past, was to overlay the Open dialog, with a screenshot of the window, while the dialog was open.)