我改写的一段 TIEAddress 的程序,原来的程序中直接调用 'SHAutoComplete' 函数,
但在 Win95, IE4.0 的时候,shlwapi.dll 中没有这个函数,就会出错,改为动态调用侯就
可以避免
procedure TCustomUrlComboBox.CreateWnd;
const
; FileOptionsValues: array[TGFileOption] of Cardinal = (SHACF_FILESYSTEM, SHACF_URLHISTORY, SHACF_URLMRU);
var
; I: TGFileOption;
; Options: DWORD;
; LibraryHandle: THandle;
; FSHAutoComplete: TSHAutoComplete;
begin
; inherited CreateWnd;
; if not (csDesigning in ComponentState) then
; ; FUrlDropTarget.Register;
; PostMessage(Handle, CBEM_SETIMAGELIST, 0, FDefaultImageListHandle);
; Options:= 0;
; if csDesigning in ComponentState then Exit;
; if (FFileOptions <> []) then
; ; for I:= Low(TGFileOption) to High(TGFileOption) do
; ; ; if (I in FFileOptions) then Inc(Options, FileOptionsValues);
; if FUrlAutoSuggest = asForceOn then
; ; Inc(Options, SHACF_AUTOSUGGEST_FORCE_ON)
; else if FUrlAutoSuggest = asForceOff then
; ; Inc(options, SHACF_AUTOSUGGEST_FORCE_OFF);
; if FUrlAutoComplete = acForceOn then
; ; Inc(Options, SHACF_AUTOAPPEND_FORCE_ON)
; else if FUrlAutoComplete = acForceOff then
; ; Inc(Options, SHACF_AUTOAPPEND_FORCE_OFF);
; LibraryHandle:= LoadLibrary('shlwapi.dll');
; try
; ; if LibraryHandle <> 0 then
; ; begin
; ; ; FSHAutoComplete:= GetProcAddress(LibraryHandle, PChar('SHAutoComplete'));
; ; ; if Assigned(FSHAutoComplete) then FSHAutoComplete(EditHandle, Options);
; ; end;
; finally
; ; FreeLibrary(LibraryHandle);
; end;
end;