Skip to content

nsDialogs: Add JPG/GIF/PNG support to NSD_SetImage/NSD_SetStretchedImage - #35

Open
poiru wants to merge 2 commits into
nsis-dev:masterfrom
poiru:ole-setimage
Open

poiru wants to merge 2 commits into
nsis-dev:masterfrom
poiru:ole-setimage

Conversation

@poiru

@poiru poiru commented Sep 14, 2026

Copy link
Copy Markdown

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.

Comment thread Source/exehead/exec.c Outdated
V_BSTR(&filename) = SysAllocString(olepath);
if (V_BSTR(&filename))
{
hr = OleLoadPictureFileEx(filename, 0, 0, LP_DEFAULT, &dispatch);

@poiru poiru Sep 15, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear which Windows versions support this. It should be present on Windows XP.

If needed, I can change this to use GetProcAddress.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would probably have to delay-load it, yes. Just linking directly to oleaut32 has unknown security implications that need to be investigated...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sredna Addressed that in 25cee34

poiru added 2 commits October 5, 2026 16:21
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants