LRESULT CALLBACK CContainer::BookmarksToolbarSubclass(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
	switch(uMsg)
	{
	case WM_MBUTTONUP:
		{
			Bookmark_t Bookmark;
			TBBUTTON tbButton;
			POINT ptCursor;
			DWORD dwPos;
			int iIndex;

			dwPos = GetMessagePos();
			ptCursor.x = GET_X_LPARAM(dwPos);
			ptCursor.y = GET_Y_LPARAM(dwPos);
			MapWindowPoints(HWND_DESKTOP,m_hBookmarksToolbar,&ptCursor,1);

			iIndex = (int)SendMessage(m_hBookmarksToolbar,TB_HITTEST,0,(LPARAM)&ptCursor);

			if(iIndex >= 0)
			{
				SendMessage(m_hBookmarksToolbar,TB_GETBUTTON,iIndex,(LPARAM)&tbButton);

				m_Bookmark.RetrieveBookmark((void *)tbButton.dwData,&Bookmark);

				/* If this is a bookmark, open it in a new tab. */
				if(Bookmark.Type == BOOKMARK_TYPE_BOOKMARK)
				{
					ExpandAndBrowsePath(Bookmark.szLocation,TRUE,TRUE);
				}
			}
		}
		break;
	}

	return DefSubclassProc(hwnd,uMsg,wParam,lParam);
}
HRESULT CContainer::ExpandAndBrowsePath(TCHAR *szPath)
{
	return ExpandAndBrowsePath(szPath,FALSE,FALSE);
}
Пример #3
0
HRESULT Explorerplusplus::ExpandAndBrowsePath(TCHAR *szPath)
{
	return ExpandAndBrowsePath(szPath,FALSE,FALSE);
}