Hide My Folders ActiveX - GetItemFile method

GetItemFile method lets you to get file object name by 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 successful fetched and FALSE otherwise.
Remarks
  bstrFileName pointer must be initialized by NULL value prior to it's usage or your application will crash.
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 or 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

AddItem, RemoveAt, Clear, Count, SetItemFile, GetItemState, SetItemState, Find