# Window Minize Button Script

**URL:** <https://forum.inductiveautomation.com/t/window-minize-button-script/9672>\
**Category:** Ignition\
**Created:** [February 6, 2015, 3:51pm UTC](https://forum.inductiveautomation.com/t/window-minize-button-script/9672 "2015-02-06T15:51:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [February 6, 2015, 3:51pm UTC](https://forum.inductiveautomation.com/t/window-minize-button-script/9672/1 "2015-02-06T15:51:45Z")

</div>

is there a way in scripting to duplicate the function of the Windows Minimize button?

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3d4773c18ac5b952ae1cd434db9b94e905df0629.jpg)

I would like to create a button on the main screen that minimizes the running client. On touch screens, operators with fat fingers end up using sharp objects that eventually punches a hole in the touchscreen.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 6, 2015, 4:10pm UTC](https://forum.inductiveautomation.com/t/window-minize-button-script/9672/2 "2015-02-06T16:10:33Z")

</div>

Try this one:

`win = system.gui.getParentWindow(event)
parent = win
while parent is not None:
   win = parent
   parent = win.getParent()
print dir(win)
win.setState(win.ICONIFIED)`

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [February 6, 2015, 4:27pm UTC](https://forum.inductiveautomation.com/t/window-minize-button-script/9672/3 "2015-02-06T16:27:00Z")

</div>

[quote=“JordanCClark”]Try this one:

`win = system.gui.getParentWindow(event)
parent = win
while parent is not None:
   win = parent
   parent = win.getParent()
print dir(win)
win.setState(win.ICONIFIED)`[/quote]

Outstanding!

Thanks
