summaryrefslogtreecommitdiffstats
path: root/private/nw/convert/logview
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/nw/convert/logview
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/nw/convert/logview')
-rw-r--r--private/nw/convert/logview/fv300.icobin0 -> 766 bytes
-rw-r--r--private/nw/convert/logview/fvfile.c231
-rw-r--r--private/nw/convert/logview/fvfind.c193
-rw-r--r--private/nw/convert/logview/fvinit.c155
-rw-r--r--private/nw/convert/logview/fvopen.c131
-rw-r--r--private/nw/convert/logview/fvprint.c389
-rw-r--r--private/nw/convert/logview/logview.c767
-rw-r--r--private/nw/convert/logview/logview.dlg51
-rw-r--r--private/nw/convert/logview/logview.h214
-rw-r--r--private/nw/convert/logview/logview.rc111
-rw-r--r--private/nw/convert/logview/makefile6
-rw-r--r--private/nw/convert/logview/note300.icobin0 -> 766 bytes
-rw-r--r--private/nw/convert/logview/sources23
-rw-r--r--private/nw/convert/logview/version.h52
14 files changed, 2323 insertions, 0 deletions
diff --git a/private/nw/convert/logview/fv300.ico b/private/nw/convert/logview/fv300.ico
new file mode 100644
index 000000000..b68c9cb86
--- /dev/null
+++ b/private/nw/convert/logview/fv300.ico
Binary files differ
diff --git a/private/nw/convert/logview/fvfile.c b/private/nw/convert/logview/fvfile.c
new file mode 100644
index 000000000..466ec9c4c
--- /dev/null
+++ b/private/nw/convert/logview/fvfile.c
@@ -0,0 +1,231 @@
+/*
+ +-------------------------------------------------------------------------+
+ | MDI Text File Viewer - File IO Routines |
+ +-------------------------------------------------------------------------+
+ | (c) Copyright 1994 |
+ | Microsoft Corp. |
+ | All rights reserved |
+ | |
+ | Program : [mpfile.c] |
+ | Programmer : Arthur Hanson |
+ | Original Program Date : [Jul 27, 1993 |
+ | Last Update : [Jul 30, 1993] Time : 18:30 |
+ | |
+ | Version: 0.10 |
+ | |
+ | Description: |
+ | |
+ | History: |
+ | arth Jul 27, 1993 0.10 Original Version. |
+ | |
+ +-------------------------------------------------------------------------+
+*/
+
+#include "LogView.h"
+#include <fcntl.h>
+#include <SYS\types.h>
+#include <SYS\stat.h>
+#include <io.h>
+#include <string.h>
+
+VOID APIENTRY GetFileName(HWND hwnd, PSTR);
+
+OFSTRUCT of;
+
+
+/*+-------------------------------------------------------------------------+
+ | AlreadyOpen() |
+ | |
+ | Checks to see if a file is already opened. Returns a handle to |
+ | the file's window if it is opened, otherwise NULL. |
+ | |
+ +-------------------------------------------------------------------------+*/
+HWND AlreadyOpen(CHAR *szFile) {
+ INT iDiff;
+ HWND hwndCheck;
+ CHAR szChild[64];
+ LPSTR lpChild, lpFile;
+ HFILE wFileTemp;
+
+ // Open the file with the OF_PARSE flag to obtain the fully qualified
+ // pathname in the OFSTRUCT structure.
+ wFileTemp = OpenFile((LPSTR)szFile, (LPOFSTRUCT)&of, OF_PARSE);
+ if (! wFileTemp)
+ return(NULL);
+ _lclose(wFileTemp);
+
+ // Check each MDI child window in LogView
+ for ( hwndCheck = GetWindow(hwndMDIClient, GW_CHILD);
+ hwndCheck;
+ hwndCheck = GetWindow(hwndCheck, GW_HWNDNEXT) ) {
+ // Initialization for comparison
+ lpChild = szChild;
+ lpFile = (LPSTR)AnsiUpper((LPSTR) of.szPathName);
+ iDiff = 0;
+
+ // Skip icon title windows
+ if (GetWindow(hwndCheck, GW_OWNER))
+ continue;
+
+ // Get current child window's name
+ GetWindowText(hwndCheck, lpChild, 64);
+
+ // Compare window name with given name
+ while ((*lpChild) && (*lpFile) && (!iDiff)) {
+ if (*lpChild++ != *lpFile++)
+ iDiff = 1;
+ }
+
+ // If the two names matched, the file is already open - return handle to matching
+ // child window.
+ if (!iDiff)
+ return(hwndCheck);
+ }
+
+ // No match found -- file is not open -- return NULL handle
+ return(NULL);
+
+} // AlreadyOpen
+
+
+/*+-------------------------------------------------------------------------+
+ | AddFile() |
+ | |
+ | Create a new MDI Window, and loads specified file into Window. |
+ | |
+ +-------------------------------------------------------------------------+*/
+HWND APIENTRY AddFile(CHAR * pName) {
+ HWND hwnd;
+
+ CHAR sz[160];
+ MDICREATESTRUCT mcs;
+
+ if (!pName) {
+ // The pName parameter is NULL -- load the "Untitled" string from STRINGTABLE
+ // and set the title field of the MDI CreateStruct.
+ LoadString (hInst, IDS_UNTITLED, sz, sizeof(sz));
+ mcs.szTitle = (LPSTR)sz;
+ }
+ else
+ // Title the window with the fully qualified pathname obtained by calling
+ // OpenFile() with the OF_PARSE flag (in function AlreadyOpen(), which is called
+ // before AddFile().
+ mcs.szTitle = pName;
+
+ mcs.szClass = szChild;
+ mcs.hOwner = hInst;
+
+ // Use the default size for the window
+ mcs.x = mcs.cx = CW_USEDEFAULT;
+ mcs.y = mcs.cy = CW_USEDEFAULT;
+
+ // Set the style DWORD of the window to default
+ mcs.style = 0L;
+
+ // tell the MDI Client to create the child
+ hwnd = (HWND)SendMessage (hwndMDIClient,
+ WM_MDICREATE,
+ 0,
+ (LONG)(LPMDICREATESTRUCT)&mcs);
+
+ // Did we get a file? Read it into the window
+ if (pName){
+ if (!LoadFile(hwnd, pName)){
+ // File couldn't be loaded -- close window
+ SendMessage(hwndMDIClient, WM_MDIDESTROY, (DWORD) hwnd, 0L);
+ }
+ }
+
+ return hwnd;
+
+} // AddFile
+
+
+/*+-------------------------------------------------------------------------+
+ | LoadFile() |
+ | |
+ | Loads file into specified MDI window's edit control. |
+ | |
+ +-------------------------------------------------------------------------+*/
+INT APIENTRY LoadFile ( HWND hwnd, CHAR * pName) {
+ LONG wLength;
+ HANDLE hT;
+ LPSTR lpB;
+ HWND hwndEdit;
+ HFILE fh;
+ OFSTRUCT of;
+
+ hwndEdit = (HWND)GetWindowLong (hwnd, GWL_HWNDEDIT);
+
+ // The file has a title, so reset the UNTITLED flag.
+ SetWindowWord(hwnd, GWW_UNTITLED, FALSE);
+
+ fh = OpenFile(pName, &of, OF_READ); // JAP was 0, which is OF_READ)
+
+ // Make sure file has been opened correctly
+ if ( fh < 0 )
+ goto error;
+
+ // Find the length of the file
+ wLength = (DWORD)_llseek(fh, 0L, 2);
+ _llseek(fh, 0L, 0);
+
+ // Attempt to reallocate the edit control's buffer to the file size
+ hT = (HANDLE)SendMessage (hwndEdit, EM_GETHANDLE, 0, 0L);
+ if (LocalReAlloc(hT, wLength+1, LHND) == NULL) {
+ // Couldn't reallocate to new size -- error
+ _lclose(fh);
+ goto error;
+ }
+
+ // read the file into the buffer
+ if (wLength != (LONG)_lread(fh, (lpB = (LPSTR)LocalLock (hT)), (UINT)wLength))
+ MPError (hwnd, MB_OK|MB_ICONHAND, IDS_CANTREAD, (LPSTR)pName);
+
+ // Zero terminate the edit buffer
+ lpB[wLength] = 0;
+ LocalUnlock (hT);
+
+ SendMessage (hwndEdit, EM_SETHANDLE, (UINT)hT, 0L);
+ _lclose(fh);
+
+ return TRUE;
+
+error:
+ // Report the error and quit
+ MPError(hwnd, MB_OK | MB_ICONHAND, IDS_CANTOPEN, (LPSTR)pName);
+ return FALSE;
+
+} // LoadFile
+
+
+/*+-------------------------------------------------------------------------+
+ | MyReadFile() |
+ | |
+ | Asks user for a filename. |
+ | |
+ +-------------------------------------------------------------------------+*/
+VOID APIENTRY MyReadFile(HWND hwnd) {
+ CHAR szFile[128];
+ HWND hwndFile;
+
+ GetFileName (hwnd, szFile);
+
+ // If the result is not the empty string -- take appropriate action
+ if (*szFile) {
+ // Is file already open??
+ if (hwndFile = AlreadyOpen(szFile)) {
+ // Yes -- bring the file's window to the top
+ BringWindowToTop(hwndFile);
+ }
+ else {
+ // No -- make a new window and load file into it
+ AddFile(szFile);
+ }
+ }
+ UNREFERENCED_PARAMETER(hwnd);
+
+} // MyReadFile
+
+
+
diff --git a/private/nw/convert/logview/fvfind.c b/private/nw/convert/logview/fvfind.c
new file mode 100644
index 000000000..459469477
--- /dev/null
+++ b/private/nw/convert/logview/fvfind.c
@@ -0,0 +1,193 @@
+/*
+ +-------------------------------------------------------------------------+
+ | MDI Text File Viewer - Text Search Routines |
+ +-------------------------------------------------------------------------+
+ | (c) Copyright 1994 |
+ | Microsoft Corp. |
+ | All rights reserved |
+ | |
+ | Program : [FVFind.c] |
+ | Programmer : Arthur Hanson |
+ | Original Program Date : [Jul 27, 1993 |
+ | Last Update : [Jul 30, 1993] Time : 18:30 |
+ | |
+ | Version: 0.10 |
+ | |
+ | Description: |
+ | |
+ | History: |
+ | arth Jul 27, 1993 0.10 Original Version. |
+ | |
+ +-------------------------------------------------------------------------+
+*/
+
+#include "LogView.h"
+#include <string.h>
+#include <stdlib.h>
+
+#undef HIWORD
+#undef LOWORD
+
+#define HIWORD(l) (((WORD*)&(l))[1])
+#define LOWORD(l) (((WORD*)&(l))[0])
+
+BOOL fCase = FALSE; // Turn case sensitivity off
+CHAR szSearch[160] = ""; // Initialize search string
+
+
+extern HWND hDlgFind; /* handle to modeless FindText window */
+
+LPTSTR ReverseScan(
+ LPTSTR lpSource,
+ LPTSTR lpLast,
+ LPTSTR lpSearch,
+ BOOL fCaseSensitive ) {
+ int iLen = lstrlen(lpSearch);
+
+ if (!lpLast)
+ lpLast = lpSource + lstrlen(lpSource);
+
+ do {
+ if (lpLast == lpSource)
+ return NULL;
+
+ --lpLast;
+
+ if (fCaseSensitive) {
+ if (*lpLast != *lpSearch)
+ continue;
+ } else {
+ if (CharUpper ((LPTSTR)MAKELONG((WORD)*lpLast, 0)) != CharUpper ((LPTSTR)MAKELONG((WORD)*lpSearch, 0)))
+ continue;
+ }
+
+ if (fCaseSensitive) {
+ if (!strncmp( lpLast, lpSearch, iLen))
+ break;
+ } else {
+ if (!_strnicmp (lpLast, lpSearch, iLen))
+ break;
+ }
+ } while (TRUE);
+
+ return lpLast;
+} // ReverseScan
+
+
+LPTSTR ForwardScan(LPTSTR lpSource, LPTSTR lpSearch, BOOL fCaseSensitive ) {
+ int iLen = lstrlen(lpSearch);
+
+ while (*lpSource) {
+ if (fCaseSensitive) {
+ if (*lpSource != *lpSearch) {
+ lpSource++;
+ continue;
+ }
+ } else {
+ if (CharUpper ((LPTSTR)MAKELONG((WORD)*lpSource, 0)) != CharUpper ((LPTSTR)MAKELONG((WORD)*lpSearch, 0))) {
+ lpSource++;
+ continue;
+ }
+ }
+
+ if (fCaseSensitive) {
+ if (!strncmp( lpSource, lpSearch, iLen))
+ break;
+ } else {
+ if (!_strnicmp( lpSource, lpSearch, iLen))
+ break;
+ }
+
+ lpSource++;
+ }
+
+ return *lpSource ? lpSource : NULL;
+} // ForwardScan
+
+
+// search forward or backward in the edit control text for the given pattern
+void FAR Search (TCHAR * szKey) {
+ HANDLE hText;
+ TCHAR * pStart, *pMatch;
+ DWORD StartIndex, LineNum, EndIndex;
+ DWORD SelStart, SelEnd, i;
+ DWORD dwSel;
+ INT cbText;
+
+ if (!*szKey)
+ return;
+
+ SetCursor(hWaitCursor);
+ dwSel= SendMessage(hwndActiveEdit, EM_GETSEL, (WPARAM)&SelStart, (LPARAM)&SelEnd);
+
+ /*
+ * Allocate hText and read edit control text into it.
+ * Lock hText and fall through to existing code.
+ */
+
+ cbText= SendMessage(hwndActiveEdit, WM_GETTEXTLENGTH, 0, 0L) + 1;
+ hText= LocalAlloc( LPTR, cbText );
+ if( !hText ) // quiet exit if not enough memory
+ return;
+ if( !(pStart= LocalLock(hText)) ) {
+ LocalFree(hText);
+ return;
+ }
+
+ SendMessage(hwndActiveEdit, WM_GETTEXT, cbText, (LPARAM)pStart);
+
+ if (fReverse) {
+ // Get current line number
+ LineNum= SendMessage(hwndActiveEdit, EM_LINEFROMCHAR, SelStart, 0);
+ // Get index to start of the line
+ StartIndex= SendMessage(hwndActiveEdit, EM_LINEINDEX, LineNum, 0);
+ // Set upper limit for search text
+ EndIndex= SelStart;
+ pMatch= NULL;
+
+ // Search line by line, from LineNum to 0
+ i = LineNum;
+ while (TRUE) {
+ pMatch= ReverseScan(pStart+StartIndex,pStart+EndIndex,szKey,fCase);
+ if (pMatch)
+ break;
+ // current StartIndex is the upper limit for the next search
+ EndIndex= StartIndex;
+
+ if (i) {
+ // Get start of the next line
+ i-- ;
+ StartIndex= SendMessage(hwndActiveEdit, EM_LINEINDEX, i, 0);
+ } else
+ break ;
+ }
+ } else {
+ pMatch= ForwardScan(pStart + SelEnd, szKey, fCase);
+ }
+ LocalUnlock(hText);
+ LocalFree( hText );
+ SetCursor(hStdCursor);
+
+ if (pMatch == NULL) {
+ TCHAR Message[256], AppName[256] ;
+
+ if (!LoadString(hInst, IDS_CANTFINDSTR, Message,
+ sizeof(Message)/sizeof(Message[0]))) {
+ Message[0] = 0 ;
+ }
+
+ if (!LoadString(hInst, IDS_APPNAME, AppName,
+ sizeof(AppName)/sizeof(AppName[0]))) {
+ AppName[0] = 0 ;
+ }
+
+ MessageBox(hwndFrame, Message, AppName,
+ MB_APPLMODAL | MB_OK | MB_ICONASTERISK);
+ } else {
+ SelStart = pMatch - pStart;
+ SendMessage(hwndActiveEdit, EM_SETSEL, SelStart, SelStart+lstrlen(szKey));
+ SendMessage(hwndActiveEdit, EM_SCROLLCARET, 0, 0);
+ }
+
+} // Search
+
diff --git a/private/nw/convert/logview/fvinit.c b/private/nw/convert/logview/fvinit.c
new file mode 100644
index 000000000..11330fb2a
--- /dev/null
+++ b/private/nw/convert/logview/fvinit.c
@@ -0,0 +1,155 @@
+/*
+ +-------------------------------------------------------------------------+
+ | Initialization Code |
+ +-------------------------------------------------------------------------+
+ | (c) Copyright 1993 |
+ | Microsoft Corp. |
+ | All rights reserved |
+ | |
+ | Program : [mpinit.c] |
+ | Programmer : Arthur Hanson |
+ | Original Program Date : [Jul 27, 1993 |
+ | Last Update : [Jul 30, 1993] Time : 18:30 |
+ | |
+ | Version: 0.10 |
+ | |
+ | Description: |
+ | |
+ | History: |
+ | arth Jul 27, 1993 0.10 Original Version. |
+ | |
+ +-------------------------------------------------------------------------+
+*/
+#include "LogView.h"
+
+CHAR szFrame[] = "mpframe"; // Class name for "frame" window
+CHAR szChild[] = "mpchild"; // Class name for MDI window
+
+/*+-------------------------------------------------------------------------+
+ | InitializeApplication() |
+ | |
+ +-------------------------------------------------------------------------+*/
+BOOL APIENTRY InitializeApplication() {
+ WNDCLASS wc;
+
+ // Register the frame class
+ wc.style = 0;
+ wc.lpfnWndProc = (WNDPROC) MPFrameWndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInst;
+ wc.hIcon = LoadIcon(hInst,IDLOGVIEW);
+ wc.hCursor = LoadCursor(NULL,IDC_ARROW);
+ wc.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1);
+ wc.lpszMenuName = IDLOGVIEW;
+ wc.lpszClassName = szFrame;
+
+ if (!RegisterClass (&wc) )
+ return FALSE;
+
+ // Register the MDI child class
+ wc.lpfnWndProc = (WNDPROC) MPMDIChildWndProc;
+ wc.hIcon = LoadIcon(hInst,IDNOTE);
+ wc.lpszMenuName = NULL;
+ wc.cbWndExtra = CBWNDEXTRA;
+ wc.lpszClassName = szChild;
+
+ if (!RegisterClass(&wc))
+ return FALSE;
+
+ return TRUE;
+
+} // InitializeApplication
+
+
+/*+-------------------------------------------------------------------------+
+ | InitializeInstance() |
+ | |
+ +-------------------------------------------------------------------------+*/
+BOOL APIENTRY InitializeInstance(LPSTR lpCmdLine, INT nCmdShow) {
+ extern HWND hwndMDIClient;
+ CHAR sz[80], *pCmdLine, *pFileName, *pChar;
+ HDC hdc;
+ HMENU hmenu;
+
+ // Get the base window title
+ LoadString (hInst, IDS_APPNAME, sz, sizeof(sz));
+
+ hStdCursor= LoadCursor( NULL,IDC_ARROW );
+ hWaitCursor= LoadCursor( NULL, IDC_WAIT );
+
+ // Create the frame
+ hwndFrame = CreateWindow (szFrame, sz, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL,
+ NULL, hInst, NULL);
+
+ if ((!hwndFrame) || (!hwndMDIClient))
+ return FALSE;
+
+ // Load main menu accelerators
+ if (!(hAccel = LoadAccelerators (hInst, IDLOGVIEW)))
+ return FALSE;
+
+ // init.fields of the FINDREPLACE struct used by FindText()
+ FR.lStructSize = sizeof(FINDREPLACE);
+ FR.hwndOwner = hwndFrame;
+ FR.Flags = FR_DOWN | FR_HIDEWHOLEWORD;
+ FR.lpstrReplaceWith = (LPTSTR)NULL;
+ FR.wReplaceWithLen = 0;
+ FR.lpfnHook = NULL;
+
+ /* determine the message number to be used for communication with
+ * Find dialog
+ */
+ if (!(wFRMsg = RegisterWindowMessage ((LPTSTR)FINDMSGSTRING)))
+ return FALSE;
+ if (!(wHlpMsg = RegisterWindowMessage ((LPTSTR)HELPMSGSTRING)))
+ return FALSE;
+
+ // Display the frame window
+ ShowWindow (hwndFrame, nCmdShow);
+ UpdateWindow (hwndFrame);
+
+ // If the command line string is empty, nullify the pointer to it else copy
+ // command line into our data segment
+ if ( lpCmdLine && !(*lpCmdLine)) {
+ pCmdLine = NULL;
+
+ // Add the first MDI window
+ AddFile (pCmdLine);
+
+ } else {
+ pCmdLine = (CHAR *) LocalAlloc(LPTR, lstrlen(lpCmdLine) + 1);
+
+ if (pCmdLine) {
+ lstrcpy(pCmdLine, lpCmdLine);
+
+ pFileName = pChar = pCmdLine;
+
+ while (*pChar) {
+ if (*pChar == ' ') {
+ *pChar = '\0';
+ AddFile(pFileName);
+ *pChar = ' ';
+ pChar++;
+ pFileName = pChar;
+ } else
+ pChar++;
+ }
+ AddFile(pFileName);
+
+ } else
+
+ // Add the first MDI window
+ AddFile (pCmdLine);
+ }
+
+ // if we allocated a buffer then free it
+ if (pCmdLine)
+ LocalFree((LOCALHANDLE) pCmdLine);
+
+ return TRUE;
+ UNREFERENCED_PARAMETER(hmenu);
+ UNREFERENCED_PARAMETER(hdc);
+
+} // InitializeInstance
diff --git a/private/nw/convert/logview/fvopen.c b/private/nw/convert/logview/fvopen.c
new file mode 100644
index 000000000..97a0458eb
--- /dev/null
+++ b/private/nw/convert/logview/fvopen.c
@@ -0,0 +1,131 @@
+/*
+ +-------------------------------------------------------------------------+
+ | MDI Text File View - File open Functions |
+ +-------------------------------------------------------------------------+
+ | (c) Copyright 1994 |
+ | Microsoft Corp. |
+ | All rights reserved |
+ | |
+ | Program : [FVOpen.c] |
+ | Programmer : Arthur Hanson |
+ | Original Program Date : [Feb 11, 1994] |
+ | Last Update : [Feb 11, 1994] |
+ | |
+ | Version: 0.10 |
+ | |
+ | Description: |
+ | |
+ | History: |
+ | arth Jul 27, 1993 0.10 Original Version. |
+ | |
+ +-------------------------------------------------------------------------+
+*/
+
+#include "LogView.h"
+#include <fcntl.h>
+#include <io.h>
+#include <string.h>
+
+#define MAXFILENAME 256
+
+
+CHAR szPropertyName [] = "FILENAME"; // Name of the File name property list item
+
+
+/////////////////////////////////////////////////////////////////////////
+BOOL
+FileExists(
+ PSTR pch
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ int fh;
+
+ if ((fh = _open(pch, O_RDONLY)) < 0)
+ return(FALSE);
+
+ _lclose(fh);
+ return(TRUE);
+} // FileExists
+
+
+/////////////////////////////////////////////////////////////////////////
+VOID APIENTRY
+GetFileName(
+ HWND hwnd,
+ PSTR pstr
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ CHAR szFmt[128];
+ OPENFILENAME ofn;
+ CHAR szFilterSpec[128];
+ CHAR szDefExt[10];
+ CHAR szFileName[MAXFILENAME];
+ CHAR szFileTitle[MAXFILENAME];
+
+ strcpy(szFileName, ""); // these need be NULL
+ strcpy(szFileTitle, "");
+ memset(&ofn,0,sizeof(ofn)) ;
+ memset(szFilterSpec,0,sizeof(szFilterSpec)) ;
+
+ LoadString (hInst, (WORD)IDS_OPENTEXT,
+ (LPSTR)szFmt, sizeof (szFmt));
+ LoadString (hInst, (WORD)IDS_OPENFILTER,
+ (LPSTR)szFilterSpec, sizeof (szFilterSpec));
+
+
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = hwnd;
+ ofn.lpstrFilter = szFilterSpec;
+ ofn.lpstrCustomFilter = NULL;
+ ofn.nMaxCustFilter = 0;
+ ofn.nFilterIndex = 0;
+ ofn.lpstrFile = szFileName;
+ ofn.nMaxFile = MAXFILENAME;
+ ofn.lpstrInitialDir = NULL;
+ ofn.lpstrFileTitle = szFileTitle;
+ ofn.nMaxFileTitle = MAXFILENAME;
+ ofn.lpstrTitle = szFmt;
+
+ LoadString (hInst, (WORD)IDS_DEFEXT, (LPSTR)szDefExt, sizeof (szDefExt));
+ ofn.lpstrDefExt = szDefExt;
+ ofn.Flags = OFN_FILEMUSTEXIST;
+
+ // Use standard open dialog
+ if (!GetOpenFileName ((LPOPENFILENAME)&ofn)) {
+ *pstr = 0;
+ }
+ else {
+ strcpy(pstr, ofn.lpstrFile);
+ }
+
+ return;
+
+} // GetFileName
diff --git a/private/nw/convert/logview/fvprint.c b/private/nw/convert/logview/fvprint.c
new file mode 100644
index 000000000..675c46c8d
--- /dev/null
+++ b/private/nw/convert/logview/fvprint.c
@@ -0,0 +1,389 @@
+/*
+ +-------------------------------------------------------------------------+
+ | MDI Text File Viewer - Printing Routines |
+ +-------------------------------------------------------------------------+
+ | (c) Copyright 1994 |
+ | Microsoft Corp. |
+ | All rights reserved |
+ | |
+ | Program : [FVPrint.c] |
+ | Programmer : Arthur Hanson |
+ | Original Program Date : [Feb 11, 1994] |
+ | Last Update : [Feb 11, 1994] |
+ | |
+ | Version: 0.10 |
+ | |
+ | Description: |
+ | |
+ | History: |
+ | arth Jul 27, 1993 0.10 Original Version. |
+ | |
+ +-------------------------------------------------------------------------+
+*/
+
+#include "LogView.h"
+
+BOOL fAbort;
+HWND hwndPDlg;
+CHAR szDevice[160];
+PSTR szDriver;
+PSTR szPort;
+PSTR szTitle;
+INT iPrinter = 0; // level of available printer support.
+ // 0 - no printer available
+ // 1 - printer available
+ // 2 - driver supports 3.0 device initialization
+HANDLE hInitData=NULL;
+
+CHAR szExtDeviceMode[] = "EXTDEVICEMODE";
+
+
+/*+-------------------------------------------------------------------------+
+ | GetPrinterDC() |
+ | |
+ | Creates a printer display context for the default device. As a side |
+ | effect, it sets the szDevice and szPort variables. It also sets |
+ | iPrinter to the supported level of printing. |
+ | |
+ +-------------------------------------------------------------------------+*/
+HDC APIENTRY GetPrinterDC(BOOL bInformation) {
+ HDC hdc;
+ LPDEVMODE lpdevmode = NULL;
+
+ iPrinter = 0;
+
+ // Get the printer information from win.ini into a buffer and null terminate it.
+ GetProfileString ( TEXT("windows"), TEXT("device"), TEXT(""), szDevice, sizeof(szDevice));
+ for (szDriver = szDevice; *szDriver && *szDriver != TEXT(','); szDriver++)
+ ;
+ if (*szDriver)
+ *szDriver++ = 0;
+
+ // From the current position in the buffer, null teminate the list of ports
+ for (szPort = szDriver; *szPort && *szPort != TEXT(','); szPort++)
+ ;
+ if (*szPort)
+ *szPort++ = 0;
+
+ // if the device, driver and port buffers all contain meaningful data, proceed.
+ if (!*szDevice || !*szDriver || !*szPort){
+ *szDevice = 0;
+ return NULL;
+ }
+
+ // Create the printer display context
+ if (hInitData){
+ // Get a pointer to the initialization data
+ lpdevmode = (LPDEVMODE) LocalLock (hInitData);
+
+ if (lstrcmp (szDevice, (LPSTR)lpdevmode)) {
+ // User has changed the device... cancel this setup, as it is invalid
+ // (although if we worked harder we could retain some of it).
+ lpdevmode = NULL;
+ LocalUnlock (hInitData);
+ LocalFree (hInitData);
+ hInitData = NULL;
+ }
+ }
+
+ if (bInformation)
+ hdc = CreateIC (szDriver, szDevice, szPort, lpdevmode);
+ else
+ hdc = CreateDC (szDriver, szDevice, szPort, lpdevmode);
+
+ // Unlock initialization data
+ if (hInitData)
+ LocalUnlock (hInitData);
+
+ if (!hdc)
+ return NULL;
+
+
+ iPrinter = 1;
+
+ // Find out if ExtDeviceMode() is supported and set flag appropriately
+ if (GetProcAddress (LoadLibrary(szDriver), szExtDeviceMode))
+ iPrinter = 2;
+
+ return hdc;
+
+} // GetPrinterDC
+
+
+/*+-------------------------------------------------------------------------+
+ | AbortProc() |
+ | |
+ | Checks for user abort. |
+ | |
+ +-------------------------------------------------------------------------+*/
+INT APIENTRY AbortProc ( HDC hdc, WORD reserved) {
+ MSG msg;
+
+ // Allow other apps to run, or get abort messages
+ while (!fAbort && PeekMessage (&msg, NULL, 0, 0, TRUE))
+ if (!hwndPDlg || !IsDialogMessage (hwndPDlg, &msg)) {
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+
+ return !fAbort;
+
+ UNREFERENCED_PARAMETER(hdc);
+ UNREFERENCED_PARAMETER(reserved);
+
+} // AbortProc
+
+
+/*+-------------------------------------------------------------------------+
+ | PrintDlgProc() |
+ | |
+ | Print/Cancel dialog box. |
+ | |
+ +-------------------------------------------------------------------------+*/
+BOOL APIENTRY PrintDlgProc(HWND hwnd, UINT msg, WORD wParam, LONG lParam) {
+ switch (msg) {
+ case WM_INITDIALOG:
+ // Set up information in dialog box
+ SetDlgItemText (hwnd, IDD_PRINTTITLE, (LPSTR)szTitle);
+ break;
+
+ case WM_COMMAND:
+ // abort printing if the only button gets hit
+ fAbort = TRUE;
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ return TRUE;
+
+ UNREFERENCED_PARAMETER(wParam);
+ UNREFERENCED_PARAMETER(lParam);
+} // PrintDlgProc
+
+
+/*+-------------------------------------------------------------------------+
+ | PrintFile() |
+ | |
+ | Prints the contents of the edit control. |
+ | |
+ +-------------------------------------------------------------------------+*/
+VOID APIENTRY PrintFile(HWND hwnd) {
+ HDC hdc;
+ INT yExtPage;
+ CHAR sz[32];
+ int cch;
+ WORD ich;
+ PSTR pch;
+ WORD iLine;
+ WORD nLinesEc;
+ WORD i;
+ HANDLE hT;
+ HWND hwndPDlg;
+ DWORD dy;
+ INT yExtSoFar;
+ WORD fError = TRUE;
+ HWND hwndEdit;
+ HFONT hFont, hOldFont;
+
+ hwndEdit = (HWND)GetWindowLong(hwnd,GWL_HWNDEDIT);
+
+ // Create the job title by loading the title string from STRINGTABLE
+ cch = LoadString (hInst, IDS_PRINTJOB, sz, sizeof(sz));
+ szTitle = sz + cch;
+ cch += GetWindowText (hwnd, sz + cch, 32 - cch);
+ sz[31] = 0;
+
+ // Initialize the printer
+ hdc = GetPrinterDC(FALSE);
+ if (!hdc)
+ goto getout5;
+
+ SetMapMode(hdc, MM_TEXT);
+ SelectObject(hdc, GetStockObject(ANSI_FIXED_FONT));
+
+ // Disable the main application window and create the Cancel dialog
+ EnableWindow (hwndFrame, FALSE);
+
+ hwndPDlg = CreateDialog (hInst, IDD_PRINT, hwnd, (DLGPROC) PrintDlgProc);
+
+ if (!hwndPDlg)
+ goto getout3;
+
+ ShowWindow (hwndPDlg, SW_SHOW);
+ UpdateWindow (hwndPDlg);
+
+ // Allow the app. to inform GDI of the escape function to call
+ if (Escape(hdc, SETABORTPROC, 0, (LPSTR)AbortProc, NULL) < 0)
+ goto getout1;
+
+ // Initialize the document
+ if (Escape(hdc, STARTDOC, cch, (LPSTR)sz, NULL) < 0)
+ goto getout1;
+
+ // Get the height of one line and the height of a page
+ {
+ SIZE tmp;
+ GetTextExtentPoint(hdc, "CC", 2, &tmp );
+ dy = tmp.cy;
+ }
+
+ yExtPage = GetDeviceCaps(hdc, VERTRES);
+
+ // Get the lines in document and and a handle to the text buffer
+ iLine = 0;
+ yExtSoFar = 0;
+ nLinesEc = (WORD)SendMessage (hwndEdit, EM_GETLINECOUNT, 0, 0L);
+ hT = (HANDLE)SendMessage (hwndEdit, EM_GETHANDLE, 0, 0L);
+
+ // While more lines print out the text
+ while (iLine < nLinesEc) {
+ if (yExtSoFar + (int) dy > yExtPage) {
+ // Reached the end of a page. Tell the device driver to eject a page
+ if (Escape(hdc, NEWFRAME, 0, NULL, NULL) < 0 || fAbort)
+ goto getout2;
+ yExtSoFar = 0;
+ }
+
+ // Get the length and position of the line in the buffer and lock from that
+ // offset into the buffer.
+ ich = (WORD)SendMessage (hwndEdit, EM_LINEINDEX, iLine, 0L);
+ cch = (WORD)SendMessage (hwndEdit, EM_LINELENGTH, ich, 0L);
+ pch = (PSTR)LocalLock(hT) + ich;
+
+ // Print the line and unlock the text handle
+ TextOut (hdc, 0, yExtSoFar, (LPSTR)pch, cch);
+ LocalUnlock (hT);
+
+ // Test and see if the Abort flag has been set. If yes, exit.
+ if (fAbort)
+ goto getout2;
+
+ // Move down the page
+ yExtSoFar += dy;
+ iLine++;
+ }
+
+ // Eject the last page.
+ if (Escape(hdc, NEWFRAME, 0, NULL, NULL) < 0)
+ goto getout2;
+
+ // Complete the document.
+ if (Escape(hdc, ENDDOC, 0, NULL, NULL) < 0) {
+getout2:
+ // Ran into a problem before NEWFRAME? Abort the document
+ Escape( hdc, ABORTDOC, 0, NULL, NULL);
+ } else
+ fError=FALSE;
+
+getout3:
+ // Close the cancel dialog and re-enable main app. window
+ EnableWindow (hwndFrame, TRUE);
+ DestroyWindow (hwndPDlg);
+
+getout1:
+ DeleteDC(hdc);
+
+getout5:
+#ifdef WIN16
+ // Get rid of dialog procedure instances
+ FreeProcInstance (lpfnPDlg);
+#endif
+
+#ifdef WIN16
+getout4:
+ FreeProcInstance (lpfnAbort);
+getout:
+#endif
+
+ // Error? make sure the user knows...
+ if (fError)
+ MPError (hwnd, MB_OK | MB_ICONEXCLAMATION, IDS_PRINTERROR, (LPSTR)szTitle);
+
+ return;
+ UNREFERENCED_PARAMETER(i);
+
+} // PrintFile
+
+
+/*+-------------------------------------------------------------------------+
+ | GetInitializationData() |
+ | |
+ | Gets DC initialization data from a printer driver supporting |
+ | ExtDeviceMode(). Called in response to the File/Printer setup menu |
+ | selection. |
+ | |
+ | This function allows the user to change the printer settings FOR |
+ | LOGVIEW ONLY. This allows LogView to print in a variety of settings |
+ | without messing up any othe applications. |
+ | |
+ +-------------------------------------------------------------------------+*/
+BOOL APIENTRY GetInitializationData( HWND hwnd ) {
+ LPSTR lpOld;
+ LPSTR lpNew;
+ FARPROC lpfn;
+ HANDLE hT,hDrv;
+ CHAR sz[32];
+ int cb;
+ INT flag;
+
+ // Pop up dialog for user and retain data in app buffer
+ flag = DM_PROMPT | DM_COPY;
+
+ // Load the device driver and find the ExtDeviceMode() function
+ wsprintf (sz, "%s.drv", (LPSTR)szDriver);
+ if ((int)(hDrv = LoadLibrary (sz)) < 32)
+ return FALSE;
+ if (!(lpfn = (DLGPROC) GetProcAddress (hDrv, szExtDeviceMode)))
+ return FALSE;
+
+ if (hInitData) {
+ // We have some old data... we want to modify the previously specified
+ // setup rather than starting with the default setup.
+ lpOld = (LPSTR)LocalLock(hInitData);
+ flag |= DM_MODIFY;
+ }
+ else
+ lpOld = NULL;
+
+ // Get the number of bytes needed for the init data
+ cb = (*lpfn) (hwnd, hDrv, (LPDEVMODE)NULL, (LPSTR)szDevice, (LPSTR)szPort, (LPDEVMODE)NULL, (LPSTR)NULL, 0);
+
+ // Grab some memory for the new data and lock it.
+ hT = LocalAlloc (LHND,cb);
+ if(!hT) {
+ MessageBox(hwnd, TEXT("<GetInitializationData> Not enough memory."), NULL, MB_OK | MB_ICONHAND);
+ LocalUnlock(hInitData);
+ LocalFree(hInitData);
+ FreeLibrary(hDrv);
+ return(FALSE);
+ }
+
+ lpNew = (LPSTR)LocalLock (hT);
+
+ // Post the device mode dialog. 0 flag iff user hits OK button
+ if ((*lpfn) (hwnd, hDrv, (LPDEVMODE)lpNew, (LPSTR)szDevice, (LPSTR)szPort, (LPDEVMODE)lpOld, (LPSTR)NULL, flag) == IDOK)
+ flag = 0;
+
+ // Unlock the input structures
+ LocalUnlock (hT);
+
+ if (hInitData)
+ LocalUnlock (hInitData);
+
+ // If the user hit OK and everything worked, free the original init. data and
+ // retain the new one. Otherwise, toss the new buffer.
+ if (flag)
+ LocalFree (hT);
+ else {
+ if (hInitData)
+ LocalFree (hInitData);
+
+ hInitData = hT;
+ }
+
+ FreeLibrary(hDrv);
+ return (!flag);
+
+} // GetInitializationData
diff --git a/private/nw/convert/logview/logview.c b/private/nw/convert/logview/logview.c
new file mode 100644
index 000000000..a682edec0
--- /dev/null
+++ b/private/nw/convert/logview/logview.c
@@ -0,0 +1,767 @@
+/*++
+
+Copyright (c) 1993-1995 Microsoft Corporation
+
+Module Name:
+
+ LogView.C
+
+Abstract:
+
+
+Author:
+
+ Arthur Hanson (arth) 27-Jul-1993
+
+Revision History:
+
+--*/
+
+#include "LogView.h"
+#include <string.h>
+#include <stdio.h>
+//#include <dos.h>
+//#include <direct.h>
+#include <shellapi.h>
+
+// global variables used in this module or among more than one module
+HANDLE hInst;
+HANDLE hAccel;
+HWND hwndFrame = NULL;
+HWND hwndMDIClient = NULL;
+HWND hwndActive = NULL;
+HWND hwndActiveEdit = NULL;
+HWND hDlgFind = NULL;
+LPSTR lpMenu = IDLOGVIEW;
+TCHAR szAppName[] = "LogView";
+
+FINDREPLACE FR;
+PRINTDLG PD;
+UINT wFRMsg;
+UINT wHlpMsg;
+BOOL fReverse = FALSE; // Flag for direction of search
+TCHAR szSearch[CCHKEYMAX]; // Search String
+
+HANDLE hStdCursor; // handle to arrow or beam cursor
+HANDLE hWaitCursor; // handle to hour glass cursor
+
+void FAR Search (TCHAR * szKey);
+
+
+// Forward declarations of helper functions in this module
+VOID NEAR PASCAL InitializeMenu (HANDLE);
+VOID NEAR PASCAL CommandHandler (HWND, UINT, LONG);
+LPSTR GetCmdLine( VOID );
+BOOL CenterWindow( HWND hwndChild, HWND hwndParent );
+
+#define HELP_FILE TEXT("logview.hlp")
+
+/////////////////////////////////////////////////////////////////////////
+int PASCAL
+WinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow
+ )
+
+/*++
+
+Routine Description:
+
+ Creates the "frame" window, does some initialization and enters the
+ message loop.
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ MSG msg;
+
+ hInst = hInstance;
+
+ // If this is the first instance of the app. register window classes
+ if (!hPrevInstance){
+ if (!InitializeApplication ())
+ return 0;
+ }
+
+ lpCmdLine = GetCmdLine();
+
+ // Create the frame and do other initialization
+ if (!InitializeInstance (lpCmdLine, nCmdShow))
+ return 0;
+
+ while (GetMessage (&msg, NULL, 0, 0)){
+ // If a keyboard message is for the MDI , let the MDI client take care of it.
+ // Otherwise, check to see if it's a normal accelerator key (like F3 = find next).
+ // Otherwise, just handle the message as usual.
+ if (!hDlgFind || !IsDialogMessage(hDlgFind, &msg)) {
+ if ( !TranslateMDISysAccel (hwndMDIClient, &msg) &&
+ !TranslateAccelerator (hwndFrame, hAccel, &msg)) {
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+ }
+ }
+
+ return 0;
+
+} // WinMain
+
+
+/////////////////////////////////////////////////////////////////////////
+LONG APIENTRY
+MPFrameWndProc (
+ HWND hwnd,
+ UINT msg,
+ UINT wParam,
+ LONG lParam
+ )
+
+/*++
+
+Routine Description:
+
+ The window function for the "frame" window, which controls the menu
+ and encompasses all the MDI child windows.
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ LPFINDREPLACE lpfr;
+ DWORD dwFlags;
+
+ switch (msg) {
+ case WM_CREATE: {
+
+ CLIENTCREATESTRUCT ccs;
+ HDC hdc;
+
+ // Find window menu where children will be listed
+ ccs.hWindowMenu = GetSubMenu (GetMenu(hwnd), WINDOWMENU);
+ ccs.idFirstChild = IDM_WINDOWCHILD;
+
+ // Create the MDI client filling the client area
+ hwndMDIClient = CreateWindow ("mdiclient", NULL,
+ WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
+ 0, 0, 0, 0, hwnd, (HMENU) 0xCAC, hInst, (LPSTR) &ccs);
+
+ ShowWindow (hwndMDIClient,SW_SHOW);
+
+ // Check if printer can be initialized
+ if (hdc = GetPrinterDC (TRUE)) {
+ DeleteDC (hdc);
+ }
+
+ break;
+ }
+
+ case WM_INITMENU:
+ // Set up the menu state
+ InitializeMenu ((HMENU)wParam);
+ break;
+
+ case WM_WININICHANGE:
+ case WM_DEVMODECHANGE:{
+
+ // If control panel changes default printer characteristics, reinitialize our
+ // printer information...
+ HDC hdc;
+
+ if (hdc = GetPrinterDC (TRUE))
+ DeleteDC (hdc);
+
+ break;
+ }
+
+ case WM_COMMAND:
+ // Direct all menu selection or accelerator commands to another function
+ CommandHandler(hwnd, wParam, lParam);
+ break;
+
+ case WM_CLOSE:
+ DestroyWindow (hwnd);
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage (0);
+ break;
+
+ default:
+ if (msg == wFRMsg)
+ {
+ lpfr = (LPFINDREPLACE)lParam;
+ dwFlags = lpfr->Flags;
+
+ fReverse = (dwFlags & FR_DOWN ? FALSE : TRUE);
+ fCase = (dwFlags & FR_MATCHCASE ? TRUE : FALSE);
+
+ if (dwFlags & FR_FINDNEXT)
+ Search (szSearch);
+ else if (dwFlags & FR_DIALOGTERM)
+ hDlgFind = NULL; /* invalidate modeless window handle */
+ break;
+ }
+
+ // use DefFrameProc() instead of DefWindowProc() since there are things
+ // that have to be handled differently because of MDI
+ return DefFrameProc (hwnd,hwndMDIClient,msg,wParam,lParam);
+ }
+
+ return 0;
+
+} // MPFrameWndProc
+
+
+/////////////////////////////////////////////////////////////////////////
+LONG APIENTRY
+MPMDIChildWndProc (
+ HWND hwnd,
+ UINT msg,
+ UINT wParam,
+ LONG lParam
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ HWND hwndEdit;
+ HFONT hFont;
+ LRESULT ret;
+
+ switch (msg) {
+ case WM_CREATE:
+ hwndEdit = CreateWindow ("edit", NULL,
+ WS_CHILD | WS_HSCROLL | WS_MAXIMIZE | WS_VISIBLE |
+ WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL |
+ ES_MULTILINE | ES_READONLY | ES_NOHIDESEL,
+ 0, 0, 0, 0,
+ hwnd, (HMENU) ID_EDIT, hInst, NULL);
+
+ // Remember the window handle and initialize some window attributes
+ SetWindowLong (hwnd, GWL_HWNDEDIT, (LONG) hwndEdit);
+ SetWindowWord (hwnd, GWW_CHANGED, FALSE);
+ SetWindowWord (hwnd, GWL_WORDWRAP, FALSE);
+ SetWindowWord (hwnd, GWW_UNTITLED, TRUE);
+
+ hFont = GetStockObject(SYSTEM_FIXED_FONT);
+ ret = SendMessage(hwndEdit, WM_SETFONT, (WPARAM) hFont, (LPARAM) MAKELONG((WORD) TRUE, 0));
+
+ SetFocus (hwndEdit);
+ break;
+
+ case WM_MDIACTIVATE:
+ // If we're activating this child, remember it
+ if (GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wParam, lParam)) {
+ hwndActive = hwnd;
+ hwndActiveEdit = (HWND)GetWindowLong (hwnd, GWL_HWNDEDIT);
+ }
+ else {
+ hwndActive = NULL;
+ hwndActiveEdit = NULL;
+ }
+ break;
+
+ case WM_CLOSE:
+ goto CallDCP;
+
+ case WM_SIZE:{
+ RECT rc;
+
+ // On creation or resize, size the edit control.
+ hwndEdit = (HWND)GetWindowLong (hwnd, GWL_HWNDEDIT);
+ GetClientRect (hwnd, &rc);
+ MoveWindow (hwndEdit,
+ rc.left,
+ rc.top,
+ rc.right-rc.left,
+ rc.bottom-rc.top,
+ TRUE);
+ goto CallDCP;
+ }
+
+ case WM_SETFOCUS:
+ SetFocus ((HWND)GetWindowLong (hwnd, GWL_HWNDEDIT));
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)){
+ case ID_EDIT:
+ switch (GET_WM_COMMAND_CMD(wParam, lParam)) {
+
+ case EN_ERRSPACE:
+ // If the control is out of space, beep
+ MessageBeep (0);
+ break;
+
+ default:
+ goto CallDCP;
+ }
+ break;
+
+ default:
+ goto CallDCP;
+ }
+ break;
+
+ default:
+CallDCP:
+ return DefMDIChildProc (hwnd, msg, wParam, lParam);
+ }
+ return FALSE;
+
+} // MPMDIChildWndProc
+
+
+/////////////////////////////////////////////////////////////////////////
+VOID NEAR PASCAL
+InitializeMenu (
+ register HANDLE hmenu
+ )
+
+/*++
+
+Routine Description:
+
+ Sets up greying, enabling and checking of main menu items.
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ WORD status;
+ WORD i;
+ INT j;
+
+ // Is there any active child to talk to?
+ if (hwndActiveEdit) {
+
+ // Set the word wrap state for the window
+ if ((WORD) SendMessage(hwndActive, WM_COMMAND, GET_WM_COMMAND_MPS(IDM_EDITWRAP, 0, 0)))
+ status = MF_CHECKED;
+ else
+ status = MF_UNCHECKED;
+
+ CheckMenuItem (hmenu, IDM_EDITWRAP, status);
+
+ // Enable search menu items only if there is a search string
+ if (*szSearch)
+ status = MF_ENABLED;
+ else
+ status = MF_GRAYED;
+
+ EnableMenuItem (hmenu, IDM_SEARCHNEXT, status);
+ EnableMenuItem (hmenu, IDM_SEARCHPREV, status);
+
+ // Enable File/Print only if a printer is available
+ status = (WORD) (iPrinter ? MF_ENABLED : MF_GRAYED);
+ EnableMenuItem (hmenu, IDM_FILEPRINT, status);
+
+ // select all and wrap toggle always enabled
+ status = MF_ENABLED;
+ EnableMenuItem(hmenu, IDM_EDITSELECT, status);
+ EnableMenuItem(hmenu, IDM_EDITWRAP, status);
+ EnableMenuItem(hmenu, IDM_SEARCHFIND, status);
+ } else {
+ // There are no active child windows
+ status = MF_GRAYED;
+
+ // No active window, so disable everything
+ for (i = IDM_EDITFIRST; i <= IDM_EDITLAST; i++)
+ EnableMenuItem (hmenu, i, status);
+
+ CheckMenuItem (hmenu, IDM_EDITWRAP, MF_UNCHECKED);
+
+ for (i = IDM_SEARCHFIRST; i <= IDM_SEARCHLAST; i++)
+ EnableMenuItem (hmenu, i, status);
+
+ EnableMenuItem (hmenu, IDM_FILEPRINT, status);
+
+ }
+
+ // The following menu items are enabled if there is an active window
+ EnableMenuItem (hmenu, IDM_WINDOWTILE, status);
+ EnableMenuItem (hmenu, IDM_WINDOWCASCADE, status);
+ EnableMenuItem (hmenu, IDM_WINDOWICONS, status);
+ EnableMenuItem (hmenu, IDM_WINDOWCLOSEALL, status);
+
+ // Allow printer setup only if printer driver supports device initialization
+ if (iPrinter < 2)
+ status = MF_GRAYED;
+
+ EnableMenuItem ( hmenu, IDM_FILESETUP, status);
+ UNREFERENCED_PARAMETER(j);
+
+} // InitializeMenu
+
+
+/////////////////////////////////////////////////////////////////////////
+VOID NEAR PASCAL
+CloseAllChildren ()
+
+/*++
+
+Routine Description:
+
+ Destroys all MDI child windows.
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ register HWND hwndT;
+
+ // hide the MDI client window to avoid multiple repaints
+ ShowWindow(hwndMDIClient,SW_HIDE);
+
+ // As long as the MDI client has a child, destroy it
+ while ( hwndT = GetWindow (hwndMDIClient, GW_CHILD)){
+
+ // Skip the icon title windows
+ while (hwndT && GetWindow (hwndT, GW_OWNER))
+ hwndT = GetWindow (hwndT, GW_HWNDNEXT);
+
+ if (!hwndT)
+ break;
+
+ SendMessage (hwndMDIClient, WM_MDIDESTROY, (UINT)hwndT, 0L);
+ }
+
+} // CloseAllChildren
+
+
+/////////////////////////////////////////////////////////////////////////
+VOID NEAR PASCAL
+CommandHandler (
+ HWND hwnd,
+ UINT wParam,
+ LONG lParam
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ DLGPROC lpfnDlg;
+
+ switch (LOWORD(wParam)){
+ case IDM_FILENEW:
+ // Add a new, empty MDI child
+ AddFile (NULL);
+ break;
+
+ case IDM_FILEOPEN:
+ MyReadFile (hwnd);
+ break;
+
+ case IDM_FILEPRINT:
+ // Print the active child MDI
+ PrintFile (hwndActive);
+ break;
+
+ case IDM_FILESETUP:
+ // Set up the printer environment for this app
+ GetInitializationData (hwnd);
+ break;
+
+ case IDM_FILEMENU: {
+ // lengthen / shorten the size of the MDI menu
+ HMENU hMenu;
+ HMENU hWindowMenu;
+ INT i;
+
+ if (lpMenu == IDLOGVIEW) {
+ lpMenu = IDLOGVIEW2;
+ i = SHORTMENU;
+ }
+ else {
+ lpMenu = IDLOGVIEW;
+ i = WINDOWMENU;
+ }
+
+ hMenu = LoadMenu (hInst, lpMenu);
+ hWindowMenu = GetSubMenu (hMenu, i);
+
+ // Set the new menu
+ hMenu = (HMENU)SendMessage (hwndMDIClient,
+ WM_MDISETMENU,
+ (UINT)hMenu,
+ (LONG)hWindowMenu);
+
+ DestroyMenu (hMenu);
+ DrawMenuBar (hwndFrame);
+ break;
+ }
+
+ case IDM_FILEEXIT:
+ // Close LogView
+ SendMessage (hwnd, WM_CLOSE, 0, 0L);
+ break;
+
+ case IDM_HELPABOUT:
+ // Just let the shell display the about box...
+ ShellAbout(hwnd, szAppName, szAppName, LoadIcon(hInst, IDLOGVIEW));
+ break;
+
+ // The following are edit commands. Pass these off to the active child'd edit
+ // control window.
+ case IDM_EDITWRAP:
+ SendMessage(hwndActive, WM_COMMAND, GET_WM_COMMAND_MPS(IDM_EDITWRAP, 1, 0));
+ break;
+
+ case IDM_SEARCHPREV:
+ if (szSearch[0]) {
+ fReverse = TRUE;
+ Search(szSearch);
+ break;
+ }
+ // else fall through and bring up find dialog
+
+ case IDM_SEARCHNEXT:
+ if (szSearch[0]) {
+ fReverse = FALSE;
+ Search(szSearch);
+ break;
+ }
+ // else fall through and bring up find dialog
+
+ case IDM_SEARCHFIND:
+ if (hDlgFind)
+ SetFocus(hDlgFind);
+ else {
+ FR.lpstrFindWhat = szSearch;
+ FR.wFindWhatLen = CCHKEYMAX;
+ hDlgFind = FindText((LPFINDREPLACE)&FR);
+ }
+
+ break;
+
+ // The following are window commands - these are handled by the MDI Client.
+ case IDM_WINDOWTILE:
+ // Tile MDI windows
+ SendMessage (hwndMDIClient, WM_MDITILE, 0, 0L);
+ break;
+
+ case IDM_WINDOWCASCADE:
+ // Cascade MDI windows
+ SendMessage (hwndMDIClient, WM_MDICASCADE, 0, 0L);
+ break;
+
+ case IDM_WINDOWICONS:
+ // Auto - arrange MDI icons
+ SendMessage (hwndMDIClient, WM_MDIICONARRANGE, 0, 0L);
+ break;
+
+ case IDM_WINDOWCLOSEALL:
+ CloseAllChildren();
+
+ // Show the window since CloseAllChilren() hides the window for fewer repaints
+ ShowWindow( hwndMDIClient, SW_SHOW);
+ break;
+
+ case ID_HELP_CONT:
+ WinHelp(hwnd, HELP_FILE, HELP_CONTENTS, 0L);
+ break;
+
+ case ID_HELP_INDEX:
+ WinHelp(hwnd, HELP_FILE, HELP_PARTIALKEY, (DWORD) TEXT("\0"));
+ break;
+
+ case ID_HELP_USING:
+ WinHelp(hwnd, HELP_FILE, HELP_HELPONHELP, (DWORD) TEXT("\0"));
+ break;
+
+ default:
+ // This is essential, since there are frame WM_COMMANDS generated by the MDI
+ // system for activating child windows via the window menu.
+ DefFrameProc(hwnd, hwndMDIClient, WM_COMMAND, wParam, lParam);
+ }
+
+} // CommandHandler
+
+
+/////////////////////////////////////////////////////////////////////////
+SHORT
+MPError(
+ HWND hwnd,
+ WORD bFlags,
+ WORD id,
+ char *psz
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ CHAR sz[160];
+ CHAR szFmt[128];
+
+ LoadString (hInst, id, szFmt, sizeof (szFmt));
+ sprintf (sz, szFmt, psz );
+ LoadString (hInst, (WORD)IDS_APPNAME, (LPSTR)szFmt, sizeof (szFmt));
+ return( (SHORT)MessageBox (hwndFrame, sz, szFmt, bFlags));
+
+ UNREFERENCED_PARAMETER(hwnd);
+} // MPError
+
+
+/////////////////////////////////////////////////////////////////////////
+LPSTR
+GetCmdLine(
+ VOID
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ LPSTR lpCmdLine, lpT;
+
+ lpCmdLine = GetCommandLine();
+
+ // on Win32, lpCmdLine's first string includes its own name, remove this
+ if (*lpCmdLine) {
+ lpT = strchr(lpCmdLine, ' '); // skip self name
+
+ if (lpT) {
+ lpCmdLine = lpT;
+
+ while (*lpCmdLine == ' ') {
+ lpCmdLine++; // skip spaces to end or first cmd
+ }
+
+ } else {
+ lpCmdLine += strlen(lpCmdLine); // point to NULL
+ }
+ }
+ return(lpCmdLine);
+
+} // GetCmdLine
+
+
+#define CY_SHADOW 4
+#define CX_SHADOW 4
+
+/////////////////////////////////////////////////////////////////////////
+BOOL
+CenterWindow(
+ HWND hwndChild,
+ HWND hwndParent
+ )
+
+/*++
+
+Routine Description:
+
+
+Arguments:
+
+
+Return Value:
+
+
+--*/
+
+{
+ RECT rChild, rParent;
+ int wChild, hChild, wParent, hParent;
+ int wScreen, hScreen, xNew, yNew;
+ HDC hdc;
+
+ // Get the Height and Width of the child window
+ GetWindowRect (hwndChild, &rChild);
+ wChild = rChild.right - rChild.left;
+ hChild = rChild.bottom - rChild.top;
+
+ // Get the Height and Width of the parent window
+ GetWindowRect (hwndParent, &rParent);
+ wParent = rParent.right - rParent.left;
+ hParent = rParent.bottom - rParent.top;
+
+ // Get the display limits
+ hdc = GetDC (hwndChild);
+ wScreen = GetDeviceCaps (hdc, HORZRES);
+ hScreen = GetDeviceCaps (hdc, VERTRES);
+ ReleaseDC (hwndChild, hdc);
+
+ // Calculate new X position, then adjust for screen
+ xNew = rParent.left + ((wParent - wChild) /2);
+ if (xNew < 0)
+ xNew = 0;
+ else if ((xNew+wChild) > wScreen)
+ xNew = wScreen - wChild;
+
+ // Calculate new Y position, then adjust for screen
+ yNew = rParent.top + ((hParent - hChild) /2);
+ if (yNew < 0)
+ yNew = 0;
+ else if ((yNew+hChild) > hScreen)
+ yNew = hScreen - hChild;
+
+ // Set it, and return
+ return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+
+} // CenterWindow
diff --git a/private/nw/convert/logview/logview.dlg b/private/nw/convert/logview/logview.dlg
new file mode 100644
index 000000000..961272f7d
--- /dev/null
+++ b/private/nw/convert/logview/logview.dlg
@@ -0,0 +1,51 @@
+
+ABOUTBOX DIALOG DISCARDABLE 80, 40, 256, 94
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About LogView"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ ICON "LogView", -1, 6, 6, 0, 0
+ CTEXT "Logging Tool for NetWare in Windows NT Server",IDC_STATIC,45,
+ 5,200,8,NOT WS_GROUP
+ CTEXT "LogView Version 3.51",IDC_STATIC,45,15,200,8,NOT WS_GROUP
+ CTEXT "Copyright(c) Microsoft Corporation 1993-1996.",IDC_STATIC,45,25,200,8
+ CTEXT "All Rights Reserved.",IDC_STATIC,45,35,200,8
+
+ CONTROL "",IDC_STATIC,"Static",SS_BLACKRECT,45,45,200,1
+ LTEXT "Physical Memory:",IDC_STATIC,56,55,63,8,NOT WS_GROUP
+ LTEXT "(Avail mem)",IDC_PHYSICAL_MEM,127,55,129,8,NOT WS_GROUP
+ LTEXT "Disk Space:",IDC_STATIC,56,65,49,8,NOT WS_GROUP
+ LTEXT "(Disk space)",IDC_DISK_SPACE,127,65,128,8,NOT WS_GROUP
+
+ DEFPUSHBUTTON "OK",IDOK,108,77,40,14
+
+END
+
+
+// "Search/Find..." dialog box
+
+IDD_FIND DIALOG LOADONCALL MOVEABLE DISCARDABLE 18, 13, 167, 69
+FONT 8, "MS Shell Dlg"
+CAPTION "Find"
+STYLE WS_BORDER | DS_MODALFRAME | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
+BEGIN
+ CONTROL "&Find:", 100, "static", SS_RIGHT | WS_CHILD, 6, 12, 31, 10
+ CONTROL "", IDD_SEARCH, "edit", ES_LEFT | WS_BORDER | WS_TABSTOP | WS_CHILD, 43, 11, 114, 12
+ CONTROL "&Case Sensitive", IDD_CASE, "button", BS_CHECKBOX | WS_TABSTOP | WS_CHILD, 19, 28, 137, 12
+ CONTROL "&Next", IDOK, "button", BS_DEFPUSHBUTTON | WS_TABSTOP | WS_CHILD, 11, 48, 45, 14
+ CONTROL "&Previous", IDD_PREV, "button", BS_PUSHBUTTON | WS_TABSTOP | WS_CHILD, 63, 48, 45, 14
+ CONTROL "C&ancel", IDCANCEL, "button", BS_PUSHBUTTON | WS_TABSTOP | WS_CHILD, 116, 48, 43, 14
+END
+
+
+// Cancel dialog for printing
+
+IDD_PRINT DIALOG LOADONCALL MOVEABLE DISCARDABLE 20, 20, 90, 64
+FONT 8, "MS Shell Dlg"
+STYLE WS_BORDER | DS_MODALFRAME | WS_CAPTION | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
+CAPTION "Print"
+BEGIN
+ CTEXT "Now Printing", -1, 0, 8, 90, 8
+ CTEXT "", IDD_PRINTTITLE, 0, 18, 90, 8, SS_NOPREFIX
+ DEFPUSHBUTTON "Cancel" IDOK, 29, 44, 32, 14
+END
diff --git a/private/nw/convert/logview/logview.h b/private/nw/convert/logview/logview.h
new file mode 100644
index 000000000..69734edff
--- /dev/null
+++ b/private/nw/convert/logview/logview.h
@@ -0,0 +1,214 @@
+
+#include "windows.h"
+
+#ifndef WIN16
+#ifndef WIN32
+ #define WIN32 1 // placed because RC can't pass in C_DEFINES
+#endif
+ #include <commdlg.h>
+#endif
+
+#define CCHKEYMAX 32 // max characters in search string
+
+#define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
+#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
+#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
+#define GET_WM_COMMAND_MPS(id, hwnd, cmd) (UINT)MAKELONG(id, cmd), (LONG)(hwnd)
+#define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
+#define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (lp == (LONG)hwnd)
+
+#define WINDOWMENU 2 // position of window menu
+#define SHORTMENU 2 // position of short version window menu
+
+#define DEFFILESEARCH (LPSTR) "*.LOG"
+
+#ifdef RC_INVOKED
+#define ID(id) id
+#else
+#define ID(id) MAKEINTRESOURCE(id)
+#endif
+
+// edit control identifier
+#define ID_EDIT 0xCAC
+
+// resource ID's
+#define IDLOGVIEW ID(1)
+#define IDLOGVIEW2 ID(3)
+#define IDNOTE ID(2)
+
+// Window word values for child windows
+#define GWL_HWNDEDIT 0
+#define GWW_CHANGED 4
+#define GWL_WORDWRAP 6
+#define GWW_UNTITLED 10
+#define CBWNDEXTRA 12
+
+// menu ID's
+#define IDM_FILENEW 1001
+#define IDM_FILEOPEN 1002
+#define ID_HELP_INDEX 1003
+#define ID_HELP_USING 1004
+#define ID_HELP_CONT 1005
+#define IDM_FILEPRINT 1006
+#define IDM_FILEEXIT 1007
+#define IDM_FILEABOUT 1008
+#define IDM_FILESETUP 1009
+#define IDM_FILEMENU 1010
+
+#define IDM_EDITUNDO 2001
+#define IDM_EDITCUT 2002
+#define IDM_EDITCOPY 2003
+#define IDM_EDITPASTE 2004
+#define IDM_EDITCLEAR 2005
+#define IDM_EDITSELECT 2006
+#define IDM_EDITTIME 2007
+#define IDM_EDITWRAP 2008
+#define IDM_EDITFONT 2009
+#define IDM_EDITFIRST IDM_EDITUNDO
+#define IDM_EDITLAST IDM_EDITFONT
+
+#define IDM_SEARCHFIND 3001
+#define IDM_SEARCHNEXT 3002
+#define IDM_SEARCHPREV 3003
+#define IDM_SEARCHFIRST IDM_SEARCHFIND
+#define IDM_SEARCHLAST IDM_SEARCHPREV
+
+#define IDM_WINDOWTILE 4001
+#define IDM_WINDOWCASCADE 4002
+#define IDM_WINDOWCLOSEALL 4003
+#define IDM_WINDOWICONS 4004
+
+#define IDM_WINDOWCHILD 4100
+
+#define IDM_HELPHELP 5001
+#define IDM_HELPABOUT 5002
+#define IDM_HELPSPOT 5003
+
+#define IDD_FILEOPEN ID(200)
+#define IDD_FILENAME 201
+#define IDD_FILES 202
+#define IDD_PATH 203
+#define IDD_DIRS 204
+
+// dialog ids
+#define IDD_ABOUT ID(300)
+
+#define IDD_FIND ID(400)
+#define IDD_SEARCH 401
+#define IDD_PREV 402
+#define IDD_NEXT IDOK
+#define IDD_CASE 403
+
+#define IDD_SAVEAS ID(500)
+#define IDD_SAVEFROM 501
+#define IDD_SAVETO 502
+
+#define IDD_PRINT ID(600)
+#define IDD_PRINTDEVICE 601
+#define IDD_PRINTPORT 602
+#define IDD_PRINTTITLE 603
+
+#define IDD_FONT ID(700)
+#define IDD_FACES 701
+#define IDD_SIZES 702
+#define IDD_BOLD 703
+#define IDD_ITALIC 704
+#define IDD_FONTTITLE 705
+
+// +------------------------------------------------------------------------+
+// About Box
+// +------------------------------------------------------------------------+
+#define IDC_AVAIL_MEM 101
+#define IDC_PHYSICAL_MEM 101
+#define IDC_LICENSEE_COMPANY 104
+#define IDC_LICENSEE_NAME 105
+#define IDD_SPLASH 105
+#define IDC_MATH_COPR 106
+#define IDC_DISK_SPACE 107
+#define IDC_BIGICON 1001
+
+// strings
+#define IDS_CANTOPEN 1
+#define IDS_CANTREAD 2
+#define IDS_CANTCREATE 3
+#define IDS_CANTWRITE 4
+#define IDS_ILLFNM 5
+#define IDS_ADDEXT 6
+#define IDS_CLOSESAVE 7
+#define IDS_CANTFIND 8
+#define IDS_HELPNOTAVAIL 9
+#define IDS_CANTFINDSTR 10
+
+#define IDS_CLIENTTITLE 16
+#define IDS_UNTITLED 17
+#define IDS_APPNAME 18
+
+#define IDS_PRINTJOB 24
+#define IDS_PRINTERROR 25
+
+#define IDS_DISK_SPACE_UNAVAIL 26
+#define IDS_DISK_SPACE 27
+#define IDS_MATH_COPR_NOTPRESENT 28
+#define IDS_MATH_COPR_PRESENT 29
+#define IDS_AVAIL_MEM 30
+#define IDS_PHYSICAL_MEM 31
+
+#define IDS_OPENTEXT 32
+#define IDS_OPENFILTER 33
+#define IDS_DEFEXT 34
+
+#define IDC_STATIC -1
+
+
+// attribute flags for DlgDirList
+#define ATTR_DIRS 0xC010 // find drives and directories
+#define ATTR_FILES 0x0000 // find ordinary files
+#define PROP_FILENAME szPropertyName // name of property for dialog
+
+
+// External variable declarations
+extern HANDLE hInst; // application instance handle
+extern HANDLE hAccel; // resource handle of accelerators
+extern HWND hwndFrame; // main window handle
+extern HWND hwndMDIClient; // handle of MDI Client window
+extern HWND hwndActive; // handle of current active MDI child
+extern HWND hwndActiveEdit; // handle of edit control in active child
+extern LONG styleDefault; // default child creation state
+extern CHAR szChild[]; // class of child
+extern CHAR szSearch[]; // search string
+extern CHAR *szDriver; // name of printer driver
+extern CHAR szPropertyName[]; // filename property for dialog box
+extern INT iPrinter; // level of printing capability
+extern BOOL fCase; // searches case sensitive
+extern WORD cFonts; // number of fonts enumerated
+
+extern FINDREPLACE FR;
+extern UINT wHlpMsg;
+extern UINT wFRMsg;
+extern BOOL fReverse;
+
+extern HANDLE hStdCursor, hWaitCursor;
+
+// externally declared functions
+extern BOOL APIENTRY InitializeApplication(VOID);
+extern BOOL APIENTRY InitializeInstance(LPSTR,INT);
+extern BOOL APIENTRY AboutDlgProc(HWND,UINT,UINT,LONG);
+extern HWND APIENTRY AddFile(CHAR *);
+extern VOID APIENTRY MyReadFile(HWND);
+extern INT APIENTRY LoadFile(HWND, CHAR *);
+extern VOID APIENTRY PrintFile(HWND);
+extern BOOL APIENTRY GetInitializationData(HWND);
+extern SHORT MPError(HWND,WORD,WORD, char *);
+extern VOID APIENTRY Find(VOID);
+extern VOID APIENTRY FindNext(VOID);
+extern VOID APIENTRY FindPrev(VOID);
+extern LONG APIENTRY MPFrameWndProc(HWND,UINT,UINT,LONG);
+extern LONG APIENTRY MPMDIChildWndProc(HWND,UINT,UINT,LONG);
+extern HDC APIENTRY GetPrinterDC(BOOL);
+extern VOID NEAR PASCAL SetSaveFrom (HWND, PSTR);
+extern BOOL NEAR PASCAL RealSlowCompare (PSTR, PSTR);
+extern VOID APIENTRY FindPrev (VOID);
+extern VOID APIENTRY FindNext (VOID);
+extern BOOL NEAR PASCAL IsWild (PSTR);
+extern VOID NEAR PASCAL SelectFile (HWND);
+extern VOID NEAR PASCAL Local_FindText ( INT );
diff --git a/private/nw/convert/logview/logview.rc b/private/nw/convert/logview/logview.rc
new file mode 100644
index 000000000..16e69a74e
--- /dev/null
+++ b/private/nw/convert/logview/logview.rc
@@ -0,0 +1,111 @@
+
+#include "logview.h"
+#include "version.h"
+
+IDLOGVIEW ICON FV300.ico // main icon
+LogView ICON FV300.ICO
+IDNOTE ICON note300.ico // icon for child windows
+
+// frame window menu
+
+IDLOGVIEW MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Open...", IDM_FILEOPEN
+ MENUITEM SEPARATOR
+ MENUITEM "&Print", IDM_FILEPRINT
+ MENUITEM "Printer Se&tup...", IDM_FILESETUP
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", IDM_FILEEXIT
+ END
+ POPUP "&Search"
+ BEGIN
+ MENUITEM "&Find...", IDM_SEARCHFIND
+ MENUITEM "&Next\tF3", IDM_SEARCHNEXT
+ MENUITEM "&Previous\tF4", IDM_SEARCHPREV
+ END
+ POPUP "&Window"
+ BEGIN
+ MENUITEM "&Tile", IDM_WINDOWTILE
+ MENUITEM "&Cascade", IDM_WINDOWCASCADE
+ MENUITEM "Arrange &Icons", IDM_WINDOWICONS
+ MENUITEM "Close &All", IDM_WINDOWCLOSEALL
+ END
+ POPUP "&Help"
+ {
+ MENUITEM "&Contents", ID_HELP_CONT
+ MENUITEM "&Search for Help on...", ID_HELP_INDEX
+ MENUITEM "&How to Use Help", ID_HELP_USING
+ MENUITEM SEPARATOR
+ MENUITEM "&About LogView...", IDM_HELPABOUT
+ }
+END
+
+// short frame window menu
+IDLOGVIEW2 MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Open...", IDM_FILEOPEN
+ MENUITEM SEPARATOR
+ MENUITEM "&Print...", IDM_FILEPRINT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", IDM_FILEEXIT
+ MENUITEM SEPARATOR
+ MENUITEM "&About logview...", IDM_HELPABOUT
+ END
+ POPUP "&Window"
+ BEGIN
+ MENUITEM "&Arrange", IDM_WINDOWTILE
+ END
+END
+
+// frame menu accelerators
+
+IDLOGVIEW ACCELERATORS
+BEGIN
+ VK_INSERT, IDM_EDITCOPY, VIRTKEY, CONTROL
+ VK_INSERT, IDM_EDITPASTE, VIRTKEY, SHIFT
+ VK_DELETE, IDM_EDITCUT, VIRTKEY, SHIFT
+ VK_BACK, IDM_EDITUNDO, VIRTKEY, ALT
+ VK_F5, IDM_EDITTIME, VIRTKEY
+ VK_F3, IDM_SEARCHNEXT, VIRTKEY
+ VK_F4, IDM_SEARCHPREV, VIRTKEY
+ VK_F1, IDM_HELPHELP, VIRTKEY
+ VK_F1, IDM_HELPSPOT, VIRTKEY, SHIFT
+END
+
+
+
+STRINGTABLE
+BEGIN
+
+IDS_CANTOPEN "Can't open the file '%s'"
+IDS_CANTREAD "Can't read the file '%s'"
+IDS_CANTCREATE "Can't create the file '%s'"
+IDS_CANTWRITE "Can't write the file '%s'"
+IDS_ADDEXT ".TXT"
+IDS_ILLFNM "Invalid filename: '%s'"
+IDS_CLOSESAVE "%s has been changed. Save file before closing?"
+IDS_CANTFIND "Can't find '%s'"
+IDS_HELPNOTAVAIL "Can't load Windows Help application"
+IDS_CLIENTTITLE "LogView App, Version 3.51"
+IDS_UNTITLED "Untitled"
+IDS_PRINTJOB "LogView - "
+IDS_PRINTERROR "Cannot print %s!"
+IDS_APPNAME "LogView"
+IDS_CANTFINDSTR "Can't find string"
+
+ IDS_DISK_SPACE_UNAVAIL "Unavailable"
+ IDS_DISK_SPACE "%lu KB Free"
+ IDS_MATH_COPR_NOTPRESENT "Not present"
+ IDS_MATH_COPR_PRESENT "Present"
+ IDS_PHYSICAL_MEM "%lu KB Free"
+
+IDS_OPENTEXT "Open TextFiles"
+IDS_OPENFILTER "Log Files(*.LOG)\0*.LOG\0"
+IDS_DEFEXT "LOG"
+END
+
+#include "logview.dlg"
diff --git a/private/nw/convert/logview/makefile b/private/nw/convert/logview/makefile
new file mode 100644
index 000000000..6ee4f43fa
--- /dev/null
+++ b/private/nw/convert/logview/makefile
@@ -0,0 +1,6 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/private/nw/convert/logview/note300.ico b/private/nw/convert/logview/note300.ico
new file mode 100644
index 000000000..0446c5579
--- /dev/null
+++ b/private/nw/convert/logview/note300.ico
Binary files differ
diff --git a/private/nw/convert/logview/sources b/private/nw/convert/logview/sources
new file mode 100644
index 000000000..46f19230d
--- /dev/null
+++ b/private/nw/convert/logview/sources
@@ -0,0 +1,23 @@
+TARGETNAME=logview
+TARGETPATH=obj
+TARGETTYPE=PROGRAM
+
+TARGETLIBS=\
+ $(BASEDIR)\public\sdk\lib\*\shell32.lib \
+ $(BASEDIR)\public\sdk\lib\*\comdlg32.lib
+
+C_DEFINES=-DWIN32 -DWINVER=0x0400
+
+SUBSYSTEM_VERSION=4.00
+
+SOURCES=\
+ LOGVIEW.RC \
+ LOGVIEW.C \
+ FVFILE.C \
+ FVFIND.C \
+ FVINIT.C \
+ FVOPEN.C \
+ FVPRINT.C
+
+UMTYPE=windows
+UMENTRY=winmain
diff --git a/private/nw/convert/logview/version.h b/private/nw/convert/logview/version.h
new file mode 100644
index 000000000..ba9fb71b6
--- /dev/null
+++ b/private/nw/convert/logview/version.h
@@ -0,0 +1,52 @@
+/*
+** Template for version resources. Place this in your .rc file,
+** editing the values for VER_FILETYPE, VER_FILESUBTYPE,
+** VER_FILEDESCRIPTION_STR and VER_INTERNALNAME_STR as needed.
+** See winver.h for possible values.
+**
+** Ntverp.h defines several global values that don't need to be
+** changed except for official releases such as betas, sdk updates, etc.
+**
+** Common.ver has the actual version resource structure that all these
+** #defines eventually initialize.
+*/
+
+/* #include <windows.h> needed if this will be the .rc file */
+
+#include <ntverp.h>
+
+/*-----------------------------------------------*/
+/* the following lines are specific to this file */
+/*-----------------------------------------------*/
+
+/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR
+ * and VER_INTERNALNAME_STR must be defined before including COMMON.VER
+ * The strings don't need a '\0', since common.ver has them.
+ */
+#define VER_FILETYPE VFT_APP
+/* possible values: VFT_UNKNOWN
+ VFT_APP
+ VFT_DLL
+ VFT_DRV
+ VFT_FONT
+ VFT_VXD
+ VFT_STATIC_LIB
+*/
+#define VER_FILESUBTYPE VFT2_UNKNOWN
+/* possible values VFT2_UNKNOWN
+ VFT2_DRV_PRINTER
+ VFT2_DRV_KEYBOARD
+ VFT2_DRV_LANGUAGE
+ VFT2_DRV_DISPLAY
+ VFT2_DRV_MOUSE
+ VFT2_DRV_NETWORK
+ VFT2_DRV_SYSTEM
+ VFT2_DRV_INSTALLABLE
+ VFT2_DRV_SOUND
+ VFT2_DRV_COMM
+*/
+#define VER_FILEDESCRIPTION_STR "Migration Tool for NetWare Log File Viewer"
+#define VER_INTERNALNAME_STR "LogView"
+#define VER_ORIGINALFILENAME_STR "LOGVIEW.EXE"
+
+#include "common.ver"