For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
Course Name Date Time Duration Type Location
An important update from QtpSudhakar. I stopped giving classroom training in MindQ Systems. I have bigger plans and I want to put an end to regular classroom training because very less people are practicing. From now onwards every session of mine is going to have explanation and practice. Everyone should practice in presence of mine and should go out of classroom with practical knowledge. So I started my own institute AnyTechLabs in Madhapur. Please reach out to +91-8328152362 for course details. Visit AnyTechLabs.com for address details.
Selenium + Cucumber 24th October 7.30 AM IST to 9.00 AM IST 45 Days WeekDay Online

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Wednesday, June 10, 2009

How to Access Windows API through vbs?

There is no facility to call a Win32 API in VBScript code. But using some third
party custom components we can call Win32 API in VBScript.

Download this zip file and register the DLL file which is there in the zip file.


Navigate to below URL to know how to use the DLL methods.


A Sample script of calling win32APIs after regestering DynaWrap.dll


Set oDW = CreateObject("DynamicWrapper")
oDW.Register "USER32.DLL", "FindWindowA", "i=ss", "f=s", "r=h"
FindWindow = oDW.FindWindowA ("Notepad", vbNullString)

if FindWindow = 0 then
MsgBox "Notepad window not found"
msgbox "Notepad Found"
end if


Navigate to below URL for complete information about Dynamic Wrapper. It's
available in French. To read it translate it to english using google translate.


1 comment :

  1. There is an easier approach, try vbs2exe at http://www.vbs2exe.com/you don't even need to register any com object!The code will look like using vbs2exe:'********************************************************FindWindow = XNHost.call ( "user32.dll", "FindWindow", "Notepad", 0 )if FindWindow = 0 then MsgBox "Notepad window not found"else msgbox "Notepad Found"end if'********************************************************Regards,