Mail Archives: djgpp/1994/05/16/01:15:05
> Some of these apps, however, need a way to trap ctrl-c so they can clean up
> before exit. Go32 seems to catch this, itself, and bails with a comment.
Here's how I handle control-c in a djgcc program. To some extent, the way I
do things is the same as I do under other environments, so not everything I
do may be necessary, and there may be alternatives.
1. At startup, I call _go32_want_control_break(1);
2. I call ctrlbrk(cbreak); where cbreak is
#define DO_NOT_ABORT 1
int cbreak(void)
{
Ctlchit = TRUE;
return(DO_NOT_ABORT);
}
3. I read the keyboard using int 0x21, ah=6, dl=0xff which does not do a
control-c check or with int 0x16.
At various points, I check global variable Ctlchit to see if I need to abort
the current operation.
- Raw text -