This example gets the window user ID. The process owns the window resource and is running at the same sensitivity label so no privileges are required.
/* Get the user ID of the window */ retval = XTSOLgetResUID(display, window, IsWindow, &uid);