ShellExecuteEx can't open image while mspaint is default app since windows 10
16:03 20 Feb 2021

The execution of the following code will give an error if mspaint is chosen as the default app for images.

Setting default app for images to any other app, e.g. "Photos", will open the image with the chosen app without error.

Using ShExecInfo.lpVerb = L"edit" will open the image with mspaint without error.

The problem occurs since Windows 10.

#include 

int main()
{
    SHELLEXECUTEINFO ShExecInfo;
    ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
    ShExecInfo.fMask = NULL;
    ShExecInfo.hwnd = NULL;
    ShExecInfo.lpVerb = L"open"; //L"edit"
    ShExecInfo.lpFile = L"C:/test.jpg";
    ShExecInfo.lpParameters = NULL;
    ShExecInfo.lpDirectory = NULL;
    ShExecInfo.nShow = SW_MAXIMIZE;
    ShExecInfo.hInstApp = NULL;

    ShellExecuteEx(&ShExecInfo);

    return 0;
}

enter image description here

Is it a known Microsoft bug?

c++ windows-10