Use STOCK_SAVE_AS instead of STOCK_OPEN.
Auto-generate edited filenames like I do manually.