🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #614

Problem: WinQueryWindow

#614
From: Roman Fischer
Date: Fri, 31 Jul 1992 16:55
54 lines
1854 bytes
Hi everybody,

I think i've got a major understanding problem, but why does the second
'if' in the following sample code Beep ?

Or, why doesn't WinQueryWindow return HWND_DESKTOP ? What does it return ?

... hope the question isn't too stupid ...

thanx                     Roman


#include <os2pm.h>

MRESULT EXPENTRY myproc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
    {
    return (WinDefWindowProc (hwnd, msg, mp1, mp2));
    }

void main ()
    {
    HAB         hab;
    HMQ         hmq;
    QMSG        qmsg;
    HWND        hwnd, hwndclient;
    ULONG       ff = FCF_TASKLIST;

    hab = WinInitialize (0);
    hmq = WinCreateMsgQueue (hab, 0);

    WinRegisterClass (hab, "CLASSX", myproc, 0L, 0);
    hwnd = WinCreateStdWindow (HWND_DESKTOP, 0, &ff, "CLASSX",
                    NULL, 0L, NULL, 0, &hwndclient);

    if (WinQueryWindow (hwndclient, QW_PARENT, FALSE) != hwnd)
        DosBeep (800,1000);

    if (WinQueryWindow (hwnd, QW_PARENT, FALSE) != HWND_DESKTOP)
        DosBeep (1000,1000);

    while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
        WinDispatchMsg (hab, &qmsg);


    WinDestroyWindow (hwnd);
    WinDestroyMsgQueue (hmq);
    WinTerminate (hab);
    }


-- 
----------------------------------------------
INTERNET: rofische@iiic.ethz.ch
----------------------------------------------
Technical Details
Message-ID: <1992Jul31.165516.27867@neptune.inf.ethz.ch>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!chx400!bernina!neptune!rofische

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!chx400!bernina!neptune!rofische
From: rofische@iiic.ethz.ch (Roman Fischer)
Newsgroups: comp.os.os2.programmer
Subject: Problem: WinQueryWindow
Message-ID: <1992Jul31.165516.27867@neptune.inf.ethz.ch>
Date: 31 Jul 92 16:55:16 GMT
Sender: news@neptune.inf.ethz.ch (Mr News)
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH)
Lines: 54
Originator: rofische@c13
Nntp-Posting-Host: c13