GetItemFile method

GetItemFile method lets you get a file object name by the specified "hide list" index.  

BOOL GetItemFile(
 LONG lItemIndex,
 BSTR *pstrFileName
);

Parameters   lItemIndex     [in] A zero-based "hide list" index of necessary item.   pstrFileName     [out] A pointer to null-terminated OLE string that will contain the name of the hiding object, such as file, directory or hiding mask.
Return Values
  GetItemFile method returns TRUE if file object name was successfully got and FALSE otherwise.
Remarks
  bstrFileName pointer must be initialized by NULL value prior to its usage.


Code Example

// For instance, we would like to test Windows Notepad executable file
extern CHideMyFoldersAx m_ctrlHMFAx;
CString strFileName("c:\windows\notepad.exe");
//You MUST initialize BSTR value by NULL, otherwise your application will crash.
BSTR bstrFileName = NULL; // initialize BSTR here
BOOL bItemState = FALSE;
if(m_ctrlHMFAx.GetItemFile(i,&bstrFileName) && m_ctrlHMFAx.GetItemState(i,&bItemState)){
CString strTmp(bstrFileName);
strTmp += (" is ");
strTmp += (bItemState? _T("Hidden"):_T("Visible"));
MessageBox(strTmp);
}

See also