Ok, this case is now solved.
I was informed about the Python's ctypes module. Ctypes is used to call external functions from Python. So I can call library and its XFixesGetCursorImage() function from Python.

For more info, read this thread.
Includes also an example.


  Osmo (moma) Antero

Osmo Maatta wrote:
I would like to get cursor/mouse-pointer image for an application window in Linux. 
I have studied several libraries that support Python, but haven't found a suitable function to read cursor or mouse-pointer image.

PyGTK :  No success.
Wnck python library:  No success.
Xlib Python: Did not find any suitable function. Did I miss something?

I've done it in c-code earlier and it works well. It uses XFixesGetCursorImage(display) function.
The c-code is here:

GdkPixbuf *get_cursor_pixbuf(Display *display, GdkWindow *gdk_win, gint *cursor_x,
                 gint *cursor_y, gint *offset_x , gint *offset_y/*x-y hot spot */) {

        GdkWindow *gdk_root = gdk_get_default_root_window();

        /* Cursor image */
        GdkPixbuf *cursor_pixbuf = NULL;

        /* Check if the XFIXES extension is present in the Xorg. */
        int event, error;
        if (XFixesQueryExtension(display, &event, &error))
                XFixesCursorImage *cur = XFixesGetCursorImage(display);

Does Python-Xlib have this function?
I would like to use a Python library on Linux.
Can you help?

My system is: Ubuntu 9.10 64bit.
http:/ (.com)