Attached image show what i want to have which the showing and the hiding of the save modified documents pragmatically via API as if the I check or uncheck the specified checkbox
Now that I understand what you're after !
What you're looking for is the FileSaveNotifyEventHandler Delegate (SolidWorks.Interop.sldworks). You'll have to treat parts, assemblies and drawings separately. This event is fired right after the user clicks on Save and before the save dialog box is shown. You must return 1 in .NET if you want SolidWorks to stop the default Save window from showing.
Now if your document has never been saved before, you must be FileSaveAsNotify2EventHandler Delegate (SolidWorks.Interop.sldworks) and "rebelote".
After this you can show your personal saving dialog and save the file silently.
Good luck with what you want to achieve but overwriting SolidWorks's default dialogs is never a good idea.
Make sure to clean up the event handlers in case your user disables the add-in. You don't want your personal dialog box to show up when the add-in is not enabled.
What's your question?
as the check box say "dont show again when saving" I want to hide this window via API and show it also via API depending on the location of the model
What version of SW are you using?
Are you saving via API? If yes then use swSaveAsOptions_Silent
As Deepak pointed out, the API has several methods that allows you to save silently. Use IModelDocExtension::SaveAs. One of its parameter is a enumeration object called Options. Use the swSaveAsOptions_e.swSaveAsOptions_Silent enum members to save silently.
Thank you all
Well I not saving via API I am just handling the event when the user click save button with the use of SaveToStorageNotify. So when the user click the save button based on the location of the model and other informations , I choose to show my custom UI page or the default solidworks save modified document window.That is why i need to show or hide this window via api.
Ah,I have Solidworks 2015
Can you mark Deepak's response as correct answer so people have the same question can search for it. Thx
Sorry but Deepak's response is in the case I am saving using the API via save3 ModelDoc2 method or via IModelDocExtension::SaveAs as Amen 's response.But I as i said previously I am not saving via API I am waiting for for the user to click the save button to handle its event
Thanks a lot Amen your answer did help me a lot .It did help me do the control of the location of the model however the message of "save modified document " is still shown .And I think it is not even possible to hide it based on this http://help.solidworks.com/2015/english/api/swconst/so_messages.htm
Well, I think you mount should a feature request to your VAR or the SolidWorks API team (email@example.com).Your last resort is to hide the SolidWorks application altogether (swApp.Visible = false;). However, I don't think this would be good either.
If one of my answers helped you, you can tick it green !
Retrieving data ...