DarkenRahl Posted February 11, 2016 Share Posted February 11, 2016 I'm still trying Dll's in autoit.. This time the GetClipboardData function. I wrote a code an am wondering if its the ideal way to get clipboard data.. I hear that messing with pointers can cause programmes to malfunction. I know autoit has a more simplier way with the clipget() function but just trying to learn dll in autoit... ;//Open Clipboard for data reading $clipboardopen = DllCall("User32.dll", "bool", "OpenClipboard", "HWND", Null) If $clipboardopen[0] <> 0 Then ;//Get Clipboard data.. $clipbaordget returns a pointer $clipboardget = DllCall("User32.dll", "handle", "GetClipboardData", "UINT", 1) ;//We create struct with pointer of $clipboardget $struct = DllStructCreate("struct;char var1[128];endstruct", $clipboardget[0]) ;//We get the data of the pointer with structgetdata $results = DllStructGetData($struct, "var1") MsgBox(64, "Struct Pointer", $results) EndIf Link to comment Share on other sites More sharing options...
Danyfirex Posted February 11, 2016 Share Posted February 11, 2016 (edited) yes. But You need to get correct SIZE. Also check formats to corrent handle structure. But Basically check for right size. Local $iSize=DllCall("Kernel32.dll","ULONG_PTR","GlobalSize","handle",$clipboardget[0])[0] of course handle error etc. (my code above is not safe) Then check type for example if you use format for get unicode text you must use a dllstructure wchar to easy see uncode text etc... Saludos Edited February 11, 2016 by Danyfirex DarkenRahl 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
DarkenRahl Posted February 11, 2016 Author Share Posted February 11, 2016 Thank you Danifirex Link to comment Share on other sites More sharing options...
Danyfirex Posted February 11, 2016 Share Posted February 11, 2016 You're welcome. So It's Danyfirex lol Saludos DarkenRahl 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now