Mail Archives: djgpp/1998/08/20/01:16:46
OoHOSEoO wrote:
> Hello, I was wondering if there is a way I can have a DOS Console application
> close its own window when run through Windows... I am aware of the "Close On
> Exit" feature of Windows' short-cuts, but that only helps me so much.
> I'd appreciate any suggestions.
I actually found a way to do this in a 16-bit application. I tried to convert it
into DJGPP and it gave confusing results. I've been told that explicitely writing
int main()
{
asm ("int $0x19;");
}
was effectively the same as
#include <dpmi.h>
#include <string.h>
int main()
{
__dpmi_regs Regs;
memset(&Regs, 0, sizeof(Regs));
__dpmi_int(0x19, &Regs);
}
But these 2 programs run differently. These call interrupt #19, which is supposed
to reboot the computer, apparently Win95 catches this and just closes the DOS
Box. This is a trick I used to use in Borland C++. The first example works as I
expected, whenever you with to end your program AND the DOS box your in, just put
a line:
asm ("int $0x19;");
and the DOS box will close, if you are in real dos, your machine will reboot. I
am confused by the way the __dpmi_int call works differently though, it locks the
machine for about 5 seconds then a window pops up saying the application has ended
improperly and must be restarted. What does __dpmi_int do that is different?
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -