In fact, I could finally find a solution to my question, and I would like to post it here, as I think it might be useful to someone ...
When creating SaveFileDialog using the GetSaveFileName Windows function, we must send a link to the OPENFILENAME structure (we will consider it as fromn), which contains the information necessary to create savefiledialog. In this structure, we must set flags for what we need, therefore, if we want to stop the rewrite request, we should not set a flag for it:
The flag value must be in .Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_NOTESTFILECREATE | OFN_ENABLEHOOK | OFN_HIDEREADONLY;
instead
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_NOTESTFILECREATE | OFN_ENABLEHOOK | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
Dulini atapattu
source share