This function creates a new item programmatically, as if an item were chosen from the global New drop-down menu.
When SHCreateNewItem is called, the OS sends an NMN_INVOKECOMMAND notification message to the window of the application hosting the New button. This gives the application the opportunity to handle the call itself. If the value returned from the hosting application is zero, then the OS calls CoCreateInstance on the CLSID obtained from that menu item's registry setting to instantiate an object representing the new item.
If the object supports the IPersistPropertyBag interface, then the OS sends an NMN_GETPROPERTYBAG notification message to the hosting application. If the application returns a non-zero value from the notification, then the OS uses the IPersistPropertyBag interface to load the property bag returned from the application. Otherwise, the OS calls IPersistPropertyBag::InitNew from the interface it had previously obtained.
If the object does not support the IPersistPropertyBag interface, then the OS queries the object for the INewMenuItemServer interface.