XtDisplayToApplicationContext - obtain an application context
#include <X11/Intrinsic.h>
XtAppContext XtDisplayToApplicationContext(Display* dpy);
Specifies the display that you want the application context for.
The XtDisplayToApplicationContext function returns the application context for the specified display.
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface