~~Title: Introduction~~ The Directory Opus Viewer Plugin SDK allows you to extend the file viewing capabilities of Directory Opus by writing //viewer plugins//. A viewer plugin is a DLL that exports several defined functions that Directory Opus will call in order to identify and view unknown file types. Viewer plugins are called when Directory Opus does not natively recognize a file format. Each installed plugin is called in turn until one returns a result code indicating that it recognizes and can view the given file. Directory Opus then calls the other exported DLL functions in that plugin to view the file. Plugins can support file viewing in two ways. The **bitmap method** uses an exported function that returns a standard Windows bitmap (HBITMAP). Implementing this system of file viewing is the simplest as Directory Opus will then handle all the actual file viewing functionality itself - all the plugin has to do is interpret the file and turn it into a bitmap. Implementation of this method is necessary if you wish your plugin to support the Thumbnails mode in Opus Listers, as well as images used for Lister and Toolbar background pictures, toolbar buttons, etc. The **window method** uses an exported function that creates a child window. In this instance, Directory Opus calls the plugin with the file information, and the plugin must create its own window (using its own private window class) and return the window handle. All viewing and manipulation functionality must be performed by the plugin. This method offers you the maximum control over image viewing, but does require additional work to handle the various messages that Directory Opus may send to your plugin's window. Plugins that only implement the window method can not support Thumbnails mode, background pictures, etc. Accompanying [[https://cdn.gpsoft.com.au/files/Misc/opus_sdk.zip|the header files]] is a partially-complete TGA (TARGA) viewer plugin that implements the bitmap method of image viewing. It currently only supports 24-bit TGA files - full implementation of the TGA standard is left as an exercise for the reader. More: * [[.viewer_plugins:exported_functions|Exported Functions]] * [[.viewer_plugins:plugin_initialization|Plugin Initialization]] * [[.viewer_plugins:supporting_usb_export|Supporting USB Export]] * [[.viewer_plugins:plugin_identification|Plugin Identification]] * [[.viewer_plugins:file_identification|File Identification]] * [[.viewer_plugins:loading_bitmap_images_the_bitmap_method|Loading Bitmap Images (the "bitmap method")]] * [[.viewer_plugins:returning_text_data|Returning Text Data]] * [[.viewer_plugins:custom_image_viewers_the_window_method|Custom Image Viewers (the "window method")]] * [[.viewer_plugins:image_viewer_messages|Image Viewer messages]] * [[.viewer_plugins:non_image_file_information|Non-Image File Information]] * [[.viewer_plugins:properties_configuration_and_about_functions|Properties, Configuration and About functions]]