当前位置: 首页>>代码示例>>C++>>正文


C++ FileObject::GetPath方法代码示例

本文整理汇总了C++中FileObject::GetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ FileObject::GetPath方法的具体用法?C++ FileObject::GetPath怎么用?C++ FileObject::GetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileObject的用法示例。


在下文中一共展示了FileObject::GetPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnConnect

int FTPWindow::OnConnect(int code) {
	if (code != 0)	//automated connect
		return 0;



	FileObject * root = m_ftpSession->GetRootObject();
	m_treeview.AddRoot(root);

	FileObject * last = root;
	while(last->GetChildCount() > 0) {
		last = last->GetChild(0);
	}

	m_treeview.EnsureObjectVisible(last);
	TreeView_Select(m_treeview.GetHWND(), last->GetData(), TVGN_CARET);
	m_ftpSession->GetDirectory(last->GetPath());

	TCHAR * info = SU::TSprintfNB(TEXT("Connected to %T"), m_ftpSession->GetCurrentProfile()->GetName());
	SetInfo(info);
	delete [] info;

	SetToolbarState();

	return 0;
}
开发者ID:Praymundo,项目名称:NppFTP,代码行数:26,代码来源:FTPWindow.cpp

示例2: MessageProc

LRESULT FTPWindow::MessageProc(UINT uMsg, WPARAM wParam, LPARAM lParam) {
	bool doDefaultProc = false;
	LRESULT result = 0;

	switch(uMsg) {
		case WM_SETFOCUS: {
			//Why restore focus here? This window should never be able to get focus in the first place
			HWND hPrev = (HWND)wParam;
			if (hPrev != NULL)
				::SetFocus(hPrev);
			break; }
		case WM_ERASEBKGND: {
			HDC hDC = (HDC) wParam;
			RECT rectClient;
			GetClientRect(m_hwnd, &rectClient);
			FillRect(hDC, &rectClient, m_backgroundBrush);
			result = TRUE;
			break; }
		case WM_SETCURSOR: {
			if (m_splitter.OnSetCursor()) {
				return TRUE;
			}
			return FALSE;
			break; }
		case WM_CAPTURECHANGED: {
			m_splitter.OnCaptureChanged((HWND)lParam);
			break; }
		case WM_LBUTTONDOWN: {
			m_splitter.OnButtonDown();
			break; }
		case WM_LBUTTONUP: {
			m_splitter.OnButtonUp();
			m_ftpSettings->SetSplitRatio(m_splitter.GetRatio());
			break; }
		case WM_MOUSEMOVE: {
			if (wParam & MK_LBUTTON) {
				m_splitter.OnMouseMove();
			}
			break; }
		case WM_COMMAND: {
			switch(LOWORD(wParam)) {
				case IDM_POPUP_QUEUE_ABORT: {
					if (m_cancelOperation && m_cancelOperation->GetRunning()) {
						m_ftpSession->AbortTransfer();
					}
					m_cancelOperation = NULL;
					result = TRUE;
					break; }
				case IDM_POPUP_QUEUE_CANCEL: {
					if (m_cancelOperation && !m_cancelOperation->GetRunning()) {
						m_ftpSession->CancelOperation(m_cancelOperation);
					}
					m_cancelOperation = NULL;
					result = TRUE;
					break; }
				case IDM_POPUP_LINKTYPE: {
					m_currentSelection->SetDir(!m_currentSelection->isDir());
					m_currentSelection->GetParent()->Sort();
					m_treeview.UpdateFileObject(m_currentSelection);
					result = TRUE;
					break; }
				case IDB_BUTTON_TOOLBAR_CONNECT: {
					//Called by chevron popup: disconnect (ie no popup)
					//disconnect();
					result = TRUE;
					break;}

                case IDB_BUTTON_TOOLBAR_OPENDIR: {

                    // Show the dialog to get input directory name from the user.
                    InputDialog id;
                    int res = id.Create(m_hwnd, TEXT("Open Directory"), TEXT("Enter directory name:"), TEXT(""));
                    if (res != 1) {
                        return 0;
                    }

                    // Read the input directory name.
                    const TCHAR *dirName    = id.GetValue();
                    char *dirNameCP         = SU::TCharToCP(dirName, CP_ACP);

                    m_ftpSession->GetDirectoryHierarchy(dirNameCP);
                    break;
                }

				case IDM_POPUP_DOWNLOADFILE:
				case IDB_BUTTON_TOOLBAR_DOWNLOAD: {
					SHORT state = GetKeyState(VK_CONTROL);
					if (!(state & 0x8000)) {
						m_ftpSession->DownloadFileCache(m_currentSelection->GetPath());
						result = TRUE;
						break;
					}
					//else fallthrough
					}
				case IDM_POPUP_DLDTOLOCATION: {
					TCHAR target[MAX_PATH];
					lstrcpy(target, m_currentSelection->GetLocalName());
					int res = PU::GetSaveFilename(target, MAX_PATH, m_hwnd);
					if (res == 0) {
						m_ftpSession->DownloadFile(m_currentSelection->GetPath(), target, false);
//.........这里部分代码省略.........
开发者ID:Praymundo,项目名称:NppFTP,代码行数:101,代码来源:FTPWindow.cpp


注:本文中的FileObject::GetPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。