[907] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: killproc.c 1341 2008-12-14 22:18:26Z stevenhl $
|
---|
| 5 |
|
---|
| 6 | Process killer applet
|
---|
| 7 |
|
---|
| 8 | Copyright (c) 1993-98 M. Kimes
|
---|
| 9 | Copyright (c) 2008 Steven H.Levine
|
---|
| 10 |
|
---|
| 11 | 05 Jan 08 SHL Sync
|
---|
[1341] | 12 | 14 Dec 08 SHL Add exception handler support
|
---|
[907] | 13 |
|
---|
| 14 | ***********************************************************************/
|
---|
| 15 |
|
---|
[2] | 16 | #define INCL_DOS
|
---|
| 17 | #define INCL_WIN
|
---|
[1341] | 18 | #define INCL_DOSEXCEPTIONS // XCTP_...
|
---|
| 19 | #define INCL_DOSERRORS // NO_ERROR
|
---|
[2] | 20 |
|
---|
[1189] | 21 | #include "dll\fm3dll.h"
|
---|
[1341] | 22 | #include "dll\mainwnd.h" // FM3ModHandle
|
---|
[907] | 23 | #include "dll\fm3dlg.h"
|
---|
[1341] | 24 | #include "dll\init.h" // InitFM3DLL
|
---|
| 25 | #include "dll\killproc.h" // KillDlgProc
|
---|
| 26 | #include "dll\errutil.h" // Error reporting
|
---|
| 27 | #include "dll\excputil.h" // Exception handlers
|
---|
[2] | 28 |
|
---|
[1341] | 29 | static PSZ pszSrcFile = __FILE__;
|
---|
| 30 |
|
---|
[551] | 31 | int main(int argc, char *argv[])
|
---|
| 32 | {
|
---|
| 33 | HAB hab;
|
---|
| 34 | HMQ hmq;
|
---|
[1341] | 35 | APIRET regRet;
|
---|
| 36 | EXCEPTIONREGISTRATIONRECORD regRec = { NULL, NULL };
|
---|
[2] | 37 |
|
---|
| 38 | DosError(FERR_DISABLEHARDERR);
|
---|
[1341] | 39 |
|
---|
| 40 | regRec.ExceptionHandler = HandleException;
|
---|
| 41 | regRet = DosSetExceptionHandler(®Rec);
|
---|
| 42 | if (regRet != NO_ERROR) {
|
---|
| 43 | DbgMsg(pszSrcFile, __LINE__,
|
---|
| 44 | "DosSetExceptionHandler failed with error %u", regRet);
|
---|
| 45 | }
|
---|
| 46 |
|
---|
[2] | 47 | hab = WinInitialize(0);
|
---|
[551] | 48 | if (hab) {
|
---|
| 49 | hmq = WinCreateMsgQueue(hab, 256);
|
---|
| 50 | if (hmq) {
|
---|
| 51 | if (InitFM3DLL(hab, argc, argv)) {
|
---|
[1341] | 52 | WinDlgBox(HWND_DESKTOP,
|
---|
| 53 | HWND_DESKTOP, KillDlgProc, FM3ModHandle, KILL_FRAME, NULL);
|
---|
[2] | 54 | }
|
---|
| 55 | DosSleep(250L);
|
---|
| 56 | WinDestroyMsgQueue(hmq);
|
---|
| 57 | }
|
---|
| 58 | WinTerminate(hab);
|
---|
| 59 | }
|
---|
| 60 | return 0;
|
---|
| 61 | }
|
---|