通过 Windows 句柄访问 Windows 数据

Access to Windows data though Windows Handles

我正在使用 FPC 在 Win32 中编程 IDE 我创建 Windows 个对象(如 Windows、钢笔、画笔等)和 Windows returns 个手柄。我想通过这些句柄直接访问对象的数据。 可能吗 ?如果是,如何?

I want to directly access to the objects' data though those handles. Is it possible?

没有。这些手柄是不透明的。使用提供的 API 与这些对象进行交互。

访问图形对象(例如钢笔或画笔)数据的正确方法是在库存DC_PEN时使用GetObject(). But if you want to modify such an object, you need to create a new object using the appropriate API (CreatePenIndirect(), etc), unless there is an API specifically for manipulating an existing object (such as SetDCPenColor()被选入HDC).