Adds a directory to the search path used to locate DLLs for the application.
#Include <WinAPIEx.au3>
_WinAPI_SetDllDirectory ( $sPath )
$sPath | The directory to be added to the search path. If this parameter is an empty string (""), the call removes the current directory from the default DLL search order. If this parameter is not specified, the function restores the default search order. |
成功: | 返回 1. |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
If Not _WinAPI_SetDllDirectory(@ScriptDir & '\Extras') Then
Exit
EndIf
Global $hModule = _WinAPI_LoadLibraryEx('Resources.dll', $LOAD_LIBRARY_AS_DATAFILE)
ConsoleWrite('Path: ' & _WinAPI_GetDllDirectory() & @CR)
ConsoleWrite('Module: ' & $hModule & @CR)
_WinAPI_FreeLibrary($hModule)