AddItem method

Brief Information.

AddItem method adds file object and its initialization parameter into the “hide list”.

BOOL AddItem(
 BSTR strFileName,
 BOOL bInitialState
);


Parameters
strFileName [in] Null-terminated OLE string that specifies the name of the hiding object, such as file, directory or hiding mask.   bInitialState     [in] If this value is TRUE, the hidden list item initial state is hidden. Otherwise, the list item initial state is visible.
Return Values
AddItem method returns TRUE if operation was successful and FALSE otherwise.
Remarks
“Null-terminated string” term is discussed here. We strongly recommend you to read article Naming file objects before using our ActiveX control.


Code Example  

// For instance, we would like to add Windows Notepad executable file into a hidden items listextern CHideMyFoldersAx m_ctrlHMFAx;

CString strFileName(“c:\windows\notepad.exe”);

if(m_ctrlHMFAx.AddItem((LPCTSTR)strFileName,TRUE))

//notepad.exe is successfully added to hide list of HMFAx control.

else

//notepad.exe wasn’t added to “hide list” of HMFAx control. Your exception code handler here.


See also