Do HMONITORs need to be released? If so, how?
Asked Answered
W

2

5

Several multiple-monitor API functions (eg, MonitorFromRect) return a HMONITOR handle to the monitor in question. I have been unable to find the function to free this handle - does it need to be freed, and if so, how should I free it?

Whiz answered 23/1, 2011 at 15:22 Comment(1)
since you can't create them it seems unlikely that you'd be expected to destroy themAmphora
M
6

The SDK docs always explicitly mention how a handle needs to be released. Nothing for HMONITOR, you are just getting a handle to an internal object that's around anyway.

Mallis answered 23/1, 2011 at 15:36 Comment(0)
T
4

Microsoft's Example program doesn't try to free the handle. While their examples might not be perfect, they are a good indication of the way a function is meant to be used.

Tachistoscope answered 23/1, 2011 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.