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.

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

Parameters

Handle
The 32-bit handle to be mapped.
Type
Indicates the type of handle being translated. The accepted values are of the form WOW_TYPE_handle where handle can be HWND, HMENU, HDWP, HDROP, HDC, HFONT, HMETAFILE, HRGN, HBITMAP, HBRUSH, HPALETTE, HPEN, HACCEL, and 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.