Jump to content

WinQueryWindowModel

From EDM2

This function queries the memory model associated with a window.

Syntax

WinQueryWindowModel(hwnd)

Parameters

hwnd (HWND) - input
Window handle.

Returns

ulModel (ULONG) - returns
Memory model associated with the window.
PM_MODEL_1X
The 16-bit memory model of the 80386 processor.
PM_MODEL_2X
The 32-bit memory model of the 80386 processor.

Remarks

This function enables an application to query the memory model associate with a particular window to find out whether or not conversion of application-defined data is required. This may be necessary, for example, when sending DDE data. An existing OS/2 Version 1.1 or 1.2 application does not know about pointer conversion, so its data has to be converted for use in a 32-bit application.

The memory model is determined by how the window procedure was registered. If an application calls WinRegisterClass from 32-bit code, any windows created with that class are called 32-bit windows. If the application calls WinSubclassWindow from 16-bit code on a 32-bit window, that window becomes a 16-bit window.

Example Code

This example shows how to check if WinOpenWindowDC has been called for this window.

#define INCL_WINHOOKS
#define INCL_WINTHUNKAPI
#include <os2.h>
HWND  hwndClient;           /* window handle. */

if(WinQueryWindowModel(hwndClient) == PM_MODEL_2X)
{
     /*  The 32-bit memory model of the 80386 processor.    */
}

Related Functions