Activating and Maximizingan Application 
Author Message
 Activating and Maximizingan Application

The WshShell object contains an "AppActivate" method to activate a
window,  but it does not provide the ability to maximize the window.
According to the method's documentation, if sizing is requested, then
"use the Shell function".  What "Shell function" is being referred to
here?  I just want to be able to activate the window and maximize it.
How can I do this?

-Greg



Mon, 01 Sep 2003 02:21:43 GMT  
 Activating and Maximizingan Application

Quote:

>    Part 1.1    Type: Plain Text (text/plain)
>            Encoding: 7bit

By activate, do you mean start it running or put the focus on an already
running application?  If it is the form, see the WSH Shell's Run method,
in particular the inWindowsType parameter.

Documentation  (compiled html download)

  http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe

If it is the later, use AppActivate to get the focus and then use
SendKeys to something like this ...

  WSHShell.Sendkeys "% x" ' sends Alt-Space and X to application

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Mon, 01 Sep 2003 06:06:46 GMT  
 Activating and Maximizingan Application
Tom:

Thanks for the reply.  By "Activating", I mean start the application running, AND display its window to the user.  I can do this with the WshShell.run command, but unfortunately there's a problem in that when the run command is issued, it not only displays the application's window, but it also brings up a console window as well, which is what I don't want - I just want the application's window displayed.  I've gone through all the options in the WshShell run command, but all of them dispay the application window with the console window.  

However, I found that there is a run command option that will leave both the application and the console minimized in the lower tool bar.  If I then use the AppActivate call and specify the name of my application, the minimized application icon in the toolbar will light up (indicating its been activated), but the window is not opened/displayed.  I will try your suggestion of sending it a key to see if this will bring up its window.  Meanwhile, if you have any other ideas, let me know.

Thanks again,
Greg Matoka

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 02 Sep 2003 01:17:25 GMT  
 Activating and Maximizingan Application

Quote:

> Tom:

> Thanks for the reply.  By "Activating", I mean start the application running, AND display its window to the user.  I can do this with the WshShell.run command, but unfortunately there's a problem in that when the run command is issued, it not only displays the application's window, but it also brings up a console window as well, which is what I don't want - I just want the application's window displayed.  I've gone through all the options in the WshShell run command, but all of them dispay the application window with the console window.

> However, I found that there is a run command option that will leave both the application and the console minimized in the lower tool bar.  If I then use the AppActivate call and specify the name of my application, the minimized application icon in the toolbar will light up (indicating its been activated), but the window is not opened/displayed.  I will try your suggestion of sending it a key to see if this will bring up its window.  Meanwhile, if you have any other ideas, let me know.

> Thanks again,
> Greg Matoka

How exactly are you calling this application and what kind of an app is
it?  I say that because I have never witnessed such behavior in running
applications with Run.  If it is a console app, it should open one
MS-DOS session window and run in that window.  If it is a Win32 app, it
should just open its own window - there should be no console as well.
This is weird.

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Tue, 02 Sep 2003 03:16:41 GMT  
 Activating and Maximizingan Application


Tom:

The application I start is the JAVA appletviewer, which in turns starts an
applet.  The call looks something like this:
"WshShell.run(c:\jdk1.3\bin\appletviewer testView.html)".

==> obviously not *exactly* like that, at least not without the command to
run being enclosed in quotes. It is not clear (to me, anyway) what the
actual command is. Is it:

    WshShell.run("c:\jdk1.3\bin\appletviewer testView.html")

or:

    WshShell.run("""c:\jdk1.3\bin\appletviewer""  testView.html")

/Al

I've also tried supplying parameters to this method that controls whether
the application is activated, minimized, maximized, etc., but the console
window always appears.  I've used the WshShell.run method several other
times to start up applications that are kicked off by calls to the java
interpreter, and there's been no problem.  Usually, these calls are in the
form of "WshShell.run(c:\jdk1.3\bin\java javafile.class ...)".  If you have
any ideas, let me know.

Thanks,
Greg Matoka

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 19 Sep 2003 04:44:43 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Bring focus to Excel application activated from ASP

2. activating different application

3. How to activating my application on server

4. No default printer in script activated application

5. Problem Activating Word application from VBScript. Any ideas?

6. Problem Activating Word application from VBScript. Any ideas?

7. detect if java plugin is installed AND activated for IE

8. How to activate or move window on top ?

9. writing on non-html data to window/activating the a pluggin

10. Activating an OBJECT without <object>

11. Activating Word from IE

12. activating listbox pulldown in code

 

 
Powered by phpBB® Forum Software