What exactly is a "HANDLE"?

Todd Chester 706 Reputation points
2022-11-30T21:33:30.097+00:00

What exactly is a "HANDLE".

A pointer?

A DWORD (32 bits)?

A LDWORD (64bit

And does it vary in 32 bit and 64 bit Windows?

Windows development | Windows API - Win32
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,551 Reputation points
    2022-11-30T21:49:47.417+00:00

    The Windows data type HANDLE is documented at windows-data-types. It is a C/C++ typedef that resolves to a void pointer. Consequently, in 32-bit code the size of a HANDLE is four bytes while in 64 bit code it is 8 bytes.

    However, in most cases handles should be viewed as opaque objects even though the underlying representation may be a pointer.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.