Jump to content

WinQueryWindowModel

From EDM2
Revision as of 21:12, 26 November 2023 by Martini (talk | contribs) (Created page with "This function queries the memory model associated with a window. ==Syntax== WinQueryWindowModel(''hwnd'') ==Parameters== ;''hwnd'' (HWND) - input :Window handle. ==Returns...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.    */
}

Definition

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

HWND     hwnd;     /*  Window handle. */
ULONG    ulModel;  /*  Memory model associated with the window. */

ulModel = WinQueryWindowModel(hwnd);

Related Functions