|
|
Microsoft Windows NT Build 328 10-12-1992
#include <windows.h>
#include <commdlg.h>
#include <string.h>
#include <stdlib.h>
#ifdef RC_INVOKED
#define ID(id) id
#else
#define ID(id) MAKEINTRESOURCE(id)
#endif
#undef EDIT_FIXED
// resource ID's
#define IDPortTool ID(1)
#define IDBkPort ID(2)
#define IDA_PORTTOOL 1
// edit control child window ID
#define IDC_EDIT 1000
// max string lengths
#define MAXSEARCHSTRING 80
#define MAXPTRDEFINITION 200
#define MAXPTRDEVICE 50
#define MAXPTRDRIVER 50
#define MAXPTRPORT 50
// extra byte window word and long definitions
#define WL_HWNDEDIT 0
#define WW_SCROLL 4
#define WW_UNTITLED 6
#define WW_SEARCHCASE 8
#define WW_SEARCHDN 10
#define WL_HPTRDEVNAMES 12
#define CBWNDEXTRA 16
// menuitem IDs, file submenu
#define IDM_FILENEW 1001
#define IDM_FILEOPEN 1002
#define IDM_FILESAVE 1003
#define IDM_FILESAVEAS 1004
#define IDM_FILEPRINT 1005
#define IDM_FILESETUP 1006
#define IDM_FILEEXIT 1007
#define IDM_FILEABOUT 1008
// edit submenu
#define IDM_EDITUNDO 2000
#define IDM_EDITCUT WM_CUT
#define IDM_EDITCOPY WM_COPY
#define IDM_EDITPASTE WM_PASTE
#define IDM_EDITCLEAR WM_CLEAR
#define IDM_EDITSELECT 2001
#define IDM_EDITWRAP 2002
#define IDM_EDITSCROLL 2003
#define IDM_EDITFONT 2004
// search submenu
#define IDM_SEARCHFIND 3001
#define IDM_SEARCHNEXT 3002
#define IDM_SEARCHPREV 3003
// port submenu
#define IDM_PORTCURFILE 4000
#define IDM_PORTBKGND 4001
#define IDM_FUNCTION1 5000
#define IDM_FUNCTION2 5001
#define IDM_FUNCTION3 5002
#define IDM_FUNCTION4 5003
#define IDM_FUNCTION5 5004
// dialog & control IDs
// about dialog
#define IDD_ABOUT ID(300)
// cancel print dialog
#define IDD_CANCELDLG ID(400)
#define IDC_PRINTDEVICE 401
#define IDC_PRINTPORT 402
#define IDC_PRINTTITLE 403
// port options dialog
#define IDD_OPTIONSDLG ID(500)
#define IDC_NOAPIS 501
#define IDC_NOMESSAGES 502
#define IDC_NOSTRUCTURES 503
#define IDC_NOMACROS 504
#define IDC_NOCONSTANTS 505
#define IDC_NOTYPES 506
#define IDC_NOCUSTOM 507
#define IDC_IGNORECASE 508
#define IDC_CURTOKEN 509
#define IDC_IGNORETOKEN 510
// port current file dialog
#define IDD_PORTDIALOG ID(600)
#define IDC_SEARCHFOUND 601
#define IDC_ISSUECNT 602
#define IDC_LINENO 603
#define IDC_LINE 604
#define IDC_ISSUE 605
#define IDC_CONTINUE 606
#define IDC_SUGGESTION 608
#define IDC_SUGGESTLABEL 609
#define IDC_OPTIONS 610
#define IDC_DONE 611
#define IDC_HELP 612
#define IDC_RESTART 613
// background port status dialog
#define IDD_BKPORTDIALOG ID(700)
#define IDC_BKNOAPIS 702
#define IDC_BKNOMESSAGES 703
#define IDC_BKNOSTRUCTURES 704
#define IDC_BKNOMACROS 705
#define IDC_BKNOCONSTANTS 706
#define IDC_BKNOTYPES 707
#define IDC_BKNOCUSTOM 708
#define IDC_BKIGNORECASE 709
#define IDC_CHANGEOPTIONS 710
#define IDC_ADDFILE 711
#define IDC_COMPLETE 712
#define IDC_LINES 713
#define IDC_ISSUES 714
#define IDC_ABORTFILE 715
#define IDC_FILEPATH 716
#define IDC_FILELIST 717
#define IDC_BKDONE 718
// file I/O error stringtable entries
#define IDS_OPENFAILED -1
#define IDS_NOSIZE -2
#define IDS_READFAILED -3
#define IDS_REALLOCFAILED -4
#define IDS_EDITWNDFAILED -5
#define IDS_GETHANDLEFAILED -6
#define IDS_WRITEOPENFAILED -7
#define IDS_WRITEFAILED -8
#define IDS_PTRCOMMDLGFAILED -9
#define IDS_PRINTABORTED -10
#define IDS_STARTDOCFAILED -11
#define IDS_SETABORTPROCFAILED -12
#define IDS_CANCELDLGFAILED -13
#define IDS_PTRCONFIGFAILED -14
#define IDS_NOFILETOPORT -15
#define IDS_PORTINITFAILED -16
#define IDS_MEMORYFAILED -17
#define IDS_FONTFAILEDTOCREATE -18
#define IDS_LOADPORTFAILED -19
#define IDS_PROCADDRESSFAILED -20
#define IDS_UNTITLED 1
#define IDS_APPNAME 2
#define IDS_PRINTJOB 3
#define IDS_PRINTERROR 4
#define IDS_DATACHANGED 5
#define IDS_DEFAULTFILEEXT 6
#define IDS_SAVEASTITLE 7
#define IDS_FILEOPENTITLE 8
#define IDS_STRINGNOTFOUND 9
#define IDS_SEARCHDLGFAILED 10
#define IDS_WINDOWSAPPNAME 11
#define IDS_DEVICENAME 12
#define IDS_PORTFILE 13
#define IDS_SEARCHING 14
#define IDS_FOUND 15
#define IDS_NOMOREPORTISSUES 16
#define IDS_INIFILE 17
#define IDS_WINHELP 18
#define IDS_NOTYETIMPLEMENTED 19
#define IDS_NOT 20
#define IDS_PORTDLLFILE 21
#define IDS_CHECKSTRING 22
#define IDS_BKPORTNEWLINE 23
#define IDS_BKPORTHEADER 24
#define IDS_BKPORTTOKEN 25
#define IDS_BKPORTISSUE 26
#define IDS_BKPORTSUGGEST 27
#define IDS_BKPORTHELP 28
#define IDS_BKPORTHELPFILE 29
#define IDS_BKPORTEOL 30
#define IDS_BKPORTABORT 31
#define IDS_BKPORTSTATUS 32
#define IDS_BKPORTCANCEL 33
#define IDS_BKPORTSTARTFAILED 34
#define IDS_CANTBUILDFILELIST 35
// define background porting handle array indexes
#define BKPORT_ABORT 0
#define BKPORT_STATUS 1
#define nBKPORTEVENTS 2
#define MAXBKTHREADS 20
// define structure used in background porting
typedef struct tagBkPortFile
{
char szFile[MAX_PATH];
char szFilePath[MAX_PATH];
DWORD dwPTFlags;
HANDLE hThread;
HWND hDlg;
}BKPORTFILESTRUCT, * LPBKPORTFILESTRUCT;
// linked list structure defines background files being ported
typedef struct _BKFILELIST
{
BKPORTFILESTRUCT bkFile;
HANDLE hEvents[nBKPORTEVENTS];
LPVOID Next;
}BKFILELIST, * LPBKFILELIST;
// function prototypes defined in PORTTOOL.C
#define UM_SAVEFILE WM_USER+1
VOID WINAPI ErrorNotify (HWND, int);
LONG WINAPI MainWndProc (HWND, UINT, UINT, LONG);
BOOL WINAPI AboutDlgProc (HWND, UINT, UINT, LONG);
// globals and function prototypes defined in PTFILE.C
extern char lpszFilePath[MAX_PATH];
BOOL WINAPI GetFileName(HWND, char *, char *);
BOOL WINAPI GetFileFromPath (char *, char *);
BOOL WINAPI GetIniFile (char *);
int WINAPI SaveFile (HWND, char *);
BOOL WINAPI SaveAsFileName (HWND, char *, char *);
int WINAPI LoadFile (HWND, char *);
// globals and function prototypes defined in PTFIND.C
extern char lpszSearch[MAXSEARCHSTRING+1];
extern HWND hDlgSearch;
BOOL WINAPI FindDialog (HWND, WORD, WORD, char *);
BOOL WINAPI LocateText (HWND, WORD, WORD, char *);
// globals and function prototypes defined in PTPRINT.C
#define UM_CANCELPRINT WM_USER+2
int WINAPI PrintFile (HWND);
int WINAPI PrinterSetup (HWND);
BOOL WINAPI GetPrinterConfig (HWND);
// globals and function prototypes defined in PTDLGS.C
BOOL WINAPI OptionsDlgProc (HWND, UINT, UINT, LONG);
BOOL WINAPI PortDlgProc (HWND, UINT, UINT, LONG);
BOOL WINAPI BkPortDlgProc (HWND, UINT, UINT, LONG);
// globals and function prototypes defined in PTBKPORT.C
#define UM_THREADCOMPLETE WM_USER+2
#define UM_STATUSUPDATE WM_USER+3
HANDLE WINAPI StartBkPortThread (LPBKPORTFILESTRUCT);
BOOL WINAPI CreateEvents (HANDLE *, LPBKPORTFILESTRUCT);
void WINAPI DestroyEvents (HANDLE *);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.