WinAPI: Callback function in VBScript

Anyone ever try a WinAPI callback function call in VBScript? Here's the deal: I am trying to write a procedure that will open an internet explorer browser, and return the browser's Widows handle. I can use the EnumWindows API call to do it, and I can write something in VB6 that does this very well. However, I need to write this so that it is portable without dealing with DLL hell issues. Also, QTP needs to be able use it. I am going to see if I can get this to work, but thought someone might've tried this before.

Wish me luck!

 

posted @ Thursday, April 27, 2006 11:38 AM

Print

Comments on this entry:

# re: WinAPI: Callback function in VBScript

Left by Marcus at 4/27/2006 12:24 PM
Gravatar
Funny, we've the reverse when we open QTP via the Win32::OLE Perl module... but we haven't done much with calling WinAPI calls from VBScript.

So I'm answering a question with a question:

Dim ie
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = true
ie.Navigate("http://www.softwareinquisition.com")

Should I assume that does NOT call the WinAPI, and that it indeed contributes to DLL hell?

If I'm correct in my assumption, I'm as interested in the solution as you are, I think...
MM

# re: WinAPI: Callback function in VBScript

Left by Theo Moore at 4/27/2006 12:49 PM
Gravatar
The CreateObject shouldn't give you any DLL conflicts, really. All of that should be abstracted from you. For example, if you call CreateObject("ADODB.Connection"), CreateObject doesn't know if we mean msado15.dll or msado26.dll; Windows handles that for us. Only trouble I've seen is when one tries to access functionality that is dll specific and the created object won't support it.

Theo

# re: WinAPI: Callback function in VBScript

Left by PKCs at 7/20/2007 8:08 AM
Gravatar
Did you found a solution to the "using EnumWindows from VBScript" problem?
Please post the solution. Thanks
Comments have been closed on this topic.
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910