'###############################################
' Extern Object
'###############################################
' Purpose - Declares references to external procedures which are stored with a dynamic-link library (DLL).
'Syntax:- Extern.Declare(RetType, MethodName, LibName, Alias [, ArgType(s)])
'Ex:-
' FindWindowA is a function in user32.dll. This function is used to find a window which is currently opened on Desktop.
' This function takes two string inputs NativeClass & Title of the Window.
' This will return a handler value of the identified window.
' If it is returned 0 then there is no window found
'Declare FindWindow method
Extern.Declare micHwnd, "FindWindow", "user32.dll", "FindWindowA", micString, micString
'Get HWND of the Notepad window
hwnd = Extern.FindWindow("Notepad", vbNullString)
If hwnd = 0 Then
MsgBox "Notepad window not found"
Else
MsgBox "Notepad window found"
end if
HI,
ReplyDeleteVery useful information, but I need small clarification like, when I am trying to execute this function, its asking like Object Required.
But with my understanding, Extern is builtin function right?
Could you please help me?
Thanks in advance your your help,
Rama
Can you clearly explain the functions present inside the dll files,eg..what is the use of findwindow and findwindowA... because i have a little bit of confusion in that can u rectify that as soon as possible
ReplyDelete