home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PARADIS1 / DVOPEN.PAS < prev    next >
Pascal/Delphi Source File  |  1992-02-07  |  3KB  |  77 lines

  1. (4301)  Wed 5 Feb 92 11:57
  2. By: Robert Jenkins
  3. To: All
  4. Re: DESQview
  5. St:
  6. ---------------------------------------------------------------------------
  7. @EID:1185 005aa120
  8. @MSGID: 1:389/5@FidoNet 120bc4af
  9. Not long ago, some one posted a message wondering how to 'open a desqview
  10. window' from dos (once DV is running).  I have a procedure that will accept the
  11. path to DV's file '??-PIF.DVP' and open that window.  There is no error
  12. checking.  It is not to great, but here it is...
  13.  
  14. Unit DVWindow;
  15.  
  16. Interface
  17.  
  18. Procedure Open_DV_Window(DVP : String);
  19.  
  20. {Open a window in DESQview.  DVP := Path to XX-PIF.DVP file}
  21. {Example   ' C:\DV\BD-PIF.DVP'}
  22.  
  23.  
  24. {**************************************************************}
  25.  
  26. implementation
  27.  
  28.  
  29.  
  30. Procedure Open_DV_Window(DVP : String);  {DVP := Full path to XX-PIF.DVP}
  31.  
  32. Var F      : File;  {This will be DV's  XX-PIF.DVP file}
  33. Var Buf    : Array[1..416] of Byte;  {buffer to store XX-PIF.DVP}
  34. Var BufSeg : Word;  {Seg of the buffer}
  35. Var BufOfs : Word;  {Ofs of the buffer}
  36. Var Result : Word;  {Variable for the results of the BlockRead}
  37.  
  38. Begin
  39.      Assign(F,DVP);
  40.      Reset(F,416);               {The XX-PIF.DVP for DV 2.40 is 416 bytes}
  41.      BlockRead(F,Buf,1,Result);  {Block Read the file into the buffer}
  42.      Close(F);                   {Close the XX-PIF.DVP file}
  43.      bufSeg := Seg(buf);         {Get Segment of the buffer}
  44.      bufOfs := Ofs(buf);         {Get the offset of the buffer}
  45.      asm
  46.           push ax        ; {save the ax register                  }
  47.           push bx        ; {save the bx register                  }
  48.           push es        ; {save the es register                  }
  49.           push di        ; {save the di register                  }
  50.           mov ax,$102C   ; {load ax with the service request      }
  51.           mov bx,$1a0    ; {load bx with the size of the buffer   }
  52.           mov es,bufSeg  ; {load es with the seg of the buffer    }
  53.           mov di,bufOfs  ; {load di with the ofs of the buffer    }
  54.           int $15        ; {call the interrupt                    }
  55.           pop ax         ; {restore the ax register               }
  56.           pop bx         ; {restore the bx register               }
  57.           pop es         ; {restore the es register               }
  58.           pop di         ; {restore the di register               }
  59.      End; {end of the asm part}
  60. End; {end of Open_DV_Window}
  61.  
  62.  
  63. Begin
  64. End. {End of DVWindow Unit}
  65.  
  66.  
  67.  
  68. Hope this helps some one!
  69.  
  70. Robert,
  71.  
  72.  
  73. --- TosScan(q) 1.00
  74.  * Origin: ROBBS......................................? (1:389/5)
  75.  
  76. @PATH: 389/5 2 147/46 13/13 396/1 170/400 512/0 1007 
  77.