Hi, all. 

I use XChangeProperty/XGetWindowProperty as following code:
 
#include <stdio.h&gt;
#include <X11/Xlib.h&gt;
#include <X11/Xatom.h&gt;

int main(void)
{
&nbsp;&nbsp;&nbsp; Display *display=XOpenDisplay(NULL);
&nbsp;&nbsp;&nbsp; int screen=DefaultScreen(display);
&nbsp;&nbsp;&nbsp; Window root_win=RootWindow(display, screen);

&nbsp;&nbsp;&nbsp; Window win=XCreateSimpleWindow(display, root_win, -1, -1, 1, 
1, 0, 0, 0);
&nbsp;&nbsp;&nbsp; Atom prop=XInternAtom(display, "test_prop", False);
&nbsp;&nbsp;&nbsp; Atom type=XInternAtom(display, "test_type", False);
&nbsp;&nbsp;&nbsp; int32_t a[]={0x11223344, 0x55667788};
&nbsp;&nbsp;&nbsp; XChangeProperty(display, win, prop, type, 32, 
PropModeReplace, (unsigned char *)a, 2);

&nbsp;&nbsp;&nbsp; int fmt;
&nbsp;&nbsp;&nbsp; unsigned long nitems=0, n=0, rest;
&nbsp;&nbsp;&nbsp; unsigned char *p=NULL;
&nbsp;&nbsp;&nbsp; Atom atype;
&nbsp;&nbsp;&nbsp; if( XGetWindowProperty(display, win, prop, 0, 2, False,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type, &amp;atype, &amp;fmt, &amp;n, 
&amp;rest, &amp;p) != Success
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || !atype || !fmt || !n || !p)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XFree(p), p=NULL;
&nbsp;&nbsp;&nbsp; long *d=(long *)p;
&nbsp;&nbsp;&nbsp; printf("%lx, %lx, %lu\n", d[0], d[1], rest);

&nbsp;&nbsp;&nbsp; XCloseDisplay(display);

&nbsp;&nbsp;&nbsp; return 0;
}



But the output is:


406643764
406643...@qq.com



&nbsp;

Reply via email to