#include #include static int error_handler (Display *d, XErrorEvent *ev) { return 1; } int main (int argc, char *argv[]) { Display *d; Atom type = None; int format; unsigned long nitems; unsigned long after; unsigned char *data = NULL; d = XOpenDisplay (NULL); XSetErrorHandler (error_handler); XGetWindowProperty (d, (Window)12345, XA_WM_NAME, 0, 0, False, XA_WM_NAME, &type, &format, &nitems, &after, &data); if (data) XFree (data); return 0; }