X programmers often misunderstand the role of the window manager. The answer to all of these questions is that, with very few exceptions, X application programs should not directly implement any of these features. The window manager implements them and application programs should request them only by communicating with the window manager. It covers most of its material very well and I recommend that you study it.
Application programs are responsible for widgets beneath their shell widgets.
Applications should use these interfaces whenever possible. Simply setting the resources will cause your application to participate in the protocols. Note that most of the resources are hints, not demands. Most modern window managers support all the protocols, though some may decide not to implement some of them some or all of the time. X Toolkit application programmers have a much easier time.