boji Posted January 28, 2009 Posted January 28, 2009 (edited) Any one see a problem arising from using this? Perhaps a better way? CODEFunc clearclip() Clipput("") ;clear clipboard If not ClipGet() = "" Then Do Sleep(10) Clipput("") Until Clipget() = "" EndIf EndFunc Edited January 28, 2009 by boji
PsaltyDS Posted January 28, 2009 Posted January 28, 2009 Any one see a problem arising from using this? Perhaps a better way? Func clearclip() Clipput("");clear clipboard If not ClipGet() = "" Then Do Sleep(10) Clipput("") Until Clipget() = "" EndIf EndFunc Perhaps like this? #include <ClipBoard.au3> _ClipBoard_Open(0) _ClipBoard_Empty() _ClipBoard_Close() Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
MyName Posted January 28, 2009 Posted January 28, 2009 Try Func _ClipEmpty() Local $Success = 0 DllCall('user32.dll', 'int', 'OpenClipboard', 'hwnd', 0) IF @error = 0 THEN DllCall('user32.dll', 'int', 'EmptyClipboard') IF @error = 0 THEN $Success = 1 DllCall('user32.dll', 'int', 'CloseClipboard') IF $Success THEN Return 1 ENDIF DllCall('user32.dll', 'int', 'CloseClipboard') Return 0 EndFunc -= [font="Verdana"]A Men Who believes in himself and not circumstances is the real Winner =-[/font]
boji Posted January 28, 2009 Author Posted January 28, 2009 (edited) Thanks guys. May I ask a question about these two excellent responses then: So Psalty's way is to use autoit's clipboard as opposed to windows, right? bypass the whole thing by not calling the api? And MyName's response works with the underlying .dll behind windows clipboard? Man I have so much to learn... Edited January 28, 2009 by boji
PsaltyDS Posted January 28, 2009 Posted January 28, 2009 (edited) Thanks guys.May I ask a question about these two excellent responses then:So Psalty's way is to use autoit's clipboard as opposed to windows, right? bypass the whole thing by not calling the api?And MyName's response works with the underlying .dll behind windows clipboard?Man I have so much to learn...Put my code in SciTE, put the cursor on one of the functions, and hit CTRL-j.If you open the ClipBoard.au3 file and look at those UDFs, you'll find they use exactly the DLL calls that MyName used. The point of the UDF is to be able to do that easily in AutoIT syntax. AutoIt still has to use the same Windows APIs every other program does, it can just be hidden behind a simplified wrapper. Edited January 28, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
boji Posted January 28, 2009 Author Posted January 28, 2009 (edited) Excellent! Thank you so much for pointing me in the right direction! Did you just give me the red pill Morpheus? Edited January 28, 2009 by boji
PsaltyDS Posted January 28, 2009 Posted January 28, 2009 Did you just give me the red pill Morpheus?I'm not sure. "Is this real...?" Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
MyName Posted January 28, 2009 Posted January 28, 2009 Thank Psalty -= [font="Verdana"]A Men Who believes in himself and not circumstances is the real Winner =-[/font]
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