Conversation
When LoadImage cannot load an image file, we now use OleLoadPictureFileEx and render the result into a standard HBITMAP, preserving existing handle cleanup and replacement behavior.
poiru
commented
Sep 15, 2026
| V_BSTR(&filename) = SysAllocString(olepath); | ||
| if (V_BSTR(&filename)) | ||
| { | ||
| hr = OleLoadPictureFileEx(filename, 0, 0, LP_DEFAULT, &dispatch); |
Author
There was a problem hiding this comment.
It's unclear which Windows versions support this. It should be present on Windows XP according this this:
https://github.com/DeDf/winxp_source/blob/a2f6d7c93aa4f11efc51147566d5961c59a8ef89/Source/XPSP1/NT/base/win32/fusion/oleaut32/whistler/oleaut32.src#L485
If needed, I can change this to use GetProcAddress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When LoadImage cannot load an image file, we now use OleLoadPictureFileEx and render the result into a standard HBITMAP, preserving existing handle cleanup and replacement behavior.