4 * Copyright 1998,99 Marcel Baur <mbaur@g26.ethz.ch>
5 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
6 * Copyright 2002 Andriy Palamarchuk
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #define SPACES_IN_TAB 8
34 #define PRINT_LEN_MAX 120
36 static const WCHAR helpfileW[] = { 'n','o','t','e','p','a','d','.','h','l','p',0 };
38 static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
40 VOID ShowLastError(void)
42 DWORD error = GetLastError();
43 if (error != NO_ERROR)
46 WCHAR szTitle[MAX_STRING_LEN];
48 LoadString(Globals.hInstance, STRING_ERROR, szTitle, SIZEOF(szTitle));
50 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
52 (LPTSTR) &lpMsgBuf, 0, NULL);
53 MessageBox(NULL, lpMsgBuf, szTitle, MB_OK | MB_ICONERROR);
59 * Sets the caption of the main window according to Globals.szFileTitle:
60 * Untitled - Notepad if no file is open
61 * filename - Notepad if a file is given
63 static void UpdateWindowCaption(void)
65 WCHAR szCaption[MAX_STRING_LEN];
66 WCHAR szNotepad[MAX_STRING_LEN];
67 static const WCHAR hyphenW[] = { ' ','-',' ',0 };
69 if (Globals.szFileTitle[0] != '\0')
70 lstrcpy(szCaption, Globals.szFileTitle);
72 LoadString(Globals.hInstance, STRING_UNTITLED, szCaption, SIZEOF(szCaption));
74 LoadString(Globals.hInstance, STRING_NOTEPAD, szNotepad, SIZEOF(szNotepad));
75 lstrcat(szCaption, hyphenW);
76 lstrcat(szCaption, szNotepad);
78 SetWindowText(Globals.hMainWnd, szCaption);
81 static void AlertFileNotFound(LPCWSTR szFileName)
83 WCHAR szMessage[MAX_STRING_LEN];
84 WCHAR szResource[MAX_STRING_LEN];
86 /* Load and format szMessage */
87 LoadString(Globals.hInstance, STRING_NOTFOUND, szResource, SIZEOF(szResource));
88 wsprintf(szMessage, szResource, szFileName);
91 LoadString(Globals.hInstance, STRING_ERROR, szResource, SIZEOF(szResource));
93 /* Display Modal Dialog */
94 MessageBox(Globals.hMainWnd, szMessage, szResource, MB_ICONEXCLAMATION);
97 static int AlertFileNotSaved(LPCWSTR szFileName)
99 WCHAR szMessage[MAX_STRING_LEN];
100 WCHAR szResource[MAX_STRING_LEN];
101 WCHAR szUntitled[MAX_STRING_LEN];
103 LoadString(Globals.hInstance, STRING_UNTITLED, szUntitled, SIZEOF(szUntitled));
105 /* Load and format Message */
106 LoadString(Globals.hInstance, STRING_NOTSAVED, szResource, SIZEOF(szResource));
107 wsprintf(szMessage, szResource, szFileName[0] ? szFileName : szUntitled);
110 LoadString(Globals.hInstance, STRING_NOTEPAD, szResource, SIZEOF(szResource));
113 return MessageBox(Globals.hMainWnd, szMessage, szResource, MB_ICONEXCLAMATION|MB_YESNOCANCEL);
118 * TRUE - if file exists
119 * FALSE - if file does not exist
121 BOOL FileExists(LPCWSTR szFilename)
123 WIN32_FIND_DATA entry;
126 hFile = FindFirstFile(szFilename, &entry);
129 return (hFile != INVALID_HANDLE_VALUE);
133 static VOID DoSaveFile(VOID)
140 hFile = CreateFile(Globals.szFileName, GENERIC_WRITE, FILE_SHARE_WRITE,
141 NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
142 if(hFile == INVALID_HANDLE_VALUE)
148 size = GetWindowTextLengthA(Globals.hEdit) + 1;
149 pTemp = HeapAlloc(GetProcessHeap(), 0, size);
156 size = GetWindowTextA(Globals.hEdit, pTemp, size);
158 if (!WriteFile(hFile, pTemp, size, &dwNumWrite, NULL))
161 SendMessage(Globals.hEdit, EM_SETMODIFY, FALSE, 0);
165 HeapFree(GetProcessHeap(), 0, pTemp);
170 * TRUE - User agreed to close (both save/don't save)
171 * FALSE - User cancelled close by selecting "Cancel"
173 BOOL DoCloseFile(void)
176 static const WCHAR empty_strW[] = { 0 };
178 if (SendMessage(Globals.hEdit, EM_GETMODIFY, 0, 0))
180 /* prompt user to save changes */
181 nResult = AlertFileNotSaved(Globals.szFileName);
183 case IDYES: DIALOG_FileSave();
188 case IDCANCEL: return(FALSE);
191 default: return(FALSE);
196 SetFileName(empty_strW);
198 UpdateWindowCaption();
203 void DoOpenFile(LPCWSTR szFileName)
205 static const WCHAR dotlog[] = { '.','L','O','G',0 };
212 /* Close any files and prompt to save changes */
216 hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
217 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
218 if(hFile == INVALID_HANDLE_VALUE)
224 size = GetFileSize(hFile, NULL);
225 if (size == INVALID_FILE_SIZE)
233 pTemp = HeapAlloc(GetProcessHeap(), 0, size);
241 if (!ReadFile(hFile, pTemp, size, &dwNumRead, NULL))
244 HeapFree(GetProcessHeap(), 0, pTemp);
250 pTemp[dwNumRead] = 0;
252 if (IsTextUnicode(pTemp, dwNumRead, NULL))
254 LPWSTR p = (LPWSTR)pTemp;
255 /* We need to strip BOM Unicode character, SetWindowTextW won't do it for us. */
256 if (*p == 0xFEFF || *p == 0xFFFE) p++;
257 SetWindowTextW(Globals.hEdit, p);
260 SetWindowTextA(Globals.hEdit, pTemp);
262 HeapFree(GetProcessHeap(), 0, pTemp);
264 SendMessage(Globals.hEdit, EM_SETMODIFY, FALSE, 0);
265 SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
266 SetFocus(Globals.hEdit);
268 /* If the file starts with .LOG, add a time/date at the end and set cursor after
269 * See http://support.microsoft.com/?kbid=260563
271 if (GetWindowTextW(Globals.hEdit, log, sizeof(log)/sizeof(log[0])) && !lstrcmp(log, dotlog))
273 static const WCHAR lfW[] = { '\r','\n',0 };
274 SendMessage(Globals.hEdit, EM_SETSEL, GetWindowTextLength(Globals.hEdit), -1);
275 SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
276 DIALOG_EditTimeDate();
277 SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)lfW);
280 SetFileName(szFileName);
281 UpdateWindowCaption();
284 VOID DIALOG_FileNew(VOID)
286 static const WCHAR empty_strW[] = { 0 };
288 /* Close any files and promt to save changes */
290 SetWindowText(Globals.hEdit, empty_strW);
291 SendMessage(Globals.hEdit, EM_EMPTYUNDOBUFFER, 0, 0);
292 SetFocus(Globals.hEdit);
296 VOID DIALOG_FileOpen(VOID)
298 OPENFILENAME openfilename;
299 WCHAR szPath[MAX_PATH];
300 WCHAR szDir[MAX_PATH];
301 static const WCHAR szDefaultExt[] = { 't','x','t',0 };
302 static const WCHAR txt_files[] = { '*','.','t','x','t',0 };
304 ZeroMemory(&openfilename, sizeof(openfilename));
306 GetCurrentDirectory(SIZEOF(szDir), szDir);
307 lstrcpy(szPath, txt_files);
309 openfilename.lStructSize = sizeof(openfilename);
310 openfilename.hwndOwner = Globals.hMainWnd;
311 openfilename.hInstance = Globals.hInstance;
312 openfilename.lpstrFilter = Globals.szFilter;
313 openfilename.lpstrFile = szPath;
314 openfilename.nMaxFile = SIZEOF(szPath);
315 openfilename.lpstrInitialDir = szDir;
316 openfilename.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST |
318 openfilename.lpstrDefExt = szDefaultExt;
321 if (GetOpenFileName(&openfilename)) {
322 if (FileExists(openfilename.lpstrFile))
323 DoOpenFile(openfilename.lpstrFile);
325 AlertFileNotFound(openfilename.lpstrFile);
330 VOID DIALOG_FileSave(VOID)
332 if (Globals.szFileName[0] == '\0')
338 VOID DIALOG_FileSaveAs(VOID)
341 WCHAR szPath[MAX_PATH];
342 WCHAR szDir[MAX_PATH];
343 static const WCHAR szDefaultExt[] = { 't','x','t',0 };
344 static const WCHAR txt_files[] = { '*','.','t','x','t',0 };
346 ZeroMemory(&saveas, sizeof(saveas));
348 GetCurrentDirectory(SIZEOF(szDir), szDir);
349 lstrcpy(szPath, txt_files);
351 saveas.lStructSize = sizeof(OPENFILENAME);
352 saveas.hwndOwner = Globals.hMainWnd;
353 saveas.hInstance = Globals.hInstance;
354 saveas.lpstrFilter = Globals.szFilter;
355 saveas.lpstrFile = szPath;
356 saveas.nMaxFile = SIZEOF(szPath);
357 saveas.lpstrInitialDir = szDir;
358 saveas.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT |
360 saveas.lpstrDefExt = szDefaultExt;
362 if (GetSaveFileName(&saveas)) {
364 UpdateWindowCaption();
369 VOID DIALOG_FilePrint(VOID)
374 int cWidthPels, cHeightPels, border;
375 int xLeft, yTop, pagecount, dopage, copycount;
378 HFONT font, old_font=0;
381 WCHAR cTemp[PRINT_LEN_MAX];
382 static const WCHAR print_fontW[] = { 'C','o','u','r','i','e','r',0 };
383 static const WCHAR letterM[] = { 'M',0 };
385 /* Get a small font and print some header info on each page */
386 hdrFont.lfHeight = -35;
388 hdrFont.lfEscapement = 0;
389 hdrFont.lfOrientation = 0;
390 hdrFont.lfWeight = FW_BOLD;
391 hdrFont.lfItalic = 0;
392 hdrFont.lfUnderline = 0;
393 hdrFont.lfStrikeOut = 0;
394 hdrFont.lfCharSet = ANSI_CHARSET;
395 hdrFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
396 hdrFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
397 hdrFont.lfQuality = PROOF_QUALITY;
398 hdrFont.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN;
399 lstrcpy(hdrFont.lfFaceName, print_fontW);
401 font = CreateFontIndirect(&hdrFont);
403 /* Get Current Settings */
404 ZeroMemory(&printer, sizeof(printer));
405 printer.lStructSize = sizeof(printer);
406 printer.hwndOwner = Globals.hMainWnd;
407 printer.hDevMode = Globals.hDevMode;
408 printer.hDevNames = Globals.hDevNames;
409 printer.hInstance = Globals.hInstance;
411 /* Set some default flags */
412 printer.Flags = PD_RETURNDC | PD_NOSELECTION;
413 printer.nFromPage = 0;
414 printer.nMinPage = 1;
415 /* we really need to calculate number of pages to set nMaxPage and nToPage */
417 printer.nMaxPage = -1;
418 /* Let commdlg manage copy settings */
419 printer.nCopies = (WORD)PD_USEDEVMODECOPIES;
421 if (!PrintDlg(&printer)) return;
423 Globals.hDevMode = printer.hDevMode;
424 Globals.hDevNames = printer.hDevNames;
426 assert(printer.hDC != 0);
428 /* initialize DOCINFO */
429 di.cbSize = sizeof(DOCINFO);
430 di.lpszDocName = Globals.szFileTitle;
431 di.lpszOutput = NULL;
432 di.lpszDatatype = NULL;
435 if (StartDoc(printer.hDC, &di) <= 0) return;
437 /* Get the page dimensions in pixels. */
438 cWidthPels = GetDeviceCaps(printer.hDC, HORZRES);
439 cHeightPels = GetDeviceCaps(printer.hDC, VERTRES);
441 /* Get the file text */
442 size = GetWindowTextLength(Globals.hEdit) + 1;
443 pTemp = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
449 size = GetWindowText(Globals.hEdit, pTemp, size);
452 old_font = SelectObject(printer.hDC, Globals.hFont);
453 GetTextExtentPoint32(printer.hDC, letterM, 1, &szMetric);
454 for (copycount=1; copycount <= printer.nCopies; copycount++) {
458 if (printer.Flags & PD_PAGENUMS) {
459 /* a specific range of pages is selected, so
460 * skip pages that are not to be printed
462 if (pagecount > printer.nToPage)
464 else if (pagecount >= printer.nFromPage)
473 if (StartPage(printer.hDC) <= 0) {
474 static const WCHAR failedW[] = { 'S','t','a','r','t','P','a','g','e',' ','f','a','i','l','e','d',0 };
475 static const WCHAR errorW[] = { 'P','r','i','n','t',' ','E','r','r','o','r',0 };
476 MessageBox(Globals.hMainWnd, failedW, errorW, MB_ICONEXCLAMATION);
479 /* Write a rectangle and header at the top of each page */
480 SelectObject(printer.hDC, font);
481 Rectangle(printer.hDC, border, border, cWidthPels-border, border+szMetric.cy*2);
482 TextOut(printer.hDC, border*2, border+szMetric.cy/2, Globals.szFileTitle, lstrlen(Globals.szFileTitle));
485 SelectObject(printer.hDC, Globals.hFont);
486 /* The starting point for the main text */
488 yTop = border+szMetric.cy*4;
492 /* find the end of the line */
493 while (i < size && pTemp[i] != '\n' && pTemp[i] != '\r') {
494 if (pTemp[i] == '\t') {
495 /* replace tabs with spaces */
496 for (m=0; m<SPACES_IN_TAB; m++) {
497 if (k < PRINT_LEN_MAX)
501 else if (k < PRINT_LEN_MAX)
502 cTemp[k++] = pTemp[i];
506 TextOut(printer.hDC, xLeft, yTop, cTemp, k);
507 /* find the next line */
508 while (i < size && (pTemp[i] == '\n' || pTemp[i] == '\r')) {
509 if (pTemp[i] == '\n')
513 } while (i<size && yTop<(cHeightPels-border*2));
516 EndPage(printer.hDC);
520 SelectObject(printer.hDC, old_font);
523 DeleteDC(printer.hDC);
524 HeapFree(GetProcessHeap(), 0, pTemp);
527 VOID DIALOG_FilePrinterSetup(VOID)
531 ZeroMemory(&printer, sizeof(printer));
532 printer.lStructSize = sizeof(printer);
533 printer.hwndOwner = Globals.hMainWnd;
534 printer.hDevMode = Globals.hDevMode;
535 printer.hDevNames = Globals.hDevNames;
536 printer.hInstance = Globals.hInstance;
537 printer.Flags = PD_PRINTSETUP;
542 Globals.hDevMode = printer.hDevMode;
543 Globals.hDevNames = printer.hDevNames;
546 VOID DIALOG_FileExit(VOID)
548 PostMessage(Globals.hMainWnd, WM_CLOSE, 0, 0l);
551 VOID DIALOG_EditUndo(VOID)
553 SendMessage(Globals.hEdit, EM_UNDO, 0, 0);
556 VOID DIALOG_EditCut(VOID)
558 SendMessage(Globals.hEdit, WM_CUT, 0, 0);
561 VOID DIALOG_EditCopy(VOID)
563 SendMessage(Globals.hEdit, WM_COPY, 0, 0);
566 VOID DIALOG_EditPaste(VOID)
568 SendMessage(Globals.hEdit, WM_PASTE, 0, 0);
571 VOID DIALOG_EditDelete(VOID)
573 SendMessage(Globals.hEdit, WM_CLEAR, 0, 0);
576 VOID DIALOG_EditSelectAll(VOID)
578 SendMessage(Globals.hEdit, EM_SETSEL, 0, (LPARAM)-1);
581 VOID DIALOG_EditTimeDate(VOID)
584 WCHAR szDate[MAX_STRING_LEN];
585 static const WCHAR spaceW[] = { ' ',0 };
589 GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, szDate, MAX_STRING_LEN);
590 SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szDate);
592 SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)spaceW);
594 GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &st, NULL, szDate, MAX_STRING_LEN);
595 SendMessage(Globals.hEdit, EM_REPLACESEL, TRUE, (LPARAM)szDate);
598 VOID DIALOG_EditWrap(VOID)
600 static const WCHAR editW[] = { 'e','d','i','t',0 };
601 DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
602 ES_AUTOVSCROLL | ES_MULTILINE;
607 size = GetWindowTextLength(Globals.hEdit) + 1;
608 pTemp = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
614 GetWindowText(Globals.hEdit, pTemp, size);
615 DestroyWindow(Globals.hEdit);
616 GetClientRect(Globals.hMainWnd, &rc);
617 if( Globals.bWrapLongLines ) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
618 Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL, dwStyle,
619 0, 0, rc.right, rc.bottom, Globals.hMainWnd,
620 NULL, Globals.hInstance, NULL);
621 SendMessage(Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)FALSE);
622 SetWindowTextW(Globals.hEdit, pTemp);
623 SetFocus(Globals.hEdit);
624 HeapFree(GetProcessHeap(), 0, pTemp);
626 Globals.bWrapLongLines = !Globals.bWrapLongLines;
627 CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP,
628 MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
631 VOID DIALOG_SelectFont(VOID)
634 LOGFONT lf=Globals.lfFont;
636 ZeroMemory( &cf, sizeof(cf) );
637 cf.lStructSize=sizeof(cf);
638 cf.hwndOwner=Globals.hMainWnd;
640 cf.Flags=CF_SCREENFONTS | CF_INITTOLOGFONTSTRUCT;
642 if( ChooseFont(&cf) )
644 HFONT currfont=Globals.hFont;
646 Globals.hFont=CreateFontIndirect( &lf );
648 SendMessage( Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)TRUE );
650 DeleteObject( currfont );
654 VOID DIALOG_Search(VOID)
656 ZeroMemory(&Globals.find, sizeof(Globals.find));
657 Globals.find.lStructSize = sizeof(Globals.find);
658 Globals.find.hwndOwner = Globals.hMainWnd;
659 Globals.find.hInstance = Globals.hInstance;
660 Globals.find.lpstrFindWhat = Globals.szFindText;
661 Globals.find.wFindWhatLen = SIZEOF(Globals.szFindText);
662 Globals.find.Flags = FR_DOWN;
664 /* We only need to create the modal FindReplace dialog which will */
665 /* notify us of incoming events using hMainWnd Window Messages */
667 Globals.hFindReplaceDlg = FindText(&Globals.find);
668 assert(Globals.hFindReplaceDlg !=0);
671 VOID DIALOG_SearchNext(VOID)
673 /* FIXME: Search Next */
677 VOID DIALOG_HelpContents(VOID)
679 WinHelp(Globals.hMainWnd, helpfileW, HELP_INDEX, 0);
682 VOID DIALOG_HelpSearch(VOID)
687 VOID DIALOG_HelpHelp(VOID)
689 WinHelp(Globals.hMainWnd, helpfileW, HELP_HELPONHELP, 0);
692 VOID DIALOG_HelpLicense(VOID)
694 TCHAR cap[20], text[1024];
695 LoadString(Globals.hInstance, IDS_LICENSE, text, 1024);
696 LoadString(Globals.hInstance, IDS_LICENSE_CAPTION, cap, 20);
697 MessageBox(Globals.hMainWnd, text, cap, MB_ICONINFORMATION | MB_OK);
700 VOID DIALOG_HelpNoWarranty(VOID)
702 TCHAR cap[20], text[1024];
703 LoadString(Globals.hInstance, IDS_WARRANTY, text, 1024);
704 LoadString(Globals.hInstance, IDS_WARRANTY_CAPTION, cap, 20);
705 MessageBox(Globals.hMainWnd, text, cap, MB_ICONEXCLAMATION | MB_OK);
708 VOID DIALOG_HelpAboutWine(VOID)
710 static const WCHAR notepadW[] = { 'N','o','t','e','p','a','d','\n',0 };
711 WCHAR szNotepad[MAX_STRING_LEN];
713 LoadString(Globals.hInstance, STRING_NOTEPAD, szNotepad, SIZEOF(szNotepad));
714 ShellAbout(Globals.hMainWnd, szNotepad, notepadW, 0);
718 /***********************************************************************
720 * DIALOG_FilePageSetup
722 VOID DIALOG_FilePageSetup(void)
724 DialogBox(Globals.hInstance, MAKEINTRESOURCE(DIALOG_PAGESETUP),
725 Globals.hMainWnd, DIALOG_PAGESETUP_DlgProc);
729 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
731 * DIALOG_PAGESETUP_DlgProc
734 static INT_PTR WINAPI DIALOG_PAGESETUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
743 /* save user input and close dialog */
744 GetDlgItemText(hDlg, 0x141, Globals.szHeader, SIZEOF(Globals.szHeader));
745 GetDlgItemText(hDlg, 0x143, Globals.szFooter, SIZEOF(Globals.szFooter));
746 GetDlgItemText(hDlg, 0x14A, Globals.szMarginTop, SIZEOF(Globals.szMarginTop));
747 GetDlgItemText(hDlg, 0x150, Globals.szMarginBottom, SIZEOF(Globals.szMarginBottom));
748 GetDlgItemText(hDlg, 0x147, Globals.szMarginLeft, SIZEOF(Globals.szMarginLeft));
749 GetDlgItemText(hDlg, 0x14D, Globals.szMarginRight, SIZEOF(Globals.szMarginRight));
750 EndDialog(hDlg, IDOK);
754 /* discard user input and close dialog */
755 EndDialog(hDlg, IDCANCEL);
760 /* FIXME: Bring this to work */
761 static const WCHAR sorryW[] = { 'S','o','r','r','y',',',' ','n','o',' ','h','e','l','p',' ','a','v','a','i','l','a','b','l','e',0 };
762 static const WCHAR helpW[] = { 'H','e','l','p',0 };
763 MessageBox(Globals.hMainWnd, sorryW, helpW, MB_ICONEXCLAMATION);
773 /* fetch last user input prior to display dialog */
774 SetDlgItemText(hDlg, 0x141, Globals.szHeader);
775 SetDlgItemText(hDlg, 0x143, Globals.szFooter);
776 SetDlgItemText(hDlg, 0x14A, Globals.szMarginTop);
777 SetDlgItemText(hDlg, 0x150, Globals.szMarginBottom);
778 SetDlgItemText(hDlg, 0x147, Globals.szMarginLeft);
779 SetDlgItemText(hDlg, 0x14D, Globals.szMarginRight);