Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsPreviewHandlerMBS class.

WindowsPreviewHandlerMBS.Constructor(ClassID as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Initializes the object with loading the class with the given classid.

You find those ClassIDs in the registry (See example project).

See HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers in the registry.

WindowsPreviewHandlerMBS.DoPreview

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Directs the preview handler to load data from the source specified in an earlier Initialize method call, and to begin rendering to the previewer window.

Lasterror is set.

If the previewer window has not yet been created, then it must be created after this method has been called. The preview handler is responsible for painting the area specified in SetWindow or SetRect. If these methods are called while the preview handler is rendering, the window must be reparented/resized without stopping or restarting the rendering of the item.
This method should be called only after SetWindow has been called.
Aditionally, this method should be called only after Constructor has been called.

Some examples using this method:

WindowsPreviewHandlerMBS.InitWithData(data as MemoryBlock)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Loads the given data.

Lasterror is set.
If loading from data is not supported for preview, we use a temporary file instead.

You need to call Preview next on success to show a preview.

See also:

WindowsPreviewHandlerMBS.InitWithData(data as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Loads the given data.

Lasterror is set.
If loading from data is not supported for preview, we use a temporary file instead.

You need to call Preview next on success to show a preview.

See also:

WindowsPreviewHandlerMBS.InitWithFile(file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Loads the given file.

Lasterror is set.
If the preview handler does not support reading file, the plugin reads the file and passes as data.

You need to call Preview next on success to show a preview.

If the file path is invalid, the preview will show a file not found error message.

WindowsPreviewHandlerMBS.SetBackgroundColor(red as Integer, green as Integer, blue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the background color of the preview handler.

Lasterror is set.
Not all preview handlers implement this method.

WindowsPreviewHandlerMBS.SetFocus

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Directs the preview handler to set focus to itself.

Lasterror is set.

WindowsPreviewHandlerMBS.SetFont(size as Integer, font as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the font attributes to be used for text within the preview handler.

Lasterror is set.
Not all preview handlers implement this method.

WindowsPreviewHandlerMBS.SetRect(left as Integer, top as Integer, width as Integer, height as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Directs the preview handler to change the area within the parent hwnd that it draws into.

Lasterror is set.

If called before the preview handler window has been created, the new rectangle replaces the rectangle previously received in the SetWindow call.
If called after the preview handler window has been created, the preview handler window must be resized.
If the preview handler is already rendering, then the preview must be resized without interrupting the render process.

Some examples using this method:

WindowsPreviewHandlerMBS.SetTextColor(red as Integer, green as Integer, blue as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the color of the text within the preview handler.

Lasterror is set.
Not all preview handlers implement this method.

WindowsPreviewHandlerMBS.SetWindow(win as DesktopWindow, left as integer, top as integer, width as integer, height as integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 22.0 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window.

Pass the window and the area for the previewer.
Lasterror is set.

The preview handler is responsible for painting the entire area. If the previewer window has been created, the preview handler must associate the previewer window to the new parent hwnd and resize the previewer window to the area defined by the rectangle. If the previewer window has not yet been created, the preview handler must remember this information for when the previewer window is created in DoPreview.
It is preferred that this information be stored prior to calling DoPreview. Doing so increases performance at setup time for any cases where the preview does not start.

Coordinates in pixels.

See also:

WindowsPreviewHandlerMBS.SetWindow(win as window, left as Integer, top as Integer, width as Integer, height as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window.

Pass the window and the area for the previewer.
Lasterror is set.

The preview handler is responsible for painting the entire area. If the previewer window has been created, the preview handler must associate the previewer window to the new parent hwnd and resize the previewer window to the area defined by the rectangle. If the previewer window has not yet been created, the preview handler must remember this information for when the previewer window is created in DoPreview.
It is preferred that this information be stored prior to calling DoPreview. Doing so increases performance at setup time for any cases where the preview does not start.

Coordinates in pixels.

See also:

WindowsPreviewHandlerMBS.Unload

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 12.3 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Directs the preview handler to cease rendering a preview and to release all resources that have been allocated based on the item passed in during the initialization.

Lasterror is set.
When called, the preview window will be destroyed.

This method should be called only after Constructor has been called. All resources associated with this initialization will be released. Prior to calling DoPreview, this preview handler will be re-initialized with a call to one of the initialization interfaces and a call to SetWindow.

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


The biggest plugin in space...