myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Detect Window Title

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> VB Script >> Detect Window Title Page: [1]
Login
Message << Older Topic   Newer Topic >>
Detect Window Title - 11/3/2008 9:10:26 AM   
jgutty

 

Posts: 22
Score: 0
Joined: 3/22/2007
Status: offline
Hi

Is there a way in VBSCRIPT to find a Window by it's titke name?

For example, if I have notepad open and the title of the window is "Untitked - Notepad". When I run the script to detect window title "Untitled - Notepad" it should return TRUE.

thanks 
Post #: 1
RE: Detect Window Title - 11/4/2008 3:08:23 PM   
rbennett806


Posts: 885
Score: 18
Joined: 6/14/2006
Status: offline
I'd suggest thinking about checking for the process instead of the actual window title if possible. I've run into things in the past assuming that the window will always be titled the same, and then things change and my code bombs. So would something like this work:

strProgramProcess = "notepad.exe"
Set colProcessList = objWMI.ExecQuery ("Select * from Win32_Process Where Name = '" & strProgramProcess & "'")
If Not colProcessList.Count = 0 Then
  'The .EXE is running.
End If


Of course, that's just a snippet of code and not the whole script....

(in reply to jgutty)
Post #: 2
RE: Detect Window Title - 1/7/2009 7:05:11 AM   
dstein


Posts: 631
Score: 10
Joined: 3/12/2003
From: Virginia, USA
Status: offline
Another option, found via Google search: http://www.tek-tips.com/viewthread.cfm?qid=1215459&page=1

_____________________________

software is squishy-squashy, hardware is wishy-washy

(in reply to jgutty)
Post #: 3
Page:   [1]
All Forums >> [Scripting Technologies] >> VB Script >> Detect Window Title Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.264