home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3934 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.7 KB  |  67 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!chx400!bernina!neptune!rofische
  2. From: rofische@iiic.ethz.ch (Roman Fischer)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Problem: WinQueryWindow
  5. Message-ID: <1992Jul31.165516.27867@neptune.inf.ethz.ch>
  6. Date: 31 Jul 92 16:55:16 GMT
  7. Sender: news@neptune.inf.ethz.ch (Mr News)
  8. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH)
  9. Lines: 54
  10. Originator: rofische@c13
  11. Nntp-Posting-Host: c13
  12.  
  13. Hi everybody,
  14.  
  15. I think i've got a major understanding problem, but why does the second
  16. 'if' in the following sample code Beep ?
  17.  
  18. Or, why doesn't WinQueryWindow return HWND_DESKTOP ? What does it return ?
  19.  
  20. ... hope the question isn't too stupid ...
  21.  
  22. thanx                     Roman
  23.  
  24.  
  25. #include <os2pm.h>
  26.  
  27. MRESULT EXPENTRY myproc (HWND hwnd, USHORT msg, MPARAM mp1, MPARAM mp2)
  28.     {
  29.     return (WinDefWindowProc (hwnd, msg, mp1, mp2));
  30.     }
  31.  
  32. void main ()
  33.     {
  34.     HAB         hab;
  35.     HMQ         hmq;
  36.     QMSG        qmsg;
  37.     HWND        hwnd, hwndclient;
  38.     ULONG       ff = FCF_TASKLIST;
  39.  
  40.     hab = WinInitialize (0);
  41.     hmq = WinCreateMsgQueue (hab, 0);
  42.  
  43.     WinRegisterClass (hab, "CLASSX", myproc, 0L, 0);
  44.     hwnd = WinCreateStdWindow (HWND_DESKTOP, 0, &ff, "CLASSX",
  45.                     NULL, 0L, NULL, 0, &hwndclient);
  46.  
  47.     if (WinQueryWindow (hwndclient, QW_PARENT, FALSE) != hwnd)
  48.         DosBeep (800,1000);
  49.  
  50.     if (WinQueryWindow (hwnd, QW_PARENT, FALSE) != HWND_DESKTOP)
  51.         DosBeep (1000,1000);
  52.  
  53.     while (WinGetMsg (hab, &qmsg, NULL, 0, 0))
  54.         WinDispatchMsg (hab, &qmsg);
  55.  
  56.  
  57.     WinDestroyWindow (hwnd);
  58.     WinDestroyMsgQueue (hmq);
  59.     WinTerminate (hab);
  60.     }
  61.  
  62.  
  63. -- 
  64. ----------------------------------------------
  65. INTERNET: rofische@iiic.ethz.ch
  66. ----------------------------------------------
  67.