XtArgVal should be a type that encompasses XtPointer and long integer types. In the X.org implementation it is currently defined as (long). Don't use (unsigned int *) instead of (Window *).