Friday, July 28, 2006

ClipBoard

Five clipboard functions are provided. Two of them duplicate the action performed by the keyboard sequence PrtScr and Alt-PrtScr. Three of them deal with text data.

ActiveScreenToClipboard

Takes a snapshot of the current screen. Equivalent to tapping the PrtScr key.

You can use this in reporting errors or the status of a running program.

Once you have trapped the run-time error, issue a call to ActiveScreenToClipboard and at least have the user paste the results into Paintbrush. Better yet, use a routine to capture the clipboard image as a bitmap or other graphic file.

Sub TESTActiveScreenToClipboard()
Call ActiveScreenToClipboard
End Sub


ActiveWindowToClipboard

Takes a snapshot of the current window. Equivalent to tapping the Alt-PrtScr key combination.

You can use this in reporting errors or the status of a running program.

Once you have trapped the run-time error, issue a call to ActiveWindowToClipboard and at least have the user paste the results into Paintbrush. Better yet, use a routine to capture the clipboard image as a bitmap or other graphic file.

I have had little success with this function, the equivalent of Alt-PrtScr, under Windows XP

Sub TESTActiveWindowToClipboard()
Call ActiveWindowToClipboard
End Sub


ClearClipboard

Returns any text stored in the clipboard before emptying the clipboard.

Sub TESTstrClearClipboard()
MsgBox strClearClipboard
End Sub


StrAppendToClipboard

Returns any text stored in the clipboard before appending the supplied string to the clipboard.

Sub TESTstrAppendToClipboard()
MsgBox strAppendToClipboard("v")
MsgBox strAppendToClipboard("w")
MsgBox strAppendToClipboard("x")
MsgBox strClearClipboard
MsgBox strAppendToClipboard("y")
MsgBox strAppendToClipboard("z")
End Sub



strLoadToClipboard


Returns any text stored in the clipboard before loading the supplied string to the clipboard.

Sub TESTstrLoadToClipboard()
MsgBox strLoadToClipboard("b")
MsgBox strLoadToClipboard("c")
MsgBox strLoadToClipboard("d")
End Sub

0 Comments:

Post a Comment

<< Home