Platform SDK: DLLs, Processes, and Threads |
The WOWHandle32 function is used to map a 16-bit handle to a 32-bit handle. Because the relationship between a Win16 handle and a Win32 handle may change in the future, use this function to convert handles instead of any knowledge of the relationship between them.
This function can only be called in the context of a thunk.
HANDLE WINAPI WOWHandle32( WORD Handle, // 16-bit handle WOW_HANDLE_TYPE Type // handle type );
The accepted values are of the form WOW_TYPE_handle, where handle can be one of the following values.
HWND
HBITMAP
HMENU
HBRUSH
HDWP
HPALETTE
HDROP
HPEN
HDC
HACCEL
HFONT
HTASK
HMETAFILE
FULLHWND
HRGN
For example, use WOW_TYPE_HWND to convert an HWND.
A 32-bit handle.
You can also use supplied macros to map handles. For example, to map a 16-bit HWND to a 32-bit HWND, you would use the HWND_32 macro.
(hWnd32 = HWND_32(hWnd16))
The type WOW_TYPE_FULLHWND is a window handle that the system passes to a Win32-based application. The type WOW_TYPE_HWND has a different value, but it is recognized by the system and may be passed as a parameter to Win32 functions. If you intend to store the window handle and use it in comparisons with 32-bit window handles received from Win32 functions, use WOW_TYPE_FULLHWND when calling WOWHandle32. Do not make assumptions about the relationship between the 16-bit window handle, the 32-bit window handle, and the full window handle. This relationship has changed in the past (for performance reasons), and it may change again in the future.
When you pass WOWHandle32 type WOW_TYPE_HTASK with a 16-bit task handle, it returns a 32-bit thread identifier. You may compare this value with other thread identifiers, such as those returned by the GetWindowThreadProcessId function.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Wownt32.h.
Library: Included as a resource in Wow32.dll.
Generic Thunks Overview, 32-bit Generic Thunk Functions, WOWHandle16