Skip to content

I have a question about setting an icon for a plugin button. #2

@hktkzyz

Description

@hktkzyz

CorelDraw X7 64-bit, Visual Studio 2019.

I want to set an icon for a plugin button (not a form, it's the icon for "AddCustomButton").
I have only managed to do these two ways:

  1. Use a local file path with SetCustomIcon:
    _bstr_t bstrPath(m_pApp->Path + _bstr_t("Plugins64\cn_plugin.ico"));
    ctl->SetCustomIcon(bstrPath);

  2. Use a GUID:
    ctl->SetIcon2(_bstr_t("guid://d2fdc0d9-09f8-4948-944c-4297395c05b7"));

I have already added my own .ico file to the project resources (IDI_ICON1), and included #include "resource.h" in my cpp file.
But I don’t know how to use it for the button icon.
I see other plugins have their own icons without extra .ico files.
Could you please tell me how to do this?
Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions