It'll peek the data, especially (unicode)text, of the DragDrop & Clipboard data.
BTW, the length of the text will be limited to 1023 bytes, but it can be easily circumvented using other string-related APIs, so I'll leave it to the users.
And, it may be combined with any HexViewer script as a full DragDrop/Clipboard data viewer.
To see the contents of the DragDrop, just drag and drop the source to the GUI.
And, press the hotkey #c to see the content of the current clipboard.
DOWNLOAD DragDrop.ahk. [SKAN's Dropbox]
Peeking DragDrop & Clipboard Data
Started by
Sean
, Aug 11 2007 04:00 AM
11 replies to this topic
#1
-
Posted 11 August 2007 - 04:00 AM
Thanks guys!
I updated the script a little to detect unicode strings as possible as it can using Window's provided API.
I updated the script a little to detect unicode strings as possible as it can using Window's provided API.
#4
-
Posted 11 August 2007 - 11:35 AM
Fantastic! Thanks for figuring it out. Your script got into my list of favorite tools.
#5
-
Posted 11 August 2007 - 03:41 PM
A wish come true! Almost...
It crashes AutoHotkey when copying something from Internet Explorer, or it takes a break before continuing. Any ideas?
Skrommel
It crashes AutoHotkey when copying something from Internet Explorer, or it takes a break before continuing. Any ideas?
Skrommel
#6
-
Posted 01 April 2008 - 05:04 PM
Dear Sean,Very Great Now i can drop a link on my gui...
But, for all text...
cause i have remplaced 1023 with nSize:
How to Do?
At this time, soggos have no problem with ie8, to recover a link.It crashes AutoHotkey when copying something from Internet Explorer, or it takes a break before continuing. Any ideas?
Skrommel
But, for all text...
how to retrieve sData (no limit but all)?... the length of the text will be limited to 1023 bytes, but it can be easily circumvented using other string-related APIs, so I'll leave it to the users....
cause i have remplaced 1023 with nSize:
IEnumFormatEtc(this) { LV_Delete() DllCall(NumGet(NumGet(1*this)+32),"Uint",this,"Uint",1,"UintP",penum) ; DATADIR_GET=1, DATADIR_SET=2 Loop { VarSetCapacity(FormatEtc,20,0) If DllCall(NumGet(NumGet(1*penum)+12), "Uint", penum, "Uint",1, "Uint", &FormatEtc, "Uint",0) Break 0+(nFormat:=NumGet(FormatEtc,0,"Ushort"))<18 ? RegExMatch("CF_TEXT CF_BITMAP CF_METAFILEPICT CF_SYLK CF_DIF CF_TIFF CF_OEMTEXT CF_DIB CF_PALETTE CF_PENDATA CF_RIFF CF_WAVE CF_UNICODETEXT CF_ENHMETAFILE CF_HDROP CF_LOCALE CF_DIBV5", "(?:\w+\s+){" . nFormat-1 . "}(?<FORMAT>\w+\b)", CF_) : nFormat>=0x80&&nFormat<=0x83 ? RegExMatch("CF_OWNERDISPLAY CF_DSPTEXT CF_DSPBITMAP CF_DSPMETAFILEPICT", "(?:\w+\s+){" . nFormat-0x80 . "}(?<FORMAT>\w+\b)", CF_) : nFormat=0x8E ? CF_FORMAT:="CF_DSPENHMETAFILE" : CF_FORMAT:=GetClipboardFormatName(nFormat) VarSetCapacity(StgMedium,12,0) If DllCall(NumGet(NumGet(1*this)+12), "Uint", this, "Uint", &FormatEtc, "Uint", &StgMedium) Continue If NumGet(StgMedium,0)=1 ; TYMED_HGLOBAL=1 { hData:=NumGet(StgMedium,4) pData:=DllCall("GlobalLock", "Uint", hData) nSize:=DllCall("GlobalSize", "Uint", hData) ; nSize ; VarSetCapacity(sData,1023), DllCall("wsprintf", "str", sData, "str", DllCall("advapi32\IsTextUnicode", "Uint", pData, "Uint", nSize, "Uint", 0) ? "%S" : "%s", "Uint", pData, "Cdecl") VarSetCapacity(sData,nSize), DllCall("wsprintf", "str", sData, "str", DllCall("advapi32\IsTextUnicode", "Uint", pData, "Uint", nSize, "Uint", 0) ? "%S" : "%s", "Uint", pData, "Cdecl") DllCall("GlobalUnlock", "Uint", hData) LV_Add("", A_Index, CF_FORMAT, nSize, sData) if CF_FORMAT= CF_TEXT ; for putting in clipboard { Clipboard:= sData MsgBox , 4160 , , TEXTE> %sData% ; BUT not ALL! } ; if CF_FORMAT= UniformResourceLocator ; OK ; MsgBox , 4160 , , %sData% ; if CF_FORMAT= FileNameW ; OK ; MsgBox , 4160 , , %sData% } Else RegExMatch("TYMED_NULL TYMED_FILE TYMED_ISTREAM TYMED_ISTORAGE TYMED_GDI TYMED_MFPICT TYMED_ENHMF", "(?:\w+\s+){" . Floor(ln(NumGet(StgMedium)+1)/ln(2)) . "}(?<STGMEDIUM>\w+\b)", TYMED_), LV_Add("", A_Index, CF_FORMAT, "?", TYMED_STGMEDIUM) DllCall("ole32\ReleaseStgMedium","Uint",&StgMedium) } DllCall(NumGet(NumGet(1*penum)+8), "Uint", penum) LV_ModifyCol() }But if sData is more great > 1023 he don't giveall!
How to Do?
#7
-
Posted 19 March 2010 - 10:50 AM
with ahk, all is different!...
The limit of 1023 is imposed by wsprintf API itself used in the script. I chose it due to UNICODE text and Binary data. If you only need the (ANSI) text, you may use the following instead.
However, it's prone to crash AHK when applied to Binary Data. So, my recommendation is using UNICODE build of AHK_L and only retrieve the UNICODE text.
nLen := DllCall("lstrlen", "Uint", pData) VarSetCapacity(sData, nLen) DllCall("lstrcpy", "str", sData, "Uint", pData)
However, it's prone to crash AHK when applied to Binary Data. So, my recommendation is using UNICODE build of AHK_L and only retrieve the UNICODE text.
#8
-
Posted 19 March 2010 - 12:36 PM
Very good for me, thank's again Sean
#9
-
Posted 19 March 2010 - 01:15 PM
with ahk, all is different!...
How would one detect if the user is currently dragging a file (without dropping it onto a GUI) ?
Reason is, I'm programming tabs for windows explorer, and would like to be able to toggle to tab under mouse when the user drags a file over it.
Reason is, I'm programming tabs for windows explorer, and would like to be able to toggle to tab under mouse when the user drags a file over it.
#10
-
Posted 14 May 2010 - 12:56 PM
how can i get notification thet item is dragging over the gui window from this code?
got it
the only problem - current code won't allow multi files dragging, how to fix this?
got it
the only problem - current code won't allow multi files dragging, how to fix this?
#12
-
Posted 29 October 2010 - 11:00 AM