set Shell = WScript.CreateObject("WScript.Shell")
shell.run "notepad"
wscript.sleep(5000)
shell.sendkeys("test")
'>>> procedure to minimize, restore/maximize, close window
=======================================
set shell = createobject("wscript.shell")
shell.run "about:blank"
wscript.sleep 2000
success = shell.appactivate("about:blank")
if success then shell.sendkeys "% n" '...minimize
wscript.sleep 2000
success = shell.appactivate("about:blank")
if success then shell.sendkeys "% x" '...maximize
wscript.sleep 2000
success = shell.appactivate("about:blank")
if success then shell.sendkeys "% r" '...restore
wscript.sleep 2000
success = shell.appactivate("about:blank")
if success then shell.sendkeys "%{F4}" '...maximize
--
Michael Harris
Microsoft.MVP.Scripting
--
mik...@mvps.org
Please do not email questions - post them to the newsgroup instead.
--
<Robert L. Stokes> wrote in message news:3ae62eec.6989032@news...
to maximize -
s.sendkeys "(% )X"
to minimize -
s.sendkeys "(% )N"
try pressing ALT-SPACE in any window for your other options
f