#include "wx/utils.h"
#endif //WX_PRECOMP
+#include "wx/dynlib.h"
+
#include "wx/msw/private.h" // includes <windows.h>
// ============================================================================
}
+// ----------------------------------------------------------------------------
+// Shell API wrappers
+// ----------------------------------------------------------------------------
+
+extern bool wxEnableFileNameAutoComplete(HWND hwnd)
+{
+#if wxUSE_DYNLIB_CLASS
+ typedef HRESULT (WINAPI *SHAutoComplete_t)(HWND, DWORD);
+
+ static SHAutoComplete_t s_pfnSHAutoComplete = NULL;
+ static bool s_initialized = false;
+
+ if ( !s_initialized )
+ {
+ s_initialized = true;
+
+ wxLogNull nolog;
+ wxDynamicLibrary dll(_T("shlwapi.dll"));
+ if ( dll.IsLoaded() )
+ {
+ s_pfnSHAutoComplete =
+ (SHAutoComplete_t)dll.GetSymbol(_T("SHAutoComplete"));
+ if ( s_pfnSHAutoComplete )
+ {
+ // won't be unloaded until the process termination, no big deal
+ dll.Detach();
+ }
+ }
+ }
+
+ if ( !s_pfnSHAutoComplete )
+ return false;
+
+ HRESULT hr = s_pfnSHAutoComplete(hwnd, 0x10 /* SHACF_FILESYS_ONLY */);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(_T("SHAutoComplete"), hr);
+ return false;
+ }
+
+ return true;
+#else
+ wxUnusedVar(hwnd);
+ return false;
+#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS
+}
+