What is the handle?

We can interpret it this way Windows handles:

      The value is a 32-bit unsigned integer (32-bit system); logically equivalent pointer to a pointer; the image understood in Windows is a unique, fixed each object ID; effect on , Windows uses to identify objects such as window handles, bitmaps, brushes, etc., and to find these objects by handles.

Below, on the handle, and then explain some key details:

1. The so-called "unique", "change" refers to a running program. If this run finished, close the program, start the program running again, then this run, value and compare the last run when the same object handle, usually is not the same.

  In fact, this understanding is also very natural, so-called "a return one, which is to put it, is that it put the both irrelevant" ( "put" is the image of the argument, like playing cards, in this case program the first run).

2. The handle is generated when the object specified by the system, the attribute is read-only, the programmer can not be modified handle.

3. The different systems, the size of the handle (number of bytes) are different, use the sizeof () calculates the size of the handle.

4. By the handle, the programmer can call the service provided by the system (ie, API calls), I did not like the use of pointers, to do other things.

Guess you like

Origin www.cnblogs.com/mktest123/p/12127373.html