AutoHotkey Community

It is currently May 27th, 2012, 6:09 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: August 11th, 2007, 5:00 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Last edited by Sean on August 21st, 2007, 5:13 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2007, 7:17 am 
Thanks for sharing! :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2007, 10:20 am 
Offline

Joined: July 2nd, 2006, 7:59 pm
Posts: 87
Very useful :D Thanks for sharing your work.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2007, 12:35 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Thanks guys!
I updated the script a little to detect unicode strings as possible as it can using Window's provided API.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 11th, 2007, 4:41 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Fantastic! Thanks for figuring it out. Your script got into my list of favorite tools.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 1st, 2008, 6:04 pm 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
:) A wish come true! Almost...

:( It crashes AutoHotkey when copying something from Internet Explorer, or it takes a break before continuing. Any ideas?

Skrommel

_________________
www.1HourSoftware.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject: but more great 1023 ¿
PostPosted: March 19th, 2010, 11:50 am 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
Dear Sean,Very Great Now i can drop a link on my gui...

skrommel wrote:
:( It crashes AutoHotkey when copying something from Internet Explorer, or it takes a break before continuing. Any ideas?

Skrommel

At this time, soggos have no problem with ie8, to recover a link.
But, for all text...

Sean wrote:
... 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....

how to retrieve sData (no limit but all)?
cause i have remplaced 1023 with nSize:
Code:
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?

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 1:36 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.
Code:
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 19th, 2010, 2:15 pm 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
Very good for me, thank's again Sean

_________________
with ahk, all is different!...<img>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2010, 1:56 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2010, 7:12 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
bump

Thanks for this!

I'm wondering if this could be considered a replacement for ClipSpy??

Anyway, great work :D

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 29th, 2010, 12:00 pm 
Offline

Joined: May 16th, 2010, 2:38 pm
Posts: 185
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?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Exabot [Bot], Google Feedfetcher, JamixZol, Yahoo [Bot] and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group