+void wxDrawLine(HDC hdc, int x1, int y1, int x2, int y2)
+{
+#ifdef __WXWINCE__
+ POINT points[2];
+ points[0].x = x1;
+ points[0].y = y1;
+ points[1].x = x2;
+ points[1].y = y2;
+ Polyline(hdc, points, 2);
+#else
+ MoveToEx(hdc, x1, y1, NULL); LineTo((HDC) hdc, x2, y2);
+#endif
+}
+
+
+// ----------------------------------------------------------------------------
+// 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
+}