Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset / clear out the clipboard

Status
Not open for further replies.

schothorst

Programmer
Aug 26, 2008
30
0
0
NL
Hello
Is there a way to reset the clibboard
I will copy something on it a few times but in between I need the erase the clipboard.
Is there a way

cheers
 
Have you tried
Code:
clipboard('')
?

Matt

"Nature forges everything on the anvil of time
 
Hi

Yes but that just just add a black space to the clibbord and will nog reset the whole clibboard.
can't be that hard, but I just need to find the solution :)
 
Ok, try this:
Code:
//external functions
Function boolean OpenClipboard ( &
	ulong hWndNewOwner &
	) Library "user32.dll"

Function boolean EmptyClipboard ( &
	) Library "user32.dll"

Function boolean CloseClipboard ( &
	) Library "user32.dll"

//code to clear clipboard
PowerObject lpo_parent
ULong lul_hWnd

// loop thru parents until a window is found
lpo_parent = This.GetParent()
Do While lpo_parent.TypeOf() <> Window! and IsValid (lpo_parent)
	lpo_parent = lpo_parent.GetParent()
Loop

// get handle to window
lul_hWnd = Handle(lpo_parent)	
	
If OpenClipboard(lul_hWnd) Then
	EmptyClipboard()
	CloseClipboard()
Else
	MessageBox("error","OpenClipboard Failed") 

End If

Matt

"Nature forges everything on the anvil of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top