home *** CD-ROM | disk | FTP | other *** search
- // Copyright ⌐ Nick Payne 1993
- // CIS 100033,3030
-
- #include <windows.h>
- #include <string.h>
- #include <stdio.h>
-
- #define argv __argv
-
- extern char **argv;
-
- int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpszCmdLine, int nCmdShow)
- {
- POFSTRUCT pof;
- char execCmd[80];
- HWND hWindow;
- RECT rect;
-
- // is there a parameter on the command line?
- if (_fstrlen(lpszCmdLine) == 0)
- _fstrcpy(lpszCmdLine, "SYSNEWS.TXT");
-
- // does the file exist?
- if (OpenFile(lpszCmdLine, pof, OF_READ | OF_EXIST) != -1)
- {
- _fstrcpy(execCmd, "NOTEPAD.EXE ");
- _fstrcat(execCmd, lpszCmdLine);
-
- WinExec(execCmd, SW_NORMAL); // fire up Notepad
- // get its window handle
- hWindow = FindWindow("Notepad", NULL);
- if (hWindow != NULL)
- // force the Notepad window to stay on top
- SetWindowPos(hWindow, HWND_TOPMOST, 0, 0, 0, 0,
- SWP_NOMOVE | SWP_NOSIZE);
- }
-
- return 0;
- }