SetErrorMode(0);
if (hFile != INVALID_HANDLE_VALUE) {
FindClose(hFile);
- strcpy(pFIStruct->name, FindFileData.cFileName);
+ strcpy(pFIStruct->name, pFullPath);
pFIStruct->info.data = getTime70(FindFileData.ftLastWriteTime);
if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
pFIStruct->info.size = 0;
m_hwndRemotePath = NULL;
m_FTMenuSource = 0;
+ m_dwNumStatusStrings = 0;
m_szLocalPath[0] = '\0';
m_szRemotePath[0] = '\0';
va_list args;
va_start(args, format);
int nSize = _vsnprintf(text, sizeof(text), format, args);
- SetDlgItemText(m_hwndFTDialog, IDC_FTSTATUS, text);
+
+ HWND hStatusBox = GetDlgItem(m_hwndFTDialog, IDC_FTSTATUS);
+
+ LRESULT lRes = SendMessage(hStatusBox, (UINT) CB_INSERTSTRING, (WPARAM) 0, (LPARAM) text);
+ if ((lRes != CB_ERR) && (lRes != CB_ERRSPACE)) {
+ lRes = SendMessage(hStatusBox, (UINT) CB_SETCURSEL, (WPARAM) lRes, (LPARAM) 0);
+ }
+
+ m_dwNumStatusStrings++;
+ if (m_dwNumStatusStrings > FT_MAX_STATUS_STRINGS) {
+ int numItems = SendMessage(hStatusBox, (UINT) CB_GETCOUNT, (WPARAM) 0, (LPARAM) 0);
+ if (numItems != CB_ERR) {
+ m_dwNumStatusStrings--;
+ SendMessage(hStatusBox, (UINT) CB_DELETESTRING, (WPARAM) numItems - 1, (LPARAM) 0);
+ }
+ }
}
void
UINT m_msgUploadFilePortion;
UINT m_msgDownloadFilePortion;
+ DWORD m_dwNumStatusStrings;
+
FTListView *m_pLocalLV;
FTListView *m_pRemoteLV;
FileTransfer::checkDeleteQueue()
{
if (m_DeleteQueue.getNumEntries() > 0) {
+ if (m_bFTDlgShown)
+ m_pFTDialog->setStatusText("Delete Operation Executing: %s", m_DeleteQueue.getFullLocPathAt(0));
if (m_DeleteQueue.getFlagsAt(0) & FT_ATTR_DELETE_LOCAL) {
FolderManager fm;
- if (!fm.deleteIt(m_DeleteQueue.getLocNameAt(0))) {
+ if (!fm.deleteIt(m_DeleteQueue.getFullLocPathAt(0))) {
if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Failed");
} else {
if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed");
m_pWriter->writeFileDeleteRqst(strlen(m_DeleteQueue.getFullLocPathAt(0)),
m_DeleteQueue.getFullLocPathAt(0));
- char *pPath = m_DeleteQueue.getRemPathAt(0);
+ char *pPath = m_DeleteQueue.getLocPathAt(0);
m_queueFileListRqst.add(pPath, 0, 0, FT_FLR_DEST_DELETE);
m_pWriter->writeFileListRqst(strlen(pPath), pPath, false);
}
}
} else {
- if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed Successfully");
+ if (m_bFTDlgShown) {
+ m_pFTDialog->setStatusText("Delete Operation Completed Successfully");
+ PostMessage(m_pFTDialog->getWndHandle(), WM_COMMAND, MAKEWPARAM(IDC_FTLOCALRELOAD, 0), 0);
+ PostMessage(m_pFTDialog->getWndHandle(), WM_COMMAND, MAKEWPARAM(IDC_FTREMOTERELOAD, 0), 0);
+ }
}
}
bool
FileTransfer::procFLRDelete(FileInfo *pFI)
{
- return false;
+ if (isExistName(pFI, m_DeleteQueue.getLocNameAt(0)) >= 0) {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Failed.");
+ } else {
+ if (m_bFTDlgShown) m_pFTDialog->setStatusText("Delete Operation Completed.");
+ }
+ m_DeleteQueue.deleteAt(0);
+ checkDeleteQueue();
+ return true;
}
bool
WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_CONTROLPARENT
CAPTION "TightVNC File Transfers"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
+FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",IDC_FTLOCALLIST,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER |
CONTROL "Progress1",IDC_FTGENERALPROGRESS,"msctls_progress32",
WS_BORDER,55,244,128,10
LTEXT "File Transfer",IDC_STATIC,7,245,40,8
- COMBOBOX IDC_FTSTATUS,7,262,516,30,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL
+ COMBOBOX IDC_FTSTATUS,7,263,516,65,CBS_DROPDOWNLIST |
+ CBS_NOINTEGRALHEIGHT | WS_VSCROLL
CONTROL "Progress1",IDC_FTSINGLEPROGRESS,"msctls_progress32",
WS_BORDER,370,244,128,10
EDITTEXT IDC_FTREMOTEPATH,323,20,155,12,ES_AUTOHSCROLL | NOT