Exemple #1
0
bool BrowseForFolder(LPBROWSEINFO browseInfo, CSysString &resultPath)
{
  NWindows::NCOM::CComInitializer comInitializer;
  LPITEMIDLIST itemIDList = ::SHBrowseForFolder(browseInfo);
  if (itemIDList == NULL)
    return false;
  CItemIDList itemIDListHolder;
  itemIDListHolder.Attach(itemIDList);
  return GetPathFromIDList(itemIDList, resultPath);
}
CString BrowseForFolder(HWND hwnd)
{
	TCHAR	szDisplayName[MAX_PATH+1] = _T("\0");
	BROWSEINFO	bi = {
		hwnd, NULL, szDisplayName, _T("フォルダ選択"),
		BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE, 
		NULL, 0,				0
	};

	CItemIDList idl;
	idl.Attach( ::SHBrowseForFolder(&bi) );
	return idl.GetPath();
}
Exemple #3
0
bool BrowseForFolder(LPBROWSEINFOW browseInfo, UString &resultPath)
{
  NWindows::NCOM::CComInitializer comInitializer;
  SHBrowseForFolderWP shBrowseForFolderW = (SHBrowseForFolderWP)
    ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHBrowseForFolderW");
  if (shBrowseForFolderW == 0)
    return false;
  LPITEMIDLIST itemIDList = shBrowseForFolderW(browseInfo);
  if (itemIDList == NULL)
    return false;
  CItemIDList itemIDListHolder;
  itemIDListHolder.Attach(itemIDList);
  return GetPathFromIDList(itemIDList, resultPath);
}
Exemple #4
0
CString CMainPropertyPage2::BrowseForFolder(const CString& strTitle, const CString& strNowPath)
{
	TCHAR		szDisplayName[MAX_PATH] = _T("\0");

	BROWSEINFO	bi = {
		m_hWnd,
		NULL,
		szDisplayName,
		LPCTSTR(strTitle),				//+++ strTitle.GetBuffer(0),	//+++
		BIF_RETURNONLYFSDIRS,
		&BrowseCallbackProc,
		(LPARAM) LPCTSTR(strNowPath),	//+++ (LPARAM)strNowPath.GetBuffer(0),
		0
	};

	CItemIDList idl;

	idl.Attach( ::SHBrowseForFolder(&bi) );
	return idl.GetPath();
}
//*******************************************************************************
void CBCGPDiagramVisualContainer::UpdateItems (CItemIDList& lst, BOOL bRedraw)
{
	if (m_bInsideUpdateItems)
	{
// 		for (POSITION pos = lst.GetHeadPosition (); pos != NULL; )
// 		{
// 			CBCGPBaseVisualObject* pObject = GetItem (lst.GetNext (pos));
// 			if (pObject != NULL)
// 			{
// 				ASSERT_VALID(pObject);
// 				pObject->SetDirty (TRUE, bRedraw);
// 			}
// 		}
		return;
	}

	m_bInsideUpdateItems = TRUE;

	for (POSITION pos = lst.GetHeadPosition (); pos != NULL; )
	{
		CBCGPBaseVisualObject* pObject = GetItem (lst.GetNext (pos));
		CBCGPDiagramConnector* pConnector = DYNAMIC_DOWNCAST(CBCGPDiagramConnector, pObject);

		if (pConnector != NULL)
		{
			pConnector->SetRect (pConnector->GetBoundsRect (), bRedraw);
		}
		else if (pObject != NULL)
		{
			ASSERT_VALID(pObject);
			pObject->SetDirty (TRUE, bRedraw);
		}
	}

	m_bInsideUpdateItems = FALSE;
}