windowshandletaskmanageruser-object

Are User Objects just like weak pointers?


I was studying Task Manager in detail, there I found column called USER Objects. Now when I tried to search for it's exact meaning, I got following description,

Task Manager Columns Description

The number of USER objects currently being used by the process. A USER object is an object from Window Manager, which includes windows, menus, cursors, icons, hooks, accelerators, monitors, keyboard layouts, and other internal objects.

Does this mean, USER object is like weak pointer to objects like Cursor, Icons, Monitor etc, which will be shared by all the running applications?


Solution

  • Yes you are somewhat correct.

    An object can only be accessed by its handle. An application cannot directly access object data or the system resource that an object represents. Instead, an application must obtain an object handle, which it can use to examine or modify the system resource.

    The entities that are explicitly labeled as objects under Windows are GDI and USER objects:

    Each handle has an entry in an internally maintained table. These entries contain the addresses of the resources and the means to identify the resource type.

    Handles for these objects are, in fact, pointers into the default data segments of the GDI and USER modules, respectively. A relationship between the handles and the objects is implied in that the handles, when converted to pointers into USER's and GDI's default data segment, point to data structures that describe the objects internally.