mHandle = WinWindowFromID( HWND_OBJECT, ID_MESSAGEWINDOW );
HATOMTBL  hatomtbl; HENUM     henum; HWND      hwndNext; char      classname[CCHMAXPATH];  mHandle = NULLHANDLE;  hatomtbl = WinQuerySystemAtomTable(); mMsgWindowAtom = WinFindAtom(hatomtbl, className()); if (mMsgWindowAtom == 0) {   mMsgWindowAtom = WinAddAtom(hatomtbl, className()); } else {    henum = WinBeginEnumWindows(HWND_OBJECT); while ((hwndNext = WinGetNextWindow(henum)) != NULLHANDLE) { if (WinQueryWindowUShort(hwndNext, QWS_ID) == (USHORT)mMsgWindowAtom) { WinQueryClassName(hwndNext, CCHMAXPATH, classname); if (strcmp(classname, className()) == 0) { mHandle = hwndNext; break; } } } }
    MessageWindow() {        // Try to find window.        // XXX need to improve this to use check the class        mHandle = WinWindowFromID( HWND_OBJECT, ID_MESSAGEWINDOW );     }