Jump to content

Recommended Posts

Posted (edited)

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])

;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard/clipboardreference/clipboardfunctions/getclipboarddata.asp
$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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...