- BOOL ret;
- FileOpenDlgInfos fodInfos;
- LPSTR lpstrSavDir = NULL;
- LPWSTR title = NULL;
- LPWSTR defext = NULL;
- LPWSTR filter = NULL;
- LPWSTR customfilter = NULL;
- INITCOMMONCONTROLSEX icc;
-
- /* Initialize ComboBoxEx32 */
- icc.dwSize = sizeof(icc);
- icc.dwICC = ICC_USEREX_CLASSES;
- InitCommonControlsEx(&icc);
-
- /* Initialize CommDlgExtendedError() */
- COMDLG32_SetCommDlgExtendedError(0);
-
- /* Initialize FileOpenDlgInfos structure */
- ZeroMemory(&fodInfos, sizeof(FileOpenDlgInfos));
-
- /* Pass in the original ofn */
- fodInfos.ofnInfos = (LPOPENFILENAMEW)ofn;
-
- /* save current directory */
- if (ofn->Flags & OFN_NOCHANGEDIR)
- {
- lpstrSavDir = MemAlloc(MAX_PATH);
- GetCurrentDirectoryA(MAX_PATH, lpstrSavDir);
- }