Platform SDK: DLLs, Processes, and Threads

WOWHandle16

The WOWHandle16 function is used to map a 32-bit handle to a 16-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.

WORD WINAPI WOWHandle16(
  HANDLE Handle,        // 32-bit handle
  WOW_HANDLE_TYPE Type  // handle type
);

Parameters

Handle
[in] The 32-bit handle to be mapped.
Type
[in] Specifies the type of handle being translated. The accepted values are of the form WOW_TYPE_handle, where handle can be one of the following values.

HWND
HRGN
HMENU
HBITMAP
HDWP
HBRUSH
HDROP
HPALETTE
HDC
HPEN
HFONT
HACCEL
HMETAFILE
HTASK

For example, use WOW_TYPE_HWND to convert an HWND.

Return Values

A 16-bit handle.

Remarks

You can also use supplied macros to map handles. For example, to map a 32-bit HWND to a 16-bit HWND, you would use the HWND_16 macro.

(hWnd16 = HWND_16(hWnd32)) 

WOWHandle16 with WOW_TYPE_HTASK (and HTASK_16) takes a thread identifier and converts it to a handle to a task if possible.

Requirements

  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.

See Also

Generic Thunks Overview, 32-bit Generic Thunk Functions, WOWHandle32