Step 2: Handle WM_GETOBJECT Messages

[This is preliminary documentation and subject to change.]

After initializing the COM library, the server will idle until it has a WM_GETOBJECT message to process. The object, if found, is returned in the LRESULT of the message; otherwise NULL is returned.

MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg)
    {

        case WM_GETOBJECT:
            if (fShuttingDown)
                return(NULL);

            return(GetObjectPointer(hwnd, wParam, lParam));

}