Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsClipboardMBS class.

WindowsClipboardMBS.ClipboardSequenceNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 10.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the clipboard sequence number for the current window station.

The return value is the clipboard sequence number. If you do not have WINSTA_ACCESSCLIPBOARD access to the window station, the function returns zero.

The system keeps a serial number for the clipboard for each window station. This number is incremented whenever the contents of the clipboard change or the clipboard is emptied. You can track this value to determine whether the clipboard contents have changed and optimize creating DataObjects. If clipboard rendering is delayed, the sequence number is not incremented until the changes are rendered.

WindowsClipboardMBS.GetClipboardFormatName(format as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 10.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves from the clipboard the name of the specified registered format. The function copies the name to the specified buffer.
Example
// show items on clipboard

dim w as new WindowsClipboardMBS
dim types(-1) as integer = w.ClipboardFormats
dim names() as string

for each type as integer in types
dim n as string = w.GetClipboardFormatName(type)

n = str(type)+" "+n

names.append n
next

MsgBox Join(names,EndOfLine)

Some examples using this method:

WindowsClipboardMBS.IsClipboardFormatAvailable(type as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 10.4 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Determines whether the clipboard contains data in the specified format.

type: A standard or registered clipboard format.

If the clipboard format is available, the return value is true.
If the clipboard format is not available, the return value is false.

Typically, an application that recognizes only one clipboard format would call this function when processing the EnableMenuItems event. The application would then enable or disable the Paste menu item, depending on the return value.

WindowsClipboardMBS.RegisterClipboardFormat(type as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows MBS Win Plugin 13.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Registers a new clipboard format. This format can then be used as a valid clipboard format.
Example
dim TypeHTML as Integer
dim TypeRTF as Integer

TypeHTML = WindowsClipboardMBS.RegisterClipboardFormat("HTML Format")
TypeRTF = WindowsClipboardMBS.RegisterClipboardFormat("Rich Text Format")

If the function succeeds, the return value identifies the registered clipboard format.
If the function fails, the return value is zero.

If a registered format with the specified name already exists, a new format is not registered and the return value identifies the existing format. This enables more than one application to copy and paste data using the same registered clipboard format. Note that the format name comparison is case-insensitive.
Registered clipboard formats are identified by values in the range &hC000 through &hFFFF.

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...