Jump to content

WinQueryObjectWindow: Difference between revisions

From EDM2
Ak120 (talk | contribs)
Created page with "This function returns the desktop object window handle. ==Syntax== WinQueryObjectWindow(hwndDesktop) Category:Win"
 
No edit summary
Line 3: Line 3:
==Syntax==
==Syntax==
  WinQueryObjectWindow(hwndDesktop)
  WinQueryObjectWindow(hwndDesktop)
==Parameters==
;hwndDesktop ([[HWND]]) - input
:Desktop-window handle.
:;HWND_DESKTOP
::The desktop-window handle
:;Other
::Specified desktop-window handle.
==Returns==
;hwndObject ([[HWND]]) - returns
:Object-window handle.
:;NULLHANDLE
::Error occurred.
==Errors==
Possible returns from WinGetLastError
;PMERR_INVALID_HWND (0x1001)
:An invalid window handle was specified.
==Remarks==
Any window created as a descendant of hwndObject is an object window.
==Example Code==
Declaration:
<pre>
#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>
HWND    hwndDesktop;  /*  Desktop-window handle. */
HWND    hwndObject;  /*  Object-window handle. */
hwndObject = WinQueryObjectWindow(hwndDesktop);
</pre>
This example calls WinQueryObjectWindow to return the desktop object window handle. All windows created as descendants of this object window-as in the example-will be object windows.
<pre>
#define INCL_WINWINDOWMGR      /* Window Manager Functions    */
#include <os2.h>
HWND    hwndObject;    /* desktop object window                */
HWND    hwndObject1;    /* descendant object window            */
USHORT  WindowId;
hwndObject = WinQueryObjectWindow(HWND_DESKTOP);
/* create object window */
hwndObject1 = WinCreateWindow(hwndObject,  /* parent window    */
                      "NewClass",    /* class name            */
                      "new button",  /* window text            */
                      WS_VISIBLE,    /* window style          */
                      0, 0,          /* position (x,y)        */
                      200, 100,      /* size (width,height)    */
                      0L,            /* owner window          */
                      HWND_TOP,      /* sibling window        */
                      WindowId,      /* window id              */
                      NULL,          /* control data          */
                      NULL);        /* presentation parms    */
</pre>


[[Category:Win]]
[[Category:Win]]

Revision as of 18:25, 14 May 2025

This function returns the desktop object window handle.

Syntax

WinQueryObjectWindow(hwndDesktop)

Parameters

hwndDesktop (HWND) - input
Desktop-window handle.
HWND_DESKTOP
The desktop-window handle
Other
Specified desktop-window handle.

Returns

hwndObject (HWND) - returns
Object-window handle.
NULLHANDLE
Error occurred.

Errors

Possible returns from WinGetLastError

PMERR_INVALID_HWND (0x1001)
An invalid window handle was specified.

Remarks

Any window created as a descendant of hwndObject is an object window.

Example Code

Declaration:

#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HWND    hwndDesktop;  /*  Desktop-window handle. */
HWND    hwndObject;   /*  Object-window handle. */

hwndObject = WinQueryObjectWindow(hwndDesktop);

This example calls WinQueryObjectWindow to return the desktop object window handle. All windows created as descendants of this object window-as in the example-will be object windows.

#define INCL_WINWINDOWMGR       /* Window Manager Functions     */
#include <os2.h>

HWND    hwndObject;     /* desktop object window                */
HWND    hwndObject1;    /* descendant object window             */
USHORT  WindowId;
hwndObject = WinQueryObjectWindow(HWND_DESKTOP);

/* create object window */
hwndObject1 = WinCreateWindow(hwndObject,  /* parent window     */
                       "NewClass",    /* class name             */
                       "new button",  /* window text            */
                       WS_VISIBLE,    /* window style           */
                       0, 0,          /* position (x,y)         */
                       200, 100,      /* size (width,height)    */
                       0L,            /* owner window           */
                       HWND_TOP,      /* sibling window         */
                       WindowId,      /* window id              */
                       NULL,          /* control data           */
                       NULL);         /* presentation parms     */