Skip to content

How to use LoadImage #1171

Closed Answered by AArnott
karmeye asked this question in Q&A
Apr 27, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

If you avoid the SafeHandle overload altogether, there won't be a SafeHandle to worry about releasing or finalizing. The native HANDLE you get back would typically need to be released when you're done with it, but if you want it for the lifetime of your application, you don't ever have to release it because closing the process has the OS implicitly release it. So you can call the LoadImage overload that returns a HANDLE and then just drop the result (after using it in SendMessage).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@karmeye
Comment options

@AArnott
Comment options

Answer selected by karmeye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants