WOWHandle32

The WOWHandle32 function is used to map a 16-bit handle to a 32-bit handle. Because the relationship between these handles 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,
  WOW_HANDLE_TYPE Type
);

Parameters

  • Handle
    [in] The 16-bit handle to be mapped.

  • Type
    [in] Indicates the type of handle being translated.

    This parameter can be one of the following values.

    WOW_TYPE_HWND
    WOW_TYPE_HBITMAP
    WOW_TYPE_HMENU
    WOW_TYPE_HBRUSH
    WOW_TYPE_HDWP
    WOW_TYPE_HPALETTE
    WOW_TYPE_HDROP
    WOW_TYPE_HPEN
    WOW_TYPE_HDC
    WOW_TYPE_HACCEL
    WOW_TYPE_HFONT
    WOW_TYPE_HTASK
    WOW_TYPE_HMETAFILE
    WOW_TYPE_FULLHWND
    WOW_TYPE_HRGN

Return Value

A 32-bit handle.

Remarks

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.

Requirements

Client Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header

Declared in Wownt32.h.

Library

Use Wow32.lib.

DLL Requires Wow32.dll.

See Also

Generic Thunks Overview
32-bit Generic Thunk Functions
WOWHandle16