get_IconPath
Description
Retrieves the full path to the icon file used for the packed executable.
If this property is set, the specified icon replaces the original icon of the input executable during the packing process.
This allows developers to customize the visual identity of the packed EXE by providing their own .ico resource file.
Syntax
HRESULT get_IconPath([out, retval] BSTR* pValue);Parameters
pValue
Type: BSTR*
[out, retval] Receives a string containing the path to the icon file used for the packed executable.
Return Value
Returns an HRESULT.
S_OKif the icon path was successfully retrieved.E_POINTERifpValueis null.- Other standard COM error codes on failure.
Example
CComPtr<IBxProject> project;
if (SUCCEEDED(BxPackerApi_CreateProject(&project))) {
CComBSTR iconPath;
if (SUCCEEDED(project->get_IconPath(&iconPath))) {
wprintf(L"Icon path: %s\n", static_cast<LPCWSTR>(iconPath));
}
}Remarks
- If no custom icon is specified, the packed executable retains the original icon from the input file.
- The icon file should be in standard
.icoformat. Other formats (e.g.,.png,.bmp) are not supported. - Use
put_IconPathto specify a new icon for the packed executable. - The specified icon path is stored in the project configuration and used during the build process.