Window.SetDockImage
-------------------

Sets the dock image for a window.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Window](component_Window.md) | [7.5](newinversion75.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "Window.SetDockImage"; WindowRef { ; Image } ) 

**MBS**( **"Window.SetDockImage";** /\* Sets the dock image for a window. \*/  
**$WindowRef**; /\* Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window.e.g. 0 \*/   
**$Image**) /\* Optional; The image to use.  
Can be container in various formats, e.g. PNG.  
If empty, clears existing picture.e.g. $MyImage \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window. | 0 |  |
| Image | The image to use.   Can be container in various formats, e.g. PNG.   If empty, clears existing picture. | $MyImage | Optional |

### Result

Returns OK or error.

### Description

Sets the dock image for a window.  
The miniaturized window image is the image displayed in the Dock when the window is minimized. If you did not assign a custom image to the window, the value of this property is empty.  
When the user minimizes the window, the Dock displays this image in the corresponding Dock tile, scaling it as needed to fit in the tile. If you do not specify a custom image using this property, the Dock creates one for you automatically.  
You can also set this property as needed to change the minimized window image. Typically, you would specify a custom image immediately prior to a window being minimized. You can set this image while the window is minimized to update the current image in the Dock. However, you should not use this property to create complex animations in the Dock.  
Support for custom images is disabled by default. To enable support the plugin automatically sets the AppleDockIconEnabled key to true when updating the image. Due to this enable process, the function may only work the second time you call it after restarting FileMaker.  
### Examples

Set image for current window:

 Set Variable \[ $r ; Value: MBS ( "Window.SetDockImage"; 0; Assets::Image ) \]  
### See also

- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)

### Release notes

- **Version 7.5**
    - Added [Window.SetDockImage](http://www.mbsplugins.eu/WindowSetDockImage.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 7.5pr7](https://www.mbsplugins.de/archive/2017-11-13/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 10th November 2017 , last changed 10th November 2017

  
[Window.SetCurrentTag](WindowSetCurrentTag.md) - [Window.SetFocus](WindowSetFocus.md)

[HTML Version](WindowSetDockImage.shtml)