home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17903 < prev    next >
Encoding:
Text File  |  1992-11-13  |  2.4 KB  |  82 lines

  1. Xref: sparky comp.os.vms:17903 vmsnet.misc:1004
  2. Newsgroups: comp.os.vms,vmsnet.misc
  3. Path: sparky!uunet!mcsun!sunic!lth.se!styx!mats
  4. From: mats@efd.lth.se (Mats Akerberg)
  5. Subject: Re: Changing DECW PauseScreen background?
  6. In-Reply-To: jhautala@nyx.cs.du.edu's message of Thu, 12 Nov 92 19:10:05 GMT
  7. Message-ID: <MATS.92Nov13100412@styx.efd.lth.se>
  8. Lines: 67
  9. Sender: newsuser@lth.se (LTH network news server)
  10. Organization: EFD, Lund Inst. of Technology, Lund, Sweden
  11. References: <1992Nov12.191005.5083@mnemosyne.cs.du.edu>
  12. Date: 13 Nov 92 09:04:12 GMT
  13. Lines: 67
  14.  
  15. In article <1992Nov12.191005.5083@mnemosyne.cs.du.edu> jhautala@nyx.cs.du.edu (Jim Hautala) writes:
  16. >    I was wondering if anyone knows of a way to change the DECwindows
  17. >   Pausescreen background? Is it similar to the way you change the login
  18. >   screen??
  19. No it isn't!
  20.  
  21. I got The following from Paul Winalski (@ DEC) Thanks Paul!
  22.  
  23. >This code is public domain--feel free to use it or modify it to your heart's
  24. >content.
  25.  
  26.  
  27. /* SMPAUSEWINDOW.C - Routine to find the Session Manager pause window for   */
  28. /*                   DECwindows MOTIF on VMS.                               */
  29.  
  30. #include <decw$include/Xatom.h>
  31. #include <decw$include/Xlib.h>
  32.  
  33. static int SmPauseHandler(dpy, e)
  34.     Display *dpy;
  35.     XErrorEvent *e;
  36. {
  37.     /* ignore errors from GetWindowProperty */
  38.     
  39.     return 0;
  40. }
  41.  
  42.  
  43. Window SmPauseWindow(dpy, root)
  44.     Display *dpy;
  45.     Window root;
  46. {
  47.     char *pause_window = "_DEC_SM_PAUSE_WINDOW";
  48.     Atom pause_window_atom; 
  49.     Window *wid;
  50.     Window retval;
  51.     Atom type_returned;
  52.     int format_returned, status;
  53.     unsigned long num_items_returned, bytes_remaining;
  54.  
  55.     /* enable handler to trap errors (especially BadAtom) */
  56.     
  57.     XSetErrorHandler(&SmPauseHandler);
  58.  
  59.     pause_window_atom = XInternAtom (dpy, pause_window, True);
  60.  
  61.     status = XGetWindowProperty (dpy, root, pause_window_atom, 0, 1, False,
  62.                  XA_WINDOW, &type_returned, &format_returned,
  63.                  &num_items_returned, &bytes_remaining, &wid);
  64.  
  65.     /* disable the handler */
  66.     
  67.     XSetErrorHandler(0);
  68.  
  69.     if ((status != 0) || (type_returned == None))
  70.     return 0;    /* XGetWindowProperty failed */
  71.  
  72.     retval = *wid;
  73.     XFree(wid);
  74.     return retval;    /* Success */
  75. }
  76.  
  77. --
  78.   Mats Akerberg, System Manager (mats@efd.lth.se),(MATS@SELDC52) on Earn/Bitnet
  79.   Lund Institute of Technology ,School of Electrical Engineering and  
  80.   Computer Sciences. Snail: Box 118  S-221 00 Lund Sweden
  81.   Phone: + 46 46-109847 FAX: + 46 46-104013 
  82.