cshiers
-
Total Posts
:
27
- Scores: 0
-
Reward points
:
0
- Joined: 4/28/2005
- Location:
-
Status: offline
|
Find if a window is open.
Friday, May 13, 2005 4:44 AM
( permalink)
I am trying to find out if a window is running. Dow the FindWindow function work in VBscript? If not, how can I find if a window is running using VB script?
|
|
|
|
didorno
-
Total Posts
:
361
- Scores: 0
-
Reward points
:
0
- Joined: 2/12/2005
- Location:
-
Status: offline
|
Re: Find if a window is open.
Friday, May 13, 2005 6:38 AM
( permalink)
Better en more window commands can be found in a 3rd party tool : "AutoIt". I use, with success, version V3.0.102. It is very easy to use and you can manage a lot of things with windows which you can't do with vbs. Search with Google, I should say. Good luck !
|
|
|
|
Fredledingue
-
Total Posts
:
572
- Scores: 2
-
Reward points
:
0
- Joined: 5/9/2005
- Location: Europe
-
Status: offline
|
Re: Find if a window is open.
Friday, May 13, 2005 9:09 AM
( permalink)
|
|
|
|
cshiers
-
Total Posts
:
27
- Scores: 0
-
Reward points
:
0
- Joined: 4/28/2005
- Location:
-
Status: offline
|
Re: Find if a window is open.
Monday, May 16, 2005 4:09 AM
( permalink)
Thanks for all the help, however I found a way to do it with just Windows Script. The AppActivate method returns a boolean value if the application if running. Here is the code to check if an app is running. -- Set WshShell = WScript.CreateObject("WScript.Shell") a = WshShell.AppActivate("Application Title") 'this will still give focus to the application if a = true then msgbox "Application is running" else msgbox "Application is not running" End if
|
|
|
|
didorno
-
Total Posts
:
361
- Scores: 0
-
Reward points
:
0
- Joined: 2/12/2005
- Location:
-
Status: offline
|
Re: Find if a window is open.
Monday, May 16, 2005 8:55 AM
( permalink)
In the beginning I tried to find all scripting solutions within VBScript, so without 3rd party software. But, I found that the VBScript window manipulation was not always reliable, leading to sometimes "surprising" results, especially in case of using the "sendkeys" command (dangerous). I started carefully with AutoItX support and the experience with it was very good. So I can recommend the use of AutoItX, for all kind of window manipulation. B.t.w.,Fredledingue, I mixed up AutoItX and AutoIt, I use versions 1.51 and 3.0.102, respectively. Regards.
|
|
|
|