mr_unreliable
Sat Apr 09 17:08:04 CDT 2005
hi Always,
What you want to do is easy, _IF_ you are willing to use system api's
from script. The "bad news" is that Microsoft doesn't want you calling
api's from script, and most "professional" scripters will also
discourage the practice.
However, assuming that you are willing to give it a try, there are
two approaches.
1. The most simple and direct way is to use "FindWindow" to get the
handle of the app's window, and then either hide it with "ShowWindow"
using the "SW_HIDE" command constant. _or_ (maybe better) use
"MoveWindow" and just move the window offscreen. (You can move the
window offscreen by setting the left and top coordinates to large
negative numbers (like: -10000, -10000). Note that when the window
is offscreen, it is not technically "hidden" -- you just can't see it.
2. A more subtle approach would be just to "Block" the user's input.
The "BlockInput" api will block all user keyboard and mouse input.
http://www.mentalis.org/apilist/1B463387B31CF691556B7458C7FE1D68.html
I acknowledge that you asked about hiding the window, but you later
implied that the only reason for hiding the window was to foil the
user's attempts to close it before it had finished whatever
(installing?) it was doing. If you block the user's input, he/she
can type and click to their heart's content, but it will have no
effect. Also note: if you do use blockinput, then kindly remember to
unblock when you are finished...
cheers, jw
p.s. As there is no native ability in script to call api's, you will
have to use an actX object to do it. You can write your own, or you
can use a pre-programmed utility. One such utility is called "DynaWrap"
(a.k.a DynaCall), which may be found at Guenter Born's website:
http://people.freenet.de/gborn/WSHBazaar/WSHBazaar.htm
Look for "actX controls", then "The DynaCall Page"