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
);
A 16-bit handle.
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.