source: trunk/killproc.c

Last change on this file was 1341, checked in by Steven Levine, 17 years ago

Ticket 26: add thread 1 exception handler support to applets

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
RevLine 
[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]29static PSZ pszSrcFile = __FILE__;
30
[551]31int 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(&regRec);
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}
Note: See TracBrowser for help on using the repository browser.