[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference unxa::cde

Title:CDE on Digital UNIXonment - CDE
Notice:CDE on Digital UNIX - for CDE on VMS, please see Note 1.3
Moderator:UNXA::SYSTEM
Created:Tue Nov 23 1993
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:660
Total number of notes:2674

636.0. "How to check if CDE is running?" by AOSF1::kras (Cyber-Shredder) Fri Apr 18 1997 16:34

An ISV asked me if there is any easy way to tell if CDE is running on a 
system?  They want to be able to make a check in thier code for this.
T.RTitleUserPersonal
Name
DateLines
636.1UNXA::BEUTENo good deed ever goes unpunished...Mon Apr 21 1997 11:0945
>>An ISV asked me if there is any easy way to tell if CDE is running on a 
>>system?  They want to be able to make a check in thier code for this.

What part of CDE? The login manager? the session manager? the window 
manager? Lots of this is customizable. Here's a code snippet used by
the Sysman apps to figure out if the system is running dtwm vs mwm.

/*
 * Function:
 *      IsCDEWMRunning - returns true of dtwm is running. This is
 *      a hack for now cause there is no CDE equivalent
 *      to XmIsMotifWMRunning.
 * Inputs:
 *
 * Outputs:
 *
 * Returns:
 *      true is dtwm is running.
 * Notes:
 *      The check below relies on the DtWsmGetCurrentWorkspace function.
 *      This is only a hueristic since some other wm might
 *      emulate dtwm but it's good enough for our purposes.
 */
#if AM_PROTO_OK

Boolean IsCDEWMRunning(Widget toplevel)

#else

Boolean IsCDEWMRunning(toplevel)

     Widget toplevel;

#endif /* AM_PROTO_OK */
{
Status status;
Atom workspace;

    status = DtWsmGetCurrentWorkspace(XtDisplay(toplevel),
                RootWindowOfScreen(DefaultScreenOfDisplay(XtDisplay(toplevel))),
                &workspace);

    return(status == Success);