An application can create an object window by using the WinCreateWindow function and setting the desktop-object window as the parent window. The code fragment in the following figure shows how to create an object window.
#define ID_OBJWINDOW 2
HWND hwndObject;
hwndObject = WinCreateWindow(
HWND_OBJECT, /* Parent is object window. */
"MyObjClass", /* Window class for client */
NULL, /* Window text */
0, /* No styles for object window */
0, 0, /* Lower-left corner */
0, 0, /* Width and height */
NULL, /* No owner */
HWND_BOTTOM, /* Inserts window at bottom of z-order */
ID_OBJWINDOW, /* Window identifier */
NULL, /* No class-specific data */
NULL); /* No presentation data */