4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
11 * These classes should be used only on Windows machines.
20 # error os_win32.h should be compiled only under Windows.
23 /* The GetLongPathNameA function declaration in
24 * <winbase.h> is protected by the WINVER macro which is
25 * defined to a default value in <windef.h> under MinGW and Cygwin.
27 * SHGFP_TYPE_CURRENT is defined in <shlobj.h> for __W32API_VERSION >= 3.2
28 * where it is protected by _WIN32_IE, also defined to a default value
29 * in <windef.h> under MinGW and Cygwin.
30 * It is missing in earlier versions of the MinGW w32api headers.
32 * We need to #include <windows.h> now to make available the
33 * DWORD, HMODULE et al. typedefs, so first define WINVER, _WIN32_IE.
35 * Note: __CYGWIN__ can be defined here if building in _WIN32 mode.
37 #if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__CYGWIN32__)
40 # error WINVER must be >= 0x0600
43 # define WINVER 0x0600
45 # define _WIN32_IE 0x0600
53 #undef IN // used in Length::UNIT enum
60 /** Win98 and earlier don't have SHGetFolderPath in shell32.dll.
61 * Microsoft recommend that we load shfolder.dll at run time and
62 * access the function through that.
64 * shfolder.dll is loaded dynamically in the constructor. If loading
65 * fails or if the .dll is found not to contain SHGetFolderPathA then
66 * the program exits immediately. Otherwise, the .dll is unloaded in
69 * The class makes SHGetFolderPath available through its function operator.
70 * It will work on all versions of Windows >= Win95.
84 /** Wrapper for SHGetFolderPathA, returning
85 * the path associated with @c id in utf8 encoding.
87 std::string const operator()(folder_id id) const;
89 typedef HRESULT (__stdcall * function_pointer)(HWND, int, HANDLE, DWORD, LPCSTR);
91 HMODULE folder_module_;
92 function_pointer folder_path_func_;
96 } // namespace support