-#include "precomp.h"\r
-\r
-static OPENFILENAME ofn;\r
-\r
-/*\r
- * Initialize file open / save structure\r
- */\r
-VOID FileInitialize(HWND hwnd)\r
-{\r
- ZeroMemory(&ofn, sizeof(ofn));\r
- ofn.lStructSize = sizeof(OPENFILENAME);\r
- ofn.hwndOwner = hwnd;\r
- ofn.nMaxFile = MAX_PATH;\r
- ofn.nMaxFileTitle = MAX_PATH;\r
- ofn.lpstrDefExt = _T("bmp");\r
-}\r
-\r
-\r
-static BOOL\r
-DoWriteFile(LPCTSTR pszFileName)\r
-{\r
- return TRUE;\r
-}\r
-\r
-\r
-BOOL\r
-DoOpenFile(HWND hwnd,\r
- LPTSTR szFileName,\r
- LPTSTR szTitleName)\r
-{\r
- DWORD err;\r
- /*static TCHAR Filter[] = _T("All image files (*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png)\0*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png\0") \\r
- _T("All files (*.*)\0*.*\0") \\r
- _T("Graphics Interchange format (*gif)\0*.gif\0") \\r
- _T("Windows Bitmap (*bmp)\0*.bmp\0") \\r
- _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \\r
- _T("TAG Image File Format (*tif)\0*.tif\0") \\r
- _T("Portable Network Graphics (*png)\0*.png\0\0");*/\r
-\r
- static TCHAR Filter[] = _T("Windows Bitmap (*.bmp)\0*.bmp\0");\r
-\r
- ofn.lpstrFilter = Filter;\r
- ofn.lpstrFile = szFileName;\r
- ofn.lpstrFileTitle = szTitleName;\r
- ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;\r
-\r
- if (GetOpenFileName(&ofn))\r
- {\r
- return TRUE;\r
- }\r
-\r
- err = CommDlgExtendedError();\r
-\r
- if (err != CDERR_GENERALCODES)\r
- MessageBox(NULL, _T("Open file failed"), NULL, 0);\r
-\r
- return FALSE;\r
-}\r
-\r
-\r
-\r
-BOOL\r
-DoSaveFile(HWND hwnd)\r
-{\r
- TCHAR szFileName[MAX_PATH] = _T("");\r
- static TCHAR Filter[] = _T("Graphics Interchange format (*gif)\0*.gif\0") \\r
- _T("Windows Bitmap (*bmp)\0*.bmp\0") \\r
- _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \\r
- _T("TAG Image File Format (*tif)\0*.tif\0") \\r
- _T("Portable Network Graphics (*png)\0*.png\0\0");\r
-\r
- ofn.lpstrFilter = Filter;\r
- ofn.lpstrFile = szFileName;\r
- ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;\r
-\r
- if (GetSaveFileName(&ofn))\r
- {\r
- if (DoWriteFile(szFileName))\r
- return TRUE;\r
- }\r
-\r
- if (CommDlgExtendedError() != CDERR_GENERALCODES)\r
- MessageBox(NULL, _T("Save to file failed"), NULL, 0);\r
-\r
- return FALSE;\r
-}\r
-\r
+#include "precomp.h"
+
+static OPENFILENAME ofn;
+
+/*
+ * Initialize file open / save structure
+ */
+VOID FileInitialize(HWND hwnd)
+{
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = hwnd;
+ ofn.nMaxFile = MAX_PATH;
+ ofn.nMaxFileTitle = MAX_PATH;
+ ofn.lpstrDefExt = _T("bmp");
+}
+
+
+static BOOL
+DoWriteFile(LPCTSTR pszFileName)
+{
+ return TRUE;
+}
+
+
+BOOL
+DoOpenFile(HWND hwnd,
+ LPTSTR szFileName,
+ LPTSTR szTitleName)
+{
+ DWORD err;
+ /*static TCHAR Filter[] = _T("All image files (*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png)\0*.gif,*.bmp,*.jpg,*.jpeg,*.tif,*.png\0") \
+ _T("All files (*.*)\0*.*\0") \
+ _T("Graphics Interchange format (*gif)\0*.gif\0") \
+ _T("Windows Bitmap (*bmp)\0*.bmp\0") \
+ _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \
+ _T("TAG Image File Format (*tif)\0*.tif\0") \
+ _T("Portable Network Graphics (*png)\0*.png\0\0");*/
+
+ static TCHAR Filter[] = _T("Windows Bitmap (*.bmp)\0*.bmp\0");
+
+ ofn.lpstrFilter = Filter;
+ ofn.lpstrFile = szFileName;
+ ofn.lpstrFileTitle = szTitleName;
+ ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
+
+ if (GetOpenFileName(&ofn))
+ {
+ return TRUE;
+ }
+
+ err = CommDlgExtendedError();
+
+ if (err != CDERR_GENERALCODES)
+ MessageBox(NULL, _T("Open file failed"), NULL, 0);
+
+ return FALSE;
+}
+
+
+
+BOOL
+DoSaveFile(HWND hwnd)
+{
+ TCHAR szFileName[MAX_PATH] = _T("");
+ static TCHAR Filter[] = _T("Graphics Interchange format (*gif)\0*.gif\0") \
+ _T("Windows Bitmap (*bmp)\0*.bmp\0") \
+ _T("JPEG File Interchange Format (*jpg,*.jpeg)\0*.jpg,*.jpeg\0") \
+ _T("TAG Image File Format (*tif)\0*.tif\0") \
+ _T("Portable Network Graphics (*png)\0*.png\0\0");
+
+ ofn.lpstrFilter = Filter;
+ ofn.lpstrFile = szFileName;
+ ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+
+ if (GetSaveFileName(&ofn))
+ {
+ if (DoWriteFile(szFileName))
+ return TRUE;
+ }
+
+ if (CommDlgExtendedError() != CDERR_GENERALCODES)
+ MessageBox(NULL, _T("Save to file failed"), NULL, 0);
+
+ return FALSE;
+}
+