| 159 | |
| 160 | typedef BOOL (WINAPI * GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL); |
| 161 | static GetSpecialFolderPath |
| 162 | resolveGetSpecialFolderPath() |
| 163 | { |
| 164 | static GetSpecialFolderPath gsfp = 0; |
| 165 | |
| 166 | if (!gsfp) { |
| 167 | #ifndef Q_OS_WINCE |
| 168 | QString lib = QString::fromUtf8("shell32"); |
| 169 | #else |
| 170 | QString lib = QString::fromUtf8("coredll"); |
| 171 | #endif // Q_OS_WINCE |
| 172 | HINSTANCE libHandle = load( (const wchar_t*)lib.utf16() ); |
| 173 | if (libHandle) { |
| 174 | gsfp = (GetSpecialFolderPath)(void*)GetProcAddress(libHandle, "SHGetSpecialFolderPathW"); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | return gsfp; |
| 179 | } |
| 180 | |
| 181 | static QString |
| 182 | convertCharArray(const wchar_t *path) |