How to minimize window?
I am making HTA application and I want replace window title bar with my custom one. I've disabled it by HTA's "caption=no" option and placed my own minimize/maximize/close buttons.
I found two ways to minimize window:
So I could send this shortcuts to window using WScript.Shell's SendKeys method.
WsShell = new ActiveXObject("WScript.Shell")
WsShell.SendKeys("% n")
But the first one can't be used because there is no title bar, and the second because WinKey doesn't work with SendKeys.
I found MinimizeAll() method of Shell.Application, but it's alone.
Is there any other way to minimize the window? May be another activeX object or shortcut?
I came up with exact the same issue. This is the solution that worked for me:
Place in the <head> section:
<object id="HHCtrlMinimizeWindowObject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="command" value="minimize" />
</object>
<script type="text/javascript">
function _jsMinWin( ) {
try {
HHCtrlMinimizeWindowObject.Click( );
}
catch ( err ) {
alert( err.message );
}
}
</script>
Then on <body> section something like:
<input type="button" value="Minimize Window" name="MinimizeWindow" id="MinimizeWindow" onclick="javascript:_jsMinWin();" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With