Geeks With Blogs

News QTP and Stuff
Theo Moore Questions... Morphology? Longevity? Incept dates?

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 on Thursday, April 27, 2006 11:38 AM | Back to top

Comments on this post: WinAPI: Callback function in VBScript

# re: WinAPI: Callback function in VBScript
Requesting 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

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...
Left by Marcus on Apr 27, 2006 12:24 PM

# re: WinAPI: Callback function in VBScript
Requesting 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.

Left by Theo Moore on Apr 27, 2006 12:49 PM

# re: WinAPI: Callback function in VBScript
Requesting Gravatar...
Did you found a solution to the "using EnumWindows from VBScript" problem?
Please post the solution. Thanks
Left by PKCs on Jul 20, 2007 8:08 AM

Comments have been closed on this topic.
Copyright © Theo Moore | Powered by: