Jump to content
Sign in to follow this  

Clipboard trouble

Recommended Posts


I am trying to create a udf that will read a file from the clipboard (if you copied it in windows explorer). I have gotten as far as "GetClipBoardData" but I do not know where to continue from here. For testing I am copying this script (named clip.au3) in windows explorer. Would someone experienced with dllcall please help me with this? The link to msdn is in the code.

$owner = DllCall("user32.dll", "hwnd", "GetClipboardOwner")

$open = DllCall("user32.dll", "int", "OpenClipboard", "hwnd", $owner[0])
If not $open[0] Then Exit

$format = DllCall("user32.dll", "int", "EnumClipboardFormats", "int", 0)
MsgBox(0, "format", $format[0])

$data = DllCall("user32.dll", "int", "GetClipboardData", "int", $format[0]);"DataObject = 49161"
MsgBox(0, "data", $data[0])

DllCall("user32.dll", "int", "CloseClipboard")

The name of the clipboard object I am getting is "DataObject" whose format is 49161. For $data[0] I then get 1546416.

Thanks! :P

Edited by erifash

Share this post

Link to post
Share on other sites

Nevermind, I just tested regular ClipGet() and now it returns the full path to the file that is copied. When was this implemented?

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