From 2d3b058e330f9f183b65aec676eade7a648e0e58 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Wed, 27 May 2009 17:56:50 +0000 Subject: [PATCH] Change Paint to use Unicode svn path=/trunk/; revision=41147 --- reactos/base/applications/paint/definitions.h | 2 + reactos/base/applications/paint/dib.c | 4 +- reactos/base/applications/paint/dib.h | 4 +- reactos/base/applications/paint/globalvar.h | 4 +- reactos/base/applications/paint/main.c | 87 ++++++++++--------- reactos/base/applications/paint/paint.rbuild | 2 +- reactos/base/applications/paint/winproc.c | 55 ++++++------ 7 files changed, 81 insertions(+), 77 deletions(-) diff --git a/reactos/base/applications/paint/definitions.h b/reactos/base/applications/paint/definitions.h index 174d0c6ebe9..ca47a0345ee 100644 --- a/reactos/base/applications/paint/definitions.h +++ b/reactos/base/applications/paint/definitions.h @@ -8,6 +8,8 @@ /* DEFINES **********************************************************/ +#define SIZEOF(a) (sizeof(a) / sizeof((a)[0])) + #define IDI_APPICON 500 #define IDB_TOOLBARICONS 510 diff --git a/reactos/base/applications/paint/dib.c b/reactos/base/applications/paint/dib.c index ba6f8f0e630..aa63e0ae754 100644 --- a/reactos/base/applications/paint/dib.c +++ b/reactos/base/applications/paint/dib.c @@ -43,7 +43,7 @@ int GetDIBHeight(HBITMAP hbm) return bm.bmHeight; } -void SaveDIBToFile(HBITMAP hbm, LPSTR name, HDC hdc) +void SaveDIBToFile(HBITMAP hbm, LPTSTR name, HDC hdc) { BITMAP bm; GetObject(hbm, sizeof(BITMAP), &bm); @@ -77,7 +77,7 @@ void SaveDIBToFile(HBITMAP hbm, LPSTR name, HDC hdc) HeapFree(GetProcessHeap(), 0, buffer); } -HBITMAP LoadDIBFromFile(LPSTR name) +HBITMAP LoadDIBFromFile(LPTSTR name) { HBITMAP bm; BITMAPFILEHEADER bfh; diff --git a/reactos/base/applications/paint/dib.h b/reactos/base/applications/paint/dib.h index 9f1c077066f..ce7f3d5e020 100644 --- a/reactos/base/applications/paint/dib.h +++ b/reactos/base/applications/paint/dib.h @@ -12,6 +12,6 @@ int GetDIBWidth(HBITMAP hbm); int GetDIBHeight(HBITMAP hbm); -void SaveDIBToFile(HBITMAP hbm, LPSTR name, HDC hdc); +void SaveDIBToFile(HBITMAP hbm, LPTSTR name, HDC hdc); -HBITMAP LoadDIBFromFile(LPSTR name); +HBITMAP LoadDIBFromFile(LPTSTR name); diff --git a/reactos/base/applications/paint/globalvar.h b/reactos/base/applications/paint/globalvar.h index 029ce2f130d..d039db4280c 100644 --- a/reactos/base/applications/paint/globalvar.h +++ b/reactos/base/applications/paint/globalvar.h @@ -68,6 +68,6 @@ extern HWND hToolBtn[16]; extern HINSTANCE hProgInstance; -extern char filename[256]; -extern char filepathname[1000]; +extern TCHAR filename[256]; +extern TCHAR filepathname[1000]; extern BOOL isAFile; diff --git a/reactos/base/applications/paint/main.c b/reactos/base/applications/paint/main.c index 99c4b73c48b..a6b9338eb34 100644 --- a/reactos/base/applications/paint/main.c +++ b/reactos/base/applications/paint/main.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "definitions.h" #include "drawing.h" @@ -97,11 +98,11 @@ HWND hToolBtn[16]; HINSTANCE hProgInstance; -char filename[256]; -char filepathname[1000]; +TCHAR filename[256]; +TCHAR filepathname[1000]; BOOL isAFile = FALSE; -int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) +int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil) { hProgInstance = hThisInstance; HWND hwnd; /* This is the handle for our window */ @@ -113,7 +114,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz //initializing and registering the window class used for the main window WNDCLASSEX wincl; wincl.hInstance = hThisInstance; - wincl.lpszClassName = "WindowsApp"; + wincl.lpszClassName = _T("WindowsApp"); wincl.lpfnWndProc = WindowProcedure; wincl.style = CS_DBLCLKS; wincl.cbSize = sizeof (WNDCLASSEX); @@ -130,7 +131,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz WNDCLASSEX wclScroll; wclScroll.hInstance = hThisInstance; - wclScroll.lpszClassName = "Scrollbox"; + wclScroll.lpszClassName = _T("Scrollbox"); wclScroll.lpfnWndProc = WindowProcedure; wclScroll.style = 0; wclScroll.cbSize = sizeof (WNDCLASSEX); @@ -147,7 +148,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz WNDCLASSEX wclPal; wclPal.hInstance = hThisInstance; - wclPal.lpszClassName = "Palette"; + wclPal.lpszClassName = _T("Palette"); wclPal.lpfnWndProc = PalWinProc; wclPal.style = CS_DBLCLKS; wclPal.cbSize = sizeof (WNDCLASSEX); @@ -164,7 +165,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz WNDCLASSEX wclSettings; wclSettings.hInstance = hThisInstance; - wclSettings.lpszClassName = "ToolSettings"; + wclSettings.lpszClassName = _T("ToolSettings"); wclSettings.lpfnWndProc = SettingsWinProc; wclSettings.style = CS_DBLCLKS; wclSettings.cbSize = sizeof (WNDCLASSEX); @@ -181,7 +182,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz WNDCLASSEX wclSelection; wclSelection.hInstance = hThisInstance; - wclSelection.lpszClassName = "Selection"; + wclSelection.lpszClassName = _T("Selection"); wclSelection.lpfnWndProc = SelectionWinProc; wclSelection.style = CS_DBLCLKS; wclSelection.cbSize = sizeof (WNDCLASSEX); @@ -194,15 +195,15 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz wclSelection.hbrBackground = NULL;//GetSysColorBrush(COLOR_BTNFACE); RegisterClassEx (&wclSelection); - LoadString(hThisInstance, IDS_DEFAULTFILENAME, (LPTSTR)filename, sizeof(filename)); - char progtitle[1000]; - char resstr[100]; - LoadString(hThisInstance, IDS_WINDOWTITLE, (LPTSTR)resstr, sizeof(resstr)); - sprintf(progtitle, resstr, filename); + LoadString(hThisInstance, IDS_DEFAULTFILENAME, filename, SIZEOF(filename)); + TCHAR progtitle[1000]; + TCHAR resstr[100]; + LoadString(hThisInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); + _stprintf(progtitle, resstr, filename); // create main window - hwnd = CreateWindowEx (0, "WindowsApp", (LPTSTR)progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544, 375, HWND_DESKTOP, NULL, hThisInstance, NULL); + hwnd = CreateWindowEx (0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544, 375, HWND_DESKTOP, NULL, hThisInstance, NULL); hMainWnd = hwnd; @@ -222,7 +223,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN)); hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH)); - HWND hLine = CreateWindowEx (0, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); + HWND hLine = CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); // creating the 16 bitmap radio buttons and setting the bitmap @@ -236,12 +237,12 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz DeleteObject(tempBm); SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); int i; - char tooltips[16][30]; + TCHAR tooltips[16][30]; for (i=0; i<16; i++) { int wrapnow = 0; if (i % 2 == 1) wrapnow = TBSTATE_WRAP; - LoadString(hThisInstance, IDS_TOOLTIP1 + i, (LPTSTR)tooltips[i], 30); + LoadString(hThisInstance, IDS_TOOLTIP1 + i, tooltips[i], 30); TBBUTTON tbbutton = { i, ID_FREESEL + i, TBSTATE_ENABLED | wrapnow, TBSTYLE_CHECKGROUP, {0}, 0, (INT_PTR)tooltips[i] }; SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&tbbutton); } @@ -256,25 +257,25 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz // creating the tool settings child window - hToolSettings = CreateWindowEx(0, "ToolSettings", "", WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL, hThisInstance, NULL); + hToolSettings = CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL, hThisInstance, NULL); // creating the palette child window - hPalWin = CreateWindowEx(0, "Palette", "", WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL, hThisInstance, NULL); + hPalWin = CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL, hThisInstance, NULL); // creating the scroll box - hScrollbox = CreateWindowEx (WS_EX_CLIENTEDGE, "Scrollbox", "", WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd, NULL, hThisInstance, NULL); + hScrollbox = CreateWindowEx (WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""), WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd, NULL, hThisInstance, NULL); // creating the status bar - hStatusBar = CreateWindowEx (0, STATUSCLASSNAME, "", SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hThisInstance, NULL); + hStatusBar = CreateWindowEx (0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hThisInstance, NULL); SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0); - hScrlClient = CreateWindowEx(0, "Scrollbox", "", WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL, hThisInstance, NULL); + hScrlClient = CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL, hThisInstance, NULL); // create selection window (initially hidden) - hSelection = CreateWindowEx(WS_EX_TRANSPARENT, "Selection", "", WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100, hScrlClient, NULL, hThisInstance, NULL); + hSelection = CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100, hScrlClient, NULL, hThisInstance, NULL); // creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn - hImageArea = CreateWindowEx (0, "Scrollbox", "", WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient, NULL, hThisInstance, NULL); + hImageArea = CreateWindowEx (0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient, NULL, hThisInstance, NULL); hDrawingDC = CreateCompatibleDC(GetDC(hImageArea)); hSelDC = CreateCompatibleDC(GetDC(hImageArea)); @@ -299,41 +300,41 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz choosecolor.lpfnHook = NULL; choosecolor.lpTemplateName = NULL; - char *c; + TCHAR *c; // initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName - char ofnFilename[1000]; + TCHAR ofnFilename[1000]; CopyMemory(ofnFilename, filename, sizeof(filename)); - char ofnFiletitle[256]; - char ofnFilter[1000]; - LoadString(hThisInstance, IDS_OPENFILTER, (LPTSTR)ofnFilter, sizeof(ofnFilter)); + TCHAR ofnFiletitle[256]; + TCHAR ofnFilter[1000]; + LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter)); for (c = ofnFilter; *c; c++) if (*c == '\1') *c = '\0'; ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof (OPENFILENAME); ofn.hwndOwner = hwnd; ofn.hInstance = hThisInstance; - ofn.lpstrFilter = (LPCTSTR)ofnFilter; - ofn.lpstrFile = (LPTSTR)ofnFilename; - ofn.nMaxFile = sizeof(ofnFilename); - ofn.lpstrFileTitle = (LPTSTR)ofnFiletitle; - ofn.nMaxFileTitle = sizeof(ofnFiletitle); + ofn.lpstrFilter = ofnFilter; + ofn.lpstrFile = ofnFilename; + ofn.nMaxFile = SIZEOF(ofnFilename); + ofn.lpstrFileTitle = ofnFiletitle; + ofn.nMaxFileTitle = SIZEOF(ofnFiletitle); ofn.Flags = OFN_HIDEREADONLY; - char sfnFilename[1000]; + TCHAR sfnFilename[1000]; CopyMemory(sfnFilename, filename, sizeof(filename)); - char sfnFiletitle[256]; - char sfnFilter[1000]; - LoadString(hThisInstance, IDS_SAVEFILTER, (LPTSTR)sfnFilter, sizeof(sfnFilter)); + TCHAR sfnFiletitle[256]; + TCHAR sfnFilter[1000]; + LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter)); for (c = sfnFilter; *c; c++) if (*c == '\1') *c = '\0'; ZeroMemory(&sfn, sizeof(OPENFILENAME)); sfn.lStructSize = sizeof (OPENFILENAME); sfn.hwndOwner = hwnd; sfn.hInstance = hThisInstance; - sfn.lpstrFilter = (LPCTSTR)sfnFilter; - sfn.lpstrFile = (LPTSTR)sfnFilename; - sfn.nMaxFile = sizeof(sfnFilename); - sfn.lpstrFileTitle = (LPTSTR)sfnFiletitle; - sfn.nMaxFileTitle = sizeof(sfnFiletitle); + sfn.lpstrFilter = sfnFilter; + sfn.lpstrFile = sfnFilename; + sfn.nMaxFile = SIZEOF(sfnFilename); + sfn.lpstrFileTitle = sfnFiletitle; + sfn.nMaxFileTitle = SIZEOF(sfnFiletitle); sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; diff --git a/reactos/base/applications/paint/paint.rbuild b/reactos/base/applications/paint/paint.rbuild index 32f1c9d8269..8025cf91373 100644 --- a/reactos/base/applications/paint/paint.rbuild +++ b/reactos/base/applications/paint/paint.rbuild @@ -1,6 +1,6 @@ - + . comdlg32 shell32 diff --git a/reactos/base/applications/paint/winproc.c b/reactos/base/applications/paint/winproc.c index f5a1241c88d..96fe59db225 100644 --- a/reactos/base/applications/paint/winproc.c +++ b/reactos/base/applications/paint/winproc.c @@ -13,6 +13,7 @@ #include //#include #include +#include #include "definitions.h" #include "globalvar.h" #include "dialogs.h" @@ -60,13 +61,13 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_CLOSE: if (undoSteps>0) { - char programname[20]; - char saveprompttext[100]; - LoadString(hProgInstance, IDS_PROGRAMNAME, (LPTSTR)programname, sizeof(programname)); - LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, (LPTSTR)saveprompttext, sizeof(saveprompttext)); - char temptext[500]; - sprintf(temptext, saveprompttext, filename); - switch (MessageBox(hwnd, (LPTSTR)temptext, (LPTSTR)programname, MB_YESNOCANCEL | MB_ICONQUESTION)) + TCHAR programname[20]; + TCHAR saveprompttext[100]; + LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname)); + LoadString(hProgInstance, IDS_SAVEPROMPTTEXT, saveprompttext, SIZEOF(saveprompttext)); + TCHAR temptext[500]; + _stprintf(temptext, saveprompttext, filename); + switch (MessageBox(hwnd, temptext, programname, MB_YESNOCANCEL | MB_ICONQUESTION)) { case IDNO: DestroyWindow(hwnd); @@ -319,8 +320,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM { if ((!drawing)||(activeTool<=9)) { - char coordStr[100]; - sprintf(coordStr, "%d, %d", (short)LOWORD(lParam)*1000/zoom, (short)HIWORD(lParam)*1000/zoom); + TCHAR coordStr[100]; + _stprintf(coordStr, _T("%d, %d"), (short)LOWORD(lParam)*1000/zoom, (short)HIWORD(lParam)*1000/zoom); SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM)coordStr); } if (drawing) @@ -331,8 +332,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM SendMessage(hImageArea, WM_PAINT, 0, 0); if ((activeTool>=10)||(activeTool==2)) { - char sizeStr[100]; - sprintf(sizeStr, "%d x %d", (short)LOWORD(lParam)*1000/zoom-startX, (short)HIWORD(lParam)*1000/zoom-startY); + TCHAR sizeStr[100]; + _stprintf(sizeStr, _T("%d x %d"), (short)LOWORD(lParam)*1000/zoom-startX, (short)HIWORD(lParam)*1000/zoom-startY); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)sizeStr); } } @@ -342,15 +343,15 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM SendMessage(hImageArea, WM_PAINT, 0, 0); if (activeTool>=10) { - char sizeStr[100]; - sprintf(sizeStr, "%d x %d", (short)LOWORD(lParam)*1000/zoom-startX, (short)HIWORD(lParam)*1000/zoom-startY); + TCHAR sizeStr[100]; + _stprintf(sizeStr, _T("%d x %d"), (short)LOWORD(lParam)*1000/zoom-startX, (short)HIWORD(lParam)*1000/zoom-startY); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)sizeStr); } } } } else { - SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM)""); + SendMessage(hStatusBar, SB_SETTEXT, 1, (LPARAM)_T("")); } break; @@ -362,11 +363,11 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM case IDM_HELPINFO: { HICON paintIcon = LoadIcon(hProgInstance, MAKEINTRESOURCE(IDI_APPICON)); - char infotitle[100]; - char infotext[200]; - LoadString(hProgInstance, IDS_INFOTITLE, (LPTSTR)infotitle, sizeof(infotitle)); - LoadString(hProgInstance, IDS_INFOTEXT, (LPTSTR)infotext, sizeof(infotext)); - ShellAbout(hMainWnd, (LPTSTR)infotitle, (LPTSTR)infotext, paintIcon); + TCHAR infotitle[100]; + TCHAR infotext[200]; + LoadString(hProgInstance, IDS_INFOTITLE, infotitle, SIZEOF(infotitle)); + LoadString(hProgInstance, IDS_INFOTEXT, infotext, SIZEOF(infotext)); + ShellAbout(hMainWnd, infotitle, infotext, paintIcon); DeleteObject(paintIcon); } break; @@ -388,12 +389,12 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM { insertReversible(bmNew); updateCanvasAndScrollbars(); - char tempstr[1000]; - char resstr[100]; + TCHAR tempstr[1000]; + TCHAR resstr[100]; CopyMemory(filename, ofn.lpstrFileTitle, sizeof(filename)); CopyMemory(filepathname, ofn.lpstrFileTitle, sizeof(filepathname)); - LoadString(hProgInstance, IDS_WINDOWTITLE, (LPTSTR)resstr, sizeof(resstr)); - sprintf(tempstr, resstr, filename); + LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); + _stprintf(tempstr, resstr, filename); SetWindowText(hMainWnd, tempstr); clearHistory(); isAFile = TRUE; @@ -410,12 +411,12 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM if (GetSaveFileName(&sfn)!=0) { SaveDIBToFile(hBms[currInd], sfn.lpstrFile, hDrawingDC); - char tempstr[1000]; - char resstr[100]; + TCHAR tempstr[1000]; + TCHAR resstr[100]; CopyMemory(filename, sfn.lpstrFileTitle, sizeof(filename)); CopyMemory(filepathname, sfn.lpstrFileTitle, sizeof(filepathname)); - LoadString(hProgInstance, IDS_WINDOWTITLE, (LPTSTR)resstr, sizeof(resstr)); - sprintf(tempstr, resstr, filename); + LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); + _stprintf(tempstr, resstr, filename); SetWindowText(hMainWnd, tempstr); isAFile = TRUE; }