|
-
Jun 29th, 2012, 02:11 PM
#1
Thread Starter
Lively Member
[RESOLVED] Window handle from title
Is it possible to get the window handle of a window using just its "title"
The method has be a universal method which can be used by different languages.
I was thinking something like a vbscript file which is then executed using system shell the output is sent to a text file in a temp folder. you open the text file and then get the handle then delete the file.
anything like this possible
-
Jun 29th, 2012, 03:24 PM
#2
Thread Starter
Lively Member
Re: Window handle from title
Ok got it sorted
Code:
Dim DataBin
Set obj = CreateObject("APIWrapperCOM.APIWrapper")
DataBin = obj.FindWindow("'+title+'")
Dim filesys, filetxt, getname, path
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.CreateTextFile("'+output+'", True)
filetxt.WriteLine(DataBin)
filetxt.Close
title is the name of the window you pass (as a variable)
output is where the hwnd (or 0 if none found) is written to as a text file
it requires a few files a to register the dll as well see here:
http://www.codeproject.com/Articles/...ow-in-VBScript
Last edited by rafhelp; Jun 29th, 2012 at 03:47 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|