--- mstools/samples/ntfonts/ntfonts.h 2018/08/09 18:20:59 1.1.1.1 +++ mstools/samples/ntfonts/ntfonts.h 2018/08/09 18:22:13 1.1.1.2 @@ -1,32 +1,51 @@ /* ntf.h - header file */ -#define STRICT - /* function prototypes, window procedures first. */ -LRESULT MainWndProc (HWND, UINT, WPARAM, LPARAM); -LRESULT ToolBarWndProc (HWND, UINT, WPARAM, LPARAM); -LRESULT AllFontsWndProc(HWND, UINT, WPARAM, LPARAM); -LRESULT LogFontWndProc (HWND, UINT, WPARAM, LPARAM); -LRESULT DemoWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK ToolBarWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK AllFontsWndProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK LogFontWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK FontDataWndProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK DisplayWndProc (HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM); + + /* the initialization routines for the different modules. */ int initDlg(HWND); -int initDemo(HWND); +int initDisplay(HWND); int initTB(HWND); int initAllFont(HWND); /* misc. routine to show data flow to the user. */ VOID flyWinWin(HWND, HWND, HWND, int); + +HDC GetPrinterDC (VOID); + /* the height of the toolbar in pels. */ -#define TOOLBARHEIGHT 50 +#define TOOLBARHEIGHT 30 /* for the initial positioning of the three child windows. */ #define CHILDLEFT(x) (GetSystemMetrics (SM_CXFULLSCREEN) * x/3 + 5) #define CHILDTOP TOOLBARHEIGHT*6/5 +/* the default size of some of the dialogs. */ +#define DLGWIDTH 110 +#define DLGHEIGHT 160 + + + +/* menu IDs */ +#define IDM_CASCADE 1001 +#define IDM_TILE 1002 +#define IDM_ARRANGE 1003 +#define IDM_HELP 2001 +#define IDM_ABOUT 2002 +#define IDM_FLYWINWIN 2000 +#define IDM_GRID 2001 /* dialog IDs from the LOGFONT dialog. */ @@ -46,31 +65,96 @@ VOID flyWinWin(HWND, HWND, HWND, int); #define DIDPITCHA 213 #define DIDFACENA 214 - /* dialog ID from the TEXTMETRIC dialog. */ #define DID_LISTBOX 500 +/* dialog ID from the FontData dialog. */ +#define DID_DWTABLE 200 +#define DID_DWOFFSET 201 +#define DID_CBDATA 203 +#define DID_DOIT 300 + + + /* button window IDs from toolbar. */ #define TBID_ENUM 57 #define TBID_CREATE 58 #define TBID_GETTM 59 #define TBID_PRINT 60 -#define TBID_CHKALLGLYPHS 70 -#define TBID_CHKMAPPERFLAGS 71 +#define TBID_GETFONTDATA 61 +#define IDM_PRINT 70 + /* USER messages used between windows. */ -#define WMU_LFTODEMO WM_USER+1 -#define WMU_DEMOTOLF WM_USER+2 -#define WMU_DEMOTOTM WM_USER+3 +#define WMU_LFTODEMO WM_USER+0x1001 +#define WMU_DEMOTOLF WM_USER+0x1002 +#define WMU_DEMOTOTM WM_USER+0x1003 +#define WMU_DEMOTOOLTM WM_USER+0x1004 +#define WMU_DEMOGETDC WM_USER+0x1005 +#define WMU_DEMORELEASEDC WM_USER+0x1006 +#define WMU_GETFONTDATA WM_USER+0x1007 +#define WMU_PREPAREALLGLYPHS WM_USER+0x1008 + + +#define WMU_NEWFONT WM_USER+0x1100 +#define WMU_NEWMODEHELLO WM_USER+0x1101 +#define WMU_NEWMODETMRANGE WM_USER+0x1102 +#define WMU_NEWMODEALL WM_USER+0x1103 +#define WMU_NEWMODE_NEWSEG WM_USER+0x1104 +#define WMU_PRINT WM_USER+0x1110 + +/* user defined create messsage, sent to window once CreateWindow() returns */ +#define WMU_CREATE WM_USER+0x1000 + + + + +/* define strings and flags for use in warning message boxes */ +#define MBGETFONTDATAERR TEXT("Not a scalable font.") +#define MBERROR TEXT("Application Error.") +#define MBERRORFLAGS MB_OK | MB_ICONHAND + + /* Global variables. */ HANDLE hInst; -HWND hwndMain, hwndTB, hwndDlgLF, hwndDlgTM, hwndDemo; +HWND hwndMain, hwndDisplay; +HWND hwndTB, hwndDlgLF, hwndDlgTM, hwndDlgOLTM, hwndDlgFD; HWND hwndDisplayFonts, hwndPrinterFonts; +HWND hwndClient; + +/* the display window works in one of 3 modes + * this is shown to the user by a check mark in the 'Display' menu + * it is stored internally in the following variable + * (contains the checked menu ID) + */ +int gDisplaymode; +#define IDM_MODEHELLO 101 +#define IDM_MODETMRANGE 102 +#define IDM_MODEALL 103 + + + + + +// right out of the help files... generic string function macros + +#ifdef UNICODE + +#define CharStrCmp wcscmp +#define CharStrnCmp wcsncmp +#define CharStrCpy wcscpy +#define CharStrLen wcslen + +#else + +#define CharStrCmp strcmp +#define CharStrnCmp strncmp +#define CharStrCpy strcpy +#define CharStrLen strlen -/* reflect the state of the two check boxes. */ -BOOL allglyphsGlobal, mapperflagsGlobal; +#endif