Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using ".Flags = TDF_USE_COMMAND_LINKS" in a "TaskDialog" with radio buttons, custom icons are not reflected. #11

Open
Eschamali opened this issue Dec 10, 2024 · 0 comments

Comments

@Eschamali
Copy link

Hi, and thanks a lot for this amazing program.

As the title says.
The code below will correctly display the custom icon.
※Uses Windows API: ExtractIconExA.

Private Sub Sample_OKIcon()
    Dim testIcon As LongPtr, tmp As LongPtr
    Debug.Print ExtractIconEx("C:\Windows\System32\SHELL32.dll", 0, tmp, testIcon, 1)

    With New cTaskDialog
        .CommonButtons = TDCBF_CLOSE_BUTTON
        
        .AddCustomButton 103, "button 1"
        .AddCustomButton 102, "button 2", testIcon

        .Flags = TDF_USE_COMMAND_LINKS

        .ParenthWnd = Application.hWnd
        .ShowDialog

    End With

End Sub

image

However, when using ".AddRadioButton", the "hIcon" parameter of ".AddCustomButton" is ignored.

Private Sub Sample_NoCustomIcon()
    Dim testIcon As LongPtr, tmp As LongPtr
    Debug.Print ExtractIconEx("C:\Windows\System32\SHELL32.dll", 0, tmp, testIcon, 1)

    With New cTaskDialog
        .CommonButtons = TDCBF_CLOSE_BUTTON
        
        .AddRadioButton 201, "testChose1"
        
        .AddCustomButton 103, "button 1"
        .AddCustomButton 102, "button 2", testIcon

        .Flags = TDF_USE_COMMAND_LINKS

        .ParenthWnd = Application.hWnd
        .ShowDialog

    End With

End Sub

image

Can you fix it so that the "hIcon" of ".AddCustomButton" is reflected even if I use "TDF_USE_COMMAND_LINKS" and ".AddRadioButton" at the same time, as in the code above?

Thank you in advance.

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

No branches or pull requests

1 participant