Your communication object must be able to remove itself from the chain and keep the chain intact. When the communication object does remove itself, it is no longer the active object. This can be carried out as follows:

The following code fragment illustrates this process:

        case WM_DESTROY:

            hwndPrevious = (HWND) WinQueryWindowULong (hwnd, COM_HWND);

            hwndLatest = (HWND) WinSendMsg (hwnd,
                                     HM_QUERY,
                                     MPFROM2SHORT ((USHORT)0, HMQW_OBJCOM_WINDOW),
                                     NULL);

            WinMessageBox (HWND_DESKTOP,
                           HWND_DESKTOP,
                           (PCH)str,
                           (PCH)"IPF Sample Error Message",
                           1,
                           MB_OK | MB_APPLMODAL |
                           MB_MOVEABLE | MB_ICONASTERISK);
            WinSendMsg (hwndLatest,
                        HM_UPDATE_OBJCOM_WINDOW_CHAIN,
                        (MPARAM) hwndPrevious,
                        (MPARAM) WinQueryWindow (hwnd, QW_PARENT));

            rValue = FALSE;
            break;

        default:

            rValue = TRUE;
            break;

    }
}


[Back] [Next]