NTLinks + NTLinksMaker: NTFS links creation and information

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *Dalai »

I get the two-colored MessageBox dialogs on Win10 (tested 1709 and 21H2) just like on Win7. However, it's possible that MS changed the design in later releases of Win10 again, but I somewhat doubt that. But I'm pretty sure that the colors themselves depend on the active theme/design; I tested the default design, of course.

[ADD]
Just for reference, here's a thread on StackOverflow that shows the design that I also see on the systems I tested: https://stackoverflow.com/questions/17686981/message-boxes-with-windows-7-look-and-feel

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *MVV »

My Win7 with classic theme shows me dialogs that look like this. Same light background for text and background of buttons' color for buttons bar. And if I enlarge this window size, I see light background below the buttons bar.
https://i.ibb.co/fxLx7Hc/tcabdlg.png

Adding the "Skip All" button at the right side of buttons bar is bad too, I would need to make entire dialog much larger and buttons bar background would end too:
https://i.ibb.co/6BKPGgw/ntldlg.png

And I'm pretty sure that I shouldn't make any assumptions regarding dialog look and paint anything manually.
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *AntonyD »

Adding the "Skip All" button at the right side of buttons bar
so IF you have the opportunity to choose a place - WHERE you need to place
an additional button, then please add it first - it has a more logical place there.

Btw do you use MessageBox or TaskDialog form?
#146217 personal license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *MVV »

What is TaskDialog? If it's .NET class, it can't be used in native applications. I use MessageBox function and modify its dialog.

I add button manually when all standard buttons already exist, so I enlarge window and create my button then. It is easy to add button to the bottom or to the right, but adding a button to the left requires moving all standard buttons right, and coloured rectangle will still be too small to hold all buttons.
Last edited by MVV on 2023-10-18, 19:08 UTC, edited 1 time in total.
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *AntonyD »

What is TaskDialog?
https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-taskdialog

Code: Select all

#include <windows.h>
#include <commctrl.h>

int main() {
    // Initialize the common controls library
    INITCOMMONCONTROLSEX icex;
    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icex.dwICC = ICC_STANDARD_CLASSES;

    InitCommonControlsEx(&icex);

    // Define the TaskDialog configuration
    TASKDIALOGCONFIG taskDialogParams = {};
    taskDialogParams.cbSize = sizeof(TASKDIALOGCONFIG);
    taskDialogParams.hwndParent = NULL;
    taskDialogParams.dwFlags = TDF_USE_COMMAND_LINKS;

    taskDialogParams.pszMainIcon = TD_INFORMATION_ICON;
    taskDialogParams.pszMainInstruction = L"Sample TaskDialog";
    taskDialogParams.pszContent = L"This is a custom TaskDialog with four buttons.";

    TASKDIALOG_BUTTON buttons[] = {
        { IDOK, L"OK" },
        { IDCANCEL, L"Cancel" },
        { IDABORT, L"Abort" },
        { 1000, L"SkipAll" }  // Use a custom ID for the SkipAll button
    };

    taskDialogParams.cButtons = ARRAYSIZE(buttons);
    taskDialogParams.pButtons = buttons;

    // Show the TaskDialog
    int buttonId = 0;
    TaskDialogIndirect(&taskDialogParams, &buttonId, NULL, NULL);

    // Handle the button click
    switch (buttonId) {
        case IDOK:
            // OK button clicked
            break;
        case IDCANCEL:
            // Cancel button clicked
            break;
        case IDABORT:
            // Abort button clicked
            break;
        case 1000:
            // SkipAll button clicked
            break;
        default:
            // Handle other buttons or cases
            break;
    }

    return 0;
}
Make sure to link against the Comctl32.lib library when compiling your C++ program.
#146217 personal license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *MVV »

Well, I tried this code and unfortunately it doesn't work even on my Windows 7, it can't find TaskDialogIndirect function by ordinal in comctl32.dll. That's strange because MSDN states that the function is available since Windows Vista. MessageBox is available on all Windows versions meanwhile...
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *Dalai »

2MVV
%SystemRoot%\system32\comctl32.dll is version 5.x. The v6 is located somewhere in %SystemRoot%\winsxs, and these files indeed export the TaskDialog and TaskDialogIndirect functions (by name). Not sure if Windows somehow automagically loads the v6 DLL upon calling a function like this.

[ADD]
Windows might load comctl32.dll v6 automatically if an application tells Windows about it in the application manifest. NTLinks Maker doesn't have a manifest, so it's probably not possible to use the newer comctl32.
[/ADD]

Since this function is limited to Vista+ you would need to check for the export of this function before calling it if you want to make sure the program still works on XP (and older).

Anyway, since it's only a (minor) visual glitch I honestly wouldn't bother too much about it.

Regards
Dalai
Last edited by Dalai on 2023-10-22, 12:11 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *MVV »

It is funny but even 6.1 versions found in my winsxs folder don't have required exported function. So I would say that this function is incompatible with most Windows versions.
Anyway, since it's only a (minor) visual glitch I honestly wouldn't bother too much about it.
Of course, but if there could be an easy and still compatible way, I would use it.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: NTLinks + NTLinksMaker: NTFS links creation and information

Post by *Dalai »

MVV wrote: 2023-10-22, 07:13 UTCIt is funny but even 6.1 versions found in my winsxs folder don't have required exported function.
You looked at the wrong ones. I removed duplicates with a newer Windows build number and got this list:

Code: Select all

C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll
C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\comctl32.dll
C:\Windows\winsxs\amd64_microsoft-windows-shell-comctl32-v5_31bf3856ad364e35_6.1.7601.17514_none_97c2246fee970dbb\comctl32.dll
C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_ec83dffa859149af\comctl32.dll
C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll
C:\Windows\winsxs\x86_microsoft-windows-shell-comctl32-v5_31bf3856ad364e35_6.1.7601.17514_none_3ba388ec36399c85\comctl32.dll
You need to ignore "comctl32-v5" and "common-controls_*_5.*" as both of them refer to comctl32 v5. That leaves just one of each architecture in case of the list above. And both of them export the appropriate functions. Another way is to let TC search for the text "TaskDialogIndirect" in any comctl32.dll ;)
Of course, but if there could be an easy and still compatible way, I would use it.
See my addition above: include a manifest and Windows will most likely use the newer comctl32.dll automatically. Then you can test it to see if it's any help.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply