From: LiveSucks@hotmail.com   
      
   "Femme Verbeek" wrote:   
   > On second reading my solution probably only restores the previous text   
   > mode. I see that you want to return to some graphic state mode. What you   
   > are trying to do here is to solve a problem in your shell by means of   
   > modifying your client program. Even if you return to the previous   
   > graphic state, the shell may not rebuild its original screen.   
   > Any way the idea is clear. In the main body of the unit, store the   
   > videomode, and restore it the BYE procedure on exit.   
      
   Meanwhile I found a solution on the Web:   
      
   - Putting a screen-mode-detection-routine   
    and a screen-mode-setting-routine into a unit   
   - Calling the screen-mode-detection within the   
    initialization-part of that unit already   
   - Calling the mentioned unit as first item of the   
    uses-statement of the main-program   
      
   Sincerely   
      
   Sam   
      
   UNIT STARTVID;   
      
   INTERFACE   
   VAR   
    LastModus : INTEGER;   
      
   PROCEDURE SetStartMode;   
      
   IMPLEMENTATION   
      
   USES DOS;   
      
   PROCEDURE Int10h; ASSEMBLER;   
   {written by Pedt Scragg    
   Code is released into the Public Domain - please leave   
   this notice intact if redistributed}   
   asm   
    push di   
    push si   
    push es   
    push bp   
    int 10h   
    pop bp   
    pop es   
    pop si   
    pop di   
   end;   
      
   PROCEDURE Variable; ASSEMBLER;   
   {written by Pedt Scragg    
   Code is released into the Public Domain - please leave   
   this notice intact if redistributed}   
   asm   
    mov ah, 0fh   
    call int10h   
    xor dl, dl   
    xor bh, bh   
    push ax   
    mov ax, 1130h   
    call int10h   
    pop ax   
    or dl, dl   
    jne @@3   
    mov dl, 18h   
   @@3:   
    mov dh, dl   
    xor ah, ah   
    cmp dh, 18h   
    jbe @@4   
    inc ah   
   @@4:   
    mov LastModus, ax   
   end;   
      
   PROCEDURE SetStartMode;   
   {found this on SWAG,   
    by SWAG-support-team,   
    sets the video mode}   
   VAR   
    Regs : Registers;   
   BEGIN   
    regs.ah := 0;   
    regs.al := LastModus;   
    Intr($10,regs);   
   END;   
      
   BEGIN   
    Variable;   
    (*   
    This will set the variable "LastModus" to the   
    screen-mode which was current when this unit   
    was loaded/initialized.   
    The procedure SetStartMode will set the screen-mode   
    to the value which is stored in "LastModus".   
    *)   
   END.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|