|
|
1.1.1.3 ! 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: 1.1 root 12: 13: /*--------------------------------------------------------------------------*/ 1.1.1.3 ! root 14: /* Typedefs and Structures */ 1.1 root 15: /*--------------------------------------------------------------------------*/ 16: 17: /* Don't change without updating GETTIME.ASM. */ 18: typedef struct tagTIME 19: { 20: INT hour; /* 0 - 11 hours for analog clock */ 21: INT hour12; /* 12 hour format */ 22: INT hour24; /* 24 hour format */ 23: INT minute; 24: INT second; 25: INT ampm; /* 0 - AM , 1 - PM */ 26: } TIME; 27: 28: typedef struct 29: { 30: SHORT sin; 31: SHORT cos; 32: } TRIG; 33: 1.1.1.3 ! root 34: TRIG CirTab[] = { // circle sin, cos, table ! 35: { 0, -7999 }, ! 36: { 836, -7956 }, ! 37: { 1663, -7825 }, ! 38: { 2472, -7608 }, ! 39: { 3253, -7308 }, ! 40: { 3999, -6928 }, ! 41: { 4702, -6472 }, ! 42: { 5353, -5945 }, ! 43: { 5945, -5353 }, ! 44: { 6472, -4702 }, ! 45: { 6928, -4000 }, ! 46: { 7308, -3253 }, ! 47: { 7608, -2472 }, ! 48: { 7825, -1663 }, ! 49: { 7956, -836 }, ! 50: ! 51: { 8000, 0 }, ! 52: { 7956, 836 }, ! 53: { 7825, 1663 }, ! 54: { 7608, 2472 }, ! 55: { 7308, 3253 }, ! 56: { 6928, 4000 }, ! 57: { 6472, 4702 }, ! 58: { 5945, 5353 }, ! 59: { 5353, 5945 }, ! 60: { 4702, 6472 }, ! 61: { 3999, 6928 }, ! 62: { 3253, 7308 }, ! 63: { 2472, 7608 }, ! 64: { 1663, 7825 }, ! 65: { 836, 7956 }, ! 66: ! 67: { 0, 7999 }, ! 68: { -836, 7956 }, ! 69: { -1663, 7825 }, ! 70: { -2472, 7608 }, ! 71: { -3253, 7308 }, ! 72: { -4000, 6928 }, ! 73: { -4702, 6472 }, ! 74: { -5353, 5945 }, ! 75: { -5945, 5353 }, ! 76: { -6472, 4702 }, ! 77: { -6928, 3999 }, ! 78: { -7308, 3253 }, ! 79: { -7608, 2472 }, ! 80: { -7825, 1663 }, ! 81: { -7956, 836 }, ! 82: ! 83: { -7999, -0 }, ! 84: { -7956, -836 }, ! 85: { -7825, -1663 }, ! 86: { -7608, -2472 }, ! 87: { -7308, -3253 }, ! 88: { -6928, -4000 }, ! 89: { -6472, -4702 }, ! 90: { -5945, -5353 }, ! 91: { -5353, -5945 }, ! 92: { -4702, -6472 }, ! 93: { -3999, -6928 }, ! 94: { -3253, -7308 }, ! 95: { -2472, -7608 }, ! 96: { -1663, -7825 }, ! 97: { -836 , -7956 } ! 98: }; ! 99: 1.1 root 100: typedef struct tagCLOCKDISPSTRUCT 101: { 102: /* Clock display format for main window/icon outut */ 103: /* either IDM_ANALOG, or IDM_DIGITAL */ 104: WORD wFormat; 105: 1.1.1.3 ! root 106: /* Various boolean settings for the clock style ! 107: * and current settings */ ! 108: BOOL bMinimized; ! 109: BOOL bMaximized; ! 110: BOOL bTopMost; ! 111: BOOL bNoTitle; ! 112: BOOL bTmpHide; ! 113: BOOL bIconic; ! 114: BOOL bColor; ! 115: BOOL bNewFont; ! 116: 1.1 root 117: /* X and Y offset within client area of window 118: * or icon where digital clock will be displayed */ 119: POINT line1; 120: 121: /* Y offset within icon area to second line where 122: * minute will be displayed */ 123: INT yline2; 124: 125: /* length of the digital clock readout string, 126: * required by the text out function. 127: * if the time format is 24 hour, this value is 128: * set so that the AM/PM indicator is not output */ 129: WORD wDigTimeLen; 130: 131: /* buffer to store digital time in. the hour/minute/ampm 132: * sections of this buffer are only modified if they 133: * change from the previous call. */ 134: CHAR szDigTime[20]; 135: 136: /* buffer to hold the win.ini international indicators 137: * for 1159, and 2359 AM/PM 12 hour time format. 138: * szAMPM[0] holds AM, szAMPM[1] holds PM indicator */ 139: CHAR szAMPM[2][7]; 140: 141: /* intl time format (like DOS) 0 - 12 hour, 1 - 24 hour */ 142: WORD wTimeFormat; 143: 144: /* intl time seperator character */ 145: CHAR cTimeSep; 146: } CLOCKDISPSTRUCT; 147: 148: 149: /*--------------------------------------------------------------------------*/ 1.1.1.3 ! root 150: /* Function Templates */ 1.1 root 151: /*--------------------------------------------------------------------------*/ 152: 153: void NEAR GetTime(TIME *); 154: void NEAR ConvTime(TIME *); 155: 156: LONG APIENTRY ClockWndProc(HWND, UINT, WPARAM, LONG); 157: 158: 159: /*--------------------------------------------------------------------------*/ 1.1.1.3 ! root 160: /* Constants */ 1.1 root 161: /*--------------------------------------------------------------------------*/ 162: 1.1.1.2 root 163: #define IDD_ABOUT 400 164: 1.1 root 165: /* Main Menu ID defines */ 166: 1.1.1.3 ! root 167: #define IDM_ANALOG 1 ! 168: #define IDM_DIGITAL 2 ! 169: #define IDM_ABOUT 4 ! 170: //-------------- ! 171: #define IDM_TOPMOST 5 ! 172: #define IDM_NOTITLE 6 ! 173: //-------------- ! 174: 1.1 root 175: 176: /* Temp ID for dialogs. */ 177: #define ID_JUNK 0xCACC 178: 179: /* String Resource definitions */ 180: 1.1.1.3 ! root 181: #define IDS_APPNAME 1 ! 182: #define IDS_DATA 2 1.1 root 183: #define IDS_TOOMANY 3 184: #define IDS_FONTFILE 4 185: 1.1.1.3 ! root 186: #define IDS_INTL 16 ! 187: #define IDS_ITIME 18 ! 188: #define IDS_S1159 19 ! 189: #define IDS_S2359 20 ! 190: #define IDS_STIME 22 ! 191: #define IDS_CLKFORMAT 23 ! 192: ! 193: #define IDS_1159 24 ! 194: #define IDS_2359 25 ! 195: #define IDS_TIMESEP 27 1.1 root 196: #define IDS_USNAME 29 197: #define IDS_INIFILE 30 1.1.1.3 ! root 198: //-------------- ! 199: #define IDS_TOPMOST 31 ! 200: //-------------- 1.1 root 201: 202: #define HOURSCALE 65 203: #define MINUTESCALE 80 204: #define HHAND TRUE 205: #define MHAND FALSE 206: #define SECONDSCALE 80 207: #define MAXBLOBWIDTH 25 208: #define BUFLEN 30 209: #define REPAINT 0 210: #define HANDPAINT 1 211: 1.1.1.3 ! root 212: #define UPDATE 0 ! 213: #define REDRAW 1 1.1 root 214: 1.1.1.3 ! root 215: #define OPEN_TLEN 450 ! 216: #define ICON_TLEN 45000 1.1 root 217: 218: #define CLKSCALE ((INT)8000)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.