Jump to content

Clipput clear/read buffer


boji
 Share

Recommended Posts

Any one see a problem arising from using this?

Perhaps a better way?

CODE
Func clearclip()

Clipput("") ;clear clipboard

If not ClipGet() = "" Then

Do

Sleep(10)

Clipput("")

Until Clipget() = ""

EndIf

EndFunc

Edited by boji
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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 by boji
Link to comment
Share on other sites

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 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
Link to comment
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
 Share

  • Recently Browsing   0 members

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