The post How To Invoke External DLL’s | VBScript appeared first on TestMate.
]]>The below code demonstrates the usage of LoadAndRun method to invoke SetForegroundWindow method from user32.dl:
'Declare The DLL to be used
sDLL = "user32.dll"
'Declare the returrn type - Which is boolean
sRet = "bool"
'Declare the method string
sDec = "static extern bool SetForegroundWindow(IntPtr hWnd)"
'Fetch the handle of the application
hwndCalculator = Native.GetHandleByCaption("Calculator")
'Declare the Method string
sFunc = "SetForegroundWindow((IntPtr)" & hwndCalculator &" )"
'Run the method from the DLL
Call dll.LoadAndRun(sDLL,sRet,sDec,sFunc)
All the available DLL's and methods can be found here.
The post How To Invoke External DLL’s | VBScript appeared first on TestMate.
]]>