|
|
1.1 ! root 1: ! 2: /******************************************************************************\ ! 3: * This is a part of the Microsoft Source Code Samples. ! 4: * Copyright (C) 1993 Microsoft Corporation. ! 5: * All rights reserved. ! 6: * This source code is only intended as a supplement to ! 7: * Microsoft Development Tools and/or WinHelp documentation. ! 8: * See these sources for detailed information regarding the ! 9: * Microsoft samples programs. ! 10: \******************************************************************************/ ! 11: ! 12: /* ttfonts.h - header file ! 13: */ ! 14: ! 15: /* function prototypes, window procedures first. */ ! 16: LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM); ! 17: LRESULT CALLBACK ToolBarWndProc (HWND, UINT, WPARAM, LPARAM); ! 18: LRESULT CALLBACK AllFontsWndProc(HWND, UINT, WPARAM, LPARAM); ! 19: LRESULT CALLBACK LogFontWndProc (HWND, UINT, WPARAM, LPARAM); ! 20: LRESULT CALLBACK FontDataWndProc(HWND, UINT, WPARAM, LPARAM); ! 21: LRESULT CALLBACK DisplayWndProc (HWND, UINT, WPARAM, LPARAM); ! 22: LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM); ! 23: ! 24: ! 25: ! 26: /* the initialization routines for the different modules. */ ! 27: int initDlg(HWND); ! 28: int initDisplay(HWND); ! 29: int initTB(HWND); ! 30: int initAllFont(HWND); ! 31: ! 32: /* misc. routine to show data flow to the user. */ ! 33: VOID flyWinWin(HWND, HWND, HWND, int); ! 34: ! 35: ! 36: HDC GetPrinterDC (VOID); ! 37: ! 38: /* the height of the toolbar in pels. */ ! 39: #define TOOLBARHEIGHT 30 ! 40: ! 41: /* for the initial positioning of the three child windows. */ ! 42: #define CHILDLEFT(x) (GetSystemMetrics (SM_CXFULLSCREEN) * x/3 + 5) ! 43: #define CHILDTOP TOOLBARHEIGHT*6/5 ! 44: ! 45: /* the default size of some of the dialogs. */ ! 46: #define DLGWIDTH 110 ! 47: #define DLGHEIGHT 160 ! 48: ! 49: ! 50: ! 51: /* menu IDs */ ! 52: #define IDM_CASCADE 1001 ! 53: #define IDM_TILE 1002 ! 54: #define IDM_ARRANGE 1003 ! 55: #define IDM_HELP 2001 ! 56: #define IDM_ABOUT 2002 ! 57: ! 58: #define IDM_FLYWINWIN 2000 ! 59: #define IDM_GRID 2001 ! 60: ! 61: #define IDM_GETOBJECT 3000 ! 62: #define IDM_CHOOSEFONT 3001 ! 63: #define IDM_ANSI_FIXED_FONT 3002 ! 64: #define IDM_ANSI_VAR_FONT 3003 ! 65: #define IDM_DEVICE_DEFAULT_FONT 3004 ! 66: #define IDM_OEM_FIXED_FONT 3005 ! 67: #define IDM_SYSTEM_FIXED_FONT 3006 ! 68: #define IDM_SYSTEM_FONT 3007 ! 69: ! 70: ! 71: /* dialog IDs from the LOGFONT dialog. */ ! 72: #define DID_X 101 ! 73: #define DIDHEIGHT 201 ! 74: #define DIDWIDTH 202 ! 75: #define DIDESCAPE 203 ! 76: #define DIDORIENT 204 ! 77: #define DIDWEIGHT 205 ! 78: #define DIDITALIC 206 ! 79: #define DIDUNDERL 207 ! 80: #define DIDSTRIKE 208 ! 81: #define DIDCHARSE 209 ! 82: #define DIDOUTPRE 210 ! 83: #define DIDCLIPPR 211 ! 84: #define DIDQUALIT 212 ! 85: #define DIDPITCHA 213 ! 86: #define DIDFACENA 214 ! 87: ! 88: /* dialog ID from the TEXTMETRIC dialog. */ ! 89: #define DID_LISTBOX 500 ! 90: ! 91: /* dialog ID from the FontData dialog. */ ! 92: #define DID_DWTABLE 200 ! 93: #define DID_DWOFFSET 201 ! 94: #define DID_CBDATA 203 ! 95: #define DID_DOIT 300 ! 96: ! 97: ! 98: ! 99: ! 100: /* button window IDs from toolbar. */ ! 101: #define TBID_ENUM 57 ! 102: #define TBID_CREATE 58 ! 103: #define TBID_GETTM 59 ! 104: #define TBID_PRINT 60 ! 105: #define TBID_GETFONTDATA 61 ! 106: #define IDM_PRINT 70 ! 107: ! 108: ! 109: ! 110: ! 111: /* user defined wm_command to send to main window */ ! 112: #define IDU_NOPRINTER 71 ! 113: ! 114: ! 115: /* USER messages used between windows. */ ! 116: #define WMU_HFONTTODEMO WM_USER+0x1000 ! 117: #define WMU_LFTODEMO WM_USER+0x1001 ! 118: #define WMU_DEMOTOLF WM_USER+0x1002 ! 119: #define WMU_DEMOTOTM WM_USER+0x1003 ! 120: #define WMU_DEMOTOOLTM WM_USER+0x1004 ! 121: #define WMU_DEMOGETDC WM_USER+0x1005 ! 122: #define WMU_DEMORELEASEDC WM_USER+0x1006 ! 123: #define WMU_GETFONTDATA WM_USER+0x1007 ! 124: #define WMU_PREPAREALLGLYPHS WM_USER+0x1008 ! 125: ! 126: ! 127: #define WMU_NEWFONT WM_USER+0x1100 ! 128: #define WMU_NEWMODEHELLO WM_USER+0x1101 ! 129: #define WMU_NEWMODETMRANGE WM_USER+0x1102 ! 130: #define WMU_NEWMODEALL WM_USER+0x1103 ! 131: #define WMU_NEWMODE_NEWSEG WM_USER+0x1104 ! 132: #define WMU_PRINT WM_USER+0x1110 ! 133: ! 134: /* user defined create messsage, sent to window once CreateWindow() returns */ ! 135: #define WMU_CREATE WM_USER+0x1000 ! 136: ! 137: ! 138: ! 139: ! 140: /* define strings and flags for use in warning message boxes */ ! 141: #define MBGETFONTDATAERR TEXT("Not a scalable font.") ! 142: #define MBERROR TEXT("Application Error.") ! 143: #define MBERRORFLAGS MB_OK | MB_ICONHAND ! 144: ! 145: ! 146: ! 147: ! 148: ! 149: /* Global variables. */ ! 150: HANDLE hInst; ! 151: HWND hwndMain, hwndDisplay; ! 152: HWND hwndTB, hwndDlgLF, hwndDlgTM, hwndDlgOLTM, hwndDlgFD; ! 153: HWND hwndDisplayFonts, hwndPrinterFonts; ! 154: HWND hwndClient; ! 155: ! 156: /* the display window works in one of 3 modes ! 157: * this is shown to the user by a check mark in the 'Display' menu ! 158: * it is stored internally in the following variable ! 159: * (contains the checked menu ID) ! 160: */ ! 161: int gDisplaymode; ! 162: #define IDM_MODEHELLO 101 ! 163: #define IDM_MODETMRANGE 102 ! 164: #define IDM_MODEALL 103
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.