unit AutoCompleteUnit;
interface
uses Windows, StdCtrls, ComObj;
Const
SHACF_DEFAULT = $0;
SHACF_FILESYSTEM = $1;
SHACF_URLHISTORY = $2;
SHACF_URLMRU = $4;
SHACF_URLALL = (SHACF_URLHISTORY
Or SHACF_URLMRU);
SHACF_AUTOSUGGEST_FORCE_ON = $10000000;
SHACF_AUTOSUGGEST_FORCE_OFF = $20000000;
SHACF_AUTOAPPEND_FORCE_ON = $40000000;
SHACF_AUTOAPPEND_FORCE_OFF = $80000000;
function AutoComplete(editField: TEdit; dwFlags: DWORD): Boolean;
implementation
type TShAutoCompleteFunc =
function(hwndEdit: HWND; dwFlags: dWord): LongInt;
stdcall;
var SHAutoComplete: TShAutoCompleteFunc;
theDLL: THandle;
function AutoComplete(editField: TEdit; dwFlags: DWORD): Boolean;
begin
if @ShAutoComplete <>
nil then
Result := (SHAutoComplete(editField.Handle, dwFlags) = 0)
else
Result := false;
end;
initialization
theDLL := LoadLibrary('
shlwapi.dll');
if theDLL <> 0
then
@ShAutoComplete := GetProcAdress(theDLL, '
SHAutoComplete');
finalization
if theDLL <> 0
then FreeLibrary(theDLL);
end.