Share via


IVsAddProjectItemDlg2.AddProjectItemDlgTitled Method

Definition

Allows adding or changing a caption on the Add Project Item dialog box.

public:
 int AddProjectItemDlgTitled(System::UInt32 itemidLoc, Guid % rguidProject, Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, System::UInt32 grfAddFlags, System::String ^ lpszDlgTitle, System::String ^ lpszExpand, System::String ^ lpszSelect, [Runtime::InteropServices::Out] System::String ^ % pbstrLocation, [Runtime::InteropServices::Out] System::String ^ % pbstrFilter, [Runtime::InteropServices::Out] int % pfDontShowAgain);
public int AddProjectItemDlgTitled (uint itemidLoc, ref Guid rguidProject, Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, uint grfAddFlags, string lpszDlgTitle, string lpszExpand, string lpszSelect, out string pbstrLocation, out string pbstrFilter, out int pfDontShowAgain);
abstract member AddProjectItemDlgTitled : uint32 * Guid * Microsoft.VisualStudio.Shell.Interop.IVsProject * uint32 * string * string * string * string * string * int -> int
Public Function AddProjectItemDlgTitled (itemidLoc As UInteger, ByRef rguidProject As Guid, pProject As IVsProject, grfAddFlags As UInteger, lpszDlgTitle As String, lpszExpand As String, lpszSelect As String, ByRef pbstrLocation As String, ByRef pbstrFilter As String, ByRef pfDontShowAgain As Integer) As Integer

Parameters

itemidLoc
UInt32

[in] Item identifier of the folder in the project to which items should be added. This is only useful for directory-based projects. Non-directory-based projects pass VSITEMID_ROOT. The Add Item dialog box does not use the parameter except to pass it back to AddItem(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]).

rguidProject
Guid

[in] Identifier for the project type. This identifier should be registered under the Projects subkey of the Microsoft Visual Studio registry key. The dialog box uses the following information under that key:ItemTemplateDir value, which should contain the path to the directory containing item templates for this project type.Filters key, which is used to construct open filters for the Existing tab.The dialog box displays items and filters specific to this project type.

pProject
IVsProject

[in] Pointer to the IVsProject3 interface the dialog uses to generate default names for each item by calling the interface's GenerateUniqueItemName(UInt32, String, String, String) method and to cause items to be added to the project by calling the AddItem(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]) method.

grfAddFlags
UInt32

[in] Flag values that modify the behavior of the dialog box. Values are taken from the __VSADDITEMFLAGS enumeration.

lpszDlgTitle
String

[in] Dialog box caption.

lpszExpand
String

[in] Subfolder of the item template directory to select (and expand, if it has subfolders of its own). This initializes the state of the tree and does not affect what the item template directory is.

lpszSelect
String

[in] Item within the pszExpand folder to be selected. The project uses this parameter to implement a sticky behavior for the selected folder, in which item selection persists between sessions. This parameter overrides the default behavior for the dialog box, which is to select the first item in the folder.

pbstrLocation
String

[in, out] Pointer to the location field (initial/final value). This parameter is used only if you specify a value of VSADDITEM_ShowLocationField. To have the project implement sticky behavior, which is the recommended behavior, for the location field, pass the last location field value back in when you open the dialog box again.

pbstrFilter
String

[in, out] Value of the filter string on the Existing tab. Specify a value of VSADDITEM_AllowStickyFilter instead of VSADDITEM_AllowStickyFilter is set. To have the project implement a sticky behavior for the filter field, which is the recommended behavior, pass the last filter field value back in when you open the dialog box again.

pfDontShowAgain
Int32

[out] Indicator of whether the user selected or cleared the Don't Show This Dialog Again option. This parameter is used only if you specify VSADDITEM_ShowDontShowAgain. To implement the option, which is the recommended behavior, call directly the last selected item template's AddItem(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]) method. Typically, a project maintains a separate Don't Show Again option for each item type, such as Form, Module, and Class.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsAddProjectItemDlg2::AddProjectItemDlgTitled(  
   [in] VSITEMID itemidLoc,  
   [in] REFGUID rguidProject,  
   [in] IVsProject *pProject,  
   [in] VSADDITEMFLAGS grfAddFlags,  
   [in] LPCOLESTR lpszDlgTitle,  
   [in] LPCOLESTR lpszExpand,  
   [in] LPCOLESTR lpszSelect,  
   [in, out] BSTR *pbstrLocation,  
   [in, out] BSTR *pbstrFilter,  
   [out] BOOL *pfDontShowAgain  
);  

Applies to