home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / apmt34.zip / CLEARMSG.CMD < prev    next >
OS/2 REXX Batch file  |  1994-07-15  |  2KB  |  43 lines

  1. /******************************************************************/
  2. /* This program loops and every 10 seconds looks at the top most  */
  3. /* window at the desktop. If the top window is a system trap      */
  4. /* window, it dismisses the window by clicking on the first       */
  5. /* pushbutton.                                                    */
  6. /* Note that this window does not return any text to APMT queries.*/
  7. /* The title and the labels are all blanks, even though the user  */
  8. /* sees differently. Also it is not possible to get the trap      */
  9. /* information using APMT (that would be nice!)                   */
  10. /******************************************************************/
  11. signal on error name  errorexit
  12. call LoadFUNC
  13. rc = INIT_SESSION()
  14. if rc \= 0 then signal errorexit
  15. signal on HALT name Break
  16. do while 1=1
  17.    rc = WAIT(10000)
  18.    rc = SELECT_WINDOW("*")
  19.    rc = QUERY_TITLE("title")
  20.    rc = PUSHBUTTON_QUERY_ALL("pbs")
  21.    /* A tell-tale sign that we are looking at the system trap window */
  22.    if title = '' & pbs.0 = 2 & pbs.1 = "" & pbs.2 = ""
  23.       then rc = PUSHBUTTON_CLICK("")
  24.    end
  25. /******************************************************************/
  26. Break:
  27. rc = END_SESSION();
  28. exit
  29. /******************************************************************/
  30. errorexit:
  31. call DropFUNC
  32. exit
  33. LoadFUNC:
  34.  call rxfuncadd  'APMTLoadFuncs',  'apmtext', 'APMTLoadFuncs'  /* entry points from the DLL    */
  35.  call APMTLoadFuncs;
  36. return
  37.  
  38. DropFUNC:
  39.  call APMTDropFuncs;
  40.  call rxfuncdrop(APMTDropFuncs)
  41. return
  42.  
  43.