home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1529 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  2.5 KB

  1. Path: sparky!uunet!mcsun!uknet!axion!apricot!marcusj
  2. From: marcusj@apricot.co.uk (Marcus Jenkins)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: App./TSR needs to know that a DOS session has focus - How?
  5. Message-ID: <1992Aug27.073803.15216@apricot.co.uk>
  6. Date: 27 Aug 92 07:38:03 GMT
  7. References: <1992Aug25.093642.8421@apricot.co.uk> <1992Aug27.022006.15021@mnemosyne.cs.du.edu>
  8. Organization: Apricot Computers Limited
  9. Lines: 51
  10.  
  11. bmcilroy@nyx.cs.du.edu (Bernie McIlroy) writes:
  12.  
  13. >In article <1992Aug25.093642.8421@apricot.co.uk> marcusj@apricot.co.uk (M
  14. >rcus Jenkins) writes:
  15. >>I have an app./TSR/DLL (and VxD for Enhanced Mode) system supporting
  16. >>some special hardware.  I want (at least) one of these components
  17. >>to be notified or find out by polling (and the latter would have to
  18. >>be a re-entrant service since I would be polling off a harware IRQ)
  19. >>that a DOS session is becoming active/inactive or is active.  How?
  20. >>
  21.  
  22. >There are three methods that come to mind:
  23. >  1) In your TSR, watch for the Windows INT 2Fh Startup broadcast.  When
  24. >     you see this, issues the INT 2Fh Get VM ID call.  At any given time,
  25. >     your TSR can call the Get VM ID and compare to the original value 
  26. >     which was the system VM ID.  (Sorry, I don't know the AX= numbers
  27. >     offhand...)
  28.  
  29. >  2) Your VxD will receive a VMM_Set_Execution_Focus call when you switch 
  30. >     VMs.  Keep track of where you are. 
  31.  
  32. >  3) At any time, your VxD can call Get_Cur_VM_Handle
  33. >     and Test_Sys_VM_Handle to see if the currently executing VM is
  34. >     a DOS box.
  35. >
  36.  
  37. There are problems with the above:
  38.  
  39. 1)  This only applies to Enhanced Mode - one of my biggest headaches
  40.     is the active Standard Mode DOS session.
  41.  
  42. 2)  I don't fancy issuing INT 2F's off a hardware interrupt.  I have 
  43.     tried before and run into serious re-entrancy problems.  This is
  44.     not suprising if you trace though INT 2Fh with Soft-ICE (or whatever).
  45.     You will find STI's all over the place (ANSI.SYS, DOS, HIMEM.SYS)
  46.     etc. etc..  I have never seen it specified that INT 2Fh is supposed
  47.     to be a re-entrant service.
  48.  
  49. Thanks for your ideas, anyway.
  50.  
  51. Anybody else?
  52.  
  53.  
  54.  _ _ _
  55. ' ) ) )                         Internet: marcusj@apricot.co.uk
  56.  / / / __.  __  _. . . _        UUCP: marcusj@apricot.uucp
  57. / ' (_(_/|_/ (_(__(_/_/_)_      If all else fails from US, try:  
  58. Marcus Jenkins                  apricot!marcusj@relay.EU.net
  59. Tel: +44 21 472 3002  Fax: +44 21 471 2935
  60. Disclaimer:  Anything I wrote above is, of course, my own view and
  61.              does not in any way represent my employer.
  62.