WinQueryWindowModel: Difference between revisions
Created page with "This function queries the memory model associated with a window. ==Syntax== WinQueryWindowModel(''hwnd'') ==Parameters== ;''hwnd'' (HWND) - input :Window handle. ==Returns..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
This function queries the memory model associated with a window. | This function queries the memory model associated with a window. | ||
==Syntax== | ==Syntax== | ||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;''hwnd'' (HWND) - input | ;''hwnd'' (HWND) - input:Window handle. | ||
:Window handle. | |||
==Returns== | ==Returns== | ||
;''ulModel'' (ULONG) - returns | ;''ulModel'' (ULONG) - returns:Memory model associated with the window. | ||
:Memory model associated with the window. | :;PM_MODEL_1X:The 16-bit memory model of the 80386 processor. | ||
:;PM_MODEL_1X | :;PM_MODEL_2X:The 32-bit memory model of the 80386 processor. | ||
:;PM_MODEL_2X | |||
==Remarks== | ==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. | 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. | 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== | ==Example Code== | ||
This example shows how to check if WinOpenWindowDC has been called for this window. | This example shows how to check if WinOpenWindowDC has been called for this window. | ||
Line 23: | Line 22: | ||
#define INCL_WINHOOKS | #define INCL_WINHOOKS | ||
#define INCL_WINTHUNKAPI | #define INCL_WINTHUNKAPI | ||
#include < | #include <os2.h> | ||
HWND hwndClient; /* window handle. */ | HWND hwndClient; /* window handle. */ | ||
Line 30: | Line 29: | ||
/* The 32-bit memory model of the 80386 processor. */ | /* The 32-bit memory model of the 80386 processor. */ | ||
} | } | ||
</pre> | </pre> | ||
Line 49: | Line 36: | ||
* [[WinSetClassThunkProc]] | * [[WinSetClassThunkProc]] | ||
* [[WinSetWindowThunkProc]] | * [[WinSetWindowThunkProc]] | ||
[[Category:Win]] | [[Category:Win]] |
Latest revision as of 20:45, 27 November 2023
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. */ }