XGetClassHint()XGetClassHint()NameXGetClassHint – get the XA_WM_CLASS property of a window.
Synopsis
Status XGetClassHint(display, w, class_hints_return)
Display *display;
Window w;
XClassHint *class_hints_return;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
w Specifies the ID of the window for which the property is
desired.
class_hints_return
Returns the XClassHint structure.
Returns
Zero on failure, non-zero on success.
DescriptionXGetClassHint() obtains the XA_WM_CLASS property for the specified win‐
dow. This property stores the resource class and instance name, that
the window manager uses to get any resource settings that may control
how the window manager manages the application that set this property.
If the data returned by the server is in the Latin Portable Character
Encoding, then the returned strings are in the Host Portable Character
Encoding. Otherwise, the result is implementation-dependent. XGet‐
ClassHint() returns a Status of zero on failure, non-zero on success.
The XClassHint structure returned contains res_class, which is the name
of the client such as "emacs", and res_name, which should be the first
of the following that applies:
· Command-line option (-rn name)
· A specific environment variable (e.g., RESOURCE_NAME)
· The trailing component of argv[0] (after the last /)
To free res_name and res_class when finished with the strings, use
XFree().
For more information on using hints, see Volume One, Chapter 12, Inter‐
client Communication.
Structures
typedef struct {
char *res_name;
char *res_class;
} XClassHint;
Errors
BadWindow
See AlsoXAllocClassHint(), XFetchName(), XGetIconName(), XGetIconSizes(), XGet‐
NormalHints(), XGetSizeHints(), XGetTransientForHint(), XGetWMHints(),
XGetZoomHints(), XSetClassHint(), XSetCommand(), XSetIconName(), XSetI‐
conSizes(), XSetNormalHints(), XSetSizeHints(), XSetTransientForHint(),
XSetWMHints(), XSetZoomHints(), XStoreName(), XSetWMProperties(),
XSetWMProperties().
Xlib - Window Manager Hints XGetClassHint()