How to close an open window? 
Author Message
 How to close an open window?

Hi,
I know that I can activate, minimize, maximize, hide,
deactivate windows but is it also possible to close an
open window by using something like AppActivate?
I'm writing a script which starts different installation-
programs. Some of the programs leave DOS-windows and I
would like to close them automatically. Is there any way?

thanks

Petra



Fri, 02 Jul 2004 21:43:34 GMT  
 How to close an open window?
Hallo Petra!

In all windows is a program runnig. This could be an application like Word
or a console. Both of it you have to exit as you do it manually (Word ->
File, Exit / Command Prompt with "exit"). You can simulate this with Windows
Script Host by using the shell methode SendKeys. Take a look on the example
below.
There are some special characters for simulation special keys (ALT, etc.)
Take a look on MSDN CDs or
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/scri...
ml/wsobjwshshell.asp for detailed information

P.S. Gruesse nach Bayern ;-)))

        set WshShell = WScript.CreateObject("WScript.Shell")
        WshShell.Run "calc"
        WScript.Sleep 100
        WshShell.AppActivate "Calculator"
         WScript.Sleep 100
         WshShell.SendKeys "2{+}"
         WScript.Sleep 500
         WshShell.SendKeys "8"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 500
         WshShell.SendKeys "*3"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 2500


Quote:
> Hi,
> I know that I can activate, minimize, maximize, hide,
> deactivate windows but is it also possible to close an
> open window by using something like AppActivate?
> I'm writing a script which starts different installation-
> programs. Some of the programs leave DOS-windows and I
> would like to close them automatically. Is there any way?

> thanks

> Petra



Fri, 02 Jul 2004 22:53:36 GMT  
 How to close an open window?

Quote:

> Hi,
> I know that I can activate, minimize, maximize, hide,
> deactivate windows but is it also possible to close an
> open window by using something like AppActivate?
> I'm writing a script which starts different installation-
> programs. Some of the programs leave DOS-windows and I
> would like to close them automatically. Is there any way?

> thanks

> Petra

Have a serious look at AutoIt (free, good stuff) for automating
all those tons of GUI-only installation programs that require
user input. If SendKeys-like solution is your only option:

http://www.hiddensoft.com/AutoIt/

Branimir



Fri, 02 Jul 2004 23:12:58 GMT  
 How to close an open window?
Hi Thomas,

thanks for your answer. I know and use the SendKey-method
but it doesn't work with DOS-Programms. The Programm is
already finished and I should close the window by clicking
on the closing-button in the corner at top of the window.
I can't find the SendKey-Character for this. Do you know
it?

Grsse aus Franken!
Petra

Quote:
>-----Original Message-----
>Hallo Petra!

>In all windows is a program runnig. This could be an

application like Word
Quote:
>or a console. Both of it you have to exit as you do it
manually (Word ->
>File, Exit / Command Prompt with "exit"). You can

simulate this with Windows
Quote:
>Script Host by using the shell methode SendKeys. Take a
look on the example
>below.
>There are some special characters for simulation special
keys (ALT, etc.)
>Take a look on MSDN CDs or
>http://msdn.microsoft.com/library/default.asp?

url=/library/en-us/script56/ht
Quote:
>ml/wsobjwshshell.asp for detailed information

>P.S. Gruesse nach Bayern ;-)))

>        set WshShell = WScript.CreateObject
("WScript.Shell")
>        WshShell.Run "calc"
>        WScript.Sleep 100
>        WshShell.AppActivate "Calculator"
>         WScript.Sleep 100
>         WshShell.SendKeys "2{+}"
>         WScript.Sleep 500
>         WshShell.SendKeys "8"
>         WScript.Sleep 500
>         WshShell.SendKeys "~"
>         WScript.Sleep 500
>         WshShell.SendKeys "*3"
>         WScript.Sleep 500
>         WshShell.SendKeys "~"
>         WScript.Sleep 2500



>> Hi,
>> I know that I can activate, minimize, maximize, hide,
>> deactivate windows but is it also possible to close an
>> open window by using something like AppActivate?
>> I'm writing a script which starts different
installation-
>> programs. Some of the programs leave DOS-windows and I
>> would like to close them automatically. Is there any
way?

>> thanks

>> Petra

>.



Fri, 02 Jul 2004 23:26:12 GMT  
 How to close an open window?
Hi Petra!

You should close all programs with a menu option, a key combination, etc.
All Windows programs & even DOS programs. If this would be possible you
could send a "EXIT" to the command line followed by an "<RETURN>". This will
close Command Line Window as if you would do this manualy 8-)))

What's your problem? Terminate your program? Close your command line window?

P.S. Gruesse aus Mainhatten in Hessen!


Hi Thomas,

thanks for your answer. I know and use the SendKey-method
but it doesn't work with DOS-Programms. The Programm is
already finished and I should close the window by clicking
on the closing-button in the corner at top of the window.
I can't find the SendKey-Character for this. Do you know
it?

Grsse aus Franken!
Petra

Quote:
>-----Original Message-----
>Hallo Petra!

>In all windows is a program runnig. This could be an

application like Word
Quote:
>or a console. Both of it you have to exit as you do it
manually (Word ->
>File, Exit / Command Prompt with "exit"). You can

simulate this with Windows
Quote:
>Script Host by using the shell methode SendKeys. Take a
look on the example
>below.
>There are some special characters for simulation special
keys (ALT, etc.)
>Take a look on MSDN CDs or
>http://msdn.microsoft.com/library/default.asp?

url=/library/en-us/script56/ht
Quote:
>ml/wsobjwshshell.asp for detailed information

>P.S. Gruesse nach Bayern ;-)))

>        set WshShell = WScript.CreateObject
("WScript.Shell")
>        WshShell.Run "calc"
>        WScript.Sleep 100
>        WshShell.AppActivate "Calculator"
>         WScript.Sleep 100
>         WshShell.SendKeys "2{+}"
>         WScript.Sleep 500
>         WshShell.SendKeys "8"
>         WScript.Sleep 500
>         WshShell.SendKeys "~"
>         WScript.Sleep 500
>         WshShell.SendKeys "*3"
>         WScript.Sleep 500
>         WshShell.SendKeys "~"
>         WScript.Sleep 2500



>> Hi,
>> I know that I can activate, minimize, maximize, hide,
>> deactivate windows but is it also possible to close an
>> open window by using something like AppActivate?
>> I'm writing a script which starts different
installation-
>> programs. Some of the programs leave DOS-windows and I
>> would like to close them automatically. Is there any
way?

>> thanks

>> Petra

>.



Fri, 02 Jul 2004 23:48:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Closing a window that was opened with the window.open method

2. window.open and window.close

3. window.close()/window.open()

4. window.open and window.close

5. Problems Closing a New Window using window.close()

6. Opening and closing windows

7. Problem with Closing and Opening popup windows - IE4

8. windows open and close problem between IE 4.0 and IE 5.0/5.5

9. open/close window

10. Opening a New Window and then Closing the Parent HELP

11. window open/close problems

12. how do open and close a window?

 

 
Powered by phpBB® Forum Software