home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************/
- /* CPPTSR.C */
- /* (C) U.Killermann & toolbox 1990 */
- /**********************************************************/
-
- /* disp_tsr.c - demonstriert die Anwendung des tsr und
- disp packages von Zortech
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <bios.h>
- #include <disp.h> // TSR wird aktiviert durch gleich-
- #include <dos.h> // zeitiges drücken von CTRL+LSHIFT+Q
- #include <time.h> // Fingerprint des TSR
- #include <tsr.h> // Puffer für gelöschten
- // Bildschirmberreich
- unsigned TSR_HOTSHIFT = CTRL+LSHIFT;
- char TSR_HOTSCAN = SCAN_Q;
- char tsr_fprint[20]="Message_V0.1";
- unsigned buff[11*31*2];
-
- union REGS regs;
- unsigned int cur_pg, cur_s, cur_p;
-
- int i;
- // POPUP mit Debuginfo
- main() // falls bereits resident
- { // entfernen !
- // Sonst Fehlermeldung
- int i;
- i=tsr_install(POPONLY | TSR_DEBUG);
- if (i==1)
- tsr_uninstall();
- else
- printf("Error Installing TSR !: %d \n",i);
- }
-
- void popmain(void) // kontrolliert das Geschehen
- /* Die Routine speichert die aktuelle Cusorposition, öffnet
- ein Fenster, schreibt "Hallo Welt !" in das Fenster,
- schließt das Fenster und restauriert den Cursor.
- */
- {
- save_cursor();
- disp_open();
- disp_peekbox(buff,5,10,15,40);
- disp_box(0,DISP_NORMAL,5,10,15,40);
- disp_fillbox(DISP_NORMAL*256+' ',6,11,14,39);
- disp_move(6,12);
- disp_puts("Hallo Welt ! \n");
- msleep(2000);
- disp_pokebox(buff,5,10,15,40);
- disp_close();
- restore_cursor();
- }
-
- save_cursor()
- /* speichert die aktuelle Cursorposition
- in cur_pg, cur_p, cur_s */
- {
- regs.x.ax=15*256;
- int86(0x10,®s,®s);
- cur_pg = regs.x.bx;
- regs.x.ax=3*256;
- int86(0x10,®s,®s);
- cur_p = regs.x.dx;
- cur_s = regs.x.cx;
- regs.x.dx=(24*256)+80;
- regs.x.ax=2*256;
- regs.x.bx=cur_pg;
- int86(0x10,®s,®s);
- }
-
- restore_cursor()
- /* restauriert die Cursorposition aus cur_pg,cur_p, cur_s */
- {
- regs.x.ax=256;
- regs.x.bx=cur_pg;
- regs.x.cx=cur_s;
- int86(0x10,®s,®s);
- regs.x.dx=cur_p;
- regs.x.ax=2*256;
- int86(0x10,®s,®s);
- }