本文整理汇总了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;
}
示例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);
//.........这里部分代码省略.........