|
|
1.1 ! root 1: /*********************************************************************/ ! 2: /* Windows/PM Cardfile Shared Code */ ! 3: /* */ ! 4: /* (c) Copyright Microsoft Corp. 1987,1988 - All Rights Reserved */ ! 5: /*********************************************************************/ ! 6: ! 7: /*********************************************************************/ ! 8: /* The following shared code was developed from the original */ ! 9: /* Cardfile application. This code can be compiled to run under */ ! 10: /* either the Windows or the PM manager environment. All */ ! 11: /* functionality associated with bitmaps or printing has been */ ! 12: /* deleted. Some comments refering to these functions may still be */ ! 13: /* present in the code and should be disregarded. jw. */ ! 14: /*********************************************************************/ ! 15: ! 16: ! 17: /* Include proper .h file depending on which version compiling under */ ! 18: ! 19: #ifdef IN_WINDOWS ! 20: /* turn off some stuff Cardfile never uses */ ! 21: #define NOSOUND ! 22: #define NOCREATESTRUCT ! 23: #define NOMETAFILE ! 24: #define NOPEN ! 25: #define NORGN ! 26: #define NOWH ! 27: #define NOKANJI ! 28: #include "winbind.h" ! 29: #else ! 30: #include "pmbind.h" ! 31: #endif ! 32: ! 33: /* This is a useful define for converting a char to a LPSTR (used for */ ! 34: /* UpperChar calls */ ! 35: #define CHAR_STR( x ) ((LPSTR)((DWORD)((BYTE)*x))) ! 36: ! 37: #define FAR_TO_NEAR( x ) ((PSTR)((WORD)((DWORD)x))) ! 38: ! 39: /* these are the ID's for the commands in the menu */ ! 40: ! 41: /* File menu */ ! 42: #define IDSM_FILE 100 ! 43: #define IDM_NEW 101 ! 44: #define IDM_OPEN 102 ! 45: #define IDM_SAVE 103 ! 46: #define IDM_SAVEAS 104 ! 47: #define IDM_MERGE 105 ! 48: /* Edit menu */ ! 49: #define IDSM_EDIT 120 ! 50: #define IDM_HEADER 122 ! 51: #define IDM_CUT 123 ! 52: #define IDM_COPY 124 ! 53: #define IDM_PASTE 125 ! 54: #define IDM_RESTORE 126 ! 55: ! 56: /* View menu */ ! 57: #define IDSM_VIEW 140 ! 58: #define IDM_CARDFILE 141 ! 59: #define IDM_PHONEBOOK 142 ! 60: /* Card menu */ ! 61: #define IDSM_CARD 160 ! 62: #define IDM_ADD 161 ! 63: #define IDM_DELETE 162 ! 64: #define IDM_DUPLICATE 163 ! 65: /* Search menu */ ! 66: #define IDSM_SEARCH 180 ! 67: #define IDM_GOTO 181 ! 68: #define IDM_FIND 182 ! 69: #define IDM_FINDNEXT 183 ! 70: ! 71: #define IDM_ABOUT 8887 ! 72: ! 73: #define IDM_EDITWINDOW 200 /* this isn't really a command, but */ ! 74: /* the id is used in a WM_COMMAND */ ! 75: /* message */ ! 76: ! 77: /* id's for controls in dialog boxes */ ! 78: #define IDD_PATH 10 ! 79: #define IDD_EDIT 11 ! 80: #define IDD_LISTBOX 12 ! 81: #define IDD_TONE 13 ! 82: #define IDD_PULSE 14 ! 83: #define IDD_COM1 15 ! 84: #define IDD_COM2 16 ! 85: #define IDD_1200 17 ! 86: #define IDD_300 18 ! 87: ! 88: /* id's for strings */ ! 89: /* prompts */ ! 90: #define IDS_DELCURCARD 0 ! 91: #define IDS_CREATEFILE 1 ! 92: #define IDS_OKTOSAVE 2 ! 93: #define IDS_ABOUT 3 ! 94: #define IDS_CARDS 4 ! 95: #define IDS_CARD 5 ! 96: #define IDS_UNTITLED 6 ! 97: #define IDS_CARDDATA 7 ! 98: #define IDS_PICKUPPHONE 8 ! 99: #define IDS_CARDFILE 9 ! 100: #define IDS_STRINGINSERT 10 ! 101: /* errors */ ! 102: #define IDS_ECANTPRINTPICT 17 ! 103: #define IDS_EINSMEMORY 18 ! 104: #define IDS_EFILEEXISTS 19 ! 105: #define IDS_EINVALIDFILE 20 ! 106: #define IDS_ECLIPEMPTYTEXT 21 ! 107: #define IDS_ENOTEXTSEL 22 ! 108: #define IDS_EDISKFULLFILE 23 ! 109: #define IDS_ECANTMAKETEMP 24 ! 110: #define IDS_EINSMEMSAVE 25 ! 111: #define IDS_EDISKFULLSAVE 26 ! 112: #define IDS_EOPENTEMPSAVE 27 ! 113: #define IDS_ECANTREADPICT 28 ! 114: #define IDS_EINSMEMRUN 29 ! 115: #define IDS_ENOTVALIDFILE 30 ! 116: #define IDS_ECANTFIND 31 ! 117: #define IDS_EINSMEMREAD 32 ! 118: #define IDS_ECANTPRINT 33 ! 119: #define IDS_ECLIPEMPTYPICT 34 ! 120: #define IDS_ENOMODEM 35 ! 121: #define IDS_ENOPICTURES 36 ! 122: #define IDS_ECANTMAKEFILE 37 ! 123: #define IDS_EMEMPRINT 38 ! 124: #define IDS_EDISKPRINT 39 ! 125: #define IDS_NOBITMAP 40 ! 126: ! 127: ! 128: /* dialog boxes */ ! 129: #define DTOPEN 1 ! 130: #define DTSAVE 2 ! 131: #define DTHEADER 3 ! 132: #define DTADD 5 ! 133: #define DTMERGE 6 ! 134: #define DTGOTO 7 ! 135: #define DTFIND 8 ! 136: #define DTABOUT 9 ! 137: ! 138: /* resource names */ ! 139: #define CFMENU 1 ! 140: #define CFICON 1 ! 141: #define CFACCEL 1 ! 142: ! 143: /* Flags for MyOpen */ ! 144: #define READ 0 ! 145: #define WRITE 1 ! 146: #define READ_WRITE 2 ! 147: ! 148: /* card definitions */ ! 149: #define LINELENGTH 40 /* 40 characters per line */ ! 150: #define CARDLINES 11 /* 11 lines per card */ ! 151: #define CARDTEXTSIZE ((LINELENGTH+1) * CARDLINES) /* characters per card */ ! 152: ! 153: /* brush colors on a color screen */ ! 154: #define RGBRED 0x0000ff ! 155: #define RGBBLUE 0xff0000 ! 156: ! 157: /* flags for a card header */ ! 158: #define FNEW 0x01 /* new card, not in file yet */ ! 159: #define FDIRTY 0x02 /* card has changed from file */ ! 160: #define FTMPFILE 0x04 /* it's data is in the tmpfile */ ! 161: ! 162: /* margins on card */ ! 163: #define LEFTMARGIN 8 ! 164: #define RIGHTMARGIN 8 ! 165: #define BOTTOMMARGIN 8 ! 166: ! 167: #define PATHMAX 128 /* maximum # of character in filename */ ! 168: ! 169: #define ATTRDIRLIST 0x4010 /* used by open dialog box */ ! 170: ! 171: /* Cardfile's two main data structures */ ! 172: /* the first is the header. Each card in a file has a header associated */ ! 173: /* with it. All headers are resident in memory while a file is in use */ ! 174: /* the header has information about the header line on the card, and */ ! 175: /* where the rest of the card's information can be found */ ! 176: typedef struct ! 177: { ! 178: char reserved[6]; /* bytes available for future use */ ! 179: unsigned long lfData; /* file offset of data */ ! 180: unsigned char flags; /* flags */ ! 181: char line[LINELENGTH+1]; /* 40 character lines plus null */ ! 182: }CARDHEADER; ! 183: typedef CARDHEADER *PCARDHEADER; ! 184: typedef CARDHEADER far *LPCARDHEADER; ! 185: ! 186: /* the second is for the card currently viewed. It contains information */ ! 187: /* about the card's bitmap (if any), and the card's main body of text */ ! 188: typedef struct ! 189: { ! 190: int cxBitmap; /* width of the bitmap */ ! 191: int cyBitmap; /* height of the bitmap */ ! 192: int xBitmap; /* left location of bitmap */ ! 193: int yBitmap; /* top location of bitmap */ ! 194: unsigned bmSize; /* count of bytes in the bitmap */ ! 195: HANDLE hBitmap; /* handle to bitmap, NULL if none */ ! 196: HANDLE hText; /* handle to the text block */ ! 197: }CARD; ! 198: typedef CARD *PCARD; ! 199: ! 200: #include "declare.h" ! 201:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.