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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 static LRESULT WINAPI
DIALOG_PAGESETUP_DlgProc(HWND hDlg
, UINT msg
, WPARAM wParam
, LPARAM lParam
);
39 DWORD error
= GetLastError();
40 if (error
!= NO_ERROR
)
43 CHAR szTitle
[MAX_STRING_LEN
];
45 LoadString(Globals
.hInstance
, STRING_ERROR
, szTitle
, sizeof(szTitle
));
47 FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
,
49 (LPTSTR
) &lpMsgBuf
, 0, NULL
);
50 MessageBox(NULL
, (char*)lpMsgBuf
, szTitle
, MB_OK
| MB_ICONERROR
);
56 * Sets the caption of the main window according to Globals.szFileTitle:
57 * Notepad - (untitled) if no file is open
58 * Notepad - [filename] if a file is given
60 void UpdateWindowCaption(void) {
61 CHAR szCaption
[MAX_STRING_LEN
];
62 CHAR szUntitled
[MAX_STRING_LEN
];
64 LoadString(Globals
.hInstance
, STRING_NOTEPAD
, szCaption
, sizeof(szCaption
));
66 if (Globals
.szFileTitle
[0] != '\0') {
67 lstrcat(szCaption
, " - [");
68 lstrcat(szCaption
, Globals
.szFileTitle
);
69 lstrcat(szCaption
, "]");
73 LoadString(Globals
.hInstance
, STRING_UNTITLED
, szUntitled
, sizeof(szUntitled
));
74 lstrcat(szCaption
, " - ");
75 lstrcat(szCaption
, szUntitled
);
78 SetWindowText(Globals
.hMainWnd
, szCaption
);
82 int AlertIDS(UINT ids_message
, UINT ids_caption
, WORD type
) {
84 * Given some ids strings, this acts as a language-aware wrapper for
87 CHAR szMessage
[MAX_STRING_LEN
];
88 CHAR szCaption
[MAX_STRING_LEN
];
90 LoadString(Globals
.hInstance
, ids_message
, szMessage
, sizeof(szMessage
));
91 LoadString(Globals
.hInstance
, ids_caption
, szCaption
, sizeof(szCaption
));
93 return (MessageBox(Globals
.hMainWnd
, szMessage
, szCaption
, type
));
96 void AlertFileNotFound(LPSTR szFileName
) {
99 CHAR szMessage
[MAX_STRING_LEN
];
100 CHAR szRessource
[MAX_STRING_LEN
];
102 /* Load and format szMessage */
103 LoadString(Globals
.hInstance
, STRING_NOTFOUND
, szRessource
, sizeof(szRessource
));
104 wsprintf(szMessage
, szRessource
, szFileName
);
107 LoadString(Globals
.hInstance
, STRING_ERROR
, szRessource
, sizeof(szRessource
));
109 /* Display Modal Dialog */
110 nResult
= MessageBox(Globals
.hMainWnd
, szMessage
, szRessource
, MB_ICONEXCLAMATION
);
114 int AlertFileNotSaved(LPSTR szFileName
) {
117 CHAR szMessage
[MAX_STRING_LEN
];
118 CHAR szRessource
[MAX_STRING_LEN
];
120 /* Load and format Message */
122 LoadString(Globals
.hInstance
, STRING_NOTSAVED
, szRessource
, sizeof(szRessource
));
123 wsprintf(szMessage
, szRessource
, szFileName
);
127 LoadString(Globals
.hInstance
, STRING_ERROR
, szRessource
, sizeof(szRessource
));
130 nResult
= MessageBox(Globals
.hMainWnd
, szMessage
, szRessource
, MB_ICONEXCLAMATION
|MB_YESNOCANCEL
);
135 VOID
AlertOutOfMemory(void) {
138 nResult
= AlertIDS(STRING_OUT_OF_MEMORY
, STRING_ERROR
, MB_ICONEXCLAMATION
);
145 * TRUE - if file exists
146 * FALSE - if file does not exist
148 BOOL
FileExists(LPSTR szFilename
) {
149 WIN32_FIND_DATA entry
;
152 hFile
= FindFirstFile(szFilename
, &entry
);
155 return (hFile
!= INVALID_HANDLE_VALUE
);
159 VOID
DoSaveFile(VOID
) {
166 hFile
= CreateFile(Globals
.szFileName
, GENERIC_WRITE
, FILE_SHARE_WRITE
,
167 NULL
, OPEN_ALWAYS
, FILE_ATTRIBUTE_NORMAL
, NULL
);
168 if(hFile
== INVALID_HANDLE_VALUE
)
174 size
= GetWindowTextLength(Globals
.hEdit
);
175 pTemp
= (LPSTR
) GlobalAlloc(GMEM_FIXED
, size
);
181 GetWindowText(Globals
.hEdit
, pTemp
, size
);
183 bTest
= WriteFile(hFile
, pTemp
, size
, &dwNumWrite
, NULL
);
194 * TRUE - User agreed to close (both save/don't save)
195 * FALSE - User cancelled close by selecting "Cancel"
197 BOOL
DoCloseFile(void) {
200 if (Globals
.szFileName
[0] != 0) {
201 /* prompt user to save changes */
202 nResult
= AlertFileNotSaved(Globals
.szFileName
);
204 case IDYES
: DIALOG_FileSave();
209 case IDCANCEL
: return(FALSE
);
212 default: return(FALSE
);
219 UpdateWindowCaption();
224 void DoOpenFile(LPSTR szFileName
) {
225 /* Close any files and prompt to save changes */
233 hFile
= CreateFile(szFileName
, GENERIC_READ
, FILE_SHARE_READ
, NULL
,
234 OPEN_EXISTING
, FILE_ATTRIBUTE_NORMAL
, NULL
);
235 if(hFile
== INVALID_HANDLE_VALUE
)
241 size
= GetFileSize(hFile
, NULL
);
242 if (size
== 0xFFFFFFFF)
248 pTemp
= (LPSTR
) GlobalAlloc(GMEM_FIXED
, size
);
254 if (!ReadFile(hFile
, pTemp
, size
, &dwNumRead
, NULL
))
260 pTemp
[dwNumRead
] = '\0';
261 if (!SetWindowText(Globals
.hEdit
, pTemp
))
267 SendMessage(Globals
.hEdit
, EM_EMPTYUNDOBUFFER
, 0, 0);
269 SetFocus(Globals
.hEdit
);
271 SetFileName(szFileName
);
272 UpdateWindowCaption();
276 VOID
DIALOG_FileNew(VOID
)
278 /* Close any files and promt to save changes */
280 SetWindowText(Globals
.hEdit
, "");
281 SendMessage(Globals
.hEdit
, EM_EMPTYUNDOBUFFER
, 0, 0);
282 SetFocus(Globals
.hEdit
);
286 VOID
DIALOG_FileOpen(VOID
)
288 OPENFILENAME openfilename
;
290 CHAR szPath
[MAX_PATH
];
291 CHAR szDir
[MAX_PATH
];
292 CHAR szDefaultExt
[] = "txt";
294 ZeroMemory(&openfilename
, sizeof(openfilename
));
296 GetCurrentDirectory(sizeof(szDir
), szDir
);
297 lstrcpy(szPath
,"*.txt");
299 openfilename
.lStructSize
= sizeof(openfilename
);
300 openfilename
.hwndOwner
= Globals
.hMainWnd
;
301 openfilename
.hInstance
= Globals
.hInstance
;
302 openfilename
.lpstrFilter
= Globals
.szFilter
;
303 openfilename
.lpstrFile
= szPath
;
304 openfilename
.nMaxFile
= sizeof(szPath
);
305 openfilename
.lpstrInitialDir
= szDir
;
306 openfilename
.Flags
= OFN_FILEMUSTEXIST
| OFN_PATHMUSTEXIST
|
308 openfilename
.lpstrDefExt
= szDefaultExt
;
311 if (GetOpenFileName(&openfilename
)) {
312 if (FileExists(openfilename
.lpstrFile
))
313 DoOpenFile(openfilename
.lpstrFile
);
315 AlertFileNotFound(openfilename
.lpstrFile
);
320 VOID
DIALOG_FileSave(VOID
)
322 if (Globals
.szFileName
[0] == '\0')
328 VOID
DIALOG_FileSaveAs(VOID
)
331 CHAR szPath
[MAX_PATH
];
332 CHAR szDir
[MAX_PATH
];
333 CHAR szDefaultExt
[] = "txt";
335 ZeroMemory(&saveas
, sizeof(saveas
));
337 GetCurrentDirectory(sizeof(szDir
), szDir
);
338 lstrcpy(szPath
,"*.*");
340 saveas
.lStructSize
= sizeof(OPENFILENAME
);
341 saveas
.hwndOwner
= Globals
.hMainWnd
;
342 saveas
.hInstance
= Globals
.hInstance
;
343 saveas
.lpstrFilter
= Globals
.szFilter
;
344 saveas
.lpstrFile
= szPath
;
345 saveas
.nMaxFile
= sizeof(szPath
);
346 saveas
.lpstrInitialDir
= szDir
;
347 saveas
.Flags
= OFN_PATHMUSTEXIST
| OFN_OVERWRITEPROMPT
|
349 saveas
.lpstrDefExt
= szDefaultExt
;
351 if (GetSaveFileName(&saveas
)) {
353 UpdateWindowCaption();
358 VOID
DIALOG_FilePrint(VOID
)
365 char *pDevNamesSpace
;
366 LPDEVNAMES lpDevNames
;
368 int cWidthPels
, cHeightPels
, border
;
369 int xLeft
, yTop
, count
, i
, pagecount
, dopage
, copycount
;
371 HFONT font
, old_font
=0;
375 CHAR szDocumentName
[MAX_STRING_LEN
]; /* Name of document */
376 CHAR szPrinterName
[MAX_STRING_LEN
]; /* Name of the printer */
377 CHAR szDeviceName
[MAX_STRING_LEN
]; /* Name of the printer device */
378 CHAR szOutput
[MAX_STRING_LEN
]; /* in which file/device to print */
380 strcpy(szDocumentName
, Globals
.szFileTitle
);
381 count
= strlen(szDocumentName
);
383 /* Get a small font and print some header info on each page */
384 hdrFont
.lfHeight
= 100;
386 hdrFont
.lfEscapement
= 0;
387 hdrFont
.lfOrientation
= 0;
388 hdrFont
.lfWeight
= FW_BOLD
;
389 hdrFont
.lfItalic
= 0;
390 hdrFont
.lfUnderline
= 0;
391 hdrFont
.lfStrikeOut
= 0;
392 hdrFont
.lfCharSet
= ANSI_CHARSET
;
393 hdrFont
.lfOutPrecision
= OUT_DEFAULT_PRECIS
;
394 hdrFont
.lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
395 hdrFont
.lfQuality
= PROOF_QUALITY
;
396 hdrFont
.lfPitchAndFamily
= VARIABLE_PITCH
| FF_ROMAN
;
397 strcpy(hdrFont
.lfFaceName
, "Times New Roman");
399 font
= CreateFontIndirect(&hdrFont
);
401 /* Get Current Settings */
402 ZeroMemory(&printer
, sizeof(printer
));
403 printer
.lStructSize
= sizeof(printer
);
404 printer
.hwndOwner
= Globals
.hMainWnd
;
405 printer
.hInstance
= Globals
.hInstance
;
407 /* Set some default flags */
408 bFlags
= PD_RETURNDC
+ PD_SHOWHELP
;
410 /* Remove "Print Selection" if there is no selection */
411 bFlags
= bFlags
+ PD_NOSELECTION
;
413 printer
.Flags
= bFlags
;
414 printer
.nFromPage
= 1;
415 printer
.nMinPage
= 1;
416 /* we really need to calculate number of pages to set nMaxPage and nToPage */
417 printer
.nToPage
= 20;
418 printer
.nMaxPage
= 20;
420 /* Let commdlg manage copy settings */
421 printer
.nCopies
= (WORD
)PD_USEDEVMODECOPIES
;
423 nResult
= PrintDlg(&printer
);
424 if (printer
.hDevNames
==0)
427 MessageBox(Globals
.hMainWnd
, "PrintDlg failed", "Print Error", MB_ICONEXCLAMATION
);
430 hContext
= printer
.hDC
;
432 pDevNamesSpace
= GlobalLock(printer
.hDevNames
);
433 lpDevNames
= (LPDEVNAMES
) pDevNamesSpace
;
434 lstrcpy(szPrinterName
, pDevNamesSpace
+lpDevNames
->wDriverOffset
);
435 lstrcpy(szDeviceName
, pDevNamesSpace
+lpDevNames
->wDeviceOffset
);
436 lstrcpy(szOutput
, pDevNamesSpace
+lpDevNames
->wOutputOffset
);
437 GlobalUnlock(printer
.hDevNames
);
439 MessageBox(Globals.hMainWnd, szPrinterName, "Printer Name", MB_ICONEXCLAMATION);
440 MessageBox(Globals.hMainWnd, szDeviceName, "Device Name", MB_ICONEXCLAMATION);
441 MessageBox(Globals.hMainWnd, szOutput, "Output", MB_ICONEXCLAMATION);
443 /* initialize DOCINFO */
444 di
.cbSize
= sizeof(DOCINFO
);
445 di
.lpszDocName
= szDocumentName
;
446 di
.lpszOutput
= szOutput
;
447 di
.lpszDatatype
= (LPTSTR
) NULL
;
450 /* The default resolution is pixels, ie MM_TEXT */
451 /* SetMapMode(hContext, MM_TWIPS);*/
452 /* SetViewPortExExt(hContext, 10, 10, 0);*/
453 /* SetBkMode(hContext, OPAQUE);*/
455 /* Get the page dimensions in pixels. */
456 cWidthPels
= GetDeviceCaps(hContext
, HORZRES
);
457 cHeightPels
= GetDeviceCaps(hContext
, VERTRES
);
459 /* Get the file text */
460 size
= GetWindowTextLength(Globals
.hEdit
);
461 pTemp
= (LPSTR
) GlobalAlloc(GMEM_FIXED
, size
);
467 GetWindowText(Globals
.hEdit
, pTemp
, size
);
474 /* Okay, let's print */
475 nResult
= StartDoc(hContext
, &di
);
477 MessageBox(Globals
.hMainWnd
, "StartDoc failed", "Print Error", MB_ICONEXCLAMATION
);
482 for (copycount
=1; copycount
<= printer
.nCopies
; copycount
++) {
486 if (pagecount
>= printer
.nFromPage
&&
487 /* ((printer.Flags & PD_PAGENUMS) == 0 || pagecount <= printer.nToPage))*/
488 pagecount
<= printer
.nToPage
)
493 old_font
= SelectObject(hContext
, font
);
494 GetTextExtentPoint32(hContext
, "M", 1, &szMetric
);
497 nResult
= StartPage(hContext
);
499 MessageBox(Globals
.hMainWnd
, "StartPage failed", "Print Error", MB_ICONEXCLAMATION
);
502 /* Write a rectangle and header at the top of each page */
503 Rectangle(hContext
, border
, border
, cWidthPels
-border
, border
+szMetric
.cy
*2);
504 /* I don't know what's up with this TextOut command. This comes out
507 TextOut(hContext
, border
*2, border
+szMetric
.cy
/2, szDocumentName
, count
);
510 /* The starting point for the main text */
512 yTop
= border
+szMetric
.cy
*4;
514 SelectObject(hContext
, old_font
);
515 GetTextExtentPoint32(hContext
, "M", 1, &szMetric
);
517 /* Since outputting strings is giving me problems, output the main
518 text one character at a time.
521 if (pTemp
[i
] == '\n') {
525 else if (pTemp
[i
] != '\r') {
527 TextOut(hContext
, xLeft
, yTop
, &pTemp
[i
], 1);
528 xLeft
+= szMetric
.cx
;
530 } while (i
++<size
&& yTop
<(cHeightPels
-border
*2));
540 MessageBox(Globals
.hMainWnd
, "Generic Error", "Print Engine Error", MB_ICONEXCLAMATION
);
543 MessageBox(Globals
.hMainWnd
, "The print job was aborted.", "Print Engine Error", MB_ICONEXCLAMATION
);
546 MessageBox(Globals
.hMainWnd
, "The print job was aborted using the Print Manager ", "Print Engine Error", MB_ICONEXCLAMATION
);
549 MessageBox(Globals
.hMainWnd
, "Out of disk space", "Print Engine Error", MB_ICONEXCLAMATION
);
557 nResult
= EndDoc(hContext
);
559 nResult
= DeleteDC(hContext
);
563 VOID
DIALOG_FilePageSetup(VOID
)
568 VOID
DIALOG_FilePrinterSetup(VOID
)
572 ZeroMemory(&printer
, sizeof(printer
));
573 printer
.lStructSize
= sizeof(printer
);
574 printer
.hwndOwner
= Globals
.hMainWnd
;
575 printer
.hInstance
= Globals
.hInstance
;
576 printer
.Flags
= PD_PRINTSETUP
;
579 if (PrintDlg(&printer
)) {
584 VOID
DIALOG_FileExit(VOID
)
586 PostMessage(Globals
.hMainWnd
, WM_CLOSE
, 0, 0l);
589 VOID
DIALOG_EditUndo(VOID
)
591 SendMessage(Globals
.hEdit
, EM_UNDO
, 0, 0);
594 VOID
DIALOG_EditCut(VOID
)
598 hMem
= GlobalAlloc(GMEM_ZEROINIT
, 99);
600 OpenClipboard(Globals
.hMainWnd
);
603 /* FIXME: Get text */
604 lstrcpy((CHAR
*)hMem
, "Hello World");
606 SetClipboardData(CF_TEXT
, hMem
);
612 VOID
DIALOG_EditCopy(VOID
)
616 hMem
= GlobalAlloc(GMEM_ZEROINIT
, 99);
618 OpenClipboard(Globals
.hMainWnd
);
621 /* FIXME: Get text */
622 lstrcpy((CHAR
*)hMem
, "Hello World");
624 SetClipboardData(CF_TEXT
, hMem
);
630 VOID
DIALOG_EditPaste(VOID
)
634 if (IsClipboardFormatAvailable(CF_TEXT
)) {
635 OpenClipboard(Globals
.hMainWnd
);
636 hClipText
= GetClipboardData(CF_TEXT
);
638 MessageBox(Globals
.hMainWnd
, (CHAR
*)hClipText
, "PASTE", MB_ICONEXCLAMATION
);
642 VOID
DIALOG_EditDelete(VOID
)
647 VOID
DIALOG_EditSelectAll(VOID
)
653 VOID
DIALOG_EditTimeDate(VOID
)
656 LPSYSTEMTIME lpst
= &st
;
657 CHAR szDate
[MAX_STRING_LEN
];
661 GetDateFormat(LOCALE_USER_DEFAULT
, LOCALE_SLONGDATE
, lpst
, NULL
, date
, MAX_STRING_LEN
);
662 GetTimeFormat(LOCALE_USER_DEFAULT
, LOCALE_STIMEFORMAT
, lpst
, NULL
, date
, MAX_STRING_LEN
);
665 VOID
DIALOG_EditWrap(VOID
)
667 Globals
.bWrapLongLines
= !Globals
.bWrapLongLines
;
668 CheckMenuItem(GetMenu(Globals
.hMainWnd
), CMD_WRAP
,
669 MF_BYCOMMAND
| (Globals
.bWrapLongLines
? MF_CHECKED
: MF_UNCHECKED
));
672 VOID
DIALOG_SelectFont(VOID
)
675 LOGFONT lf
=Globals
.lfFont
;
677 ZeroMemory( &cf
, sizeof(cf
) );
678 cf
.lStructSize
=sizeof(cf
);
679 cf
.hwndOwner
=Globals
.hMainWnd
;
681 cf
.Flags
=CF_SCREENFONTS
;
683 if( ChooseFont(&cf
) )
685 HFONT currfont
=Globals
.hFont
;
687 Globals
.hFont
=CreateFontIndirect( &lf
);
689 SendMessage( Globals
.hEdit
, WM_SETFONT
, (WPARAM
)Globals
.hFont
, (LPARAM
)TRUE
);
691 DeleteObject( currfont
);
695 VOID
DIALOG_Search(VOID
)
697 ZeroMemory(&Globals
.find
, sizeof(Globals
.find
));
698 Globals
.find
.lStructSize
= sizeof(Globals
.find
);
699 Globals
.find
.hwndOwner
= Globals
.hMainWnd
;
700 Globals
.find
.hInstance
= Globals
.hInstance
;
701 Globals
.find
.lpstrFindWhat
= (CHAR
*) &Globals
.szFindText
;
702 Globals
.find
.wFindWhatLen
= sizeof(Globals
.szFindText
);
703 Globals
.find
.Flags
= FR_DOWN
;
705 /* We only need to create the modal FindReplace dialog which will */
706 /* notify us of incoming events using hMainWnd Window Messages */
708 Globals
.hFindReplaceDlg
= FindText(&Globals
.find
);
709 assert(Globals
.hFindReplaceDlg
!=0);
712 VOID
DIALOG_SearchNext(VOID
)
717 VOID
DIALOG_HelpContents(VOID
)
719 WinHelp(Globals
.hMainWnd
, HELPFILE
, HELP_INDEX
, 0);
722 VOID
DIALOG_HelpSearch(VOID
)
727 VOID
DIALOG_HelpHelp(VOID
)
729 WinHelp(Globals
.hMainWnd
, HELPFILE
, HELP_HELPONHELP
, 0);
732 VOID
DIALOG_HelpLicense(VOID
)
734 WineLicense(Globals
.hMainWnd
);
737 VOID
DIALOG_HelpNoWarranty(VOID
)
739 WineWarranty(Globals
.hMainWnd
);
742 VOID
DIALOG_HelpAboutWine(VOID
)
744 CHAR szNotepad
[MAX_STRING_LEN
];
746 LoadString(Globals
.hInstance
, STRING_NOTEPAD
, szNotepad
, sizeof(szNotepad
));
747 ShellAbout(Globals
.hMainWnd
, szNotepad
, "Notepad\n" WINE_RELEASE_INFO
, 0);
751 /***********************************************************************
756 VOID
DIALOG_PageSetup(VOID
)
760 lpfnDlg
= MakeProcInstance(DIALOG_PAGESETUP_DlgProc
, Globals
.hInstance
);
761 DialogBox(Globals
.hInstance
, MAKEINTRESOURCE(DIALOG_PAGESETUP
),
762 Globals
.hMainWnd
, (DLGPROC
)lpfnDlg
);
763 FreeProcInstance(lpfnDlg
);
767 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
769 * DIALOG_PAGESETUP_DlgProc
772 static LRESULT WINAPI
DIALOG_PAGESETUP_DlgProc(HWND hDlg
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
781 /* save user input and close dialog */
782 GetDlgItemText(hDlg
, 0x141, Globals
.szHeader
, sizeof(Globals
.szHeader
));
783 GetDlgItemText(hDlg
, 0x143, Globals
.szFooter
, sizeof(Globals
.szFooter
));
784 GetDlgItemText(hDlg
, 0x14A, Globals
.szMarginTop
, sizeof(Globals
.szMarginTop
));
785 GetDlgItemText(hDlg
, 0x150, Globals
.szMarginBottom
, sizeof(Globals
.szMarginBottom
));
786 GetDlgItemText(hDlg
, 0x147, Globals
.szMarginLeft
, sizeof(Globals
.szMarginLeft
));
787 GetDlgItemText(hDlg
, 0x14D, Globals
.szMarginRight
, sizeof(Globals
.szMarginRight
));
788 EndDialog(hDlg
, IDOK
);
792 /* discard user input and close dialog */
793 EndDialog(hDlg
, IDCANCEL
);
797 /* FIXME: Bring this to work */
798 MessageBox(Globals
.hMainWnd
, "Sorry, no help available", "Help", MB_ICONEXCLAMATION
);
804 /* fetch last user input prior to display dialog */
805 SetDlgItemText(hDlg
, 0x141, Globals
.szHeader
);
806 SetDlgItemText(hDlg
, 0x143, Globals
.szFooter
);
807 SetDlgItemText(hDlg
, 0x14A, Globals
.szMarginTop
);
808 SetDlgItemText(hDlg
, 0x150, Globals
.szMarginBottom
);
809 SetDlgItemText(hDlg
, 0x147, Globals
.szMarginLeft
);
810 SetDlgItemText(hDlg
, 0x14D, Globals
.szMarginRight
);