Re: Determining whether the Word window is minimized



This script already restores and activates a minimized window. That's
not what I was asking for. What I want is one simple step: to be able
to find out if the window is minimized.

Thanks.



"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@xxxxxxxxx> wrote in message
news:ugsMfmViFHA.3672@xxxxxxxxxxxxxxxxxxxxxxx
> Larry wrote:
>
> > Gary Terhune created this handy vbs code for me a while back. It
> > activates the already open (but not activated) Word window. I run
it
> > with a Winkey combo and it works fine, though there is a slight
pause
> > (which I can probably address with more memory). .
> >
> > However, I'm wondering if I might also speed it up by checking to
see
> > ifWord is minimized, and then only run the SendKeys statement if the
> > window is minimized. That might help the code work faster. So how
> > would I determine if Word is minimized?
> >
> >
> > Option Explicit
> >
> > dim w
> >
> > With WScript.CreateObject("WScript.Shell")
> > w = .AppActivate("Microsoft Word")
> > ' restores Word if Word is minimized
> > .SendKeys ("% r")
> > End With
> >
> Hi,
>
> For a solution that works better, you could use AutoItX and it's
> WinActivate method instead, it is able to restore and activate a
> window even if it minimized.
>
> AutoIt/AutoItX
> http://www.hiddensoft.com/autoit3/index.php
>
> AutoItX.dll is an ActiveX control version of AutoIt and
> can be used from e.g. VBScript/Jscript.
>
> An example:
>
> '--------------------8<----------------------
> Set oAutoIt = CreateObject("AutoItX.Control")
> oAutoIt.SetTitleMatchMode 2
>
> oAutoIt.WinActivate "Some title here", "Maybe some text here"
> oAutoIt.Send "something" ' Send is AutoItX's SendKeys command
>
> '--------------------8<----------------------
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx


.



Relevant Pages

  • Re: How to make program window go from minimized to Maximized with vbscript
    ... > I have a vbscript that runs in the scheduled tasks to do this. ... > window is in normal or max mode I guess, ... NT4/Win2k/WinXP/Win2k3), but AutoItX does, so this should work: ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Close a window if it is already open
    ... > it is not worst to have a new window than a new layer ... environments has resulted in pop-up blocking. ... It has been the lesson of the history of browser scripting that whenever ... This takes the reality that pop-up blockers render the ...
    (comp.lang.javascript)
  • Re: Find and Open Specific Files
    ... The Monarch application does support command line ... >> Monarch) needs to be opened and then the files need to be opened in Monarch. ... > AutoItwindow handling defaults to match the start of a window title that ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windows.server.scripting)
  • Re: screen saver for auto log off after a certain period of idle time
    ... "catch" the event "the PC has been idle for X time" on a client. ... > Another option is to use use AutoIt/AutoItX and e.g. it's ... > AutoItwindow handling defaults to match the start of a window title ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Sending automated keypress at timed interval?
    ... Scripting is easier than you might think. ... script which starts the application making it the Active Window, ... "redirect standard input". ... hence the need to send a timed keypress - but it ...
    (uk.comp.misc)

Loading