Postada em 02/09/2008 20:11 hs
?????????
Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long
Public Function DllRegisterServer(DllName As String) As Boolean Dim hLibrary As Long, hProcAdress As Long, Ret As Long hLibrary = LoadLibrary(DllName) If hLibrary <> 0 Then hProcAdress = GetProcAddress(hLibrary, "DllRegisterServer") 'DllUnRegisterServer para DesRegistrar If hProcAdress <> 0 Then Ret = _ CallWindowProc(hProcAdress, GetDesktopWindow, "", ByVal 0&, ByVal 0&)
DllRegisterServer = True Else 'Arquivo carregado porém o ponto de entrada não foi encontrado 'Arquivo não pode ser registrado End If Else 'Arquivo não encontrado End If
FreeLibrary hLibrary End Function
|