Platforms to show: All Mac Windows Linux Cross-Platform

Back to WinDataObjectMBS class.

WinDataObjectMBS.AddDragImage(pic as picture, width as Integer, height as Integer, x as Integer, y as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.0 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Adds a drag image to the data object.

pic: the picture to use.
width and height: The size of the picture.
x and y: The location of the cursor within the drag image. The point should contain the offset from the upper-left corner of the drag image to the location of the cursor.

Requires Windows 2000 Professional with SP3, Windows XP.
On success the HelperHandle property is not zero.

Turn off antialiasing when drawing text. Otherwise, artifacts could occur at the edges, between the text color and the color key.

This function takes the picture (and it's mask) and turns it in a nice drag picture. This includes applying the mask and passing black for the background color. Dark colors which should be transparent will be made lighter.

See also:

Some examples using this method:

WinDataObjectMBS.AddDragImage(pic as picture, width as Integer, height as Integer, x as Integer, y as Integer, ImageBackgroundColor as color)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Adds a drag image to the data object.

pic: the picture to use.
width and height: The size of the picture.
x and y: The location of the cursor within the drag image. The point should contain the offset from the upper-left corner of the drag image to the location of the cursor.
ImageBackgroundColor: The color used by the control to fill the background of the drag image.

Requires Windows 2000 Professional with SP3, Windows XP.
On success the HelperHandle property is not zero.

Turn off antialiasing when drawing text. Otherwise, artifacts could occur at the edges, between the text color and the color key.

See also:

WinDataObjectMBS.AddFiles(files() as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Adds file references in the format the explorer can understand them.

See also:

WinDataObjectMBS.AddFiles(pathes() as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Adds file pathes in the format the explorer can understand them.

Folder pathes should have no backslash on the end.

See also:

WinDataObjectMBS.AddPicture(pic as picture)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Adds a picture to the data object.

WinDataObjectMBS.AddRaw(format as Integer, data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Adds raw data to the data object.

Depending of the format you may need to add chr(0) on the end.

WinDataObjectMBS.AddText(text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Adds the text to the data object.

WinDataObjectMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates an empty data object.

See also:

WinDataObjectMBS.Constructor(files() as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a data object and adds the files.

See also:

WinDataObjectMBS.Constructor(pic as picture)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Creates a new data object and adds the given picture.
Example
// take some picture
dim p as Picture = LogoMBS(500)

// create data object
dim w as new WinDataObjectMBS(p)

See also:

WinDataObjectMBS.Constructor(text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a new data object and adds the given text.
Example
// create data object with text
dim w as new WinDataObjectMBS("Hello World")

See also:

WinDataObjectMBS.Formats as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 16.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries list of formats in the data object.

Helps for debugging to see what is inside.

WinDataObjectMBS.GetFileContents(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries file content for the file with the given index.

Use index from WindowsFileDescriptorMBS.index property.

This works for files up to a few hundred megabytes in size. For larger files we will have to change plugin if you want to receive those.

Only accepts data provided as blob.

See also:

Some examples using this method:

WinDataObjectMBS.GetFileContents(index as integer, byref IsPath as boolean) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries file content for the file with the given index.

Use index from WindowsFileDescriptorMBS.index property.

This works for files up to a few hundred megabytes in size. For larger files we will have to change plugin if you want to receive those.

IsPath is set to true, when the returned data is a file path instead of data itself.

See also:

WinDataObjectMBS.GetFileDescriptors as WindowsFileDescriptorMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries file descriptors.
Example
dim dataObject as WinDataObjectMBS // your data object

dim des(-1) as WindowsFileDescriptorMBS = dataObject.GetFileDescriptors

for each d as WindowsFileDescriptorMBS in des
// we got file descriptions. Some metadata and the data. No path.
dim data as string = dataObject.GetFileContents(0)
msgbox "File """+d.FileName+""" with "+str(lenb(data))+" bytes data."
next

Result array is empty on any error.

Some examples using this method:

WinDataObjectMBS.GetFileName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 16.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries filename from data object.

Depending on how the other application works, the drag data object may have either file descriptors, a file path or path strings.

The file name is valid at least as long as this object is alive.

Some examples using this method:

WinDataObjectMBS.GetPaths as folderitem()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries the paths in the data object.
Example
dim dataObject as WinDataObjectMBS // your data object

dim files(-1) as FolderItem = dataObject.GetPaths

for each f as FolderItem in files
// we got a file you can use like any other file (e.g. copy)
listbox1.AddRow "Path """+f.NativePath+""""
next

Checks for a CF_HDROP type. May return one or more folderitems.

Some examples using this method:

WinDataObjectMBS.GetPathStrings as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries the paths in the data object.

Checks for a CF_HDROP type. May return one or more folderitems.

WinDataObjectMBS.GetPicture as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Queries the picture from the data object.

Supports CF_BITMAP/TYMED_GDI.

WinDataObjectMBS.GetRaw(format as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries the raw data for the given type.

WinDataObjectMBS.GetText as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Queries the text from the data object.

Returns unicode or ANSI text depending on what is available. Unicode is preferred.

WinDataObjectMBS.HasFileDescriptors as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 11.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks whether this data object contains file descriptors.

Returns true if a path is found.
Checks for CF_FILEGROUPDESCRIPTOR.

Windows uses File Descriptors and FileContents for drag and drop operations where the data is not stored in a file. You get the descriptors and if you need you can get the data which is delivered just in time.

Some examples using this method:

WinDataObjectMBS.HasFileName as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 16.0 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks to see if a filename entry is in the data object.

WinDataObjectMBS.HasPaths as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks whether this data object contains file paths.

Returns true if a path is found.
Checks for CF_HDROP.

Some examples using this method:

WinDataObjectMBS.HasPicture as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks if a picture is part of this data object.

Returns true if a picture is found.
Checks for CF_BITMAP.

Some examples using this method:

WinDataObjectMBS.HasRaw(format as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks whether this data object contains data in the given format.

WinDataObjectMBS.HasText as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Drag & Drop MBS Win Plugin 10.5 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Checks whether this data object contains Text or UnicodeText.

Returns true if text is found.
Checks for CF_UNICODETEXT and CF_TEXT.

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


The biggest plugin in space...