Index: Common/CHPluginCore.h =================================================================== diff -u --- Common/CHPluginCore.h (revision 0) +++ Common/CHPluginCore.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,50 @@ +#ifndef __CHPLUGINCORE_H__ +#define __CHPLUGINCORE_H__ + +#include "PluginCore.h" +//#include "FileObject.h" + +// types of CH plugins +//#define PT_STORAGE 2 + +//#define IMID_LOCALSTORAGE 0x0001020000000001 + +// error codes +//#define EC_NOERROR 0x00000000 +//#define EC_SYSERROR 0x00000001 +//#define EC_USERBREAK 0x00000002 + +// error handling info struct +/*struct _ERRORINFO +{ + char szInfo[256]; // string with error description + DWORD dwCode; // code + DWORD dwError; // system error if any +};*/ + +// storage plugins section +/*struct _ENUMOBJECTS +{ + // data passed to the enumobjects func + CBaseObjectInfo* pBaseObject; // base object + + // ret values + CObjectInfo* pObject; // object that has been found + + // func + bool(*pfnCallback)(_ENUMOBJECTS* pParam); + + // other + PVOID pAppParam; // application defined parameter + PVOID pPlugParam; // plugin dependent parameter +};*/ + +// open object modes +//#define OM_READ 0x80000000 +//#define OM_WRITE 0x40000000 +//#define OM_CREATE 0x00000001 /* create, if exists - fails */ +//#define OM_CREATEALWAYS 0x00000002 /* always creates the file */ +//#define OM_OPENEXISTING 0x00000003 /* opens only if exists */ +//#define OM_OPENALWAYS 0x00000004 /* always opens the object */ + +#endif \ No newline at end of file Index: Common/FileSupport.cpp =================================================================== diff -u --- Common/FileSupport.cpp (revision 0) +++ Common/FileSupport.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,139 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "wtypes.h" +#include "FileSupport.h" +//#include "tchar.h" + +#pragma warning (disable: 4711) + +__int64 SetFilePointer64(HANDLE hFile, __int64 llDistance, DWORD dwMoveMethod) +{ + LARGE_INTEGER li; + + li.QuadPart = llDistance; + + li.LowPart = SetFilePointer(hFile, li.LowPart, &li.HighPart, dwMoveMethod); + + if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR) + li.QuadPart = -1; + + return li.QuadPart; +} + +__int64 GetFilePointer64(HANDLE hFile) +{ + return SetFilePointer64(hFile, 0, FILE_CURRENT); +} + +__int64 GetFileSize64(HANDLE hFile) +{ + ULARGE_INTEGER li; + + li.LowPart = GetFileSize(hFile, &li.HighPart); + + // If we failed ... + if (li.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR) + li.QuadPart=static_cast(-1); + + return li.QuadPart; +} + +bool SetFileSize64(LPCTSTR lpszFilename, __int64 llSize) +{ + HANDLE hFile=CreateFile(lpszFilename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + return false; + + if (SetFilePointer64(hFile, llSize, FILE_BEGIN) == -1) + { + CloseHandle(hFile); + return false; + } + + if (!SetEndOfFile(hFile)) + { + CloseHandle(hFile); + return false; + } + + if (!CloseHandle(hFile)) + return false; + + return true; +} + +// disk support routines + +bool GetDynamicFreeSpace(LPCTSTR lpszPath, __int64* pFree, __int64* pTotal) +{ + typedef BOOL(__stdcall *PGETDISKFREESPACEEX)(LPCTSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailable, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes); + + ULARGE_INTEGER ui64Available, ui64Total; + PGETDISKFREESPACEEX pGetDiskFreeSpaceEx; + pGetDiskFreeSpaceEx = (PGETDISKFREESPACEEX)GetProcAddress(GetModuleHandle(_T("kernel32.dll")), _T("GetDiskFreeSpaceExA")); + if (pGetDiskFreeSpaceEx) + { + if (!pGetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, NULL)) + { + if (pFree) + *pFree=-1; + if (pTotal) + *pTotal=-1; + return false; + } + else + { + if (pFree) + *pFree=ui64Available.QuadPart; + if (pTotal) + *pTotal=ui64Total.QuadPart; + return true; + } + } + else + { + // support for win95 (not osr2) + // set the root for path and correct '\\' at the end + TCHAR szDisk[_MAX_DRIVE]; + _tsplitpath(lpszPath, szDisk, NULL, NULL, NULL); + if (_tcslen(szDisk) != 0 && szDisk[_tcslen(szDisk)-1] != _T('\\')) + _tcscat(szDisk, _T("\\")); + + // std func + DWORD dwSectPerClust, dwBytesPerSect, dwFreeClusters, dwTotalClusters; + if (!GetDiskFreeSpace(szDisk, &dwSectPerClust, &dwBytesPerSect, &dwFreeClusters, &dwTotalClusters)) + { + if (pFree) + *pFree=-1; + if (pTotal) + *pTotal=-1; + return false; + } + else + { + if (pFree) + *pFree=((__int64)dwFreeClusters*(__int64)dwSectPerClust)*(__int64)dwBytesPerSect; + if (pTotal) + *pTotal=((__int64)dwTotalClusters*(__int64)dwSectPerClust)*(__int64)dwBytesPerSect; + return true; + } + } +} Index: Common/FileSupport.h =================================================================== diff -u --- Common/FileSupport.h (revision 0) +++ Common/FileSupport.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,32 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __FILESUPPORT_ROUTINES_H__ +#define __FILESUPPORT_ROUTINES_H__ + +// file support routines +__int64 SetFilePointer64(HANDLE hFile, __int64 llDistance, DWORD dwMoveMethod); +__int64 GetFilePointer64(HANDLE hFile); +__int64 GetFileSize64(HANDLE hFile); +bool SetFileSize64(LPCTSTR lpszFilename, __int64 llSize); + +// disk support routines +bool GetDynamicFreeSpace(LPCTSTR lpszPath, __int64* pFree, __int64* pTotal); + +#endif \ No newline at end of file Index: Common/ipcstructs.h =================================================================== diff -u --- Common/ipcstructs.h (revision 0) +++ Common/ipcstructs.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,81 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __SHAREDDATA_H__ +#define __SHAREDDATA_H__ + +// drag&drop flags +#define OPERATION_MASK 0x00ffffff +#define DD_COPY_FLAG 0x00000001 +#define DD_MOVE_FLAG 0x00000002 +#define DD_COPYMOVESPECIAL_FLAG 0x00000004 + +#define EC_PASTE_FLAG 0x00000010 +#define EC_PASTESPECIAL_FLAG 0x00000020 +#define EC_COPYTO_FLAG 0x00000040 +#define EC_MOVETO_FLAG 0x00000080 +#define EC_COPYMOVETOSPECIAL_FLAG 0x00000100 + +// messages used +#define WM_GETCONFIG WM_USER+20 + +// config type to get from program +#define GC_DRAGDROP 0x00 +#define GC_EXPLORER 0x01 + +// command properties (used in menu displaying) +#pragma pack(push, 1) +struct _COMMAND +{ + UINT uiCommandID; // command ID - would be send be + TCHAR szCommand[128]; // command name + TCHAR szDesc[128]; // and it's description +}; +#pragma pack(pop) + +#pragma pack(push, 1) +struct _SHORTCUT +{ + TCHAR szName[128]; + TCHAR szPath[_MAX_PATH]; +}; +#pragma pack(pop) + +// shared memory size in bytes +#define SHARED_BUFFERSIZE 65536 + +// structure used for passing data from program to DLL +// the rest is a dynamic texts +class CSharedConfigStruct +{ +public: + UINT uiFlags; // what items and how to display in drag&drop ctx menu & explorer.ctx.menu + + bool bShowFreeSpace; // showthe free space by the shortcuts ? + TCHAR szSizes[6][64]; // names of the kB, GB, ... + bool bShowShortcutIcons; // show shell icons with shortcuts ? + bool bOverrideDefault; // only for d&d - want to change menu default item to the one from ch ? + UINT uiDefaultAction; // default action for drag&drop when using above option + int iCommandCount; // count of commands stored at the beginning of a buffer + int iShortcutsCount; // count of shortcuts to display in submenus + + TCHAR szData[SHARED_BUFFERSIZE]; // buffer for texts and other stuff +}; + +#endif Index: Copy Handler.dsw =================================================================== diff -u --- Copy Handler.dsw (revision 0) +++ Copy Handler.dsw (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Copy Handler"=".\Copy Handler\Copy Handler.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "CopyHandlerShellExt"=".\CopyHandlerShellExt\CopyHandlerShellExt.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + Index: Copy Handler/AboutDlg.cpp =================================================================== diff -u --- Copy Handler/AboutDlg.cpp (revision 0) +++ Copy Handler/AboutDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,133 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" +#include "resource.h" +#include "AboutDlg.h" +#include "StaticEx.h" + +bool CAboutDlg::m_bLock=false; + +CAboutDlg::CAboutDlg() : CHLanguageDialog(CAboutDlg::IDD, NULL, &m_bLock) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT + RegisterStaticExControl(AfxGetInstanceHandle()); +} + +CAboutDlg::~CAboutDlg() +{ +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CAboutDlg) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +void CAboutDlg::UpdateProgramVersion() +{ + CWnd* pCtl=(CWnd*)GetDlgItem(IDC_PROGRAM_STATICEX); + CWnd* pCtl2=(CWnd*)GetDlgItem(IDC_FULLVERSION_STATICEX); + if (!pCtl || !pCtl2) + return; + else + { + TCHAR szFull[256]; + _stprintf(szFull, GetResManager()->LoadString(IDS_ABOUTVERSION_STRING), GetApp()->GetAppVersion()); + + pCtl->SetWindowText(GetApp()->GetAppNameVer()); + pCtl2->SetWindowText(szFull); + } +} + +void CAboutDlg::UpdateThanks() +{ + CEdit* pEdit=(CEdit*)GetDlgItem(IDC_THANX_EDIT); + if (pEdit == NULL) + return; + + // get the info about current translations + TCHAR szData[1024]; + GetConfig()->GetStringValue(PP_PLANGDIR, szData, 1024); + GetApp()->ExpandPath(szData); + vector vData; + GetResManager()->Scan(szData, &vData); + + // format the info + TCHAR szTI[8192]; + szTI[0]=_T('\0'); + for (vector::iterator it=vData.begin();it!=vData.end();it++) + { + _stprintf(szData, _T("%s\t\t%s [%s%lu, %s%s]\r\n"), it->GetAuthor(), it->GetLangName(), GetResManager()->LoadString(IDS_LANGCODE_STRING), it->GetLangCode(), GetResManager()->LoadString(IDS_LANGVER_STRING), it->GetVersion()); + _tcscat(szTI, szData); + } + + TCHAR szText[16384]; + _sntprintf(szText, 16384, GetResManager()->LoadString(IDR_THANKS_TEXT), szTI); + szText[16383]=0; + pEdit->SetWindowText(szText); +} + +BOOL CAboutDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + UpdateProgramVersion(); + UpdateThanks(); + + return TRUE; +} + +void CAboutDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + UpdateProgramVersion(); + UpdateThanks(); +} + +BOOL CAboutDlg::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip) +{ + switch(uiID) + { + case IDC_HOMEPAGELINK_STATIC: + case IDC_HOMEPAGELINK2_STATIC: + case IDC_CONTACT1LINK_STATIC: + case IDC_CONTACT2LINK_STATIC: + case IDC_CONTACT3LINK_STATIC: + case IDC_GENFORUMPAGELINK_STATIC: + case IDC_GENFORUMSUBSCRIBELINK_STATIC: + case IDC_GENFORUMUNSUBSCRIBELINK_STATIC: + case IDC_GENFORUMSENDLINK_STATIC: + case IDC_DEVFORUMPAGELINK_STATIC: + case IDC_DEVFORUMSUBSCRIBELINK_STATIC: + case IDC_DEVFORUMUNSUBSCRIBELINK_STATIC: + case IDC_DEVFORUMSENDLINK_STATIC: + { + HWND hWnd=::GetDlgItem(this->m_hWnd, uiID); + if (!hWnd) + return FALSE; + ::SendMessage(hWnd, SEM_GETLINK, (WPARAM)79, (LPARAM)pTip->szText); + pTip->szText[79]=_T('\0'); + return TRUE; + } + default: + return FALSE; + } +} Index: Copy Handler/AboutDlg.h =================================================================== diff -u --- Copy Handler/AboutDlg.h (revision 0) +++ Copy Handler/AboutDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,56 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __ABOUTDLG_H__ +#define __ABOUTDLG_H__ + +class CAboutDlg : public CHLanguageDialog +{ +public: + CAboutDlg(); + ~CAboutDlg(); + + void UpdateProgramVersion(); + void UpdateThanks(); + + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + virtual BOOL OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + //}}AFX_VIRTUAL + static bool m_bLock; // locker + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + virtual BOOL OnInitDialog(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +#endif Index: Copy Handler/BufferSizeDlg.cpp =================================================================== diff -u --- Copy Handler/BufferSizeDlg.cpp (revision 0) +++ Copy Handler/BufferSizeDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,334 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "BufferSizeDlg.h" +#include "Copy Handler.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CBufferSizeDlg dialog + +CBufferSizeDlg::CBufferSizeDlg() + : CHLanguageDialog(CBufferSizeDlg::IDD) +{ + //{{AFX_DATA_INIT(CBufferSizeDlg) + m_uiDefaultSize = 0; + m_uiLANSize = 0; + m_uiCDROMSize = 0; + m_uiOneDiskSize = 0; + m_uiTwoDisksSize = 0; + m_bOnlyDefaultCheck = FALSE; + //}}AFX_DATA_INIT + m_iActiveIndex=BI_DEFAULT; +} + +void CBufferSizeDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CBufferSizeDlg) + DDX_Control(pDX, IDC_TWODISKSMULTIPLIER_COMBO, m_ctlTwoDisksMulti); + DDX_Control(pDX, IDC_ONEDISKMULTIPLIER_COMBO, m_ctlOneDiskMulti); + DDX_Control(pDX, IDC_LANMULTIPLIER_COMBO, m_ctlLANMulti); + DDX_Control(pDX, IDC_DEFAULTMULTIPLIER_COMBO, m_ctlDefaultMulti); + DDX_Control(pDX, IDC_CDROMMULTIPLIER_COMBO, m_ctlCDROMMulti); + DDX_Text(pDX, IDC_DEFAULTSIZE_EDIT, m_uiDefaultSize); + DDX_Text(pDX, IDC_LANSIZE_EDIT, m_uiLANSize); + DDX_Text(pDX, IDC_CDROMSIZE_EDIT, m_uiCDROMSize); + DDX_Text(pDX, IDC_ONEDISKSIZE_EDIT, m_uiOneDiskSize); + DDX_Text(pDX, IDC_TWODISKSSIZE_EDIT, m_uiTwoDisksSize); + DDX_Check(pDX, IDC_ONLYDEFAULT_CHECK, m_bOnlyDefaultCheck); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CBufferSizeDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CBufferSizeDlg) + ON_BN_CLICKED(IDC_ONLYDEFAULT_CHECK, OnOnlydefaultCheck) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CBufferSizeDlg message handlers + +BOOL CBufferSizeDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // set all the combos + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + + // fill edit controls and set multipliers + SetDefaultSize(m_bsSizes.m_uiDefaultSize); + SetOneDiskSize(m_bsSizes.m_uiOneDiskSize); + SetTwoDisksSize(m_bsSizes.m_uiTwoDisksSize); + SetCDSize(m_bsSizes.m_uiCDSize); + SetLANSize(m_bsSizes.m_uiLANSize); + m_bOnlyDefaultCheck=m_bsSizes.m_bOnlyDefault; + + EnableControls(!m_bsSizes.m_bOnlyDefault); + + UpdateData(FALSE); + + // set focus to the requested control + switch (m_iActiveIndex) + { + case BI_DEFAULT: + GetDlgItem(IDC_DEFAULTSIZE_EDIT)->SetFocus(); + static_cast(GetDlgItem(IDC_DEFAULTSIZE_EDIT))->SetSel(0, -1); + break; + case BI_ONEDISK: + GetDlgItem(IDC_ONEDISKSIZE_EDIT)->SetFocus(); + static_cast(GetDlgItem(IDC_ONEDISKSIZE_EDIT))->SetSel(0, -1); + break; + case BI_TWODISKS: + GetDlgItem(IDC_TWODISKSSIZE_EDIT)->SetFocus(); + static_cast(GetDlgItem(IDC_TWODISKSSIZE_EDIT))->SetSel(0, -1); + break; + case BI_CD: + GetDlgItem(IDC_CDROMSIZE_EDIT)->SetFocus(); + static_cast(GetDlgItem(IDC_CDROMSIZE_EDIT))->SetSel(0, -1); + break; + case BI_LAN: + GetDlgItem(IDC_LANSIZE_EDIT)->SetFocus(); + static_cast(GetDlgItem(IDC_LANSIZE_EDIT))->SetSel(0, -1); + break; + } + + return FALSE; +} + +void CBufferSizeDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + UpdateData(TRUE); + + // set all the combos + int iSel=m_ctlDefaultMulti.GetCurSel(); + m_ctlDefaultMulti.ResetContent(); + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlDefaultMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlDefaultMulti.SetCurSel(iSel); + + iSel=m_ctlOneDiskMulti.GetCurSel(); + m_ctlOneDiskMulti.ResetContent(); + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlOneDiskMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlOneDiskMulti.SetCurSel(iSel); + + iSel=m_ctlTwoDisksMulti.GetCurSel(); + m_ctlTwoDisksMulti.ResetContent(); + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlTwoDisksMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlTwoDisksMulti.SetCurSel(iSel); + + iSel=m_ctlCDROMMulti.GetCurSel(); + m_ctlCDROMMulti.ResetContent(); + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlCDROMMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlCDROMMulti.SetCurSel(iSel); + + iSel=m_ctlLANMulti.GetCurSel(); + m_ctlLANMulti.ResetContent(); + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_BYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_KBYTE_STRING)); + m_ctlLANMulti.AddString(GetResManager()->LoadString(IDS_MBYTE_STRING)); + m_ctlLANMulti.SetCurSel(iSel); + + UpdateData(FALSE); +} + +UINT CBufferSizeDlg::IndexToValue(int iIndex) +{ + switch (iIndex) + { + case 0: + return 1; + case 1: + return 1024; + case 2: + return 1048576; + default: + ASSERT(true); // bad index + return 1; + } +} + +void CBufferSizeDlg::OnOK() +{ + if (!UpdateData(TRUE)) + return; + + // no buffer could be 0 + if (m_uiDefaultSize == 0 || m_uiOneDiskSize == 0 || m_uiTwoDisksSize == 0 || m_uiCDROMSize == 0 || m_uiLANSize == 0) + { + MsgBox(IDS_BUFFERSIZEZERO_STRING); + return; + } + + // assign values + m_bsSizes.m_bOnlyDefault=m_bOnlyDefaultCheck != 0; + m_bsSizes.m_uiDefaultSize=m_uiDefaultSize*IndexToValue(m_ctlDefaultMulti.GetCurSel()); + m_bsSizes.m_uiOneDiskSize=m_uiOneDiskSize*IndexToValue(m_ctlOneDiskMulti.GetCurSel()); + m_bsSizes.m_uiTwoDisksSize=m_uiTwoDisksSize*IndexToValue(m_ctlTwoDisksMulti.GetCurSel()); + m_bsSizes.m_uiCDSize=m_uiCDROMSize*IndexToValue(m_ctlCDROMMulti.GetCurSel()); + m_bsSizes.m_uiLANSize=m_uiLANSize*IndexToValue(m_ctlLANMulti.GetCurSel()); + + CHLanguageDialog::OnOK(); +} + +void CBufferSizeDlg::SetDefaultSize(UINT uiSize) +{ + if ((uiSize % 1048576) == 0) + { + m_uiDefaultSize=static_cast(uiSize/1048576); + m_ctlDefaultMulti.SetCurSel(2); + } + else if ((uiSize % 1024) == 0) + { + m_uiDefaultSize=static_cast(uiSize/1024); + m_ctlDefaultMulti.SetCurSel(1); + } + else + { + m_uiDefaultSize=uiSize; + m_ctlDefaultMulti.SetCurSel(0); + } +} + +void CBufferSizeDlg::SetOneDiskSize(UINT uiSize) +{ + if ((uiSize % 1048576) == 0) + { + m_uiOneDiskSize=static_cast(uiSize/1048576); + m_ctlOneDiskMulti.SetCurSel(2); + } + else if ((uiSize % 1024) == 0) + { + m_uiOneDiskSize=static_cast(uiSize/1024); + m_ctlOneDiskMulti.SetCurSel(1); + } + else + { + m_uiOneDiskSize=uiSize; + m_ctlOneDiskMulti.SetCurSel(0); + } +} + +void CBufferSizeDlg::SetTwoDisksSize(UINT uiSize) +{ + if ((uiSize % 1048576) == 0) + { + m_uiTwoDisksSize=static_cast(uiSize/1048576); + m_ctlTwoDisksMulti.SetCurSel(2); + } + else if ((uiSize % 1024) == 0) + { + m_uiTwoDisksSize=static_cast(uiSize/1024); + m_ctlTwoDisksMulti.SetCurSel(1); + } + else + { + m_uiTwoDisksSize=uiSize; + m_ctlTwoDisksMulti.SetCurSel(0); + } +} + +void CBufferSizeDlg::SetCDSize(UINT uiSize) +{ + if ((uiSize % 1048576) == 0) + { + m_uiCDROMSize=static_cast(uiSize/1048576); + m_ctlCDROMMulti.SetCurSel(2); + } + else if ((uiSize % 1024) == 0) + { + m_uiCDROMSize=static_cast(uiSize/1024); + m_ctlCDROMMulti.SetCurSel(1); + } + else + { + m_uiCDROMSize=uiSize; + m_ctlCDROMMulti.SetCurSel(0); + } +} + +void CBufferSizeDlg::SetLANSize(UINT uiSize) +{ + if ((uiSize % 1048576) == 0) + { + m_uiLANSize=static_cast(uiSize/1048576); + m_ctlLANMulti.SetCurSel(2); + } + else if ((uiSize % 1024) == 0) + { + m_uiLANSize=static_cast(uiSize/1024); + m_ctlLANMulti.SetCurSel(1); + } + else + { + m_uiLANSize=uiSize; + m_ctlLANMulti.SetCurSel(0); + } +} + +void CBufferSizeDlg::EnableControls(bool bEnable) +{ + GetDlgItem(IDC_ONEDISKSIZE_EDIT)->EnableWindow(bEnable); + m_ctlOneDiskMulti.EnableWindow(bEnable); + GetDlgItem(IDC_TWODISKSSIZE_EDIT)->EnableWindow(bEnable); + m_ctlTwoDisksMulti.EnableWindow(bEnable); + GetDlgItem(IDC_CDROMSIZE_EDIT)->EnableWindow(bEnable); + m_ctlCDROMMulti.EnableWindow(bEnable); + GetDlgItem(IDC_LANSIZE_EDIT)->EnableWindow(bEnable); + m_ctlLANMulti.EnableWindow(bEnable); +} + +void CBufferSizeDlg::OnOnlydefaultCheck() +{ + UpdateData(TRUE); + EnableControls(m_bOnlyDefaultCheck == 0); +} Index: Copy Handler/BufferSizeDlg.h =================================================================== diff -u --- Copy Handler/BufferSizeDlg.h (revision 0) +++ Copy Handler/BufferSizeDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,85 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __BUFFERSIZEDLG_H__ +#define __BUFFERSIZEDLG_H__ + +#include "DataBuffer.h" + +///////////////////////////////////////////////////////////////////////////// +// CBufferSizeDlg dialog + +class CBufferSizeDlg : public CHLanguageDialog +{ +// Construction +public: + CBufferSizeDlg(); // standard constructor + + void SetLANSize(UINT uiSize); + void SetCDSize(UINT uiSize); + void SetTwoDisksSize(UINT uiSize); + void SetOneDiskSize(UINT uiSize); + void SetDefaultSize(UINT uiSize); + UINT IndexToValue(int iIndex); + + int m_iActiveIndex; + BUFFERSIZES m_bsSizes; + +// Dialog Data + //{{AFX_DATA(CBufferSizeDlg) + enum { IDD = IDD_BUFFERSIZE_DIALOG }; + CComboBox m_ctlTwoDisksMulti; + CComboBox m_ctlOneDiskMulti; + CComboBox m_ctlLANMulti; + CComboBox m_ctlDefaultMulti; + CComboBox m_ctlCDROMMulti; + UINT m_uiDefaultSize; + UINT m_uiLANSize; + UINT m_uiCDROMSize; + UINT m_uiOneDiskSize; + UINT m_uiTwoDisksSize; + BOOL m_bOnlyDefaultCheck; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CBufferSizeDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + + void EnableControls(bool bEnable=true); + // Generated message map functions + //{{AFX_MSG(CBufferSizeDlg) + virtual BOOL OnInitDialog(); + virtual void OnOK(); + afx_msg void OnOnlydefaultCheck(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/COPY HANDLER.cpp =================================================================== diff -u --- Copy Handler/COPY HANDLER.cpp (revision 0) +++ Copy Handler/COPY HANDLER.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,364 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "COPY HANDLER.h" + +#include "CfgProperties.h" +#include "MainWnd.h" +#include "..\common\CHPluginCore.h" +#include "..\common\ipcstructs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CCopyHandlerApp + +BEGIN_MESSAGE_MAP(CCopyHandlerApp, CWinApp) + //{{AFX_MSG_MAP(CCopyHandlerApp) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +CSharedConfigStruct* g_pscsShared; + +int iCount=98; +unsigned short msg[]={ 0x40d1, 0x4dcd, 0x8327, 0x6cdf, 0xb912, 0x017b, 0xac78, 0x1e04, 0x5637, + 0x1822, 0x0a69, 0x1b40, 0x4169, 0x504d, 0x80ff, 0x6c2f, 0xa612, 0x017e, + 0xac84, 0x1c8c, 0x552b, 0x16e2, 0x0a4b, 0x1dc0, 0x4179, 0x4d0d, 0x8337, + 0x6c4f, 0x6512, 0x0169, 0xac46, 0x1db4, 0x55cf, 0x1652, 0x0a0b, 0x1480, + 0x40fd, 0x470d, 0x822f, 0x6b8f, 0x6512, 0x013a, 0xac5a, 0x1d24, 0x5627, + 0x1762, 0x0a27, 0x1240, 0x40f5, 0x3f8d, 0x8187, 0x690f, 0x6e12, 0x011c, + 0xabc0, 0x1cc4, 0x567f, 0x1952, 0x0a51, 0x1cc0, 0x4175, 0x3ccd, 0x8377, + 0x6c5f, 0x6512, 0x0186, 0xac7c, 0x1e04, 0x5677, 0x1412, 0x0a61, 0x1d80, + 0x4169, 0x4e8d, 0x838f, 0x6c0f, 0xb212, 0x0132, 0xac7e, 0x1e54, 0x5593, + 0x1412, 0x0a15, 0x3dc0, 0x4195, 0x4e0d, 0x832f, 0x67ff, 0x9812, 0x0186, + 0xac6e, 0x1e4c, 0x5667, 0x1942, 0x0a47, 0x1f80, 0x4191, 0x4f8d }; + +int iOffCount=12; +unsigned char off[]={ 2, 6, 3, 4, 8, 0, 1, 3, 2, 4, 1, 6 }; +unsigned short _hash[]={ 0x3fad, 0x34cd, 0x7fff, 0x65ff, 0x4512, 0x0112, 0xabac, 0x1abc, 0x54ab, 0x1212, 0x0981, 0x0100 }; + +///////////////////////////////////////////////////////////////////////////// +// The one and only CCopyHandlerApp object + +CCopyHandlerApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CCopyHandlerApp construction + +// main routing function - routes any message that comes from modules +LRESULT MainRouter(ULONGLONG ullDst, UINT uiMsg, WPARAM wParam, LPARAM lParam) +{ + TRACE("Main routing func received ullDst=%I64u, uiMsg=%lu, wParam=%lu, lParam=%lu\n", ullDst, uiMsg, wParam, lParam); + ULONGLONG ullOperation=ullDst & 0xff00000000000000; + ullDst &= 0x00ffffffffffffff; // get rid of operation + + switch (ullOperation) + { + case ROT_EVERYWHERE: + { + // TODO: send it to a registered modules (external plugins ?) + + // now additional processing + switch (uiMsg) + { + case WM_CFGNOTIFY: + theApp.OnConfigNotify((UINT)wParam, lParam); + break; + case WM_RMNOTIFY: + theApp.OnResManNotify((UINT)wParam, lParam); + break; + } + + break; + } + + case ROT_REGISTERED: + // TODO: send a message to the registered modules + break; + + case ROT_EXACT: + { + switch(ullDst) + { + case IMID_CONFIGMANAGER: + return theApp.m_cfgManager.MsgRouter(uiMsg, wParam, lParam); + } + + // TODO: send a msg to a registered module/program internal module with a given ID + } + break; + } + + return (LRESULT)TRUE; +} + +CCopyHandlerApp::CCopyHandlerApp() +{ + m_pMainWindow=NULL; + m_szHelpPath[0]=_T('\0'); + + // this is the one-instance application + InitProtection(); +} + +CCopyHandlerApp::~CCopyHandlerApp() +{ + // Unmap shared memory from the process's address space. + UnmapViewOfFile((LPVOID)g_pscsShared); + + // Close the process's handle to the file-mapping object. + CloseHandle(m_hMapObject); + + if (m_pMainWindow) + { + ((CMainWnd*)m_pMainWindow)->DestroyWindow(); + delete m_pMainWindow; + m_pMainWnd=NULL; + } +} + + +CCopyHandlerApp* GetApp() +{ + return &theApp; +} + +CResourceManager* GetResManager() +{ + return &theApp.m_resManager; +} + +CConfigManager* GetConfig() +{ + return &theApp.m_cfgManager; +} + +CLogFile* GetLog() +{ + return &theApp.m_lfLog; +} + +int MsgBox(UINT uiID, UINT nType, UINT nIDHelp) +{ + return AfxMessageBox(GetResManager()->LoadString(uiID), nType, nIDHelp); +} + +bool CCopyHandlerApp::UpdateHelpPaths() +{ + bool bChanged=false; // flag that'll be returned - if the paths has changed + + // generate the current filename - uses language from config + TCHAR szBuffer[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PHELPDIR, szBuffer, _MAX_PATH); + ExpandPath(szBuffer); + _tcscat(szBuffer, GetResManager()->m_ld.GetHelpName()); + if (_tcscmp(szBuffer, m_szHelpPath) != 0) + { + bChanged=true; + _tcscpy(m_szHelpPath, szBuffer); + } + + return bChanged; +} + +///////////////////////////////////////////////////////////////////////////// +// CCopyHandlerApp initialization +#include "charvect.h" + +BOOL CCopyHandlerApp::InitInstance() +{ + CWinApp::InitInstance(); + + m_hMapObject = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, sizeof(CSharedConfigStruct), _T("CHLMFile")); + if (m_hMapObject == NULL) + return FALSE; + + // Get a pointer to the file-mapped shared memory. + g_pscsShared=(CSharedConfigStruct*)MapViewOfFile(m_hMapObject, FILE_MAP_WRITE, 0, 0, 0); + if (g_pscsShared == NULL) + return FALSE; + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + // load configuration + m_cfgManager.SetCallback((PFNNOTIFYCALLBACK)MainRouter); + TCHAR szPath[_MAX_PATH]; + _tcscpy(szPath, GetProgramPath()); + _tcscat(szPath, _T("\\ch.ini")); + m_cfgManager.Open(szPath); + + // register all properties + RegisterProperties(&m_cfgManager); + + // set this process class + HANDLE hProcess=GetCurrentProcess(); + ::SetPriorityClass(hProcess, m_cfgManager.GetIntValue(PP_PPROCESSPRIORITYCLASS)); + + // set current language + m_resManager.Init(AfxGetInstanceHandle()); + m_resManager.SetCallback((PFNNOTIFYCALLBACK)MainRouter); + m_cfgManager.GetStringValue(PP_PLANGUAGE, szPath, _MAX_PATH); + TRACE("Help path=%s\n", szPath); + if (!m_resManager.SetLanguage(ExpandPath(szPath))) + { + TCHAR szData[2048]; + _stprintf(szData, _T("Couldn't find the language file specified in configuration file:\n%s\nPlease correct this path to point the language file to use.\nProgram will now exit."), szPath); + AfxMessageBox(szData, MB_ICONSTOP | MB_OK); + return FALSE; + } + + // for dialogs + CLanguageDialog::SetResManager(&m_resManager); + + // initialize log file + m_cfgManager.GetStringValue(PP_LOGPATH, szPath, _MAX_PATH); + m_lfLog.EnableLogging(m_cfgManager.GetBoolValue(PP_LOGENABLELOGGING)); + m_lfLog.SetPreciseLimiting(m_cfgManager.GetBoolValue(PP_LOGPRECISELIMITING)); + m_lfLog.SetSizeLimit(m_cfgManager.GetBoolValue(PP_LOGLIMITATION), m_cfgManager.GetIntValue(PP_LOGMAXLIMIT)); + m_lfLog.SetTruncateBufferSize(m_cfgManager.GetIntValue(PP_LOGTRUNCBUFFERSIZE)); + m_lfLog.Init(ExpandPath(szPath), GetResManager()); + +#ifndef _DEBUG // for easier writing the program - doesn't collide with std CH + // set "run with system" registry settings + SetAutorun(m_cfgManager.GetBoolValue(PP_PRELOADAFTERRESTART)); +#endif + + // check instance - return false if it's the second one + if (!IsFirstInstance()) + { + MsgBox(IDS_ONECOPY_STRING); + return FALSE; + } + + m_pMainWindow=new CMainWnd; + if (!((CMainWnd*)m_pMainWindow)->Create()) + return FALSE; // will be deleted at destructor + + m_pMainWnd = m_pMainWindow; + + return TRUE; +} + +void CCopyHandlerApp::OnConfigNotify(UINT uiType, LPARAM lParam) +{ + // is this language + if (uiType == CNFT_PROFILECHANGE || (uiType == CNFT_PROPERTYCHANGE && ((UINT)lParam) == PP_PLANGUAGE)) + { + // update language in resource manager + TCHAR szPath[_MAX_PATH]; + m_cfgManager.GetStringValue(PP_PLANGUAGE, szPath, _MAX_PATH); + m_resManager.SetLanguage(ExpandPath(szPath)); + } + if (uiType == CNFT_PROFILECHANGE || (uiType == CNFT_PROPERTYCHANGE && ((UINT)lParam) == PP_PHELPDIR)) + { + if (UpdateHelpPaths()) + HtmlHelp(HH_CLOSE_ALL, NULL); + } +} + +void CCopyHandlerApp::OnResManNotify(UINT uiType, LPARAM lParam) +{ + if (uiType == RMNT_LANGCHANGE) + { + // language has been changed - close the current help file + if (UpdateHelpPaths()) + HtmlHelp(HH_CLOSE_ALL, NULL); + } +} + +HWND CCopyHandlerApp::HHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData) +{ + PCTSTR pszPath=NULL; + WIN32_FIND_DATA wfd; + HANDLE handle=::FindFirstFile(m_szHelpPath, &wfd); + if (handle != INVALID_HANDLE_VALUE) + { + pszPath=m_szHelpPath; + ::FindClose(handle); + } + + if (pszPath == NULL) + return NULL; + + if (pszFile != NULL) + { + TCHAR szAdd[2*_MAX_PATH]; + _tcscpy(szAdd, pszPath); + _tcscat(szAdd, pszFile); + return ::HtmlHelp(hwndCaller, szAdd, uCommand, dwData); + } + else + return ::HtmlHelp(hwndCaller, pszPath, uCommand, dwData); +} + +bool CCopyHandlerApp::HtmlHelp(UINT uiCommand, LPARAM lParam) +{ + switch (uiCommand) + { + case HH_DISPLAY_TOPIC: + case HH_HELP_CONTEXT: + { + return HHelp(GetDesktopWindow(), NULL, uiCommand, lParam) != NULL; + break; + } + case HH_CLOSE_ALL: + return ::HtmlHelp(NULL, NULL, HH_CLOSE_ALL, NULL) != NULL; + break; + case HH_DISPLAY_TEXT_POPUP: + { + HELPINFO* pHelp=(HELPINFO*)lParam; + if ( pHelp->dwContextId == 0 || pHelp->iCtrlId == 0 + || ::GetWindowContextHelpId((HWND)pHelp->hItemHandle) == 0) + return false; + + HH_POPUP hhp; + hhp.cbStruct=sizeof(HH_POPUP); + hhp.hinst=NULL; + hhp.idString=(pHelp->dwContextId & 0xffff); + hhp.pszText=NULL; + hhp.pt=pHelp->MousePos; + hhp.pt.y+=::GetSystemMetrics(SM_CYCURSOR)/2; + hhp.clrForeground=(COLORREF)-1; + hhp.clrBackground=(COLORREF)-1; + hhp.rcMargins.left=-1; + hhp.rcMargins.right=-1; + hhp.rcMargins.top=-1; + hhp.rcMargins.bottom=-1; + hhp.pszFont=_T("Tahoma, 8, , "); + + TCHAR szPath[_MAX_PATH]; + _stprintf(szPath, _T("::/%lu.txt"), (pHelp->dwContextId >> 16) & 0x7fff); + return (HHelp(GetDesktopWindow(), szPath, HH_DISPLAY_TEXT_POPUP, (DWORD)&hhp) != NULL); + + break; + } + } + + return true; +} Index: Copy Handler/COPY HANDLER.h =================================================================== diff -u --- Copy Handler/COPY HANDLER.h (revision 0) +++ Copy Handler/COPY HANDLER.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,101 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __COPYHANDLER_H__ +#define __COPYHANDLER_H__ + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols +#include "AppHelper.h" +#include "ResourceManager.h" + +#define DISABLE_CRYPT +#include "ConfigManager.h" + +#include "CfgProperties.h" +#include "LogFile.h" + +using namespace std; + +///////////////////////////////////////////////////////////////////////////// +// CCopyHandlerApp: +// See CopyHandler.cpp for the implementation of this class +// + +class CCopyHandlerApp : public CWinApp, public CAppHelper +{ +public: +// BOOL RegisterShellExt(); + CCopyHandlerApp(); + ~CCopyHandlerApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CCopyHandlerApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + + bool HtmlHelp(UINT uiCommand, LPARAM lParam); + + PCTSTR GetHelpPath() const { return m_szHelpPath; }; + + friend LRESULT MainRouter(ULONGLONG ullDst, UINT uiMsg, WPARAM wParam, LPARAM lParam); + friend int MsgBox(UINT uiID, UINT nType=MB_OK, UINT nIDHelp=0); + friend CCopyHandlerApp* GetApp(); + friend CResourceManager* GetResManager(); + friend CConfigManager* GetConfig(); + friend CLogFile* GetLog(); + + void OnConfigNotify(UINT uiType, LPARAM lParam); + void OnResManNotify(UINT uiType, LPARAM lParam); +protected: + bool UpdateHelpPaths(); + HWND HHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData); + +public: + CResourceManager m_resManager; + CConfigManager m_cfgManager; + CLogFile m_lfLog; + + CWnd *m_pMainWindow; + // currently opened dialogs +// list m_lhDialogs; + +protected: +// Implementation + HANDLE m_hMapObject; + TCHAR m_szHelpPath[_MAX_PATH]; // full file path to the help file + + //{{AFX_MSG(CCopyHandlerApp) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/COPY HANDLER.rc =================================================================== diff -u --- Copy Handler/COPY HANDLER.rc (revision 0) +++ Copy Handler/COPY HANDLER.rc (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1632 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +// Generated Help ID header file +#define APSTUDIO_HIDDEN_SYMBOLS +#include "resource.hm" +#undef APSTUDIO_HIDDEN_SYMBOLS + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// 25 +// + +IDR_THANKS_TEXT 25 DISCARDABLE "res\\Thanks.txt" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\COPY HANDLER.ico" +IDI_ERROR_ICON ICON DISCARDABLE "res\\error.ico" +IDI_WORKING_ICON ICON DISCARDABLE "res\\working.ico" +IDI_PAUSED_ICON ICON DISCARDABLE "res\\paused.ico" +IDI_FINISHED_ICON ICON DISCARDABLE "res\\finished.ico" +IDI_CANCELLED_ICON ICON DISCARDABLE "res\\cancelled.ico" +IDI_WAITING_ICON ICON DISCARDABLE "res\\waiting.ico" +IDI_QUESTION_ICON ICON DISCARDABLE "res\\question.ico" +IDI_INFO_ICON ICON DISCARDABLE "res\\info.ico" +IDI_ERR_ICON ICON DISCARDABLE "res\\err.ico" +IDI_WARNING_ICON ICON DISCARDABLE "res\\warning.ico" +IDI_SHUTDOWN_ICON ICON DISCARDABLE "res\\shut.ico" +IDI_NET_ICON ICON DISCARDABLE "res\\net.ico" +IDI_HDD_ICON ICON DISCARDABLE "res\\hd.ico" +IDI_CD_ICON ICON DISCARDABLE "res\\cd.ico" +IDI_HDD2_ICON ICON DISCARDABLE "res\\HD2.ICO" +IDI_TRIBE_ICON ICON DISCARDABLE "res\\tribe.ico" +IDI_FOLDER_ICON ICON DISCARDABLE "res\\folder.ico" +IDI_ADDSHORTCUT_ICON ICON DISCARDABLE "res\\addshort.ico" +IDI_DELETESHORTCUT_ICON ICON DISCARDABLE "res\\delshort.ico" +IDI_LARGEICONS_ICON ICON DISCARDABLE "res\\large.ico" +IDI_LIST_ICON ICON DISCARDABLE "res\\list.ico" +IDI_NEWFOLDER_ICON ICON DISCARDABLE "res\\newdir.ico" +IDI_REPORT_ICON ICON DISCARDABLE "res\\report.ico" +IDI_SMALLICONS_ICON ICON DISCARDABLE "res\\small.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_ADVANCED_MENU MENU DISCARDABLE +BEGIN + POPUP "_ADVANCED_POPUP_" + BEGIN + MENUITEM "&Change paths...", ID_POPUP_REPLACE_PATHS + END +END + +IDR_POPUP_MENU MENU DISCARDABLE +BEGIN + POPUP "POPUP" + BEGIN + MENUITEM "Show status...", ID_POPUP_SHOW_STATUS + MENUITEM "Show mini-status...", ID_SHOW_MINI_VIEW + MENUITEM "Enter copy parametres...", ID_POPUP_CUSTOM_COPY + MENUITEM SEPARATOR + MENUITEM "&Register shell extension dll", ID_POPUP_REGISTERDLL + MENUITEM "&Unregister shell extension dll", ID_POPUP_UNREGISTERDLL + MENUITEM SEPARATOR + MENUITEM "Monitor clipboard", ID_POPUP_MONITORING, CHECKED + MENUITEM "Shutdown after finished", ID_POPUP_SHUTAFTERFINISHED + , CHECKED + MENUITEM SEPARATOR + MENUITEM "&Options...", ID_POPUP_OPTIONS + MENUITEM "&Help...", ID_POPUP_HELP + MENUITEM "About...", ID_APP_ABOUT + MENUITEM SEPARATOR + MENUITEM "Exit", ID_APP_EXIT + END +END + +IDR_PRIORITY_MENU MENU DISCARDABLE +BEGIN + POPUP "_POPUP_" + BEGIN + MENUITEM "Time critical", ID_POPUP_TIME_CRITICAL + MENUITEM "Highest", ID_POPUP_HIGHEST + MENUITEM "Above normal", ID_POPUP_ABOVE_NORMAL + MENUITEM "Normal", ID_POPUP_NORMAL + MENUITEM "Below normal", ID_POPUP_BELOW_NORMAL + MENUITEM "Lowest", ID_POPUP_LOWEST + MENUITEM "Idle", ID_POPUP_IDLE + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_BUFFERSIZE_DIALOG DIALOGEX 0, 0, 344, 127 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Buffer size settings" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + EDITTEXT IDC_DEFAULTSIZE_EDIT,35,17,97,14,ES_AUTOHSCROLL | NOT + WS_BORDER,WS_EX_CLIENTEDGE,HIDC_DEFAULTSIZE_EDIT + COMBOBOX IDC_DEFAULTMULTIPLIER_COMBO,134,18,31,56, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0, + HIDC_DEFAULTMULTIPLIER_COMBO + EDITTEXT IDC_ONEDISKSIZE_EDIT,35,49,97,14,ES_AUTOHSCROLL | NOT + WS_BORDER,WS_EX_CLIENTEDGE,HIDC_ONEDISKSIZE_EDIT + COMBOBOX IDC_ONEDISKMULTIPLIER_COMBO,134,50,31,56, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0, + HIDC_ONEDISKMULTIPLIER_COMBO + EDITTEXT IDC_TWODISKSSIZE_EDIT,35,81,97,14,ES_AUTOHSCROLL | NOT + WS_BORDER,WS_EX_CLIENTEDGE,HIDC_TWODISKSSIZE_EDIT + COMBOBOX IDC_TWODISKSMULTIPLIER_COMBO,134,82,31,56, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,0, + HIDC_TWODISKSMULTIPLIER_COMBO + EDITTEXT IDC_CDROMSIZE_EDIT,206,18,97,14,ES_AUTOHSCROLL | NOT + WS_BORDER,WS_EX_CLIENTEDGE,HIDC_CDROMSIZE_EDIT + COMBOBOX IDC_CDROMMULTIPLIER_COMBO,306,18,31,56,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_CDROMMULTIPLIER_COMBO + EDITTEXT IDC_LANSIZE_EDIT,206,51,97,14,ES_AUTOHSCROLL | NOT + WS_BORDER,WS_EX_CLIENTEDGE,HIDC_LANSIZE_EDIT + COMBOBOX IDC_LANMULTIPLIER_COMBO,306,52,31,56,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_LANMULTIPLIER_COMBO + DEFPUSHBUTTON "&OK",IDOK,176,106,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,229,106,50,14,0,0,HIDCANCEL + LTEXT "Default",IDC_001_STATIC,35,7,127,8 + LTEXT "For copying inside one disk boundary",IDC_002_STATIC,35, + 38,130,8 + LTEXT "For copying between two different disks",IDC_003_STATIC, + 35,70,132,8 + LTEXT "For copying with CD-ROM use",IDC_004_STATIC,206,7,131,8 + LTEXT "For copying with network use",IDC_005_STATIC,206,40,131, + 8 + CONTROL "Use only default buffer",IDC_ONLYDEFAULT_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,200,83,137,10,0, + HIDC_ONLYDEFAULT_CHECK + ICON IDI_CD_ICON,IDC_006_STATIC,179,13,20,20,SS_REALSIZEIMAGE + ICON IDI_NET_ICON,IDC_007_STATIC,179,44,20,20, + SS_REALSIZEIMAGE + ICON IDI_HDD_ICON,IDC_008_STATIC,7,43,20,20,SS_REALSIZEIMAGE + ICON IDI_HDD2_ICON,IDC_009_STATIC,7,73,20,20,SS_REALSIZEIMAGE + ICON IDI_TRIBE_ICON,IDC_010_STATIC,7,9,20,20,SS_REALSIZEIMAGE + PUSHBUTTON "&Help",IDC_HELP_BUTTON,287,106,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_FEEDBACK_DSTFILE_DIALOG DIALOGEX 0, 0, 290, 111 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler - error opening file" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,7,90,53,14,0,0, + HIDC_RETRY_BUTTON + PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,63,90,50,14,0,0, + HIDC_IGNORE_BUTTON + PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,114,90,62,14,0,0, + HIDC_IGNORE_ALL_BUTTON + DEFPUSHBUTTON "&Wait",IDC_WAIT_BUTTON,178,90,50,14,0,0, + HIDC_WAIT_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,233,90,50,14,0,0,HIDCANCEL + EDITTEXT IDC_FILENAME_EDIT,44,23,239,17,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT + EDITTEXT IDC_MESSAGE_EDIT,44,57,239,24,ES_MULTILINE | + ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT + WS_BORDER,0,HIDC_MESSAGE_EDIT + ICON IDI_ERR_ICON,IDC_001_STATIC,11,15,20,20,SS_REALSIZEIMAGE + LTEXT "Cannot open file for writing:",IDC_002_STATIC,38,13,245, + 8 + LTEXT "Error description:",IDC_003_STATIC,38,46,245,8 +END + +IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG DIALOGEX 0, 0, 294, 242 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler - error opening file" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,7,221,50,14,0,0, + HIDC_RETRY_BUTTON + PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,60,221,50,14,0,0, + HIDC_IGNORE_BUTTON + PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,110,221,69,14,0,0, + HIDC_IGNORE_ALL_BUTTON + DEFPUSHBUTTON "&Wait",IDC_WAIT_BUTTON,183,221,50,14,0,0, + HIDC_WAIT_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,237,221,50,14,0,0,HIDCANCEL + EDITTEXT IDC_MESSAGE_EDIT,49,19,238,23,ES_MULTILINE | + ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER,0, + HIDC_MESSAGE_EDIT + EDITTEXT IDC_FILENAME_EDIT,111,54,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT + EDITTEXT IDC_FILESIZE_EDIT,111,69,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT + EDITTEXT IDC_CREATETIME_EDIT,111,84,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT + EDITTEXT IDC_MODIFY_TIME_EDIT,111,99,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT + EDITTEXT IDC_DEST_FILENAME_EDIT,111,130,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT + EDITTEXT IDC_DEST_FILESIZE_EDIT,111,145,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT + EDITTEXT IDC_DEST_CREATETIME_EDIT,111,160,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT + EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,175,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT + LTEXT "Cannot open source file for reading - reason:", + IDC_001_STATIC,49,10,238,8 + LTEXT "Name:",IDC_002_STATIC,53,54,53,8 + LTEXT "Size:",IDC_003_STATIC,53,69,53,8 + LTEXT "Created:",IDC_004_STATIC,53,84,53,8 + LTEXT "Last modified:",IDC_005_STATIC,53,99,53,8 + LTEXT "Expected source file:",IDC_006_STATIC,49,42,238,8 + ICON IDI_ERR_ICON,IDC_007_STATIC,16,19,20,20,SS_REALSIZEIMAGE + LTEXT "Name:",IDC_008_STATIC,53,130,53,8 + LTEXT "Size:",IDC_009_STATIC,53,145,53,8 + LTEXT "Created:",IDC_010_STATIC,53,160,53,8 + LTEXT "Last modified:",IDC_011_STATIC,53,175,53,8 + LTEXT "Source file found:",IDC_012_STATIC,49,118,81,8 + LTEXT "What would you like to do ?",IDC_013_STATIC,39,204,248, + 8 +END + +IDD_FEEDBACK_REPLACE_FILES_DIALOG DIALOGEX 0, 0, 294, 258 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler - smaller destination file found" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Co&py rest",IDC_COPY_REST_BUTTON,7,237,62,14,0,0, + HIDC_COPY_REST_BUTTON + PUSHBUTTON "R&ecopy",IDC_RECOPY_BUTTON,69,237,74,14,0,0, + HIDC_RECOPY_BUTTON + PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,143,237,58,14,0,0, + HIDC_IGNORE_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,237,237,50,14,0,0,HIDCANCEL + PUSHBUTTON "Cop&y rest all",IDC_COPY_REST_ALL_BUTTON,7,222,83,14,0, + 0,HIDC_COPY_REST_ALL_BUTTON + PUSHBUTTON "Recopy &all",IDC_RECOPY_ALL_BUTTON,91,222,110,14,0,0, + HIDC_RECOPY_ALL_BUTTON + PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,201,222,86,14,0,0, + HIDC_IGNORE_ALL_BUTTON + EDITTEXT IDC_FILENAME_EDIT,111,62,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT + EDITTEXT IDC_FILESIZE_EDIT,111,77,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT + EDITTEXT IDC_CREATETIME_EDIT,111,92,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT + EDITTEXT IDC_MODIFY_TIME_EDIT,111,107,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT + EDITTEXT IDC_DEST_FILENAME_EDIT,111,138,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT + EDITTEXT IDC_DEST_FILESIZE_EDIT,111,153,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT + EDITTEXT IDC_DEST_CREATETIME_EDIT,111,168,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT + EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,183,176,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT + ICON IDI_QUESTION_ICON,IDC_001_STATIC,10,15,20,20, + SS_REALSIZEIMAGE + LTEXT "Destination file exists and is smaller than source file.\nPossible reasons:\n- copying/moving source file wasn't finished (copy rest)\n- file being copied is in another version than destination file (recopy)", + IDC_002_STATIC,41,7,246,41 + LTEXT "Name:",IDC_003_STATIC,48,62,61,8 + LTEXT "Size:",IDC_004_STATIC,48,77,61,8 + LTEXT "Created:",IDC_005_STATIC,48,92,61,8 + LTEXT "Last modified:",IDC_006_STATIC,48,107,61,8 + LTEXT "Source file:",IDC_007_STATIC,41,50,246,8 + LTEXT "Name:",IDC_008_STATIC,48,138,61,8 + LTEXT "Size:",IDC_009_STATIC,48,153,61,8 + LTEXT "Created:",IDC_010_STATIC,48,168,61,8 + LTEXT "Last modified:",IDC_011_STATIC,48,183,61,8 + LTEXT "Destination file:",IDC_012_STATIC,41,125,246,8 + LTEXT "What would you like to do ?",IDC_013_STATIC,41,203,246, + 8 +END + +IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG DIALOGEX 0, 0, 294, 258 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler - destination file found" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + PUSHBUTTON "R&ecopy",IDC_RECOPY_BUTTON,7,237,143,14,0,0, + HIDC_RECOPY_BUTTON + DEFPUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,151,237,86,14,0,0, + HIDC_IGNORE_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,237,237,50,14,0,0,HIDCANCEL + PUSHBUTTON "Recopy &all",IDC_RECOPY_ALL_BUTTON,7,222,143,14,0,0, + HIDC_RECOPY_ALL_BUTTON + PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,151,222,136,14,0,0, + HIDC_IGNORE_ALL_BUTTON + EDITTEXT IDC_FILENAME_EDIT,111,64,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT + EDITTEXT IDC_FILESIZE_EDIT,111,79,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT + EDITTEXT IDC_CREATETIME_EDIT,111,94,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT + EDITTEXT IDC_MODIFY_TIME_EDIT,111,109,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT + EDITTEXT IDC_DEST_FILENAME_EDIT,111,138,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT + EDITTEXT IDC_DEST_FILESIZE_EDIT,111,153,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT + EDITTEXT IDC_DEST_CREATETIME_EDIT,111,168,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT + EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,183,173,14,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT + ICON IDI_QUESTION_ICON,IDC_001_STATIC,10,15,20,20, + SS_REALSIZEIMAGE + LTEXT "Destination file exists and has equal or greater size than source file.\nPossible reasons:\n- file being copied is in another version than destination one (recopy/ignore)\n- source and destination files are identical (ignore)", + IDC_002_STATIC,41,7,246,44 + LTEXT "Name:",IDC_003_STATIC,48,64,61,8 + LTEXT "Size:",IDC_004_STATIC,48,79,61,8 + LTEXT "Created:",IDC_005_STATIC,48,94,61,8 + LTEXT "Last modified:",IDC_006_STATIC,48,109,61,8 + LTEXT "Source file:",IDC_007_STATIC,41,52,246,8 + LTEXT "Name:",IDC_008_STATIC,48,138,61,8 + LTEXT "Size:",IDC_009_STATIC,48,153,61,8 + LTEXT "Created:",IDC_010_STATIC,48,168,61,8 + LTEXT "Last modified:",IDC_011_STATIC,48,183,61,8 + LTEXT "Destination file:",IDC_012_STATIC,41,125,246,8 + LTEXT "What would you like to do ?",IDC_013_STATIC,41,203,246, + 8 +END + +IDD_MINIVIEW_DIALOG DIALOGEX 0, 0, 90, 23 +STYLE DS_ABSALIGN | DS_SYSMODAL | DS_MODALFRAME | DS_SETFOREGROUND | + DS_CONTEXTHELP | WS_POPUP | WS_CAPTION +EXSTYLE WS_EX_TOOLWINDOW +CAPTION "Status" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + LISTBOX IDC_PROGRESS_LIST,7,7,76,9,LBS_OWNERDRAWFIXED | + LBS_NOINTEGRALHEIGHT | LBS_NOSEL | NOT WS_BORDER | + WS_TABSTOP,0,HIDC_PROGRESS_LIST +END + +IDD_OPTIONS_DIALOG DIALOGEX 0, 0, 396, 214 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Options" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&OK",IDOK,173,193,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,227,193,50,14,0,0,HIDCANCEL + LISTBOX IDC_PROPERTIES_LIST,7,7,382,179,LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | + WS_TABSTOP,0,HIDC_PROPERTIES_LIST + PUSHBUTTON "&Apply",IDC_APPLY_BUTTON,283,193,50,14,0,0, + HIDC_APPLY_BUTTON + PUSHBUTTON "&Help",IDC_HELP_BUTTON,339,193,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_REPLACE_PATHS_DIALOG DIALOGEX 0, 0, 342, 148 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Partial replace of source paths" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + LISTBOX IDC_PATHS_LIST,7,17,328,52,LBS_SORT | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,0, + HIDC_PATHS_LIST + EDITTEXT IDC_SOURCE_EDIT,7,70,328,14,ES_AUTOHSCROLL,0, + HIDC_SOURCE_EDIT + EDITTEXT IDC_DESTINATION_EDIT,7,98,309,14,ES_AUTOHSCROLL,0, + HIDC_DESTINATION_EDIT + PUSHBUTTON "...",IDC_BROWSE_BUTTON,319,98,16,14,0,0, + HIDC_BROWSE_BUTTON + DEFPUSHBUTTON "OK",IDOK,173,127,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,229,127,50,14,0,0,HIDCANCEL + LTEXT "Source paths:",IDC_001_STATIC,7,7,328,8 + LTEXT "Change to:",IDC_002_STATIC,7,89,328,8 + PUSHBUTTON "&Help",IDC_HELP_BUTTON,285,127,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_STATUS_DIALOG DIALOGEX 0, 0, 478, 250 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_MINIMIZEBOX | WS_POPUP | + WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Status" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_STATUS_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | + WS_BORDER | WS_TABSTOP,7,19,224,171,0,HIDC_STATUS_LIST + PUSHBUTTON "&Pause",IDC_PAUSE_BUTTON,7,196,44,14,0,0, + HIDC_PAUSE_BUTTON + PUSHBUTTON "&Restart",IDC_RESTART_BUTTON,97,196,44,14,0,0, + HIDC_RESTART_BUTTON + PUSHBUTTON "&Cancel",IDC_CANCEL_BUTTON,142,196,44,14,0,0, + HIDC_CANCEL_BUTTON + PUSHBUTTON "&Remove",IDC_DELETE_BUTTON,187,196,44,14,0,0, + HIDC_DELETE_BUTTON + PUSHBUTTON "Pause/all",IDC_PAUSE_ALL_BUTTON,7,213,71,14,0,0, + HIDC_PAUSE_ALL_BUTTON + PUSHBUTTON "Resume/all",IDC_START_ALL_BUTTON,79,213,71,14,0,0, + HIDC_START_ALL_BUTTON + PUSHBUTTON "Cancel/all",IDC_CANCEL_ALL_BUTTON,7,229,71,14,0,0, + HIDC_CANCEL_ALL_BUTTON + PUSHBUTTON "Remove/all",IDC_REMOVE_FINISHED_BUTTON,79,229,71,14,0,0, + HIDC_REMOVE_FINISHED_BUTTON + PUSHBUTTON "Restart/all",IDC_RESTART_ALL_BUTTON,151,229,71,14,0,0, + HIDC_RESTART_ALL_BUTTON + PUSHBUTTON "&Advanced >",IDC_ADVANCED_BUTTON,160,212,71,14,0,0, + HIDC_ADVANCED_BUTTON + PUSHBUTTON "",IDC_STICK_BUTTON,471,243,7,7,BS_CENTER | BS_VCENTER | + BS_FLAT,0,HIDC_STICK_BUTTON + PUSHBUTTON "&<<",IDC_ROLL_UNROLL_BUTTON,212,7,19,12,0,0, + HIDC_ROLL_UNROLL_BUTTON + PUSHBUTTON "...",IDC_SET_BUFFERSIZE_BUTTON,458,72,13,14,0,0, + HIDC_SET_BUFFERSIZE_BUTTON + PUSHBUTTON ">",IDC_SET_PRIORITY_BUTTON,458,88,13,14,0,0, + HIDC_SET_PRIORITY_BUTTON + PUSHBUTTON "View log",IDC_SHOW_LOG_BUTTON,249,116,60,14,0,0, + HIDC_SHOW_LOG_BUTTON + LTEXT "Operations list:",IDC_001_STATIC,7,7,197,8 + CONTROL "Progress1",IDC_ALL_PROGRESS,"msctls_progress32", + PBS_SMOOTH,312,234,159,9 + LTEXT "Progress:",IDC_002_STATIC,249,235,62,8 + CONTROL "Progress2",IDC_TASK_PROGRESS,"msctls_progress32",0x0, + 312,181,159,6 + LTEXT "Progress:",IDC_003_STATIC,249,179,62,8 + LTEXT "Destination object:",IDC_004_STATIC,249,59,62,8 + LTEXT "Source object:",IDC_005_STATIC,249,47,62,8 + LTEXT "Buffer size:",IDC_006_STATIC,249,75,62,8 + LTEXT "Thread priority:",IDC_007_STATIC,249,90,62,8 + LTEXT "Comments:",IDC_008_STATIC,249,106,62,8 + LTEXT "Operation:",IDC_009_STATIC,249,34,62,8 + LTEXT "Transfer:",IDC_010_STATIC,249,167,62,8 + LTEXT "Processed:",IDC_011_STATIC,249,137,62,8 + LTEXT "Transfer:",IDC_012_STATIC,249,220,62,8 + LTEXT "Processed:",IDC_013_STATIC,249,205,62,8 + CTEXT "Global statistics",IDC_014_STATIC,293,191,84,8 + CTEXT "Current selection statistics",IDC_015_STATIC,293,7,113, + 8 + CONTROL "",IDC_016_STATIC,"Static",SS_ETCHEDHORZ,384,194,87,1 + CONTROL "",IDC_017_STATIC,"Static",SS_ETCHEDHORZ,411,10,61,1 + CONTROL "",IDC_018_STATIC,"Static",SS_ETCHEDHORZ,249,194,37,1 + CONTROL "",IDC_019_STATIC,"Static",SS_ETCHEDHORZ,249,10,38,1 + LTEXT "Time:",IDC_020_STATIC,249,152,62,8 + PUSHBUTTON "&Resume",IDC_RESUME_BUTTON,52,196,44,14,0,0, + HIDC_RESUME_BUTTON + EDITTEXT IDC_ERRORS_EDIT,312,104,159,26,ES_MULTILINE | + ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | + WS_VSCROLL,WS_EX_STATICEDGE,HIDC_ERRORS_EDIT + LTEXT "Associated file:",IDC_021_STATIC,249,19,62,8 + CONTROL "",IDC_ASSOCIATEDFILES__STATIC,"STATICEX",0x4,312,17,159, + 12,WS_EX_STATICEDGE,HIDC_ASSOCIATEDFILES__STATIC + CONTROL "",IDC_OPERATION_STATIC,"STATICEX",0x4,312,32,159,12, + WS_EX_STATICEDGE,HIDC_OPERATION_STATIC + CONTROL "",IDC_SOURCE_STATIC,"STATICEX",0x4,312,45,159,12, + WS_EX_STATICEDGE,HIDC_SOURCE_STATIC + CONTROL "",IDC_DESTINATION_STATIC,"STATICEX",0x4,312,58,159,12, + WS_EX_STATICEDGE,HIDC_DESTINATION_STATIC + CONTROL "",IDC_PROGRESS_STATIC,"STATICEX",0x4,312,135,159,12, + WS_EX_STATICEDGE,HIDC_PROGRESS_STATIC + CONTROL "",IDC_TIME_STATIC,"STATICEX",0x4,312,150,159,12, + WS_EX_STATICEDGE,HIDC_TIME_STATIC + CONTROL "",IDC_TRANSFER_STATIC,"STATICEX",0x4,312,165,159,12, + WS_EX_STATICEDGE,HIDC_TRANSFER_STATIC + CONTROL "",IDC_OVERALL_PROGRESS_STATIC,"STATICEX",0x4,312,203, + 159,12,WS_EX_STATICEDGE,HIDC_OVERALL_PROGRESS_STATIC + CONTROL "",IDC_OVERALL_TRANSFER_STATIC,"STATICEX",0x4,312,218, + 159,12,WS_EX_STATICEDGE,HIDC_OVERALL_TRANSFER_STATIC + CONTROL "",IDC_BUFFERSIZE_STATIC,"STATICEX",0x4,312,74,143,12, + WS_EX_STATICEDGE,HIDC_BUFFERSIZE_STATIC + CONTROL "",IDC_PRIORITY_STATIC,"STATICEX",0x4,312,88,143,12, + WS_EX_STATICEDGE,HIDC_PRIORITY_STATIC +END + +IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG DIALOGEX 0, 0, 254, 138 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler - not enough free space" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,78,117,57,14,0,0, + HIDC_RETRY_BUTTON + PUSHBUTTON "C&ontinue",IDC_IGNORE_BUTTON,136,117,57,14,0,0, + HIDC_IGNORE_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,197,117,50,14,0,0,HIDCANCEL + LISTBOX IDC_FILES_LIST,41,35,206,44,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,0,HIDC_FILES_LIST + LTEXT "",IDC_REQUIRED_STATIC,108,85,139,8,0,0, + HIDC_REQUIRED_STATIC + LTEXT "",IDC_AVAILABLE_STATIC,108,97,139,8,0,0, + HIDC_AVAILABLE_STATIC + ICON IDI_WARNING_ICON,IDC_001_STATIC,9,11,20,20, + SS_REALSIZEIMAGE + LTEXT "Required space:",IDC_003_STATIC,41,85,59,8 + LTEXT "Space available:",IDC_004_STATIC,41,97,59,8 + LTEXT "",IDC_HEADER_STATIC,41,7,206,24 +END + +IDD_SHUTDOWN_DIALOG DIALOGEX 0, 0, 186, 86 +STYLE DS_SYSMODAL | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | + WS_CAPTION | WS_SYSMENU +CAPTION "Copy handler" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&Cancel",IDCANCEL,67,65,50,14,0,0,HIDCANCEL + ICON IDI_SHUTDOWN_ICON,IDC_001_STATIC,7,10,20,20, + SS_REALSIZEIMAGE + LTEXT "All copy/move operations were finished. Attempt to shut down the system will be performed in:", + IDC_002_STATIC,37,7,142,24 + CTEXT "",IDC_TIME_STATIC,7,35,172,8 + CONTROL "Progress1",IDC_TIME_PROGRESS,"msctls_progress32", + PBS_SMOOTH,7,48,172,9 +END + +IDD_CUSTOM_COPY_DIALOG DIALOGEX 0, 0, 349, 319 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Copying/moving parameters" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_FILES_LIST,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,7,16,279,57, + 0,HIDC_FILES_LIST + PUSHBUTTON "Add &file(s)...",IDC_ADDFILE_BUTTON,289,15,53,14,0,0, + HIDC_ADDFILE_BUTTON + PUSHBUTTON "Add f&older...",IDC_ADDDIR_BUTTON,289,30,53,14,0,0, + HIDC_ADDDIR_BUTTON + PUSHBUTTON "&Delete",IDC_REMOVEFILEFOLDER_BUTTON,289,45,53,14,0,0, + HIDC_REMOVEFILEFOLDER_BUTTON + PUSHBUTTON "&Import...",IDC_IMPORT_BUTTON,289,60,53,14,0,0, + HIDC_IMPORT_BUTTON + CONTROL "",IDC_DESTPATH_COMBOBOXEX,"ComboBoxEx32",CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP,7, + 86,314,136,0,HIDC_DESTPATH_COMBOBOXEX + PUSHBUTTON "...",IDC_DESTBROWSE_BUTTON,324,85,18,14,0,0, + HIDC_DESTBROWSE_BUTTON + COMBOBOX IDC_OPERATION_COMBO,13,124,117,143,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_OPERATION_COMBO + COMBOBOX IDC_PRIORITY_COMBO,137,124,122,75,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_PRIORITY_COMBO + EDITTEXT IDC_COUNT_EDIT,262,124,80,14,ES_AUTOHSCROLL,0, + HIDC_COUNT_EDIT + CONTROL "Spin1",IDC_COUNT_SPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,331,124, + 11,14 + LISTBOX IDC_BUFFERSIZES_LIST,13,152,275,20,LBS_NOINTEGRALHEIGHT | + LBS_MULTICOLUMN | LBS_NOSEL | WS_VSCROLL | WS_TABSTOP,0, + HIDC_BUFFERSIZES_LIST + PUSHBUTTON "&Change...",IDC_BUFFERSIZES_BUTTON,292,152,50,14,0,0, + HIDC_BUFFERSIZES_BUTTON + CONTROL "Filtering",IDC_FILTERS_CHECK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,177,61,10,0,HIDC_FILTERS_CHECK + CONTROL "List2",IDC_FILTERS_LIST,"SysListView32",LVS_REPORT | + WS_BORDER | WS_TABSTOP,13,190,303,46,0,HIDC_FILTERS_LIST + PUSHBUTTON "+",IDC_ADDFILTER_BUTTON,320,190,22,14,0,0, + HIDC_ADDFILTER_BUTTON + PUSHBUTTON "-",IDC_REMOVEFILTER_BUTTON,320,206,22,14,0,0, + HIDC_REMOVEFILTER_BUTTON + CONTROL "Advanced options",IDC_ADVANCED_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,242,84,10,0, + HIDC_ADVANCED_CHECK + CONTROL "Do not create destination directories - copy files loosely to destination folder", + IDC_IGNOREFOLDERS_CHECK,"Button",BS_AUTOCHECKBOX | + BS_NOTIFY | WS_TABSTOP,13,255,329,10,0, + HIDC_IGNOREFOLDERS_CHECK + CONTROL "Do not copy/move contents of files - only create it (empty)", + IDC_ONLYSTRUCTURE_CHECK,"Button",BS_AUTOCHECKBOX | + BS_NOTIFY | WS_TABSTOP,13,277,329,10,0, + HIDC_ONLYSTRUCTURE_CHECK + PUSHBUTTON "&OK",IDOK,186,298,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,239,298,50,14,0,0,HIDCANCEL + LTEXT "Source files/folders:",IDC_001_STATIC,7,7,335,8 + LTEXT "Destination folder:",IDC_002_STATIC,7,76,335,8 + LTEXT "Operation type:",IDC_003_STATIC,13,115,117,8 + LTEXT "Priority:",IDC_004_STATIC,137,115,120,8 + LTEXT "Count of copies:",IDC_005_STATIC,262,115,80,8 + LTEXT "Buffer sizes:",IDC_006_STATIC,13,142,244,8 + CONTROL "",IDC_BAR3_STATIC,"Static",SS_ETCHEDHORZ,74,181,268,1 + CONTROL "",IDC_BAR4_STATIC,"Static",SS_ETCHEDHORZ,96,247,246,1 + CONTROL "",IDC_BAR5_STATIC,"Static",SS_ETCHEDHORZ,7,291,335,1 + CONTROL "",IDC_BAR2_STATIC,"Static",SS_ETCHEDHORZ,105,107,237,1 + CTEXT "Standard options",IDC_007_STATIC,20,104,80,8 + CONTROL "",IDC_BAR1_STATIC,"Static",SS_ETCHEDHORZ,7,107,8,1 + CONTROL "Create directory structure in destination folder (relatively to root directory)", + IDC_FORCEDIRECTORIES_CHECK,"Button",BS_AUTOCHECKBOX | + BS_NOTIFY | WS_TABSTOP,13,266,329,10,0, + HIDC_FORCEDIRECTORIES_CHECK + PUSHBUTTON "&Help",IDC_HELP_BUTTON,292,298,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_FILTER_DIALOG DIALOGEX 0, 0, 291, 266 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Filtering settings" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "Include mask (separate by vertical lines ie. *.jpg|*.gif)", + IDC_FILTER_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7, + 7,277,10,0,HIDC_FILTER_CHECK + COMBOBOX IDC_FILTER_COMBO,15,19,269,98,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP,0,HIDC_FILTER_COMBO + CONTROL "Exclude mask",IDC_EXCLUDEMASK_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,35,277,10,0, + HIDC_EXCLUDEMASK_CHECK + COMBOBOX IDC_FILTEREXCLUDE_COMBO,15,48,269,170,CBS_DROPDOWN | + WS_VSCROLL | WS_TABSTOP,0,HIDC_FILTEREXCLUDE_COMBO + CONTROL "Filtering by size",IDC_SIZE_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,66,277,10,0, + HIDC_SIZE_CHECK + COMBOBOX IDC_SIZETYPE1_COMBO,63,81,34,140,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZETYPE1_COMBO + EDITTEXT IDC_SIZE1_EDIT,100,80,77,14,ES_AUTOHSCROLL,0, + HIDC_SIZE1_EDIT + CONTROL "Spin1",IDC_SIZE1_SPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,166,80,11, + 14,0,HIDC_SIZE1_SPIN + COMBOBOX IDC_SIZE1MULTI_COMBO,180,81,34,135,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZE1MULTI_COMBO + CONTROL "and",IDC_SIZE2_CHECK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,30,101,32,10,0,HIDC_SIZE2_CHECK + COMBOBOX IDC_SIZETYPE2_COMBO,63,99,34,137,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZETYPE2_COMBO + EDITTEXT IDC_SIZE2_EDIT,100,98,77,14,ES_AUTOHSCROLL,0, + HIDC_SIZE2_EDIT + CONTROL "Spin1",IDC_SIZE2_SPIN,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,166,98,11, + 14,0,HIDC_SIZE2_SPIN + COMBOBOX IDC_SIZE2MULTI_COMBO,180,99,34,143,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_SIZE2MULTI_COMBO + CONTROL "Filtering by date",IDC_DATE_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,124,277,10,0, + HIDC_DATE_CHECK + COMBOBOX IDC_DATETYPE_COMBO,32,138,151,133,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_DATETYPE_COMBO + COMBOBOX IDC_DATE1TYPE_COMBO,58,158,48,104,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_DATE1TYPE_COMBO + CONTROL "DateTimePicker1",IDC_DATE1_DATETIMEPICKER, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | + DTS_SHOWNONE | WS_TABSTOP,108,157,109,15,0, + HIDC_DATE1_DATETIMEPICKER + CONTROL "DateTimePicker2",IDC_TIME1_DATETIMEPICKER, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | + DTS_SHOWNONE | WS_TABSTOP,220,157,64,15,0, + HIDC_TIME1_DATETIMEPICKER + CONTROL "and",IDC_DATE2_CHECK,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,25,176,30,10,0,HIDC_DATE2_CHECK + COMBOBOX IDC_DATE2TYPE_COMBO,58,174,48,107,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP,0,HIDC_DATE2TYPE_COMBO + CONTROL "DateTimePicker1",IDC_DATE2_DATETIMEPICKER, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | + DTS_SHOWNONE | WS_TABSTOP,108,173,109,15,0, + HIDC_DATE2_DATETIMEPICKER + CONTROL "DateTimePicker2",IDC_TIME2_DATETIMEPICKER, + "SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | + DTS_SHOWNONE | WS_TABSTOP,220,173,64,15,0, + HIDC_TIME2_DATETIMEPICKER + CONTROL "By attributes",IDC_ATTRIBUTES_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,199,277,10,0, + HIDC_ATTRIBUTES_CHECK + CONTROL "Archive",IDC_ARCHIVE_CHECK,"Button",BS_AUTO3STATE | + WS_TABSTOP,29,212,81,10,0,HIDC_ARCHIVE_CHECK + CONTROL "Read only",IDC_READONLY_CHECK,"Button",BS_AUTO3STATE | + WS_TABSTOP,29,224,81,10,0,HIDC_READONLY_CHECK + CONTROL "Hidden",IDC_HIDDEN_CHECK,"Button",BS_AUTO3STATE | + WS_TABSTOP,117,212,68,10,0,HIDC_HIDDEN_CHECK + CONTROL "System",IDC_SYSTEM_CHECK,"Button",BS_AUTO3STATE | + WS_TABSTOP,117,224,68,10,0,HIDC_SYSTEM_CHECK + CONTROL "Directory",IDC_DIRECTORY_CHECK,"Button",BS_AUTO3STATE | + NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,191,212,93,10, + 0,HIDC_DIRECTORY_CHECK + DEFPUSHBUTTON "&OK",IDOK,127,245,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,179,245,50,14,0,0,HIDCANCEL + CONTROL "",IDC_001_STATIC,"Static",SS_ETCHEDHORZ,7,238,276,1 + PUSHBUTTON "&Help",IDC_HELP_BUTTON,234,245,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_SHORTCUTEDIT_DIALOG DIALOGEX 0, 0, 324, 206 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Shortcuts editing" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_SHORTCUT_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + LVS_AUTOARRANGE | LVS_EDITLABELS | WS_BORDER | + WS_TABSTOP,7,16,261,88,0,HIDC_SHORTCUT_LIST + EDITTEXT IDC_NAME_EDIT,77,123,228,14,ES_AUTOHSCROLL,0, + HIDC_NAME_EDIT + CONTROL "",IDC_PATH_COMBOBOXEX,"ComboBoxEx32",CBS_DROPDOWN | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP,77, + 142,205,89,0,HIDC_PATH_COMBOBOXEX + PUSHBUTTON "...",IDC_BROWSE_BUTTON,286,142,18,13,0,0, + HIDC_BROWSE_BUTTON + PUSHBUTTON "&Add",IDC_ADD_BUTTON,17,160,50,14,0,0,HIDC_ADD_BUTTON + PUSHBUTTON "&Update",IDC_CHANGE_BUTTON,69,160,50,14,0,0, + HIDC_CHANGE_BUTTON + PUSHBUTTON "&Delete",IDC_DELETE_BUTTON,121,160,50,14,0,0, + HIDC_DELETE_BUTTON + DEFPUSHBUTTON "&OK",IDOK,156,185,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,211,185,50,14,0,0,HIDCANCEL + LTEXT "Shortcuts:",IDC_001_STATIC,7,7,310,8 + LTEXT "Name:",IDC_002_STATIC,18,126,53,8 + LTEXT "Path:",IDC_003_STATIC,18,145,56,8 + GROUPBOX "Shortcut properties",IDC_004_STATIC,7,111,310,70 + PUSHBUTTON "Move up",IDC_UP_BUTTON,272,47,45,14,0,0,HIDC_UP_BUTTON + PUSHBUTTON "Move down",IDC_DOWN_BUTTON,272,63,45,14,0,0, + HIDC_DOWN_BUTTON + PUSHBUTTON "&Help",IDC_HELP_BUTTON,267,185,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_RECENTEDIT_DIALOG DIALOGEX 0, 0, 324, 190 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "Recent paths" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_RECENT_LIST,"SysListView32",LVS_LIST | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + LVS_AUTOARRANGE | LVS_EDITLABELS | WS_BORDER | + WS_TABSTOP,7,16,310,88,0,HIDC_RECENT_LIST + EDITTEXT IDC_PATH_EDIT,20,123,266,14,ES_AUTOHSCROLL,0, + HIDC_PATH_EDIT + PUSHBUTTON "...",IDC_BROWSE_BUTTON,290,123,18,14,0,0, + HIDC_BROWSE_BUTTON + PUSHBUTTON "&Add",IDC_ADD_BUTTON,20,141,50,14,0,0,HIDC_ADD_BUTTON + PUSHBUTTON "&Update",IDC_CHANGE_BUTTON,72,141,50,14,0,0, + HIDC_CHANGE_BUTTON + PUSHBUTTON "&Delete",IDC_DELETE_BUTTON,124,141,50,14,0,0, + HIDC_DELETE_BUTTON + DEFPUSHBUTTON "&OK",IDOK,156,169,50,14,0,0,HIDOK + PUSHBUTTON "&Cancel",IDCANCEL,211,169,50,14,0,0,HIDCANCEL + LTEXT "Recently used paths:",IDC_001_STATIC,7,7,310,8 + GROUPBOX "Path",IDC_002_STATIC,7,110,310,51 + PUSHBUTTON "&Help",IDC_HELP_BUTTON,267,169,50,14,0,0, + HIDC_HELP_BUTTON +END + +IDD_ABOUTBOX DIALOGEX 0, 0, 369, 249 +STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU +CAPTION "About ..." +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "&OK",IDOK,306,228,56,14,WS_GROUP,0,HIDOK + ICON IDR_MAINFRAME,IDC_STATIC,11,14,20,20 + CTEXT "Copyright (C) 2001-2004 J�zef Starosczyk", + IDC_COPYRIGHT_STATIC,40,80,322,8 + LTEXT "General discussion forum:",IDC_GENFORUM_STATIC,46,124, + 98,8 + LTEXT "Developers' discussion forum: ",IDC_DEVFORUM_STATIC,46, + 137,98,8 + LTEXT "Special thanks list:",IDC_THANX_STATIC,46,154,316,8 + EDITTEXT IDC_THANX_EDIT,46,164,316,54,ES_MULTILINE | ES_READONLY | + NOT WS_BORDER | WS_VSCROLL,WS_EX_STATICEDGE, + HIDC_THANX_EDIT + CONTROL "http://www.copyhandler.com|http://www.copyhandler.com", + IDC_HOMEPAGELINK_STATIC,"STATICEX",0x1,257,7,105,8,0, + HIDC_HOMEPAGELINK_STATIC + CONTROL "ixen@copyhandler.com|mailto:ixen@copyhandler.com", + IDC_CONTACT1LINK_STATIC,"STATICEX",0x1,257,41,105,8,0, + HIDC_CONTACT1LINK_STATIC + CONTROL "Page|http://groups.yahoo.com/group/copyhandler", + IDC_GENFORUMPAGELINK_STATIC,"STATICEX",0x1,155,124,33,8, + 0,HIDC_GENFORUMPAGELINK_STATIC + CONTROL "Page|http://groups.yahoo.com/group/chdev", + IDC_DEVFORUMPAGELINK_STATIC,"STATICEX",0x1,155,137,33,8, + 0,HIDC_DEVFORUMPAGELINK_STATIC + CONTROL "Subscribe|mailto:copyhandler-subscribe@yahoogroups.com", + IDC_GENFORUMSUBSCRIBELINK_STATIC,"STATICEX",0x1,198,124, + 44,8,0,HIDC_GENFORUMSUBSCRIBELINK_STATIC + CONTROL "Subscribe|mailto:chdev-subscribe@yahoogroups.com", + IDC_DEVFORUMSUBSCRIBELINK_STATIC,"STATICEX",0x1,198,137, + 44,8,0,HIDC_DEVFORUMSUBSCRIBELINK_STATIC + CONTROL "Unsubscribe|mailto:copyhandler-unsubscribe@yahoogroups.com", + IDC_GENFORUMUNSUBSCRIBELINK_STATIC,"STATICEX",0x1,251, + 124,48,8,0,HIDC_GENFORUMUNSUBSCRIBELINK_STATIC + CONTROL "Unsubscribe|mailto:chdev-unsubscribe@yahoogroups.com", + IDC_DEVFORUMUNSUBSCRIBELINK_STATIC,"STATICEX",0x1,251, + 137,48,8,0,HIDC_DEVFORUMUNSUBSCRIBELINK_STATIC + CONTROL "Send message|mailto:copyhandler@yahoogroups.com", + IDC_GENFORUMSENDLINK_STATIC,"STATICEX",0x1,307,124,55,8, + 0,HIDC_GENFORUMSENDLINK_STATIC + CONTROL "Send message|mailto:chdev@yahoogroups.com", + IDC_DEVFORUMSENDLINK_STATIC,"STATICEX",0x1,307,137,55,8, + 0,HIDC_DEVFORUMSENDLINK_STATIC + CONTROL "",IDC_PROGRAM_STATICEX,"STATICEX",0x30,39,7,122,10 + CONTROL "",IDC_FULLVERSION_STATICEX,"STATICEX",0x10,39,20,109,8 + CONTROL "Home page:",IDC_HOMEPAGE_STATICEX,"STATICEX",0x10,185,7, + 68,8 + CONTROL "Contact:",IDC_CONTACT_STATICEX,"STATICEX",0x10,185,29, + 68,8 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,39,92,323,1 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,39,120,323,1 + CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,41,148,321,1 + CONTROL "This program is free software and may be distributed according to the terms of the GNU General Public License.", + IDC_LICENSE_STATICEX,"STATICEX",0x90,46,98,310,16 + CONTROL "http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl", + IDC_HOMEPAGELINK2_STATIC,"STATICEX",0x1,257,17,105,8,0, + HIDC_HOMEPAGELINK2_STATIC + CONTROL "Author:",IDC_CONTACTAUTHOR_STATICEX,"STATICEX",0x50,185, + 41,68,8 + CONTROL "support@copyhandler.com|mailto:support@copyhandler.com", + IDC_CONTACT2LINK_STATIC,"STATICEX",0x1,257,55,105,8,0, + HIDC_CONTACT2LINK_STATIC + CONTROL "Support:",IDC_CONTACTSUPPORT_STATICEX,"STATICEX",0x50, + 185,55,68,8 + CONTROL "copyhandler@o2.pl|mailto:copyhandler@o2.pl", + IDC_CONTACT3LINK_STATIC,"STATICEX",0x1,257,66,105,8,0, + HIDC_CONTACT3LINK_STATIC +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,28,42,1074 + PRODUCTVERSION 1,28,42,1074 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x29L +#else + FILEFLAGS 0x28L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Program for copying files/folders\0" + VALUE "CompanyName", " \0" + VALUE "FileDescription", "Copy Handler v. 1.28\0" + VALUE "FileVersion", "1.28.42.1074" + VALUE "InternalName", "Copy Handler\0" + VALUE "LegalCopyright", "Copyright (C) 2001-2004 Ixen Gerthannes\0" + VALUE "LegalTrademarks", " \0" + VALUE "OriginalFilename", "COPY HANDLER.EXE\0" + VALUE "PrivateBuild", " \0" + VALUE "ProductName", "Copy Handler v. 1.28\0" + VALUE "ProductVersion", "1.28.42.1074" + VALUE "SpecialBuild", " \0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO MOVEABLE PURE +BEGIN + IDD_BUFFERSIZE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 337 + TOPMARGIN, 7 + BOTTOMMARGIN, 120 + END + + IDD_FEEDBACK_DSTFILE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 283 + TOPMARGIN, 7 + BOTTOMMARGIN, 104 + END + + IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 287 + TOPMARGIN, 7 + BOTTOMMARGIN, 235 + END + + IDD_FEEDBACK_REPLACE_FILES_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 287 + TOPMARGIN, 7 + BOTTOMMARGIN, 251 + END + + IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 287 + TOPMARGIN, 7 + BOTTOMMARGIN, 251 + END + + IDD_MINIVIEW_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 83 + TOPMARGIN, 7 + BOTTOMMARGIN, 16 + END + + IDD_OPTIONS_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 389 + TOPMARGIN, 7 + BOTTOMMARGIN, 207 + END + + IDD_REPLACE_PATHS_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 335 + TOPMARGIN, 7 + BOTTOMMARGIN, 141 + END + + IDD_STATUS_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 471 + TOPMARGIN, 7 + BOTTOMMARGIN, 243 + END + + IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 247 + TOPMARGIN, 7 + BOTTOMMARGIN, 131 + END + + IDD_SHUTDOWN_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 179 + TOPMARGIN, 7 + BOTTOMMARGIN, 79 + END + + IDD_CUSTOM_COPY_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 342 + TOPMARGIN, 7 + BOTTOMMARGIN, 312 + END + + IDD_FILTER_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 259 + END + + IDD_SHORTCUTEDIT_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 317 + TOPMARGIN, 7 + BOTTOMMARGIN, 199 + END + + IDD_RECENTEDIT_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 317 + TOPMARGIN, 7 + BOTTOMMARGIN, 183 + END + + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 362 + TOPMARGIN, 7 + BOTTOMMARGIN, 242 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_POPUP_TOOLBAR TOOLBAR MOVEABLE PURE 16, 15 +BEGIN + BUTTON ID_POPUP_OPTIONS +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_POPUP_TOOLBAR BITMAP MOVEABLE PURE "res\\main_toolbar.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// 24 +// + +IDR_MANIFEST 24 MOVEABLE PURE "res\\manifest.txt" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE MOVEABLE PURE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE MOVEABLE PURE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE MOVEABLE PURE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#endif\r\n" + "#include ""res\\COPY HANDLER.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ONECOPY_STRING "Cannot run the second instance of this program" + IDS_REGISTEROK_STRING "Library chext.dll was registered successfully" + IDS_REGISTERERR_STRING "Encountered error while trying to register library chext.dll\nError #%lu (%s)." + IDS_UNREGISTEROK_STRING "Library chext.dll was unregistered successfully" + IDS_UNREGISTERERR_STRING + "Encountered error while trying to unregister library chext.dll\nError #%lu (%s)." + IDS_HELPERR_STRING "Cannot open html help file:\n%s\n" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BROWSE_STRING "Choose path" + IDS_BDREMOTENAME_STRING "Remote name: " + IDS_BDLOCALNAME_STRING "Local name: " + IDS_BDTYPE_STRING "Type: " + IDS_BDNETTYPE_STRING "Network type: " + IDS_BDDESCRIPTION_STRING "Description: " + IDS_BDFREESPACE_STRING "Free space: " + IDS_BDCAPACITY_STRING "Capacity: " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILEDLGALLFILTER_STRING "All files (*)|*||" + IDS_DSTFOLDERBROWSE_STRING "Choose destination folder" + IDS_MISSINGDATA_STRING "You didn't fill destination path or source file.\nProgram cannot continue" + IDS_CCDCOPY_STRING "Copy" + IDS_CCDMOVE_STRING "Move" + IDS_BSEDEFAULT_STRING "Default: %s" + IDS_BSEONEDISK_STRING "One Disk: %s" + IDS_BSETWODISKS_STRING "Two disks: %s" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME_STRING "Copy Handler" + IDS_PRIORITY0_STRING "Time critical" + IDS_PRIORITY1_STRING "Highest" + IDS_PRIORITY2_STRING "Above normal" + IDS_PRIORITY3_STRING "Normal" + IDS_PRIORITY4_STRING "Below normal" + IDS_PRIORITY5_STRING "Lowest" + IDS_PRIORITY6_STRING "Idle" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MINIVIEWALL_STRING "All:" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROGRAM_STRING "Program" + IDS_CLIPBOARDMONITORING_STRING "Clipboard monitoring" + IDS_CLIPBOARDINTERVAL_STRING "Scan clipboard every ... [ms]" + IDS_AUTORUNPROGRAM_STRING "Run program with system" + IDS_AUTOSHUTDOWN_STRING "Shutdown system after copying finishes" + IDS_AUTOSAVEINTERVAL_STRING "Autosave every ... [ms]" + IDS_TEMPFOLDER_STRING "Folder for temporary data" + IDS_STATUSWINDOW_STRING "Status window" + IDS_REFRESHSTATUSINTERVAL_STRING "Refresh status every ... [ms]" + IDS_STATUSSHOWDETAILS_STRING "Show details in status window" + IDS_STATUSAUTOREMOVE_STRING "Automatically remove finished tasks" + IDS_MINIVIEW_STRING "Miniview" + IDS_SHOWFILENAMES_STRING "Show file names" + IDS_SHOWSINGLETASKS_STRING "Show single tasks" + IDS_MINIVIEWREFRESHINTERVAL_STRING "Refresh status every ... [ms]" + IDS_MINIVIEWSHOWAFTERSTART_STRING "Show at program startup" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CFGSHSHOWICONS_STRING "Show icons with shortcuts (experimental)" + IDS_CFGSHOVERRIDEDRAG_STRING + "Intercept drag&drop operation by left mouse button (experimental)" + IDS_CFGSHORTCUTS_STRING "Shortcuts" + IDS_CFGRECENT_STRING "Recently used paths" + IDS_CFGSHELL_STRING "Shell" + IDS_CFGSCCOUNT_STRING "Defined shortcuts' count" + IDS_CFGRPCOUNT_STRING "Count of recent paths" + IDS_CFGOVERRIDEDEFACTION_STRING + "Default action for dragging by left mouse button" + IDS_CFGPRIORITYCLASS_STRING "Application's priority class" + IDS_CFGDISABLEPRIORITYBOOST_STRING "Disable priority boosting" + IDS_BOOLTEXT_STRING "No!Yes" + IDS_TEMPFOLDERCHOOSE_STRING "!Choose temporary folder" + IDS_FEEDBACKTYPE_STRING "Disabled!Normal!Heavy" + IDS_SOUNDSWAVFILTER_STRING "!Sound files (.wav)|*.wav||" + IDS_FORCESHUTDOWNVALUES_STRING "Normal!Force" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MINIVIEWAUTOHIDE_STRING "Hide when empty" + IDS_PROCESSINGTHREAD_STRING "Copying/moving thread" + IDS_AUTOCOPYREST_STRING "Auto ""copy-rest"" of files" + IDS_SETDESTATTRIB_STRING "Set attributes of destination files" + IDS_SETDESTTIME_STRING "Set date/time of destination files" + IDS_PROTECTROFILES_STRING "Protect read-only files" + IDS_LIMITOPERATIONS_STRING + "Limit maximum operations running simultaneously ..." + IDS_SHOWVISUALFEEDBACK_STRING "Show visual confirmation dialogs" + IDS_USETIMEDDIALOGS_STRING "Use timed confirmation dialogs" + IDS_TIMEDDIALOGINTERVAL_STRING "Time of showing confirmation dialogs" + IDS_AUTORETRYONERROR_STRING "Auto resume on error" + IDS_AUTORETRYINTERVAL_STRING "Auto resume every ... [ms]" + IDS_DEFAULTPRIORITY_STRING "Default thread priority" + IDS_AUTODETECTBUFFERSIZE_STRING "Use only default buffer" + IDS_DEFAULTBUFFERSIZE_STRING "Default buffer size" + IDS_DELETEAFTERFINISHED_STRING + "Don't delete files before copying finishes (moving)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CREATELOGFILES_STRING "Create .log files" + IDS_SOUNDS_STRING "Sounds" + IDS_PLAYSOUNDS_STRING "Playing sounds" + IDS_SOUNDONERROR_STRING "Sound on error" + IDS_SOUNDONFINISH_STRING "Sound on copying finished" + IDS_LANGUAGE_STRING "Language" + IDS_READSIZEBEFOREBLOCK_STRING "Read tasks size before blocking" + IDS_USENOBUFFERING_STRING "Disable buffering for large files" + IDS_LARGEFILESMINSIZE_STRING + "Minimum file size for which buffering should be turned off" + IDS_OPTIONSBUFFER_STRING "Buffer" + IDS_ONEDISKBUFFERSIZE_STRING + "Buffer size for copying inside one physical disk boundary" + IDS_TWODISKSBUFFERSIZE_STRING + "Buffer size for copying between two different disks" + IDS_CDBUFFERSIZE_STRING "Buffer size for copying from CD-ROM" + IDS_LANBUFFERSIZE_STRING "Buffer size for copying over a network" + IDS_SHUTDOWNTIME_STRING "Wait ... [ms] before shutdown" + IDS_FORCESHUTDOWN_STRING "Type of shutdown" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SOURCESTRINGMISSING_STRING "You didn't enter source text" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COLUMNSTATUS_STRING "Status" + IDS_COLUMNSOURCE_STRING "File" + IDS_COLUMNDESTINATION_STRING "To:" + IDS_COLUMNPROGRESS_STRING "Progress" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_EMPTYOPERATIONTEXT_STRING "None of tasks selected" + IDS_EMPTYSOURCETEXT_STRING "empty" + IDS_EMPTYDESTINATIONTEXT_STRING "empty" + IDS_EMPTYBUFFERSIZETEXT_STRING "unknown" + IDS_EMPTYPRIORITYTEXT_STRING "unknown" + IDS_EMPTYERRORTEXT_STRING "empty" + IDS_EMPTYPROCESSEDTEXT_STRING "empty" + IDS_EMPTYTRANSFERTEXT_STRING "unknown" + IDS_EMPTYTIMETEXT_STRING "00:00 / 00:00" + IDS_CURRENTPASS_STRING "pass: " + IDS_AVERAGEWORD_STRING "avg: " + IDS_STATUSTITLE_STRING "Status" + IDS_REPLACEPATHSTEXT_STRING + "Changed:\n%d paths primarily got from clipboard" + IDS_TASKNOTPAUSED_STRING "Selected task isn't paused" + IDS_TASKNOTSELECTED_STRING "Task not selected" + IDS_NONEINPUTFILE_STRING "(waiting...)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BUFFERSIZEZERO_STRING "Cannot operate with buffer of 0 size" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_OTFSEARCHINGFORFILES_STRING "Searching for files..." + IDS_OTFMISSINGCLIPBOARDINPUT_STRING + "Source file/folder not found (clipboard) : %s" + IDS_OTFADDINGCLIPBOARDFILE_STRING + "Adding file/folder (clipboard) : %s ..." + IDS_OTFADDEDFOLDER_STRING "Added folder %s" + IDS_OTFRECURSINGFOLDER_STRING "Recursing folder %s" + IDS_OTFADDINGKILLREQEST_STRING + "Kill request while adding data to files array (RecurseDirectories)" + IDS_OTFADDEDFILE_STRING "Added file %s" + IDS_OTFSEARCHINGFINISHED_STRING "Searching for files finished" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_OTFDELETINGFILES_STRING "Deleting files (DeleteFiles)..." + IDS_OTFDELETINGKILLREQUEST_STRING + "Kill request while deleting files (Delete Files)" + IDS_OTFDELETINGERROR_STRING + "Error #%lu (%s) while deleting file/folder %s" + IDS_OTFDELETINGFINISHED_STRING "Deleting files finished" + IDS_OTFPRECHECKCANCELREQUEST_STRING + "Cancel request while checking result of dialog before opening source file %s (CustomCopyFile)" + IDS_OTFOPENINGERROR_STRING + "Error #%lu (%s) while opening source file %s (CustomCopyFile)" + IDS_OTFOPENINGCANCELREQUEST_STRING + "Cancel request [error #%lu (%s)] while opening source file %s (CustomCopyFile)" + IDS_OTFOPENINGWAITREQUEST_STRING + "Wait request [error #%lu (%s)] while opening source file %s (CustomCopyFile)" + IDS_OTFOPENINGRETRY_STRING + "Retrying [error #%lu (%s)] to open source file %s (CustomCopyFile)" + IDS_OTFDESTOPENINGERROR_STRING + "Error #%lu (%s) while opening destination file %s (CustomCopyFile)" + IDS_OTFDESTOPENINGRETRY_STRING + "Retrying [error #%lu (%s)] to open destination file %s (CustomCopyFile)" + IDS_OTFDESTOPENINGCANCELREQUEST_STRING + "Cancel request [error #%lu (%s)] while opening destination file %s (CustomCopyFile)" + IDS_OTFDESTOPENINGWAITREQUEST_STRING + "Wait request [error #%lu (%s)] while opening destination file %s (CustomCopyFile)" + IDS_OTFMOVINGPOINTERSERROR_STRING + "Error #%lu (%s) while moving file pointers of %s and %s to %I64u" + IDS_OTFRESTORINGPOINTERSERROR_STRING + "Error #%lu (%s) while restoring (moving to beginning) file pointers of %s and %s" + IDS_OTFSETTINGZEROSIZEERROR_STRING + "Error #%lu (%s) while setting size of file %s to 0" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_OTFCOPYINGKILLREQUEST_STRING + "Kill request while main copying file %s -> %s" + IDS_OTFCHANGINGBUFFERSIZE_STRING + "Changing buffer size from [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] to [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] wile copying %s -> %s (CustomCopyFile)" + IDS_OTFREADINGERROR_STRING + "Error #%lu (%s) while trying to read %d bytes from source file %s (CustomCopyFile)" + IDS_OTFWRITINGERROR_STRING + "Error #%lu (%s) while trying to write %d bytes to destination file %s (CustomCopyFile)" + IDS_OTFCAUGHTEXCEPTIONCCF_STRING + "Caught exception in CustomCopyFile [last error: #%lu (%s)] (at time %lu)" + IDS_OTFPROCESSINGFILES_STRING "Processing files/folders (ProcessFiles)" + IDS_OTFPROCESSINGFILESDATA_STRING + "Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %d\r\n\tBufferSize: [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu]\r\n\tFiles/folders count: %lu\r\n\tCopies count: %d\r\n\tIgnore Folders: %d\r\n\tDest path: %s\r\n\tCurrent pass (0-based): %d\r\n\tCurrent index (0-based): %d" + IDS_OTFPROCESSINGKILLREQUEST_STRING + "Kill request while processing file in ProcessFiles" + IDS_OTFMOVEFILEERROR_STRING + "Error #%lu (%s) while calling MoveFile %s -> %s (ProcessFiles)" + IDS_OTFCREATEDIRECTORYERROR_STRING + "Error #%lu (%s) while calling CreateDirectory %s (ProcessFiles)" + IDS_OTFPROCESSINGFINISHED_STRING "Finished processing in ProcessFiles" + IDS_OTFTHREADSTART_STRING + "\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d" + IDS_OTFWAITINGFINISHED_STRING "Finished waiting for begin permission" + IDS_OTFWAITINGKILLREQUEST_STRING + "Kill request while waiting for begin permission (wait state)" + IDS_OTFTHREADFINISHED_STRING + "Finished processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d" + IDS_OTFCAUGHTEXCEPTIONMAIN_STRING + "Caught exception in ThrdProc [last error: %lu (%s), type: %d]" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_TITLECOPY_STRING "Copying..." + IDS_TITLEMOVE_STRING "Moving..." + IDS_TITLEUNKNOWNOPERATION_STRING + "Unknown operation type - this shouldn't happen" + IDS_MAINBROWSETEXT_STRING "Enter destination path for:\n" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_COPYWORDLESSFIVE_STRING " copies" + IDS_COPYWORDMOREFOUR_STRING " copies" + IDS_STATUS0_STRING "Searching" + IDS_STATUS1_STRING "Copying" + IDS_STATUS2_STRING "Moving" + IDS_STATUS3_STRING "Finished" + IDS_STATUS4_STRING "Error" + IDS_STATUS5_STRING "Paused" + IDS_STATUS6_STRING "Deleting" + IDS_STATUS7_STRING "Unknown" + IDS_STATUS8_STRING "Cancelled" + IDS_STATUS9_STRING "Waiting" + IDS_STATUS10_STRING "Only files" + IDS_STATUS11_STRING "Without contents" + IDS_SHELLEXECUTEERROR_STRING "Error #%lu calling ShellExecute for file %s" + IDS_BSDEFAULT_STRING "Default: " +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FIRSTCOPY_STRING "Copy of %s" + IDS_NEXTCOPY_STRING "Copy (%d) of %s" + IDS_NOTFOUND_STRING "File not found (doesn't exist)" + IDS_BYTE_STRING "B" + IDS_KBYTE_STRING "kB" + IDS_MBYTE_STRING "MB" + IDS_GBYTE_STRING "GB" + IDS_TBYTE_STRING "TB" + IDS_PBYTE_STRING "PB" + IDS_LT_STRING "<" + IDS_LE_STRING "<=" + IDS_EQ_STRING "=" + IDS_GE_STRING ">=" + IDS_GT_STRING ">" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_OTFCHECKINGSPACE_STRING + "Checking for free space on destination disk..." + IDS_OTFNOTENOUGHFREESPACE_STRING + "Not enough free space on disk - needed %I64d bytes for data, available: %I64d bytes." + IDS_OTFFREESPACECANCELREQUEST_STRING + "Cancel request while checking for free space on disk." + IDS_OTFFREESPACERETRYING_STRING "Retrying to read drive's free space..." + IDS_OTFFREESPACEIGNORE_STRING + "Ignored warning about not enough place on disk to copy data." + IDS_OTFMOVEFILECANCELREQUEST_STRING + "Cancel request while calling MoveFileEx %s -> %s (ProcessFiles)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BSONEDISK_STRING "One disk: " + IDS_BSTWODISKS_STRING "Two disks: " + IDS_BSCD_STRING "CD: " + IDS_BSLAN_STRING "LAN: " + IDS_CPEDELETINGERROR_STRING + "Error #%errnum (%errdesc) while deleting file %s" + IDS_CPEOPENINGERROR_STRING + "Error #%errnum (%errdesc) while trying to open source file %s" + IDS_CPEDESTOPENINGERROR_STRING + "Error #%errnum (%errdesc) while trying to open destination file %s. Probably file has read-only attribute set, and 'Protect read-only files' flag in configuration is set (so the file cannot be open to write)." + IDS_CPERESTORINGPOINTERSERROR_STRING + "Error #%errnum (%errdesc) while restoring (moving to beginning) file pointers of %s and %s" + IDS_CPESETTINGZEROSIZEERROR_STRING + "Error #%errnum (%errdesc) while setting size of file %s to 0" + IDS_CPEREADINGERROR_STRING + "Error #%errnum (%errdesc) while trying to read %d bytes from source file %s" + IDS_CPEWRITINGERROR_STRING + "Error #%errnum (%errdesc) while trying to write %d bytes to destination file %s" + IDS_CPEMOVEFILEERROR_STRING + "Error #%errnum (%errdesc) while calling MoveFile %s -> %s" + IDS_CPECREATEDIRECTORYERROR_STRING + "Error #%errnum (%errdesc) while calling CreateDirectory %s" + IDS_EMPTYASSOCFILE_STRING "not associated" + IDS_FILTERING_STRING " [with filter]" + IDS_CONFIRMCANCEL_STRING + "Selected task wasn't finished yet.\nDo you want to finish it now ?" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SHUTDOWNERROR_STRING + "Cannot shutdown this operating system.\nEncountered error #%lu." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MINIVIEWSMOOTHPROGRESS_STRING "Use smooth progress bars" + IDS_CFGFOLDERDIALOG_STRING "Choose folder dialog" + IDS_CFGFDEXTVIEW_STRING "Show extended view" + IDS_CFGFDWIDTH_STRING "Dialog width [pixels]" + IDS_CFGFDHEIGHT_STRING "Dialog height [pixels]" + IDS_CFGFDSHORTCUTS_STRING "Shortcuts' list style" + IDS_CFGFDIGNOREDIALOGS_STRING "Ignore additional shell dialogs" + IDS_CFGSHCOPY_STRING "Show 'Copy' command in drag&drop menu" + IDS_CFGSHMOVE_STRING "Show 'Move' command in drag&drop menu" + IDS_CFGSHCMSPECIAL_STRING + "Show 'Copy/move special' command in drag&drop menu" + IDS_CFGSHPASTE_STRING "Show 'Paste' command in context menu" + IDS_CFGSHPASTESPECIAL_STRING + "Show 'Paste special' command in context menu" + IDS_CFGSHCOPYTO_STRING "Show 'Copy to' command in context menu" + IDS_CFGSHMOVETO_STRING "Show 'Move to' command in context menu" + IDS_CFGSHCMTOSPECIAL_STRING + "Show 'Copy/move special to' command in context menu" + IDS_CFGSHSHOWFREESPACE_STRING "Show free space with shortcuts' names" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BSECD_STRING "CD: %s" + IDS_BSELAN_STRING "LAN: %s" + IDS_HDRMASK_STRING "Include mask" + IDS_HDRSIZE_STRING "Size" + IDS_HDRDATE_STRING "Date" + IDS_HDRATTRIB_STRING "Attributes included" + IDS_AND_STRING " and " + IDS_FILTERMASKEMPTY_STRING "none" + IDS_FILTERSIZE_STRING "any" + IDS_FILTERDATE_STRING "any" + IDS_HDREXCLUDEMASK_STRING "Exclude mask" + IDS_HDREXCLUDEATTRIB_STRING "Attributes excluded" + IDS_FILTERATTRIB_STRING "none" + IDS_EMPTYFILTER_STRING "None of filtering options were selected" + IDS_FLTALLFILTER_STRING "All files (*.*)|*.*||" + IDS_IMPORTREPORT_STRING "Imported %lu path(s)" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_DATECREATED_STRING "Date of creation" + IDS_DATELASTWRITE_STRING "Date of last write" + IDS_DATEACCESSED_STRING "Date of last access" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MENUCOPY_STRING "(CH) Copy here" + IDS_MENUMOVE_STRING "(CH) Move here" + IDS_MENUCOPYMOVESPECIAL_STRING "(CH) Copy/move special..." + IDS_MENUPASTE_STRING "(CH) Paste" + IDS_MENUPASTESPECIAL_STRING "(CH) Paste special..." + IDS_MENUCOPYTO_STRING "(CH) Copy to" + IDS_MENUMOVETO_STRING "(CH) Move to" + IDS_MENUCOPYMOVETOSPECIAL_STRING "(CH) Copy/move special to..." +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_MENUTIPCOPY_STRING "Copies data here with Copy Handler" + IDS_MENUTIPMOVE_STRING "Moves data here with Copy Handler" + IDS_MENUTIPCOPYMOVESPECIAL_STRING + "Copies/moves data with additional settings" + IDS_MENUTIPPASTE_STRING "Pastes files/folders from clipboard here" + IDS_MENUTIPPASTESPECIAL_STRING + "Pastes files/folders from clipboard here with additional settings" + IDS_MENUTIPCOPYTO_STRING "Copies selected data into specified folder" + IDS_MENUTIPMOVETO_STRING "Moves selected data into specified folder" + IDS_MENUTIPCOPYMOVETOSPECIAL_STRING + "Copies/moves selected data into specified folder with additional settings" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_CFGFDSHORTCUTSSTYLES_STRING "Large icons!Small icons!List!Report" + IDS_CFGPRIORITYCLASSITEMS_STRING "Idle!Normal!High!Real-time" + IDS_CFGACTIONS_STRING "Copy!Move!Special operation!Autodetect" + IDS_PLUGSFOLDER_STRING "Folder with plugins" + IDS_PLUGSFOLDERCHOOSE_STRING "!Choose folder with plugins" + IDS_CFGLOGFILE_STRING "Main log file" + IDS_CFGENABLELOGGING_STRING "Enable logging" + IDS_CFGLIMITATION_STRING "Use log file size limit" + IDS_CFGMAXLIMIT_STRING "Maximum size of the limited log file" + IDS_CFGLOGPRECISELIMITING_STRING "Use precise limiting of a log file" + IDS_CFGTRUNCBUFFERSIZE_STRING "Truncate buffer size" + IDS_CFGHELPDIR_STRING "Directory with help files" + IDS_CFGHELPDIRCHOOSE_STRING "!Choose folder with program's help files" + IDS_LANGUAGESFOLDER_STRING "Directory with language files" + IDS_LANGSFOLDERCHOOSE_STRING "!Choose folder with language files" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SHORTCUTNAME_STRING "Shortcut's name" + IDS_SHORTCUTPATH_STRING "Path" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BDOK_STRING "&OK" + IDS_BDCANCEL_STRING "&Cancel" + IDS_BDCANNOTCREATEFOLDER_STRING "Cannot create the folder" + IDS_BDPATHDOESNTEXIST_STRING "Entered path doesn't exist" + IDS_BDNAME_STRING "Name" + IDS_BDPATH_STRING "Path" + IDS_BDPATH2_STRING "Path: " + IDS_BDRIGHT_STRING ">>" + IDS_BDLEFT_STRING "<<" + IDS_BDNOSHORTCUTPATH_STRING + "You haven't entered the path for this shortcut" + IDS_BDNEWFOLDER_STRING "Create new folder" + IDS_BDLARGEICONS_STRING "Large icons" + IDS_BDSMALLICONS_STRING "Small icons" + IDS_BDLIST_STRING "List" + IDS_BDREPORT_STRING "Report" + IDS_BDDETAILS_STRING "Details" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_BDADDSHORTCUT_STRING "Add to shortcut's list" + IDS_BDREMOVESHORTCUT_STRING "Remove from shortcut's list" + IDS_BDDOMAIN_STRING "Domain/Workgroup" + IDS_BDSERVER_STRING "Server" + IDS_BDSHARE_STRING "Share" + IDS_BDFILE_STRING "File" + IDS_BDGROUP_STRING "Group" + IDS_BDNETWORK_STRING "Network" + IDS_BDROOT_STRING "Root" + IDS_BDADMINSHARE_STRING "Administration share" + IDS_BDDIR_STRING "Directory" + IDS_BDTREE_STRING "Tree" + IDS_BDNDSCONTAINER_STRING "NDS Container" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUTVERSION_STRING "Compilation: %s" + IDS_LANGCODE_STRING "Code=" + IDS_LANGVER_STRING "Version=" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NERPATH_STRING "There is not enough room in %s to copy or move:" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE 9, 1 +#pragma code_page(1252) +#endif +#include "res\COPY HANDLER.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: Copy Handler/CfgProperties.cpp =================================================================== diff -u --- Copy Handler/CfgProperties.cpp (revision 0) +++ Copy Handler/CfgProperties.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,109 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "CfgProperties.h" + +bool RegisterProperties(CConfigManager* pManager) +{ + pManager->RegisterBoolProperty(_T("Program"), _T("Enabled clipboard monitoring"), false); + pManager->RegisterIntProperty(_T("Program"), _T("Monitor scan interval"), 1000); + pManager->RegisterBoolProperty(_T("Program"), _T("Reload after restart"), false); + pManager->RegisterBoolProperty(_T("Program"), _T("Shutdown system after finished"), false); + pManager->RegisterIntProperty(_T("Program"), _T("Time before shutdown"), 10000); + pManager->RegisterBoolProperty(_T("Program"), _T("Force shutdown"), false); + pManager->RegisterIntProperty(_T("Program"), _T("Autosave interval"), 30000); + pManager->RegisterIntProperty(_T("Program"), _T("Process priority class"), NORMAL_PRIORITY_CLASS); + pManager->RegisterStringProperty(_T("Program"), _T("Autosave directory"), _T("\\"), RF_PATH); + pManager->RegisterStringProperty(_T("Program"), _T("Plugins directory"), _T("\\Plugins\\"), RF_PATH); + pManager->RegisterStringProperty(_T("Program"), _T("Help directory"), _T("\\Help\\"), RF_PATH); + pManager->RegisterStringProperty(_T("Program"), _T("Language"), _T("\\Langs\\English.lng")); + pManager->RegisterStringProperty(_T("Program"), _T("Languages directory"), _T("\\Langs\\"), RF_PATH); + + pManager->RegisterIntProperty(_T("Status dialog"), _T("Status refresh interval"), 1000); + pManager->RegisterBoolProperty(_T("Status dialog"), _T("Show details"), true); + pManager->RegisterBoolProperty(_T("Status dialog"), _T("Auto remove finished"), false); + + pManager->RegisterIntProperty(_T("Folder dialog"), _T("Dialog width"), -1); + pManager->RegisterIntProperty(_T("Folder dialog"), _T("Dialog height"), -1); + pManager->RegisterIntProperty(_T("Folder dialog"), _T("Shortcut list style"), 1); + pManager->RegisterBoolProperty(_T("Folder dialog"), _T("Extended view"), true); + pManager->RegisterBoolProperty(_T("Folder dialog"), _T("Ignore shell dialogs"), false); + + pManager->RegisterBoolProperty(_T("Mini view"), _T("Show filenames"), true); + pManager->RegisterBoolProperty(_T("Mini view"), _T("Show single tasks"), true); + pManager->RegisterIntProperty(_T("Mini view"), _T("Miniview refresh interval"), 200); + pManager->RegisterBoolProperty(_T("Mini view"), _T("Autoshow when run"), true); + pManager->RegisterBoolProperty(_T("Mini view"), _T("Autohide when empty"), true); + pManager->RegisterBoolProperty(_T("Mini view"), _T("Use smooth progress"), true); + + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Use auto-complete files"), true); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Always set destination attributes"), true); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Always set destination time"), true); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Protect read-only files"), false); + pManager->RegisterIntProperty(_T("Copying/moving"), _T("Limit max operations"), 1); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Read tasks size before blocking"), true); + pManager->RegisterIntProperty(_T("Copying/moving"), _T("Show visual feedback"), 2); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Use timed feedback dialogs"), false); + pManager->RegisterIntProperty(_T("Copying/moving"), _T("Feedback time"), 60000); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Auto retry on error"), true); + pManager->RegisterIntProperty(_T("Copying/moving"), _T("Auto retry interval"), 10000); + pManager->RegisterIntProperty(_T("Copying/moving"), _T("Default priority"), THREAD_PRIORITY_NORMAL); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Disable priority boost"), false); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Delete files after finished"), true); + pManager->RegisterBoolProperty(_T("Copying/moving"), _T("Create log file"), true); + + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Copy' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Move' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Copy/move special' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Paste' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Paste special' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Copy to' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Move to' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show 'Copy to/Move to special' command"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show free space along with shortcut"), true); + pManager->RegisterBoolProperty(_T("Shell"), _T("Show shell icons in shortcuts menu"), false); + pManager->RegisterBoolProperty(_T("Shell"), _T("Use drag&drop default menu item override"), true); + pManager->RegisterIntProperty(_T("Shell"), _T("Default action when dragging"), 3); + + pManager->RegisterBoolProperty(_T("Buffer"), _T("Use only default buffer"), false); + pManager->RegisterIntProperty(_T("Buffer"), _T("Default buffer size"), 2097152); + pManager->RegisterIntProperty(_T("Buffer"), _T("One physical disk buffer size"), 4194304); + pManager->RegisterIntProperty(_T("Buffer"), _T("Two different hard disks buffer size"), 524288); + pManager->RegisterIntProperty(_T("Buffer"), _T("CD buffer size"), 262144); + pManager->RegisterIntProperty(_T("Buffer"), _T("LAN buffer size"), 131072); + pManager->RegisterBoolProperty(_T("Buffer"), _T("Use no buffering for large files"), true); + pManager->RegisterIntProperty(_T("Buffer"), _T("Large files lower boundary limit"), 2097152); + + pManager->RegisterStringProperty(_T("Log file"), _T("Path to main log file"), _T("\\ch.log")); + pManager->RegisterBoolProperty(_T("Log file"), _T("Enable logging"), true); + pManager->RegisterBoolProperty(_T("Log file"), _T("Enable log size limitation"), true); + pManager->RegisterIntProperty(_T("Log file"), _T("Max log size limit"), 65535); + pManager->RegisterBoolProperty(_T("Log file"), _T("Precise log size limiting"), false); + pManager->RegisterIntProperty(_T("Log file"), _T("Truncation buffer size"), 65535, PDL_PARANOID); + + pManager->RegisterBoolProperty(_T("Sounds"), _T("Play sounds"), true); + pManager->RegisterStringProperty(_T("Sounds"), _T("Error sound path"), _T("\\media\\chord.wav")); + pManager->RegisterStringProperty(_T("Sounds"), _T("Finished sound path"), _T("\\media\\ding.wav")); + + pManager->RegisterStringArrayProperty(_T("Shortcuts")); + pManager->RegisterStringArrayProperty(_T("Recent paths")); + + return true; +} Index: Copy Handler/CfgProperties.h =================================================================== diff -u --- Copy Handler/CfgProperties.h (revision 0) +++ Copy Handler/CfgProperties.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,112 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PROPERTYTYPES_H__ +#define __PROPERTYTYPES_H__ + +#pragma once + +// properties definitions +#define PP_PCLIPBOARDMONITORING 0 +#define PP_PMONITORSCANINTERVAL 1 +#define PP_PRELOADAFTERRESTART 2 +#define PP_PSHUTDOWNAFTREFINISHED 3 +#define PP_PTIMEBEFORESHUTDOWN 4 +#define PP_PFORCESHUTDOWN 5 +#define PP_PAUTOSAVEINTERVAL 6 +#define PP_PPROCESSPRIORITYCLASS 7 +#define PP_PAUTOSAVEDIRECTORY 8 +#define PP_PPLUGINSDIR 9 +#define PP_PHELPDIR 10 +#define PP_PLANGUAGE 11 +#define PP_PLANGDIR 12 + +#define PP_STATUSREFRESHINTERVAL 13 +#define PP_STATUSSHOWDETAILS 14 +#define PP_STATUSAUTOREMOVEFINISHED 15 + +#define PP_FDWIDTH 16 +#define PP_FDHEIGHT 17 +#define PP_FDSHORTCUTLISTSTYLE 18 +#define PP_FDEXTENDEDVIEW 19 +#define PP_FDIGNORESHELLDIALOGS 20 + +#define PP_MVSHOWFILENAMES 21 +#define PP_MVSHOWSINGLETASKS 22 +#define PP_MVREFRESHINTERVAL 23 +#define PP_MVAUTOSHOWWHENRUN 24 +#define PP_MVAUTOHIDEWHENEMPTY 25 +#define PP_MVUSESMOOTHPROGRESS 26 + +#define PP_CMUSEAUTOCOMPLETEFILES 27 +#define PP_CMSETDESTATTRIBUTES 28 +#define PP_CMSETDESTDATE 29 +#define PP_CMPROTECTROFILES 30 +#define PP_CMLIMITMAXOPERATIONS 31 +#define PP_CMREADSIZEBEFOREBLOCKING 32 +#define PP_CMSHOWVISUALFEEDBACK 33 +#define PP_CMUSETIMEDFEEDBACK 34 +#define PP_CMFEEDBACKTIME 35 +#define PP_CMAUTORETRYONERROR 36 +#define PP_CMAUTORETRYINTERVAL 37 +#define PP_CMDEFAULTPRIORITY 38 +#define PP_CMDISABLEPRIORITYBOOST 39 +#define PP_CMDELETEAFTERFINISHED 40 +#define PP_CMCREATELOG 41 + +#define PP_SHSHOWCOPY 42 +#define PP_SHSHOWMOVE 43 +#define PP_SHSHOWCOPYMOVE 44 +#define PP_SHSHOWPASTE 45 +#define PP_SHSHOWPASTESPECIAL 46 +#define PP_SHSHOWCOPYTO 47 +#define PP_SHSHOWMOVETO 48 +#define PP_SHSHOWCOPYMOVETO 49 +#define PP_SHSHOWFREESPACE 50 +#define PP_SHSHOWSHELLICONS 51 +#define PP_SHUSEDRAGDROP 52 +#define PP_SHDEFAULTACTION 53 + +#define PP_BFUSEONLYDEFAULT 54 +#define PP_BFDEFAULT 55 +#define PP_BFONEDISK 56 +#define PP_BFTWODISKS 57 +#define PP_BFCD 58 +#define PP_BFLAN 59 +#define PP_BFUSENOBUFFERING 60 +#define PP_BFBOUNDARYLIMIT 61 + +#define PP_LOGPATH 62 +#define PP_LOGENABLELOGGING 63 +#define PP_LOGLIMITATION 64 +#define PP_LOGMAXLIMIT 65 +#define PP_LOGPRECISELIMITING 66 +#define PP_LOGTRUNCBUFFERSIZE 67 + +#define PP_SNDPLAYSOUNDS 68 +#define PP_SNDERRORSOUNDPATH 69 +#define PP_SNDFINISHEDSOUNDPATH 70 + +#define PP_SHORTCUTS 71 +#define PP_RECENTPATHS 72 + +// register function +bool RegisterProperties(CConfigManager* pManager); + +#endif \ No newline at end of file Index: Copy Handler/Copy Handler.dsp =================================================================== diff -u --- Copy Handler/Copy Handler.dsp (revision 0) +++ Copy Handler/Copy Handler.dsp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,813 @@ +# Microsoft Developer Studio Project File - Name="Copy Handler" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=Copy Handler - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Copy Handler.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Copy Handler.mak" CFG="Copy Handler - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Copy Handler - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "Copy Handler - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "Copy Handler - Win32 Final Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "Copy Handler" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Copy Handler - Win32 Release" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 2 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /G5 /MD /W4 /GX /O2 /Ob2 /I "..\..\..\MODULES" /I "..\..\MODULES\\" /I "..\..\..\MODULES\App Framework" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FAs /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 winmm.lib imagehlp.lib version.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"../BIN/Release/ch.exe" +# SUBTRACT LINK32 /profile /debug /nodefaultlib +# Begin Special Build Tool +WkspDir=. +TargetPath=\projects\c++\working\Copy Handler\BIN\Release\ch.exe +SOURCE="$(InputPath)" +PostBuild_Cmds="BuildManager" "Release builds" "$(WkspDir)\ch_count.txt" upx.exe -9 -v "$(TargetPath)" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Debug" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 2 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\..\..\MODULES\App Framework" /I "..\..\..\MODULES" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 winmm.lib imagehlp.lib version.lib htmlhelp.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"../BIN/Debug/ch.exe" +# SUBTRACT LINK32 /map +# Begin Special Build Tool +WkspDir=. +SOURCE="$(InputPath)" +PostBuild_Cmds="BuildManager" "Debug builds" "$(WkspDir)\ch_count.txt" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Final Release" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Copy_Handler___Win32_Final_Release" +# PROP BASE Intermediate_Dir "Copy_Handler___Win32_Final_Release" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 2 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Copy_Handler___Win32_Final_Release" +# PROP Intermediate_Dir "Copy_Handler___Win32_Final_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G5 /MD /W4 /GX /O2 /Ob2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FAs /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /G5 /MD /W4 /GX /O2 /Ob2 /I "..\..\..\MODULES" /I "..\..\MODULES\\" /I "..\..\..\MODULES\App Framework" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_AFXDLL" /FAs /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 winmm.lib imagehlp.lib version.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"../BIN/Release/ch.exe" +# SUBTRACT BASE LINK32 /profile /debug /nodefaultlib +# ADD LINK32 winmm.lib imagehlp.lib version.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"../BIN/Release/ch.exe" +# SUBTRACT LINK32 /profile /debug /nodefaultlib +# Begin Special Build Tool +WkspDir=. +TargetPath=\projects\c++\working\Copy Handler\BIN\Release\ch.exe +SOURCE="$(InputPath)" +PostBuild_Cmds="BuildManager" "Release builds" "$(WkspDir)\ch_count.txt" upx.exe -9 -v "$(TargetPath)" +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "Copy Handler - Win32 Release" +# Name "Copy Handler - Win32 Debug" +# Name "Copy Handler - Win32 Final Release" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\AboutDlg.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\AppHelper.cpp" +# End Source File +# Begin Source File + +SOURCE=.\BufferSizeDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\CfgProperties.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ConfigManager.cpp" +# End Source File +# Begin Source File + +SOURCE=".\COPY HANDLER.cpp" +# End Source File +# Begin Source File + +SOURCE=".\COPY HANDLER.rc" + +!IF "$(CFG)" == "Copy Handler - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Compiling resources $(InputPath) +InputDir=. +OutDir=.\Release +WkspDir=. +TargetDir=\projects\c++\working\Copy Handler\BIN\Release +InputPath=".\COPY HANDLER.rc" +InputName=COPY HANDLER + +"$(OutDir)\$(InputName).res" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + "BuildManager" "$(WkspDir)\ch_count.txt" $(InputPath) /rcupd + Exe2Lng.exe $(InputPath) "$(InputDir)\Scripts\header.lng" "$(OutDir)\chtmp.rc" "$(TargetDir)\..\..\other\Langs\English.lng" $(InputDir)\resource.h "$(MSDEVDIR)\..\..\VC98\MFC\Include\afxres.h" + rc.exe /l 0x409 /d "NDEBUG" /d "_AFXDLL" /fo"$(OutDir)\$(InputName).res" "$(OutDir)\chtmp.rc" + del "$(OutDir)\chtmp.rc" + +# End Custom Build + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Compiling resources $(InputPath) +InputDir=. +OutDir=.\Debug +WkspDir=. +TargetDir=\projects\c++\working\Copy Handler\BIN\Debug +InputPath=".\COPY HANDLER.rc" +InputName=COPY HANDLER + +"$(OutDir)\$(InputName).res" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + "BuildManager" "$(WkspDir)\ch_count.txt" $(InputPath) /rcupd + Exe2Lng.exe $(InputPath) "$(InputDir)\Scripts\header.lng" "$(OutDir)\chtmp.rc" "$(TargetDir)\..\..\other\Langs\English.lng" $(InputDir)\resource.h "$(MSDEVDIR)\..\..\VC98\MFC\Include\afxres.h" + rc.exe /l 0x409 /d "_DEBUG" /d "_AFXDLL" /fo"$(OutDir)\$(InputName).res" "$(OutDir)\chtmp.rc" + del "$(OutDir)\chtmp.rc" + +# End Custom Build + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Final Release" + +# PROP BASE Ignore_Default_Tool 1 +# PROP Ignore_Default_Tool 1 + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\crc32.cpp" +# End Source File +# Begin Source File + +SOURCE=.\CustomCopyDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\DataBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=.\DestPath.cpp +# End Source File +# Begin Source File + +SOURCE=.\Dialogs.cpp +# End Source File +# Begin Source File + +SOURCE=.\DirTreeCtrl.cpp +# End Source File +# Begin Source File + +SOURCE=.\DstFileErrorDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\FFListCtrl.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\FileEx.cpp" +# End Source File +# Begin Source File + +SOURCE=.\FileInfo.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\FileSupport.cpp +# End Source File +# Begin Source File + +SOURCE=.\FilterDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\FolderDialog.cpp +# End Source File +# Begin Source File + +SOURCE=.\HelpLngDialog.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\IniFile.cpp" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\LanguageDialog.cpp" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\LogFile.cpp" +# End Source File +# Begin Source File + +SOURCE=.\MainWnd.cpp +# End Source File +# Begin Source File + +SOURCE=.\MiniViewDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\NotEnoughRoomDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\OptionsDlg.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\Plugin.cpp" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\PluginContainer.cpp" +# End Source File +# Begin Source File + +SOURCE=.\ProgressListBox.cpp +# End Source File +# Begin Source File + +SOURCE=.\PropertyListCtrl.cpp +# End Source File +# Begin Source File + +SOURCE=.\RecentDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\register.cpp +# End Source File +# Begin Source File + +SOURCE=.\ReplaceFilesDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\ReplaceOnlyDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\ReplacePathsDlg.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ResourceManager.cpp" +# End Source File +# Begin Source File + +SOURCE=.\shortcuts.cpp +# End Source File +# Begin Source File + +SOURCE=.\ShortcutsDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\ShutdownDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\SmallReplaceFilesDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\StaticEx.cpp +# End Source File +# Begin Source File + +SOURCE=.\StatusDlg.cpp +# End Source File +# Begin Source File + +SOURCE=.\stdafx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\StringHelpers.cpp +# End Source File +# Begin Source File + +SOURCE=.\structs.cpp +# End Source File +# Begin Source File + +SOURCE=".\Theme Helpers.cpp" +# End Source File +# Begin Source File + +SOURCE=.\ThemedButton.cpp +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\TrayIcon.cpp" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\AboutDlg.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\af_defs.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\AppHelper.h" +# End Source File +# Begin Source File + +SOURCE=.\btnIDs.h +# End Source File +# Begin Source File + +SOURCE=.\BufferSizeDlg.h +# End Source File +# Begin Source File + +SOURCE=.\CfgProperties.h +# End Source File +# Begin Source File + +SOURCE=.\charvect.h +# End Source File +# Begin Source File + +SOURCE=..\Common\CHPluginCore.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ConfigEntry.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ConfigManager.h" +# End Source File +# Begin Source File + +SOURCE=".\COPY HANDLER.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\crc32.h" +# End Source File +# Begin Source File + +SOURCE=.\CustomCopyDlg.h +# End Source File +# Begin Source File + +SOURCE=.\DataBuffer.h +# End Source File +# Begin Source File + +SOURCE=.\DestPath.h +# End Source File +# Begin Source File + +SOURCE=".\Device IO.h" +# End Source File +# Begin Source File + +SOURCE=.\Dialogs.h +# End Source File +# Begin Source File + +SOURCE=.\DirTreeCtrl.h +# End Source File +# Begin Source File + +SOURCE=.\DstFileErrorDlg.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ExceptionEx.h" +# End Source File +# Begin Source File + +SOURCE=.\FFListCtrl.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\FileEx.h" +# End Source File +# Begin Source File + +SOURCE=.\FileInfo.h +# End Source File +# Begin Source File + +SOURCE=..\Common\FileSupport.h +# End Source File +# Begin Source File + +SOURCE=.\FilterDlg.h +# End Source File +# Begin Source File + +SOURCE=.\FolderDialog.h +# End Source File +# Begin Source File + +SOURCE=.\HelpLngDialog.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\IniFile.h" +# End Source File +# Begin Source File + +SOURCE=..\Common\ipcstructs.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\LanguageDialog.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\LogFile.h" +# End Source File +# Begin Source File + +SOURCE=.\MainWnd.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\MemDC.h" +# End Source File +# Begin Source File + +SOURCE=.\MiniViewDlg.h +# End Source File +# Begin Source File + +SOURCE=.\NotEnoughRoomDlg.h +# End Source File +# Begin Source File + +SOURCE=.\OptionsDlg.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\Plugin.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\PluginContainer.h" +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\PluginCore.h" +# End Source File +# Begin Source File + +SOURCE=.\ProgressListBox.h +# End Source File +# Begin Source File + +SOURCE=.\PropertyListCtrl.h +# End Source File +# Begin Source File + +SOURCE=.\RecentDlg.h +# End Source File +# Begin Source File + +SOURCE=.\register.h +# End Source File +# Begin Source File + +SOURCE=.\ReplaceFilesDlg.h +# End Source File +# Begin Source File + +SOURCE=.\ReplaceOnlyDlg.h +# End Source File +# Begin Source File + +SOURCE=.\ReplacePathsDlg.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h + +!IF "$(CFG)" == "Copy Handler - Win32 Release" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Generating html help include file... +InputPath=.\resource.h + +"..\other\Help\HTMLDefines.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + call makehelpmap.bat "$(InputPath)" "..\other\Help\HTMLDefines.h" + +# End Custom Build + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Debug" + +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Generating html help include file... +InputPath=.\resource.h + +"..\other\Help\HTMLDefines.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + call makehelpmap.bat "$(InputPath)" "..\other\Help\HTMLDefines.h" + +# End Custom Build + +!ELSEIF "$(CFG)" == "Copy Handler - Win32 Final Release" + +# PROP BASE Ignore_Default_Tool 1 +# PROP Ignore_Default_Tool 1 +# Begin Custom Build - Generating html help include file... +InputPath=.\resource.h + +"..\other\Help\HTMLDefines.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + call makehelpmap.bat "$(InputPath)" "..\other\Help\HTMLDefines.h" + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\ResourceManager.h" +# End Source File +# Begin Source File + +SOURCE=.\shortcuts.h +# End Source File +# Begin Source File + +SOURCE=.\ShortcutsDlg.h +# End Source File +# Begin Source File + +SOURCE=.\ShutdownDlg.h +# End Source File +# Begin Source File + +SOURCE=.\SmallReplaceFilesDlg.h +# End Source File +# Begin Source File + +SOURCE=.\StaticEx.h +# End Source File +# Begin Source File + +SOURCE=.\StatusDlg.h +# End Source File +# Begin Source File + +SOURCE=.\stdafx.h +# End Source File +# Begin Source File + +SOURCE=.\StringHelpers.h +# End Source File +# Begin Source File + +SOURCE=.\structs.h +# End Source File +# Begin Source File + +SOURCE=".\Theme Helpers.h" +# End Source File +# Begin Source File + +SOURCE=.\ThemedButton.h +# End Source File +# Begin Source File + +SOURCE="..\..\..\MODULES\App Framework\TrayIcon.h" +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\res\addshort.ico +# End Source File +# Begin Source File + +SOURCE=.\res\cancelled.ico +# End Source File +# Begin Source File + +SOURCE=.\res\cd.ico +# End Source File +# Begin Source File + +SOURCE=.\help\ch.gif +# End Source File +# Begin Source File + +SOURCE=..\Documentation\Help\EN\ch.gif +# End Source File +# Begin Source File + +SOURCE=..\Documentation\Help\PL\ch.gif +# End Source File +# Begin Source File + +SOURCE=".\res\COPY HANDLER.ico" +# End Source File +# Begin Source File + +SOURCE=".\res\COPY HANDLER.rc2" +# End Source File +# Begin Source File + +SOURCE=.\res\delshort.ico +# End Source File +# Begin Source File + +SOURCE=.\res\diskette.ico +# End Source File +# Begin Source File + +SOURCE=.\res\err.ico +# End Source File +# Begin Source File + +SOURCE=.\res\error.ico +# End Source File +# Begin Source File + +SOURCE=.\res\finished.ico +# End Source File +# Begin Source File + +SOURCE=.\res\folder.ico +# End Source File +# Begin Source File + +SOURCE=.\res\hd.ico +# End Source File +# Begin Source File + +SOURCE=.\res\Hd2.ico +# End Source File +# Begin Source File + +SOURCE=.\res\info.ico +# End Source File +# Begin Source File + +SOURCE=.\res\large.ico +# End Source File +# Begin Source File + +SOURCE=.\res\list.ico +# End Source File +# Begin Source File + +SOURCE=.\res\main_toolbar.bmp +# End Source File +# Begin Source File + +SOURCE=.\res\net.ico +# End Source File +# Begin Source File + +SOURCE=.\res\newdir.ico +# End Source File +# Begin Source File + +SOURCE=.\res\paused.ico +# End Source File +# Begin Source File + +SOURCE=.\res\question.ico +# End Source File +# Begin Source File + +SOURCE=.\res\report.ico +# End Source File +# Begin Source File + +SOURCE=.\res\shut.ico +# End Source File +# Begin Source File + +SOURCE=.\res\small.ico +# End Source File +# Begin Source File + +SOURCE=.\res\tribe.ico +# End Source File +# Begin Source File + +SOURCE=.\res\waiting.ico +# End Source File +# Begin Source File + +SOURCE=.\res\warning.ico +# End Source File +# Begin Source File + +SOURCE=.\res\working.ico +# End Source File +# End Group +# Begin Source File + +SOURCE=.\res\manifest.txt +# End Source File +# Begin Source File + +SOURCE=.\RES\Thanks.txt +# End Source File +# Begin Source File + +SOURCE=..\other\TODO.TXT +# End Source File +# End Target +# End Project Index: Copy Handler/CustomCopyDlg.cpp =================================================================== diff -u --- Copy Handler/CustomCopyDlg.cpp (revision 0) +++ Copy Handler/CustomCopyDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,907 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "CustomCopyDlg.h" +#include "structs.h" +#include "dialogs.h" +#include "BufferSizeDlg.h" +#include "FilterDlg.h" +#include "StringHelpers.h" +#include "Copy Handler.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CCustomCopyDlg dialog + + +CCustomCopyDlg::CCustomCopyDlg() : CHLanguageDialog(CCustomCopyDlg::IDD) +{ + //{{AFX_DATA_INIT(CCustomCopyDlg) + m_ucCount = 1; + m_bOnlyCreate = FALSE; + m_bIgnoreFolders = FALSE; + m_bFilters = FALSE; + m_bAdvanced = FALSE; + m_bForceDirectories = FALSE; + //}}AFX_DATA_INIT + +// m_ccData.m_astrPaths.RemoveAll(); // unneeded +// m_ccData.m_strDestPath.Empty(); + + m_ccData.m_iOperation=0; + m_ccData.m_iPriority=THREAD_PRIORITY_NORMAL; + m_ccData.m_ucCount=1; + + // m_ccData.m_bsSizes stays uninitialized + // m_ccData.m_afFilters - this too + + m_ccData.m_bIgnoreFolders=false; + m_ccData.m_bForceDirectories=false; + m_ccData.m_bCreateStructure=false; + + m_bActualisation=false; +} + +void CCustomCopyDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CCustomCopyDlg) + DDX_Control(pDX, IDC_DESTPATH_COMBOBOXEX, m_ctlDstPath); + DDX_Control(pDX, IDC_COUNT_SPIN, m_ctlCountSpin); + DDX_Control(pDX, IDC_FILTERS_LIST, m_ctlFilters); + DDX_Control(pDX, IDC_BUFFERSIZES_LIST, m_ctlBufferSizes); + DDX_Control(pDX, IDC_OPERATION_COMBO, m_ctlOperation); + DDX_Control(pDX, IDC_PRIORITY_COMBO, m_ctlPriority); + DDX_Control(pDX, IDC_FILES_LIST, m_ctlFiles); + DDX_Text(pDX, IDC_COUNT_EDIT, m_ucCount); + DDV_MinMaxByte(pDX, m_ucCount, 1, 255); + DDX_Check(pDX, IDC_ONLYSTRUCTURE_CHECK, m_bOnlyCreate); + DDX_Check(pDX, IDC_IGNOREFOLDERS_CHECK, m_bIgnoreFolders); + DDX_Check(pDX, IDC_FORCEDIRECTORIES_CHECK, m_bForceDirectories); + DDX_Check(pDX, IDC_FILTERS_CHECK, m_bFilters); + DDX_Check(pDX, IDC_ADVANCED_CHECK, m_bAdvanced); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CCustomCopyDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CCustomCopyDlg) + ON_BN_CLICKED(IDC_ADDDIR_BUTTON, OnAddDirectoryButton) + ON_BN_CLICKED(IDC_ADDFILE_BUTTON, OnAddFilesButton) + ON_BN_CLICKED(IDC_REMOVEFILEFOLDER_BUTTON, OnRemoveButton) + ON_BN_CLICKED(IDC_DESTBROWSE_BUTTON, OnBrowseButton) + ON_BN_CLICKED(IDC_BUFFERSIZES_BUTTON, OnChangebufferButton) + ON_BN_CLICKED(IDC_ADDFILTER_BUTTON, OnAddfilterButton) + ON_BN_CLICKED(IDC_REMOVEFILTER_BUTTON, OnRemovefilterButton) + ON_WM_DESTROY() + ON_BN_CLICKED(IDC_FILTERS_CHECK, OnFiltersCheck) + ON_BN_CLICKED(IDC_STANDARD_CHECK, OnStandardCheck) + ON_BN_CLICKED(IDC_ADVANCED_CHECK, OnAdvancedCheck) + ON_NOTIFY(NM_DBLCLK, IDC_FILTERS_LIST, OnDblclkFiltersList) + ON_LBN_DBLCLK(IDC_BUFFERSIZES_LIST, OnDblclkBuffersizesList) + ON_CBN_EDITCHANGE(IDC_DESTPATH_COMBOBOXEX, OnEditchangeDestpathComboboxex) + ON_BN_CLICKED(IDC_IMPORT_BUTTON, OnImportButton) + ON_BN_CLICKED(IDC_IGNOREFOLDERS_CHECK, OnIgnorefoldersCheck) + ON_BN_CLICKED(IDC_FORCEDIRECTORIES_CHECK, OnForcedirectoriesCheck) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CCustomCopyDlg message handlers +BOOL CCustomCopyDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // make this dialog on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + // paths' listbox - init images - system image list + SHFILEINFO sfi; + HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + + m_ilImages.Attach(hImageList); + m_ctlFiles.SetImageList(&m_ilImages, LVSIL_SMALL); + + // calc list width + CRect rc; + m_ctlFiles.GetWindowRect(&rc); + rc.right-=GetSystemMetrics(SM_CXEDGE)*2; + + // some styles + m_ctlFiles.SetExtendedStyle(m_ctlFiles.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + m_ctlFilters.SetExtendedStyle(m_ctlFiles.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + + // paths' listbox - add one column + LVCOLUMN lvc; + lvc.mask=LVCF_FMT | LVCF_WIDTH; + lvc.fmt=LVCFMT_LEFT; + lvc.cx=rc.Width(); + m_ctlFiles.InsertColumn(1, &lvc); + + // fill paths' listbox + for (int i=0;iLoadString(IDS_CCDCOPY_STRING)); + m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDMOVE_STRING)); + + // copying/moving + m_ctlOperation.SetCurSel(m_ccData.m_iOperation); + + // fill priority combo + for (i=0;i<7;i++) + { + m_ctlPriority.AddString(GetResManager()->LoadString(IDS_PRIORITY0_STRING+i)); + } + + m_ctlPriority.SetCurSel(PriorityToIndex(m_ccData.m_iPriority)); + + // count of copies + m_ucCount=m_ccData.m_ucCount; + m_ctlCountSpin.SetRange(1, 255); + + // fill buffer sizes listbox + SetBuffersizesString(); + + // list width + m_ctlFilters.GetWindowRect(&rc); + rc.right-=GetSystemMetrics(SM_CXEDGE)*2; + + // filter - some columns in a header + lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt=LVCFMT_LEFT; + + // mask + lvc.iSubItem=-1; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRMASK_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.15*rc.Width()); + m_ctlFilters.InsertColumn(1, &lvc); + + // exclude mask + lvc.iSubItem=0; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.15*rc.Width()); + m_ctlFilters.InsertColumn(2, &lvc); + + // size + lvc.iSubItem=1; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRSIZE_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.3*rc.Width()); + m_ctlFilters.InsertColumn(3, &lvc); + + // time + lvc.iSubItem=2; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRDATE_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.3*rc.Width()); + m_ctlFilters.InsertColumn(4, &lvc); + + // attributes + lvc.iSubItem=3; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRATTRIB_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.1*rc.Width()); + m_ctlFilters.InsertColumn(5, &lvc); + + // -attributes + lvc.iSubItem=4; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEATTRIB_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.1*rc.Width()); + m_ctlFilters.InsertColumn(6, &lvc); + + m_bFilters=!!m_ccData.m_afFilters.GetSize(); + + // other custom flags + m_bAdvanced=(m_ccData.m_bIgnoreFolders | m_ccData.m_bCreateStructure); + m_bIgnoreFolders=m_ccData.m_bIgnoreFolders; + m_bForceDirectories=m_ccData.m_bForceDirectories; + m_bOnlyCreate=m_ccData.m_bCreateStructure; + + UpdateData(FALSE); + + EnableControls(); + + return TRUE; +} + +void CCustomCopyDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + UpdateData(TRUE); + + // count the width of a list + CRect rc; + m_ctlFiles.GetWindowRect(&rc); + rc.right-=GetSystemMetrics(SM_CXEDGE)*2; + + // change the width of a column + LVCOLUMN lvc; + lvc.mask=LVCF_WIDTH; + lvc.cx=rc.Width(); + m_ctlFiles.SetColumn(0, &lvc); + + // operation + int iPos=m_ctlOperation.GetCurSel(); + m_ctlOperation.ResetContent(); + m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDCOPY_STRING)); + m_ctlOperation.AddString(GetResManager()->LoadString(IDS_CCDMOVE_STRING)); + m_ctlOperation.SetCurSel(iPos); + + // priority combo + iPos=m_ctlPriority.GetCurSel(); + m_ctlPriority.ResetContent(); + for (int i=0;i<7;i++) + { + m_ctlPriority.AddString(GetResManager()->LoadString(IDS_PRIORITY0_STRING+i)); + } + m_ctlPriority.SetCurSel(iPos); + + // fill the listbox with buffers + SetBuffersizesString(); + + // filter section (filter, size, date, attributes) + while(m_ctlFilters.DeleteColumn(0)); // delete all columns + + lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt=LVCFMT_LEFT; + + // mask + lvc.iSubItem=-1; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRMASK_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.15*rc.Width()); + m_ctlFilters.InsertColumn(1, &lvc); + + // exclude mask + lvc.iSubItem=0; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.15*rc.Width()); + m_ctlFilters.InsertColumn(2, &lvc); + + // size + lvc.iSubItem=1; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRSIZE_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.3*rc.Width()); + m_ctlFilters.InsertColumn(3, &lvc); + + // time + lvc.iSubItem=2; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRDATE_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.3*rc.Width()); + m_ctlFilters.InsertColumn(4, &lvc); + + // attributes + lvc.iSubItem=3; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDRATTRIB_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.1*rc.Width()); + m_ctlFilters.InsertColumn(5, &lvc); + + // -attributes + lvc.iSubItem=4; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_HDREXCLUDEATTRIB_STRING); + lvc.cchTextMax=lstrlen(lvc.pszText); + lvc.cx=static_cast(0.1*rc.Width()); + m_ctlFilters.InsertColumn(6, &lvc); + + // refresh the entries in filters' list + m_ctlFilters.DeleteAllItems(); + for (i=0;iLoadString(IDS_BROWSE_STRING), &strPath)) + AddPath(strPath); +} + +void CCustomCopyDlg::OnAddFilesButton() +{ + CFileDialog dlg(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_NODEREFERENCELINKS | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager()->LoadString(IDS_FILEDLGALLFILTER_STRING), this); + + TCHAR *pszBuffer=new TCHAR[65535]; + memset(pszBuffer, 0, 65535*sizeof(TCHAR)); + dlg.m_ofn.lpstrFile=pszBuffer; + dlg.m_ofn.nMaxFile=65535; + + if (dlg.DoModal() == IDOK) + { + // first element is the path + CString strPath=pszBuffer; + + int iOffset=_tcslen(pszBuffer)+1; + + // get filenames + if (pszBuffer[iOffset] == _T('\0')) + AddPath(strPath); + else + { + if (strPath.Right(1) != _T("\\")) + strPath+=_T("\\"); + while (pszBuffer[iOffset] != _T('\0')) + { + AddPath(strPath+CString(pszBuffer+iOffset)); + iOffset+=_tcslen(pszBuffer+iOffset)+1; + } + } + } + + // delete buffer + delete [] pszBuffer; +} + +void CCustomCopyDlg::OnRemoveButton() +{ + POSITION pos; + int iItem; + while (true) + { + pos = m_ctlFiles.GetFirstSelectedItemPosition(); + if (pos == NULL) + break; + else + { + iItem=m_ctlFiles.GetNextSelectedItem(pos); + m_ctlFiles.DeleteItem(iItem); + } + } +} + +void CCustomCopyDlg::OnBrowseButton() +{ + CString strPath; + if (BrowseForFolder(GetResManager()->LoadString(IDS_DSTFOLDERBROWSE_STRING), &strPath)) + { + SetComboPath(strPath); +// m_strDest=strPath; //** + } +} + +void CCustomCopyDlg::OnOK() +{ + UpdateData(TRUE); + + // copy files from listctrl to an array + m_ccData.m_astrPaths.RemoveAll(); + CString strPath; + + for (int i=0;iLoadString(IDS_BSEDEFAULT_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiDefaultSize, szSize, true)); + m_ctlBufferSizes.AddString(szData); + + if (!m_ccData.m_bsSizes.m_bOnlyDefault) + { + _stprintf(szData, GetResManager()->LoadString(IDS_BSEONEDISK_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiOneDiskSize, szSize, true)); + m_ctlBufferSizes.AddString(szData); + + _stprintf(szData, GetResManager()->LoadString(IDS_BSETWODISKS_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiTwoDisksSize, szSize, true)); + m_ctlBufferSizes.AddString(szData); + + _stprintf(szData, GetResManager()->LoadString(IDS_BSECD_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiCDSize, szSize, true)); + m_ctlBufferSizes.AddString(szData); + + _stprintf(szData, GetResManager()->LoadString(IDS_BSELAN_STRING), GetSizeString(m_ccData.m_bsSizes.m_uiLANSize, szSize, true)); + m_ctlBufferSizes.AddString(szData); + } +} + +void CCustomCopyDlg::OnChangebufferButton() +{ + CBufferSizeDlg dlg; + dlg.m_bsSizes=m_ccData.m_bsSizes; + if (dlg.DoModal() == IDOK) + { + m_ccData.m_bsSizes=dlg.m_bsSizes; + SetBuffersizesString(); + } +} + +void CCustomCopyDlg::AddPath(CString strPath) +{ + // fill listbox with paths + LVITEM lvi; + lvi.mask=LVIF_TEXT | LVIF_IMAGE; + lvi.iItem=m_ctlFiles.GetItemCount(); + lvi.iSubItem=0; + + // there's no need for a high speed so get the images + SHFILEINFO sfi; + SHGetFileInfo(strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON/* | SHGFI_USEFILEATTRIBUTES*/); + + // fill the list + lvi.pszText=strPath.GetBuffer(0); + strPath.ReleaseBuffer(); + lvi.cchTextMax=lstrlen(lvi.pszText); + lvi.iImage=sfi.iIcon; + m_ctlFiles.InsertItem(&lvi); +} + +void CCustomCopyDlg::OnAddfilterButton() +{ + CFilterDlg dlg; + CString strData; + for (int i=0;iLoadString(IDS_FILTERMASKEMPTY_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.InsertItem(&lvi); + + ///////////////////// + lvi.iSubItem=1; + + if (rFilter.m_bUseExcludeMask) + { + CString strData; + rFilter.GetCombinedExcludeMask(strData); + _tcscpy(szLoaded, strData); + } + else + _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERMASKEMPTY_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.SetItem(&lvi); + + ///////////////// + lvi.iSubItem=2; + + if (rFilter.m_bUseSize) + { + _stprintf(szLoaded, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(static_cast<__int64>(rFilter.m_ullSize1), szData, true)); + + if (rFilter.m_bUseSize2) + { + _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); + CString strLoaded2; + strLoaded2.Format(_T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(static_cast<__int64>(rFilter.m_ullSize2), szData, true)); + _tcscat(szLoaded, strLoaded2); + } + } + else + _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERSIZE_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.SetItem(&lvi); + + /////////////////// + lvi.iSubItem=3; + + if (rFilter.m_bUseDate) + { + _stprintf(szLoaded, _T("%s %s"), GetResManager()->LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); + if (rFilter.m_bDate1) + _tcscat(szLoaded, rFilter.m_tDate1.Format(_T(" %x"))); + if (rFilter.m_bTime1) + _tcscat(szLoaded, rFilter.m_tTime1.Format(_T(" %X"))); + + if (rFilter.m_bUseDate2) + { + _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); + _tcscat(szLoaded, GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iDateType2)); + if (rFilter.m_bDate2) + _tcscat(szLoaded, rFilter.m_tDate2.Format(_T(" %x"))); + if (rFilter.m_bTime2) + _tcscat(szLoaded, rFilter.m_tTime2.Format(_T(" %X"))); + } + } + else + _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERDATE_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.SetItem(&lvi); + + ///////////////////// + lvi.iSubItem=4; + szLoaded[0]=_T('\0'); + if (rFilter.m_bUseAttributes) + { + if (rFilter.m_iArchive == 1) + _tcscat(szLoaded, _T("A")); + if (rFilter.m_iReadOnly == 1) + _tcscat(szLoaded, _T("R")); + if (rFilter.m_iHidden == 1) + _tcscat(szLoaded, _T("H")); + if (rFilter.m_iSystem == 1) + _tcscat(szLoaded, _T("S")); + if (rFilter.m_iDirectory == 1) + _tcscat(szLoaded, _T("D")); + } + + if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('\0')) + _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERATTRIB_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.SetItem(&lvi); + + ///////////////////// + lvi.iSubItem=5; + szLoaded[0]=_T('\0'); + if (rFilter.m_bUseAttributes) + { + if (rFilter.m_iArchive == 0) + _tcscat(szLoaded, _T("A")); + if (rFilter.m_iReadOnly == 0) + _tcscat(szLoaded, _T("R")); + if (rFilter.m_iHidden == 0) + _tcscat(szLoaded, _T("H")); + if (rFilter.m_iSystem == 0) + _tcscat(szLoaded, _T("S")); + if (rFilter.m_iDirectory == 0) + _tcscat(szLoaded, _T("D")); + } + + if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('0')) + _tcscpy(szLoaded, GetResManager()->LoadString(IDS_FILTERATTRIB_STRING)); + + lvi.pszText=szLoaded; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlFilters.SetItem(&lvi); +} + +void CCustomCopyDlg::OnRemovefilterButton() +{ + POSITION pos; + int iItem; + while (true) + { + pos=m_ctlFilters.GetFirstSelectedItemPosition(); + if (pos == NULL) + break; + else + { + iItem=m_ctlFilters.GetNextSelectedItem(pos); + m_ctlFilters.DeleteItem(iItem); + m_ccData.m_afFilters.RemoveAt(iItem); + } + } +} + +void CCustomCopyDlg::OnDestroy() +{ + m_ctlFiles.SetImageList(NULL, LVSIL_SMALL); + m_ilImages.Detach(); + + CHLanguageDialog::OnDestroy(); +} + +void CCustomCopyDlg::EnableControls() +{ + UpdateData(TRUE); + + m_ctlFilters.EnableWindow(m_bFilters); + GetDlgItem(IDC_ADDFILTER_BUTTON)->EnableWindow(m_bFilters); + GetDlgItem(IDC_REMOVEFILTER_BUTTON)->EnableWindow(m_bFilters); + + GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(m_bAdvanced && !m_bForceDirectories); + GetDlgItem(IDC_FORCEDIRECTORIES_CHECK)->EnableWindow(m_bAdvanced && !m_bIgnoreFolders); + GetDlgItem(IDC_ONLYSTRUCTURE_CHECK)->EnableWindow(m_bAdvanced); +} + +void CCustomCopyDlg::OnFiltersCheck() +{ + EnableControls(); +} + +void CCustomCopyDlg::OnStandardCheck() +{ + EnableControls(); +} + +void CCustomCopyDlg::OnAdvancedCheck() +{ + EnableControls(); +} + +void CCustomCopyDlg::OnDblclkFiltersList(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + POSITION pos=m_ctlFilters.GetFirstSelectedItemPosition(); + if (pos != NULL) + { + int iItem=m_ctlFilters.GetNextSelectedItem(pos); + CFilterDlg dlg; + dlg.m_ffFilter=m_ccData.m_afFilters.GetAt(iItem); + + CString strData; + for (int i=0;iSetSel(-1, -1); +} + +void CCustomCopyDlg::OnEditchangeDestpathComboboxex() +{ + if (m_bActualisation) + return; + m_bActualisation=true; + UpdateComboIcon(); + m_bActualisation=false; +} + +void CCustomCopyDlg::OnImportButton() +{ + CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager()->LoadString(IDS_FLTALLFILTER_STRING)); + if (dlg.DoModal() == IDOK) + { + UINT uiCount=0; + CString strData; + try + { + CFile file(dlg.GetPathName(), CFile::modeRead); + CArchive ar(&file, CArchive::load); + + while (ar.ReadString(strData)) + { + strData.TrimLeft(_T("\" \t")); + strData.TrimRight(_T("\" \t")); + AddPath(strData); + uiCount++; + } + + ar.Close(); + file.Close(); + } + catch(CException* e) + { + e->Delete(); + } + + // report + CString strFmt; + strFmt.Format(GetResManager()->LoadString(IDS_IMPORTREPORT_STRING), uiCount); + AfxMessageBox(strFmt); + } +} + +void CCustomCopyDlg::OnForcedirectoriesCheck() +{ + UpdateData(TRUE); + + GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(!m_bForceDirectories); +} + +void CCustomCopyDlg::OnIgnorefoldersCheck() +{ + UpdateData(TRUE); + + GetDlgItem(IDC_FORCEDIRECTORIES_CHECK)->EnableWindow(!m_bIgnoreFolders); +} Index: Copy Handler/CustomCopyDlg.h =================================================================== diff -u --- Copy Handler/CustomCopyDlg.h (revision 0) +++ Copy Handler/CustomCopyDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,120 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __CUSTOMCOPYDLG_H__ +#define __CUSTOMCOPYDLG_H__ + +#include "DataBuffer.h" +#include "FileInfo.h" +#include "charvect.h" + +///////////////////////////////////////////////////////////////////////////// +// CCustomCopyDlg dialog + +class CCustomCopyDlg : public CHLanguageDialog +{ +// Construction +public: + CCustomCopyDlg(); // standard constructor + + void SetBuffersizesString(); + + struct _CCDATA + { + CStringArray m_astrPaths; // source paths to copy/move + CString m_strDestPath; // currently selected destination path + char_vector m_vRecent; // recently selected paths + int m_iOperation; // copy || move + int m_iPriority; // operation priority + BYTE m_ucCount; // count of copys + BUFFERSIZES m_bsSizes; // buffer sizes selected for this task + + CFiltersArray m_afFilters; // list of filters to select from combos + + bool m_bIgnoreFolders; + bool m_bForceDirectories; + bool m_bCreateStructure; + } m_ccData; + + bool m_bActualisation; // is this dialog processing the combo text changing ? +// Dialog Data + //{{AFX_DATA(CCustomCopyDlg) + enum { IDD = IDD_CUSTOM_COPY_DIALOG }; + CComboBoxEx m_ctlDstPath; + CSpinButtonCtrl m_ctlCountSpin; + CListCtrl m_ctlFilters; + CListBox m_ctlBufferSizes; + CComboBox m_ctlOperation; + CComboBox m_ctlPriority; + CListCtrl m_ctlFiles; + BYTE m_ucCount; + BOOL m_bOnlyCreate; + BOOL m_bIgnoreFolders; + BOOL m_bForceDirectories; + BOOL m_bFilters; + BOOL m_bAdvanced; + //}}AFX_DATA + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CCustomCopyDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + void UpdateDialog(); + void UpdateComboIcon(); + void SetComboPath(LPCTSTR lpszText); + void EnableControls(); + void AddFilter(const CFileFilter& rFilter, int iPos=-1); + void AddPath(CString strPath); + CImageList m_ilImages; + + // Generated message map functions + //{{AFX_MSG(CCustomCopyDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnAddDirectoryButton(); + afx_msg void OnAddFilesButton(); + afx_msg void OnRemoveButton(); + afx_msg void OnBrowseButton(); + virtual void OnOK(); + afx_msg void OnChangebufferButton(); + afx_msg void OnAddfilterButton(); + afx_msg void OnRemovefilterButton(); + afx_msg void OnDestroy(); + afx_msg void OnFiltersCheck(); + afx_msg void OnStandardCheck(); + afx_msg void OnAdvancedCheck(); + afx_msg void OnDblclkFiltersList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDblclkBuffersizesList(); + afx_msg void OnEditchangeDestpathComboboxex(); + afx_msg void OnImportButton(); + afx_msg void OnIgnorefoldersCheck(); + afx_msg void OnForcedirectoriesCheck(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/DataBuffer.cpp =================================================================== diff -u --- Copy Handler/DataBuffer.cpp (revision 0) +++ Copy Handler/DataBuffer.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,158 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "DataBuffer.h" + +bool BUFFERSIZES::operator==(const BUFFERSIZES& bsSizes) const +{ + return (m_uiDefaultSize == bsSizes.m_uiDefaultSize + && m_uiOneDiskSize == bsSizes.m_uiOneDiskSize + && m_uiTwoDisksSize == bsSizes.m_uiTwoDisksSize + && m_uiCDSize == bsSizes.m_uiCDSize + && m_uiLANSize == bsSizes.m_uiLANSize); +} + +void BUFFERSIZES::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + ar<(m_bOnlyDefault); + } + else + { + ar>>m_uiDefaultSize; + ar>>m_uiOneDiskSize; + ar>>m_uiTwoDisksSize; + ar>>m_uiCDSize; + ar>>m_uiLANSize; + unsigned char ucTemp; + ar>>ucTemp; + m_bOnlyDefault=(ucTemp != 0); + } +} + +const BUFFERSIZES* CDataBuffer::Create(const BUFFERSIZES* pbsSizes) +{ + // if trying to set 0-size buffer + BUFFERSIZES bsSizes=*pbsSizes; // copy - not to mix in the def. param + + if (bsSizes.m_uiDefaultSize == 0) + bsSizes.m_uiDefaultSize=DEFAULT_SIZE; + if (bsSizes.m_uiOneDiskSize == 0) + bsSizes.m_uiOneDiskSize=DEFAULT_SIZE; + if (bsSizes.m_uiTwoDisksSize == 0) + bsSizes.m_uiTwoDisksSize=DEFAULT_SIZE; + if (bsSizes.m_uiCDSize == 0) + bsSizes.m_uiCDSize=DEFAULT_SIZE; + if (bsSizes.m_uiLANSize == 0) + bsSizes.m_uiLANSize=DEFAULT_SIZE; + + // max value from the all + UINT uiLargest; + if (bsSizes.m_bOnlyDefault) + uiLargest=bsSizes.m_uiDefaultSize; + else + { + uiLargest=(bsSizes.m_uiDefaultSize > bsSizes.m_uiOneDiskSize ? bsSizes.m_uiDefaultSize : bsSizes.m_uiOneDiskSize); + if (uiLargest < bsSizes.m_uiTwoDisksSize) + uiLargest=bsSizes.m_uiTwoDisksSize; + if (uiLargest < bsSizes.m_uiCDSize) + uiLargest=bsSizes.m_uiCDSize; + if (uiLargest < bsSizes.m_uiLANSize) + uiLargest=bsSizes.m_uiLANSize; + } + + // modify buffer size to the next 64k boundary + UINT uiRealSize=ROUNDTODS(uiLargest); + TRACE("Size: %lu, rounded: %lu\n", uiLargest, uiRealSize); + + if (m_uiRealSize == uiRealSize) + { + // real buffersize doesn't changed + m_bsSizes=bsSizes; + + return &m_bsSizes; + } + + // try to allocate + LPVOID pBuffer=VirtualAlloc(NULL, uiRealSize, MEM_COMMIT, PAGE_READWRITE); + if (pBuffer == NULL) + { + if (m_pBuffer == NULL) + { + // try safe buffesize + pBuffer=VirtualAlloc(NULL, DEFAULT_SIZE, MEM_COMMIT, PAGE_READWRITE); + if (pBuffer == NULL) + return &m_bsSizes; // do not change anything + + // delete old buffer + Delete(); + + // store data + m_pBuffer=static_cast(pBuffer); + m_uiRealSize=DEFAULT_SIZE; + m_bsSizes.m_bOnlyDefault=bsSizes.m_bOnlyDefault; + m_bsSizes.m_uiDefaultSize=DEFAULT_SIZE; + m_bsSizes.m_uiOneDiskSize=DEFAULT_SIZE; + m_bsSizes.m_uiTwoDisksSize=DEFAULT_SIZE; + m_bsSizes.m_uiCDSize=DEFAULT_SIZE; + m_bsSizes.m_uiLANSize=DEFAULT_SIZE; + + return &m_bsSizes; + } + else + { + // no new buffer could be created - leave the old one + return &m_bsSizes; + } + } + else + { + // succeeded + Delete(); // get rid of old buffer + + // store data + m_pBuffer=static_cast(pBuffer); + m_uiRealSize=uiRealSize; + m_bsSizes=bsSizes; + + return &m_bsSizes; + } +} + +void CDataBuffer::Delete() +{ + if (m_pBuffer != NULL) + { + VirtualFree(static_cast(m_pBuffer), m_uiRealSize, MEM_DECOMMIT); + m_pBuffer=NULL; + m_uiRealSize=0; + m_bsSizes.m_uiDefaultSize=0; + m_bsSizes.m_uiOneDiskSize=0; + m_bsSizes.m_uiTwoDisksSize=0; + m_bsSizes.m_uiCDSize=0; + m_bsSizes.m_uiLANSize=0; + } +} \ No newline at end of file Index: Copy Handler/DataBuffer.h =================================================================== diff -u --- Copy Handler/DataBuffer.h (revision 0) +++ Copy Handler/DataBuffer.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,86 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __DATABUFFER_H__ +#define __DATABUFFER_H__ + +#define DEFAULT_SIZE 65536 + +#define ROUNDTODS(number)\ + ((number + DEFAULT_SIZE - 1) & ~(DEFAULT_SIZE-1)) + +#define ROUNDUP(number, to)\ + ((number + to - 1) & ~(to-1)) + +#define ROUNDDOWN(number, to)\ + (number & ~(to-1)) + +#define BI_DEFAULT 0 +#define BI_ONEDISK 1 +#define BI_TWODISKS 2 +#define BI_CD 3 +#define BI_LAN 4 + +#pragma warning (disable: 4201) +struct BUFFERSIZES +{ + void Serialize(CArchive& ar); + bool operator==(const BUFFERSIZES& bsSizes) const; + union + { + struct + { + UINT m_uiDefaultSize; // default buffer size + UINT m_uiOneDiskSize; // inside one disk boundary + UINT m_uiTwoDisksSize; // two disks + UINT m_uiCDSize; // CD<->anything + UINT m_uiLANSize; // LAN<->anything + }; + UINT m_auiSizes[5]; + }; + bool m_bOnlyDefault; +}; +#pragma warning (default: 4201) + +class CDataBuffer +{ +public: + CDataBuffer() { m_pBuffer=NULL; m_uiRealSize=0; m_bsSizes.m_uiDefaultSize=0; m_bsSizes.m_uiOneDiskSize=0; m_bsSizes.m_uiTwoDisksSize=0; m_bsSizes.m_uiCDSize=0; m_bsSizes.m_uiLANSize=0; m_bsSizes.m_bOnlyDefault=false; }; + ~CDataBuffer() { Delete(); }; + + const BUFFERSIZES* Create(const BUFFERSIZES* pbsSizes); // (re)allocates the buffer; if there's an error - restores previous buffer size + void Delete(); // deletes buffer + + UINT GetRealSize() { return m_uiRealSize; }; + UINT GetDefaultSize() { return m_bsSizes.m_uiDefaultSize; }; + UINT GetOneDiskSize() { return m_bsSizes.m_uiOneDiskSize; }; + UINT GetTwoDisksSize() { return m_bsSizes.m_uiTwoDisksSize; }; + UINT GetCDSize() { return m_bsSizes.m_uiCDSize; }; + UINT GetLANSize() { return m_bsSizes.m_uiLANSize; }; + const BUFFERSIZES* GetSizes() { return &m_bsSizes; }; + + // operators + operator unsigned char*() { return m_pBuffer; }; +protected: + unsigned char *m_pBuffer; // buffer address + UINT m_uiRealSize; // real buffer size + BUFFERSIZES m_bsSizes; +}; + +#endif \ No newline at end of file Index: Copy Handler/DestPath.cpp =================================================================== diff -u --- Copy Handler/DestPath.cpp (revision 0) +++ Copy Handler/DestPath.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,88 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "DestPath.h" + +void GetDriveData(LPCTSTR lpszPath, int* piDrvNum, UINT* puiDrvType) +{ + TCHAR drv[_MAX_DRIVE+1]; + + _tsplitpath(lpszPath, drv, NULL, NULL, NULL); + if(lstrlen(drv) != 0) + { + // add '\\' + lstrcat(drv, _T("\\")); + _tcsupr(drv); + + // disk number + if (piDrvNum) + *piDrvNum=drv[0]-_T('A'); + + // disk type + if (puiDrvType) + { + *puiDrvType=GetDriveType(drv); + if (*puiDrvType == DRIVE_NO_ROOT_DIR) + *puiDrvType=DRIVE_UNKNOWN; + } + } + else + { + // there's no disk in a path + if (piDrvNum) + *piDrvNum=-1; + + if (puiDrvType) + { + // check for unc path + if (_tcsncmp(lpszPath, _T("\\\\"), 2) == 0) + *puiDrvType=DRIVE_REMOTE; + else + *puiDrvType=DRIVE_UNKNOWN; + } + } +} + +void CDestPath::SetPath(LPCTSTR lpszPath) +{ + m_strPath=lpszPath; + + // make sure '\\' has been added + if (m_strPath.Right(1) != _T('\\')) + m_strPath+=_T('\\'); + + GetDriveData(m_strPath, &m_iDriveNumber, &m_uiDriveType); +} + +void CDestPath::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + ar<>m_strPath; + ar>>m_iDriveNumber; + ar>>m_uiDriveType; + } +} Index: Copy Handler/DestPath.h =================================================================== diff -u --- Copy Handler/DestPath.h (revision 0) +++ Copy Handler/DestPath.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __DESTPATH_H__ +#define __DESTPATH_H__ + +class CDestPath +{ +public: + CDestPath() { m_iDriveNumber=-1; m_uiDriveType=static_cast(-1); }; + void SetPath(LPCTSTR lpszPath); + const CString& GetPath() const { return m_strPath; }; + + int GetDriveNumber() const { return m_iDriveNumber; }; + UINT GetDriveType() const { return m_uiDriveType; }; + + void Serialize(CArchive& ar); + +protected: + CString m_strPath; // always with ending '\\' + int m_iDriveNumber; // initialized within setpath (std -1) + UINT m_uiDriveType; // disk type - -1 if none, the rest like in GetDriveType +}; + +#endif \ No newline at end of file Index: Copy Handler/Device IO.h =================================================================== diff -u --- Copy Handler/Device IO.h (revision 0) +++ Copy Handler/Device IO.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,179 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#define VWIN32_DIOC_DOS_IOCTL 1 + +typedef struct _DEVIOCTL_REGISTERS +{ + DWORD reg_EBX; + DWORD reg_EDX; + DWORD reg_ECX; + DWORD reg_EAX; + DWORD reg_EDI; + DWORD reg_ESI; + DWORD reg_Flags; +} DEVIOCTL_REGISTERS, *PDEVIOCTL_REGISTERS; + +#pragma pack(1) +typedef struct _DRIVE_MAP_INFO +{ + BYTE dmiAllocationLength; + BYTE dmiInfoLength; + BYTE dmiFlags; + BYTE dmiInt13Unit; + DWORD dmiAssociatedDriveMap; + ULONGLONG dmiPartitionStartRBA; +} DRIVE_MAP_INFO, *PDRIVE_MAP_INFO; +#pragma pack() + +// only 9x +BOOL GetDriveMapInfo(UINT nDrive, PDRIVE_MAP_INFO pdmi) +{ + DEVIOCTL_REGISTERS reg, *preg; + reg.reg_EAX = 0x440D; // IOCTL for block devices + reg.reg_EBX = nDrive; // zero-based drive ID + reg.reg_ECX = 0x086f; // Get Media ID command + reg.reg_EDX = (DWORD)pdmi; // receives media ID info + preg=® + + preg->reg_Flags = 0x8000; // assume error (carry flag set) + + HANDLE hDevice = CreateFile("\\\\.\\vwin32", + GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, + (LPSECURITY_ATTRIBUTES) NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, (HANDLE) NULL); + + if (hDevice == (HANDLE)INVALID_HANDLE_VALUE) + { + return FALSE; + } + else + { + DWORD cb; + BOOL fResult = DeviceIoControl(hDevice, VWIN32_DIOC_DOS_IOCTL, + preg, sizeof(*preg), preg, sizeof(*preg), &cb, 0); + + if (!fResult) + { + CloseHandle(hDevice); + return FALSE; + } + } + + CloseHandle(hDevice); + + return TRUE; +} + +// only NT +bool GetSignature(LPCTSTR lpszDrive, LPTSTR lpszBuffer, int iSize) +{ + TCHAR szMapping[1024], szQuery[16384], szSymbolic[1024]; + + // read mappings + if (QueryDosDevice(lpszDrive, szMapping, 1024) == 0) + return false; + + // search for all, to find out in which string is the signature + int iCount, iCount2; + if ((iCount=QueryDosDevice(NULL, szQuery, 16384)) == 0) + { + TRACE("Encountered error #%lu @QueryDosDevice\n", GetLastError()); + return false; + } + + int iOffset=0, iOffset2=0; + TCHAR *pszSignature, *pszOffset; + while (iOffset < iCount) + { + if ((iCount2=QueryDosDevice(szQuery+iOffset, szSymbolic, 1024)) == 0) + return false; + + // read values from szSymbolic and compare with szMapping + iOffset2=0; + while (iOffset2 < iCount2) + { + // compare szSymbolic+iOffset2 with szMapping + if (_tcscmp(szMapping, szSymbolic+iOffset2) == 0 + && _tcsncmp(szQuery+iOffset, _T("STORAGE#Volume#"), _tcslen("STORAGE#Volume#")) == 0) + { + // now search for 'Signature' and extract (from szQuery+iOffset) + pszSignature=_tcsstr(szQuery+iOffset, _T("Signature")); + if (pszSignature == NULL) + continue; + pszOffset=_tcsstr(pszSignature, _T("Offset")); + if (pszOffset == NULL) + continue; + + // for better string copying + pszOffset[0]=_T('\0'); + + // found Signature & Offset - copy + int iCnt=reinterpret_cast(pszOffset)-reinterpret_cast(pszSignature)+1; + _tcsncpy(lpszBuffer, pszSignature, (iCnt > iSize) ? iSize : iCnt); + return true; + } + + iOffset2+=_tcslen(szSymbolic)+1; + } + + iOffset+=_tcslen(szQuery+iOffset)+1; + } + + return false; +} + +// at 9x function checks int13h devices and at NT within symbolic links +bool IsSamePhysicalDisk(int iDrvNum1, int iDrvNum2) +{ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize=sizeof(OSVERSIONINFO); + + GetVersionEx(&osvi); + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + { + DRIVE_MAP_INFO dmi1, dmi2; + dmi1.dmiAllocationLength=sizeof(DRIVE_MAP_INFO); + dmi1.dmiInt13Unit=0xff; + dmi2.dmiAllocationLength=sizeof(DRIVE_MAP_INFO); + dmi2.dmiInt13Unit=0xff; + + // iDrvNum is 0-based, and we need 1-based + if (!GetDriveMapInfo(iDrvNum1+1, &dmi1) || !GetDriveMapInfo(iDrvNum2+1, &dmi2) || dmi1.dmiInt13Unit != dmi2.dmiInt13Unit || dmi1.dmiInt13Unit == 0xff) + return false; + else + return true; + } + else if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + TCHAR drv1[3], drv2[3]; + + drv1[0]=static_cast(iDrvNum1+_T('A')); + drv1[1]=_T(':'); + drv1[2]=_T('\0'); + drv2[0]=static_cast(iDrvNum2+_T('A')); + drv2[1]=_T(':'); + drv2[2]=_T('\0'); + + TCHAR szSign1[512], szSign2[512]; + return (GetSignature(drv1, szSign1, 512) && GetSignature(drv2, szSign2, 512) && _tcscmp(szSign1, szSign2) == 0); + } + + return false; +} Index: Copy Handler/Dialogs.cpp =================================================================== diff -u --- Copy Handler/Dialogs.cpp (revision 0) +++ Copy Handler/Dialogs.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,63 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "dialogs.h" + +bool BrowseForFolder(LPCTSTR lpszTitle, CString* pResult) +{ + // code allows browsing on all disks + LPMALLOC pMalloc; + TCHAR pszBuffer[MAX_PATH]; + sprintf(pszBuffer, "c:\\windows\\system"); + bool retval=false; + + /* Gets the Shell's default allocator */ + if (::SHGetMalloc(&pMalloc) == NOERROR) + { + BROWSEINFO bi; + LPITEMIDLIST pidl; + + // Get help on BROWSEINFO struct - it's got all the bit settings. + bi.hwndOwner = NULL; + bi.pidlRoot = NULL; + bi.pszDisplayName = pszBuffer; + bi.lpszTitle = lpszTitle; + bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; + bi.lpfn = NULL; + bi.lParam = 0; + + // This next call issues the dialog box. + if ((pidl = ::SHBrowseForFolder(&bi)) != NULL) + { + if (::SHGetPathFromIDList(pidl, pszBuffer)) + { + *pResult=pszBuffer; + retval=true; + } + + // Free the PIDL allocated by SHBrowseForFolder. + pMalloc->Free(pidl); + } + // Release the shell's allocator. + pMalloc->Release(); + } + + return retval; +} Index: Copy Handler/Dialogs.h =================================================================== diff -u --- Copy Handler/Dialogs.h (revision 0) +++ Copy Handler/Dialogs.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,27 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __DIALOGS_H__ +#define __DIALOGS_H__ + +#include "shlobj.h" + +bool BrowseForFolder(LPCTSTR lpszTitle, CString* pResult); + +#endif \ No newline at end of file Index: Copy Handler/DirTreeCtrl.cpp =================================================================== diff -u --- Copy Handler/DirTreeCtrl.cpp (revision 0) +++ Copy Handler/DirTreeCtrl.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1141 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "DirTreeCtrl.h" +#include "afxtempl.h" +#include "memdc.h" +#include "shlobj.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define WM_INITCONTROL WM_USER+7 + +LPITEMIDLIST Next(LPCITEMIDLIST pidl) +{ + LPSTR lpMem=(LPSTR)pidl; + + lpMem+=pidl->mkid.cb; + + return (LPITEMIDLIST)lpMem; +} + +UINT GetSize(LPCITEMIDLIST pidl) +{ + UINT cbTotal = 0; + if (pidl) + { + cbTotal += sizeof(pidl->mkid.cb); // Null terminator + while (pidl->mkid.cb) + { + cbTotal += pidl->mkid.cb; + pidl = Next(pidl); + } + } + + return cbTotal; +} + +LPITEMIDLIST CreatePidl(UINT cbSize) +{ + LPMALLOC lpMalloc; + HRESULT hr; + LPITEMIDLIST pidl=NULL; + + hr=SHGetMalloc(&lpMalloc); + + if (FAILED(hr)) + return 0; + + pidl=(LPITEMIDLIST)lpMalloc->Alloc(cbSize); + + if (pidl) + memset(pidl, 0, cbSize); // zero-init for external task alloc + + if (lpMalloc) lpMalloc->Release(); + + return pidl; +} + +void FreePidl(LPITEMIDLIST lpiidl) +{ + LPMALLOC lpMalloc; + HRESULT hr; + + hr=SHGetMalloc(&lpMalloc); + + if (FAILED(hr)) + return; + + lpMalloc->Free(lpiidl); + + if (lpMalloc) lpMalloc->Release(); +} + +LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) +{ + LPITEMIDLIST pidlNew; + UINT cb1; + UINT cb2; + + if (pidl1) //May be NULL + cb1 = GetSize(pidl1) - sizeof(pidl1->mkid.cb); + else + cb1 = 0; + + cb2 = GetSize(pidl2); + + pidlNew = CreatePidl(cb1 + cb2); + if (pidlNew) + { + if (pidl1) + memcpy(pidlNew, pidl1, cb1); + memcpy(((LPSTR)pidlNew) + cb1, pidl2, cb2); + } + return pidlNew; +} + +LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi) +{ + LPITEMIDLIST lpiTemp; + + lpiTemp=(LPITEMIDLIST)lpMalloc->Alloc(lpi->mkid.cb+sizeof(lpi->mkid.cb)); + CopyMemory((PVOID)lpiTemp, (CONST VOID *)lpi, lpi->mkid.cb+sizeof(lpi->mkid.cb)); + + return lpiTemp; +} + +BOOL GetName(LPSHELLFOLDER lpsf, + LPITEMIDLIST lpi, + DWORD dwFlags, + LPSTR lpFriendlyName) +{ + BOOL bSuccess=TRUE; + STRRET str; + + if (NOERROR==lpsf->GetDisplayNameOf(lpi,dwFlags, &str)) + { + switch (str.uType) + { + case STRRET_WSTR: + + WideCharToMultiByte(CP_ACP, // CodePage + 0, // dwFlags + str.pOleStr, // lpWideCharStr + -1, // cchWideChar + lpFriendlyName, // lpMultiByteStr + MAX_PATH, + //sizeof(lpFriendlyName), // cchMultiByte, wrong. sizeof on a pointer, psk, psk + NULL, // lpDefaultChar, + NULL); // lpUsedDefaultChar + + break; + + case STRRET_OFFSET: + + lstrcpy(lpFriendlyName, (LPSTR)lpi+str.uOffset); + break; + + case STRRET_CSTR: + + lstrcpy(lpFriendlyName, (LPSTR)str.cStr); + break; + + default: + bSuccess = FALSE; + break; + } + } + else + bSuccess = FALSE; + + return bSuccess; +} + +LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi) +{ + char szBuff[MAX_PATH]; + OLECHAR szOleChar[MAX_PATH]; + LPSHELLFOLDER lpsfDeskTop; + LPITEMIDLIST lpifq; + ULONG ulEaten, ulAttribs; + HRESULT hr; + + if (!GetName(lpsf, lpi, SHGDN_FORPARSING, szBuff)) + return NULL; + + hr=SHGetDesktopFolder(&lpsfDeskTop); + + if (FAILED(hr)) + return NULL; + + MultiByteToWideChar(CP_ACP, + MB_PRECOMPOSED, + szBuff, + -1, + (USHORT *)szOleChar, + sizeof(szOleChar)); + + hr=lpsfDeskTop->ParseDisplayName(NULL, + NULL, + szOleChar, + &ulEaten, + &lpifq, + &ulAttribs); + + lpsfDeskTop->Release(); + + if (FAILED(hr)) + return NULL; + + return lpifq; +} + +///////////////////////////////////////////////////////////////////////////// +// CDirTreeCtrl + +CDirTreeCtrl::CDirTreeCtrl() +{ + m_hDrives=NULL; + m_hNetwork=NULL; + m_hImageList=NULL; + m_bIgnore=false; + m_iEditType=0; +// RegisterWindowClass(); +} +/* +bool CDirTreeCtrl::RegisterWindowClass() +{ + WNDCLASS wndcls; + HINSTANCE hInst = AfxGetInstanceHandle(); + + if (!(::GetClassInfo(hInst, DIRTREECTRL_CLASSNAME, &wndcls))) + { + // otherwise we need to register a new class + wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + wndcls.lpfnWndProc = ::DefWindowProc; + wndcls.cbClsExtra = wndcls.cbWndExtra = 0; + wndcls.hInstance = hInst; + wndcls.hIcon = NULL; + wndcls.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW); + wndcls.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1); + wndcls.lpszMenuName = NULL; + wndcls.lpszClassName = DIRTREECTRL_CLASSNAME; + + if (!AfxRegisterClass(&wndcls)) + { + AfxThrowResourceException(); + return false; + } + } + + return true; +} +*/ +CDirTreeCtrl::~CDirTreeCtrl() +{ +} + + +BEGIN_MESSAGE_MAP(CDirTreeCtrl, CTreeCtrl) + //{{AFX_MSG_MAP(CDirTreeCtrl) + ON_WM_DESTROY() + ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding) + ON_NOTIFY_REFLECT(TVN_DELETEITEM, OnDeleteitem) + ON_NOTIFY_REFLECT(TVN_ITEMEXPANDED, OnItemexpanded) + ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnEndlabeledit) + ON_NOTIFY_REFLECT(TVN_BEGINLABELEDIT, OnBeginLabelEdit) + ON_WM_ERASEBKGND() + ON_WM_PAINT() + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CDirTreeCtrl message handlers + +///////////////////////////////////////////////////////////////////////////// +// inicjalizacja +void CDirTreeCtrl::PreSubclassWindow() +{ +// InitControl(); // here's not needed (strange ??) + CTreeCtrl::PreSubclassWindow(); +} + +int CDirTreeCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + if (CTreeCtrl::OnCreate(lpCreateStruct) == -1) + return -1; + + InitControl(); + + return 0; +} + +void CDirTreeCtrl::InitControl() +{ + // prepare image list + SHFILEINFO sfi; + m_hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + + TreeView_SetImageList(this->m_hWnd, m_hImageList, TVSIL_NORMAL); + + // insert desktop icon + InsertDesktopItem(); + + // expanding, ... + PostMessage(WM_INITCONTROL); +} + +///////////////////////////////////////////////////////////////////////////// +// wstawia ikon� pulpitu +HTREEITEM CDirTreeCtrl::InsertDesktopItem() +{ + // clear treectrl - it shouldn't be more than 1 desktop + if (!DeleteAllItems()) + return NULL; + + // clear vars + m_hDrives=NULL; + m_hNetwork=NULL; + + // fill with items + SHFILEINFO sfi; + LPSHELLFOLDER lpsfDesktop; + LPITEMIDLIST lpiidlDesktop; + if (FAILED(SHGetDesktopFolder(&lpsfDesktop))) + return NULL; + if (SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_DESKTOP, &lpiidlDesktop) != NOERROR) + return NULL; + + // add desktop + TVITEM tvi; + TVINSERTSTRUCT tvis; + TCHAR szText[_MAX_PATH]; + _SHELLITEMDATA *psid=new _SHELLITEMDATA; + psid->lpiidl=lpiidlDesktop; + psid->lpsf=lpsfDesktop; + psid->lpiidlRelative=NULL; + psid->lpsfParent=NULL; + + tvi.mask=TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM; + if (!GetName(lpsfDesktop, lpiidlDesktop, 0/*SHGDN_INCLUDE_NONFILESYS*/, szText)) + lstrcpy(szText, _T("???")); + tvi.pszText=szText; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)lpiidlDesktop, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + tvi.iImage=sfi.iIcon; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)lpiidlDesktop, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON); + tvi.iSelectedImage=sfi.iIcon; + tvi.cChildren=1; + tvi.lParam=reinterpret_cast(psid); + + tvis.hParent=TVI_ROOT; + tvis.item=tvi; + return InsertItem(&tvis); +} + +////////////////////////////////////////////////////////////////////////////// +// processes WM_INITCONTROL +LRESULT CDirTreeCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + switch(message) + { + case WM_INITCONTROL: + ExpandItem(GetRootItem(), TVE_EXPAND); + break; + case WM_SETPATH: + SetPath((LPCTSTR)lParam); + break; + } + + return CTreeCtrl::WindowProc(message, wParam, lParam); +} + +//////////////////////////////////////////////////////////////////////////// +// enables image list, ... +void CDirTreeCtrl::OnDestroy() +{ + SetImageList(NULL, LVSIL_SMALL); + CTreeCtrl::OnDestroy(); +} + +//////////////////////////////////////////////////////////////////////////// +// compares two items +int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM/* lParamSort*/) +{ + // je�li si� nie da + if (lParam1 == NULL || lParam2 == NULL) + return 0; + + // normalne przetwarzanie + SHELLITEMDATA* psidl1=(SHELLITEMDATA*)lParam1, *psidl2=(SHELLITEMDATA*)lParam2; + + LPSHELLFOLDER lpsf; + if (SHGetDesktopFolder(&lpsf) != NOERROR) + return 0; + + HRESULT hRes=lpsf->CompareIDs(0, psidl1->lpiidl, psidl2->lpiidl); + if (!SUCCEEDED(hRes)) + return 0; + + lpsf->Release(); + + return (short)SCODE_CODE(GetScode(hRes)); +} + +///////////////////////////////////////////////////////////////////////////// +// fills a hParent node with items starting with lpsf and lpdil for this item +bool CDirTreeCtrl::FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent) +{ + // get the global flag under consideration + if (m_bIgnoreShellDialogs) + bSilent=m_bIgnoreShellDialogs; + + // get the desktop interface and id's of list for net neigh. and my computer + LPSHELLFOLDER lpsfDesktop=NULL; + LPITEMIDLIST lpiidlDrives=NULL, lpiidlNetwork=NULL; + if (hParent == GetRootItem()) + { + SHGetDesktopFolder(&lpsfDesktop); + SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_DRIVES, &lpiidlDrives); + SHGetSpecialFolderLocation(this->GetSafeHwnd(), CSIDL_NETWORK, &lpiidlNetwork); + } + + LPITEMIDLIST lpiidl; + SHFILEINFO sfi; + ULONG ulAttrib; + TVITEM tvi; + TVINSERTSTRUCT tvis; + _SHELLITEMDATA *psid; + TCHAR szText[_MAX_PATH]; + LPENUMIDLIST lpeid=NULL; + HTREEITEM hCurrent=NULL; + bool bFound=false; + + // shell allocator + LPMALLOC lpm; + if (SHGetMalloc(&lpm) != NOERROR) + return false; + + // enumerate child items for lpsf + if (lpsf->EnumObjects(bSilent ? NULL : GetParent()->GetSafeHwnd(), SHCONTF_FOLDERS | SHCONTF_INCLUDEHIDDEN, &lpeid) != NOERROR) + return false; + + while (lpeid->Next(1, &lpiidl, NULL) == NOERROR) + { + // filer what has been found + ulAttrib=SFGAO_FOLDER | SFGAO_HASSUBFOLDER | SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; + lpsf->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lpiidl, &ulAttrib); + if (ulAttrib & SFGAO_FOLDER && (ulAttrib & SFGAO_FILESYSANCESTOR || ulAttrib & SFGAO_FILESYSTEM) ) + { + // there's something to add so set bFound + bFound=true; + + // it's time to add everything + psid=new _SHELLITEMDATA; + lpsf->BindToObject(lpiidl, NULL, IID_IShellFolder, (void**)&psid->lpsf); + psid->lpiidl=ConcatPidls(lpidl, lpiidl); + psid->lpiidlRelative=CopyITEMID(lpm, lpiidl); + psid->lpsfParent=lpsf; + + tvi.mask=TVIF_CHILDREN | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT | TVIF_PARAM; + if (!GetName(lpsf, lpiidl, SHGDN_INFOLDER/* | SHGDN_INCLUDE_NONFILESYS*/, szText)) + lstrcpy(szText, _T("???")); + tvi.pszText=szText; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + tvi.iImage=sfi.iIcon; + sfi.iIcon=-1; + SHGetFileInfo((LPCTSTR)psid->lpiidl, 0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_OPENICON); + tvi.iSelectedImage=sfi.iIcon; + tvi.cChildren=(ulAttrib & SFGAO_HASSUBFOLDER); + tvi.lParam=reinterpret_cast(psid); + + tvis.hParent=hParent; + tvis.item=tvi; + hCurrent=InsertItem(&tvis); + + if (hParent == GetRootItem()) + { + // if this is My computer or net. neigh. - it's better to remember the handles + // compare psid->lpiidl and (lpiidlDrives & lpiidlNetwork) + if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlDrives)) == 0) + m_hDrives=hCurrent; + else if (SCODE_CODE(lpsfDesktop->CompareIDs(0, psid->lpiidl, lpiidlNetwork)) == 0) + m_hNetwork=hCurrent; + } + + FreePidl(lpiidl); // free found pidl - it was copied already + } + } + + if (lpeid) + lpeid->Release(); + + if (lpsfDesktop) + lpsfDesktop->Release(); + + lpm->Release(); + + // sortuj + if (bFound) + { + TVSORTCB tvscb; + tvscb.hParent=hParent; + tvscb.lpfnCompare=&CompareFunc; + tvscb.lParam=NULL; + if (!SortChildrenCB(&tvscb)) + TRACE("SortChildren failed\n"); + } + else + { + // some items has + and some not - correction + TVITEM tvi; + tvi.mask=TVIF_HANDLE | TVIF_CHILDREN; + tvi.hItem=hParent; + if (GetItem(&tvi) && tvi.cChildren == 1) + { + tvi.cChildren=0; + SetItem(&tvi); + } + } + + return bFound; +} + +//////////////////////////////////////////////////////////////////////////// +// alternate function for Expand(), makes additional processing +bool CDirTreeCtrl::ExpandItem(HTREEITEM hItem, UINT nCode) +{ + switch(nCode) + { + case TVE_EXPAND: + { + // get the item's data + TVITEM tvi; + tvi.mask=TVIF_PARAM | TVIF_STATE; + tvi.hItem=hItem; + tvi.stateMask=TVIS_EXPANDEDONCE | TVIS_SELECTED | TVIS_EXPANDED; + if (!GetItem(&tvi)) + return false; + + if (tvi.state & TVIS_EXPANDED) + return true; + + // Fill node before normal expanding + SHELLITEMDATA* psid; + if (GetItemStruct(hItem, &psid)) + { + if (!FillNode(hItem, psid->lpsf, psid->lpiidl, true)) + TRACE("FillNode in ExpandItem failed...\n"); + + // ignore fillnode in onitemexpanding + m_bIgnore=true; + } + + // normal expand + EnsureVisible(hItem); + SelectItem(hItem); + return Expand(hItem, TVE_EXPAND) != 0; + + break; + } + default: + return Expand(hItem, nCode) != 0; + } +} + +///////////////////////////////////////////////////////////////////////////// +// node expand handling - calls FillNode +void CDirTreeCtrl::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + _SHELLITEMDATA* psid=reinterpret_cast<_SHELLITEMDATA*>(pNMTreeView->itemNew.lParam); + + switch (pNMTreeView->action) + { + case TVE_EXPAND: + if (!m_bIgnore) + { + // fill + if (!FillNode(pNMTreeView->itemNew.hItem, psid->lpsf, psid->lpiidl)) + TRACE("FillNode failed...\n"); + } + else + { + // now refresh normally + m_bIgnore=false; + } + break; + } + + *pResult = 0; +} + +//////////////////////////////////////////////////////////////////////////// +// deleting items after node collapses +void CDirTreeCtrl::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + + switch (pNMTreeView->action) + { + case TVE_COLLAPSE: + if (ItemHasChildren(pNMTreeView->itemNew.hItem)) + { + HTREEITEM hItem; + while ((hItem=GetChildItem(pNMTreeView->itemNew.hItem)) != NULL) + DeleteItem(hItem); + } + + break; + } + + *pResult = 0; +} + +////////////////////////////////////////////////////////////////////////////// +// deletes everything what has been allocated for an item +void CDirTreeCtrl::OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + _SHELLITEMDATA *psid=reinterpret_cast<_SHELLITEMDATA*>(pNMTreeView->itemOld.lParam); + + if (psid) + { + psid->lpsf->Release(); + FreePidl(psid->lpiidl); + FreePidl(psid->lpiidlRelative); + delete psid; + } + + *pResult = 0; +} + +/////////////////////////////////////////////////////////////////////////// +// returns path associated with an item +bool CDirTreeCtrl::GetPath(HTREEITEM hItem, LPTSTR pszPath) +{ + TVITEM tvi; + tvi.mask=TVIF_HANDLE | TVIF_PARAM; + tvi.hItem=hItem; + + if (GetItem(&tvi)) + { + // item data + _SHELLITEMDATA* psid=reinterpret_cast<_SHELLITEMDATA*>(tvi.lParam); + if (psid == NULL) + return false; + + // desktop interface + LPSHELLFOLDER lpsf; + if (SHGetDesktopFolder(&lpsf) != NOERROR) + return false; + + if (!SHGetPathFromIDList(psid->lpiidl, pszPath)) + { + lpsf->Release(); + return false; + } + + lpsf->Release(); + return true; + } + else + return false; +} + +//////////////////////////////////////////////////////////////////////////// +// finds the item that is nearest to a given path - returns true if find +// even a part of a path +bool CDirTreeCtrl::SetPath(LPCTSTR lpszPath) +{ + ASSERT(lpszPath); + + // if path is empty + if (_tcscmp(lpszPath, _T("")) == 0) + return false; + + // type of path + bool bNetwork=_tcsncmp(lpszPath, _T("\\\\"), 2) == 0; + + if (!bNetwork) + return SetLocalPath(lpszPath); + else + { + // we don't look in net neighbourhood for speed reasons + EnsureVisible(m_hNetwork); +// SelectItem(m_hNetwork); +// ExpandItem(m_hNetwork, TVE_EXPAND); + return true; + } +} + + +/////////////////////////////////////////////////////////////////////////// +// sets the local path - not network +bool CDirTreeCtrl::SetLocalPath(LPCTSTR lpszPath) +{ + // expand desktop and my computer + HTREEITEM hItem=GetRootItem(); + ExpandItem(hItem, TVE_EXPAND); + ExpandItem(m_hDrives, TVE_EXPAND); + + HTREEITEM hFound=RegularSelect(m_hDrives, lpszPath); + if (hFound) + { + EnsureVisible(hFound); + SelectItem(hFound); + ExpandItem(hFound, TVE_EXPAND); + } + + return hFound != NULL; +} + +///////////////////////////////////////////////////////////////////////////// +// sets network path +/* +bool CDirTreeCtrl::SetRemotePath(LPCTSTR lpszPath) +{ + // expand desktop and net neigh + HTREEITEM hItem=GetRootItem(); + ExpandItem(hItem, TVE_EXPAND); + ExpandItem(m_hNetwork, TVE_EXPAND); + + // find root + TCHAR szBuffer[2048]; + NETRESOURCE* pnr; + CArray m_ahRoots; // root's list + bool bSkipRootChecks=false; + HTREEITEM hRoot=GetChildItem(m_hNetwork); + while(hRoot) + { + if (!GetItemShellData(hRoot, SHGDFIL_NETRESOURCE, szBuffer, 2048)) + { + // problem with NETRESOURCE - find next + hRoot=GetNextSiblingItem(hRoot); + continue; + } + + // got NETRESOURCE + pnr=(NETRESOURCE*)szBuffer; + if (pnr->dwDisplayType == RESOURCEDISPLAYTYPE_ROOT) + m_ahRoots.Add(hRoot); + else if (pnr->dwDisplayType == RESOURCEDISPLAYTYPE_SHARE) + { + if (ComparePaths(lpszPath, pnr->lpRemoteName)) + { + bSkipRootChecks=true; // skip II phase + break; // hRoot contains handle to an item from which we need to start searching from + } + } + + // next to check + hRoot=GetNextSiblingItem(hRoot); + } + + // II phase: net neigh tree traversation + if (!bSkipRootChecks) + { + hRoot=NULL; + HTREEITEM hNode; + TCHAR szBuffer[2048]; + for (int i=0;i(tvi.lParam); + + if (SHGetPathFromIDList(psid->lpiidl, szPath)) + { + if (ComparePaths(lpszPath, szPath)) + { + // it's contained - expand + ExpandItem(hItem, TVE_EXPAND); + hLast=hItem; // remember last that matches path + + hItem=GetChildItem(hItem); // another 'zoom' + continue; + } + } + } + + // next folder + hItem=GetNextSiblingItem(hItem); + } + + // return what has been found + return hLast; +} +//////////////////////////////////////////////////////////////////////////// +// helper - finds comp in a network that matches the path. Skips all the +// workgroups, network names, ... +/* +HTREEITEM CDirTreeCtrl::TraverseNetNode(HTREEITEM hItem, LPCTSTR lpszPath, LPTSTR lpszBuffer) +{ + // start with 1st chil item + HTREEITEM hNext=GetChildItem(hItem); + NETRESOURCE *pnet; + + while (hNext) + { + // get NETRESOURCE structure - is this a server ? + if (GetItemShellData(hNext, SHGDFIL_NETRESOURCE, lpszBuffer, 2048)) + { + // got NETRESOURCE + pnet=(NETRESOURCE*)lpszBuffer; + + // is the path contained + if (ComparePaths(lpszPath, pnet->lpRemoteName)) + return hNext; // found what's needed + + if (pnet->dwDisplayType != RESOURCEDISPLAYTYPE_SERVER) + { + // expand + if (!ExpandItem(hNext, TVE_EXPAND)) + return NULL; + + // recurse + HTREEITEM hFound; + if ( (hFound=TraverseNetNode(hNext, lpszPath, lpszBuffer)) != NULL) + return hFound; // if found - return, if not - continue search + } + } + + // next item to check. + hNext=GetNextSiblingItem(hNext); + } + + return NULL; // nothing has been found +} +*/ +//////////////////////////////////////////////////////////////////////////// +// compares two paths - if one is contained in another (to the first '\\' or '/' +bool CDirTreeCtrl::ComparePaths(LPCTSTR lpszFull, LPCTSTR lpszPartial) +{ + CString strSrc=lpszFull, strFnd=lpszPartial; + strFnd.MakeUpper(); + strFnd.TrimRight(_T("\\/")); + + // make uppercas the source string, cut before nearest \\ or / after strFnd.GetLength + strSrc.MakeUpper(); + + // find out the position of a nearest / lub '\\' + int iLen=strFnd.GetLength(), iPos; + if (strSrc.GetLength() >= iLen) + { + iPos=strSrc.Mid(iLen).FindOneOf(_T("\\/")); + if (iPos != -1) + strSrc=strSrc.Left(iPos+iLen); + + return strSrc == strFnd; + } + else + return false; +} + +//////////////////////////////////////////////////////////////////////////// +// returns shell description for an item (like in explorer). +bool CDirTreeCtrl::GetItemInfoTip(HTREEITEM hItem, CString* pTip) +{ + _SHELLITEMDATA* psid=(_SHELLITEMDATA*)GetItemData(hItem); + if (psid == NULL || psid->lpiidlRelative == NULL || psid->lpsfParent == NULL) + return false; + + // get interface + IQueryInfo *pqi; + if (psid->lpsfParent->GetUIObjectOf(this->GetSafeHwnd(), 1, (const struct _ITEMIDLIST**)&psid->lpiidlRelative, IID_IQueryInfo, 0, (void**)&pqi) != NOERROR) + return false; + + // get tip + WCHAR *pszTip; + if (pqi->GetInfoTip(0, &pszTip) != NOERROR) + { + pqi->Release(); + return false; + } + + // copy with a conversion + *pTip=(const WCHAR *)pszTip; + + // uwolnij pami�� skojarzon� z pszTip + LPMALLOC lpm; + if (SHGetMalloc(&lpm) == NOERROR) + { + lpm->Free(pszTip); + lpm->Release(); + } + + pqi->Release(); + + return true; +} + +//////////////////////////////////////////////////////////////////////////// +// better exchange for SHGetDataFromIDList +bool CDirTreeCtrl::GetItemShellData(HTREEITEM hItem, int nFormat, PVOID pBuffer, int iSize) +{ + PSHELLITEMDATA psid; + if (!GetItemStruct(hItem, &psid) || psid->lpsfParent == NULL || psid->lpiidlRelative == NULL) + return false; + + return SHGetDataFromIDList(psid->lpsfParent, psid->lpiidlRelative, nFormat, pBuffer, iSize) == NOERROR; +} + +///////////////////////////////////////////////////////////////////////////// +// returns SHELLITEMDATA associated with an item +bool CDirTreeCtrl::GetItemStruct(HTREEITEM hItem, PSHELLITEMDATA *ppsid) +{ + ASSERT(ppsid); + *ppsid=(PSHELLITEMDATA)GetItemData(hItem); + return *ppsid != NULL; +} + +HTREEITEM CDirTreeCtrl::InsertNewFolder(HTREEITEM hParent, LPCTSTR /*lpszNewFolder*/) +{ + // check if HTREEITEM has an associated path + TCHAR szPath[_MAX_PATH]; + if (!GetPath(hParent, szPath)) + return NULL; + + // focus + SetFocus(); + + // if has child items - enumerate + TVITEM tvi; + tvi.mask=TVIF_HANDLE | TVIF_STATE | TVIF_CHILDREN; + tvi.hItem=hParent; + tvi.stateMask=TVIS_EXPANDED; + if (GetItem(&tvi)) + { + if (!(tvi.state & TVIS_EXPANDED)) + TRACE("InsertNewFolder's expanditem returned %u\n", ExpandItem(hParent, TVE_EXPAND)); + TRACE("%lu child items\n", tvi.cChildren); + } + + // if hParent doesn't have any chilren - add + to make it look like it hastak, aby wydawa�o si�, �e ma + if (!ItemHasChildren(hParent)) + { + tvi.mask=TVIF_HANDLE | TVIF_CHILDREN; + tvi.hItem=hParent; + tvi.cChildren=1; + if (!SetItem(&tvi)) + TRACE("SetItem failed...\n"); + } + + // temp buffer for a name + TCHAR *pszPath=new TCHAR[1]; + pszPath[0]=_T('\0'); + + // insert new item with an empty lParam + TVINSERTSTRUCT tvis; + tvis.hParent=hParent; + tvis.hInsertAfter=TVI_SORT; + tvis.item.mask=TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE; + tvis.item.iImage=-1; + tvis.item.iSelectedImage=-1; + tvis.item.pszText=pszPath; + tvis.item.cchTextMax=lstrlen(tvis.item.pszText); + tvis.item.lParam=NULL; + + HTREEITEM hRes=InsertItem(&tvis); + + delete [] pszPath; + + // now make sure hParent is expanded + Expand(hParent, TVE_EXPAND); + + // edit an item + if (hRes) + { + m_iEditType=1; + CEdit *pctlEdit=EditLabel(hRes); + if (pctlEdit == NULL) + return NULL; + } + + return hRes; +} + +void CDirTreeCtrl::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMTVDISPINFO* pdi = (NMTVDISPINFO*)pNMHDR; + + if (m_iEditType == 1) // for a new folder + { + if (pdi->item.pszText && _tcslen(pdi->item.pszText) != 0) + { + // no success at beginning + int iResult=0; + + // item - parent + HTREEITEM hParent=GetParentItem(pdi->item.hItem); + + // get parent folder name + TCHAR szPath[_MAX_PATH]; + if (!GetPath(hParent, szPath)) + { + // there's no path - skip + *pResult=0; + m_iEditType=0; + + // delete item + DeleteItem(pdi->item.hItem); + GetParent()->SendMessage(WM_CREATEFOLDERRESULT, 0, iResult); + return; + } + + // try to create folder + CString strPath=szPath; + if (strPath.Right(1) != _T('\\')) + strPath+=_T('\\'); + + // full path to the new folder + strPath+=pdi->item.pszText; + + // new folder + if (CreateDirectory(strPath, NULL)) + iResult = 1; + + // refresh - delete all from hParent and fill node + HTREEITEM hChild; + while ((hChild=GetChildItem(hParent)) != NULL) + DeleteItem(hChild); + + // now fillnode + SHELLITEMDATA* psid; + if (GetItemStruct(hParent, &psid)) + { + if (!FillNode(hParent, psid->lpsf, psid->lpiidl)) + TRACE("FillNode in EndEditLabel failed...\n"); + } + + hChild=GetChildItem(hParent); + while(hChild) + { + if (!GetPath(hChild, szPath)) + { + hChild=GetNextSiblingItem(hChild); + continue; + } + + if (_tcscmp(strPath, szPath) == 0) + { + // zaznacz + ExpandItem(hChild, TVE_EXPAND); + break; + } + + hChild=GetNextSiblingItem(hChild); + } + + + // another members + *pResult=1; + m_iEditType=0; + + GetParent()->SendMessage(WM_CREATEFOLDERRESULT, 0, iResult); + } + else + { + // no path - skip + *pResult=0; + m_iEditType=0; + + // delete an item + DeleteItem(pdi->item.hItem); + } + } + + *pResult = 0; +} + +void CDirTreeCtrl::OnBeginLabelEdit(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + if (m_iEditType == 1) + *pResult=0; + else + *pResult=1; +} + +BOOL CDirTreeCtrl::OnEraseBkgnd(CDC* /*pDC*/) +{ + return FALSE; +} + +void CDirTreeCtrl::OnPaint() +{ + CPaintDC dc(this); // device context for painting + CMemDC memdc(&dc, &dc.m_ps.rcPaint); + + DefWindowProc(WM_PAINT, (WPARAM)memdc.GetSafeHdc(), 0); +} + +void CDirTreeCtrl::SetIgnoreShellDialogs(bool bFlag) +{ + m_bIgnoreShellDialogs=bFlag; +} + +bool CDirTreeCtrl::GetIgnoreShellDialogs() +{ + return m_bIgnoreShellDialogs; +} Index: Copy Handler/DirTreeCtrl.h =================================================================== diff -u --- Copy Handler/DirTreeCtrl.h (revision 0) +++ Copy Handler/DirTreeCtrl.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,173 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + CDirTreeCtrl tree control + + Files: DirTreeCtrl.h, DirTreeCtrl.cpp + Author: Ixen Gerthannes + Usage: + Use it just as normal controls - place tree ctrl on your dialog and + subclass it. + Members: + Functions: + HTREEITEM InsertDesktopItem(); - initialisation - deletes + all items in a list, and inserts desktop root icon + bool ExpandItem(HTREEITEM hItem, UINT nCode); - replacement + for function Expand - does more processing - better; + UINT nCode just as in Expand(...) + bool GetPath(HTREEITEM hItem, LPTSTR pszPath); - returns file + system path (into pszPath) given HTREEITEM. + bool SetPath(LPCTSTR lpszPath); - try to select given path in + a directory tree. Returns true if whole path or a part of it + was selected. + bool GetItemInfoTip(HTREEITEM hItem, CString* pTip); - try to + get an explorer's tool tip text for a given HTREEITEM. + It uses IQueryInfo interface on IShellFolder. Cannot use it + for top-level item (root). Note: function may return true + with empty *pTip. + bool GetItemShellData(HTREEITEM hItem, int nFormat, PVOID pBuffer, int iSize); + functions gets data as in SHGetDataFromIDList + bool GetItemStruct(HTREEITEM hItem, PSHELLITEMDATA *ppsid); + function returns address of struct associated whith a given + item (just as GetItemData, but type-casted to SHELLITEMDATA) + Structs: + SHELLITEMDATA - struct that is associated as lParam with every + item inserted into this tree control (with new operator). + Members: + LPSHELLFOLDER lpsf; - address of IShellFolder interface + associated with this item + LPITEMIDLIST lpiidl; - this's item id list relative to + desktop folder + LPSHELLFOLDER lpsfParent; - address of IShellFolder + associated with a parent's item of this item + LPITEMIDLIST lpiidlRelative; - this's item id list + relative to lpsfParent + +*************************************************************************/ + +#ifndef __DIRTREECTRL_H__ +#define __DIRTREECTRL_H__ + +#include "shlobj.h" + +// Functions that deal with PIDLs +LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); +LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi); +LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi); +BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR lpFriendlyName); +LPITEMIDLIST CreatePidl(UINT cbSize); +void FreePidl(LPITEMIDLIST lpiidl); +UINT GetSize(LPCITEMIDLIST pidl); +LPITEMIDLIST Next(LPCITEMIDLIST pidl); + +///////////////////////////////////////////////////////////////////////////// +// CDirTreeCtrl window +#define WM_SETPATH WM_USER+8 +#define WM_CREATEFOLDERRESULT WM_USER+9 + +#define SHELLITEMDATA _SHELLITEMDATA +#define PSHELLITEMDATA _SHELLITEMDATA* + +struct _SHELLITEMDATA +{ + LPSHELLFOLDER lpsf; // this shell folder (always exists) + LPITEMIDLIST lpiidl; // this item id list relative to desktop (always exists) + + LPSHELLFOLDER lpsfParent; // parent shell folder (may be NULL) + LPITEMIDLIST lpiidlRelative; // this item id list relative to the parent's lpsf (may be NULL) +}; + +class CDirTreeCtrl : public CTreeCtrl +{ +// Construction +public: + CDirTreeCtrl(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CDirTreeCtrl) + protected: + virtual void PreSubclassWindow(); + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + + // Implementation +public: + void SetIgnoreShellDialogs(bool bFlag); + bool GetIgnoreShellDialogs(); + HTREEITEM InsertDesktopItem(); + HTREEITEM InsertNewFolder(HTREEITEM hParent, LPCTSTR lpszNewFolder); + bool ExpandItem(HTREEITEM hItem, UINT nCode); + bool GetPath(HTREEITEM hItem, LPTSTR pszPath); + bool SetPath(LPCTSTR lpszPath); + bool GetItemInfoTip(HTREEITEM hItem, CString* pTip); + bool GetItemShellData(HTREEITEM hItem, int nFormat, PVOID pBuffer, int iSize); + bool GetItemStruct(HTREEITEM hItem, PSHELLITEMDATA *ppsid); + bool IsEditing() const { return m_iEditType != 0; }; + virtual ~CDirTreeCtrl(); + + // Generated message map functions +protected: + bool RegisterWindowClass(); + friend int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM/* lParamSort*/); + + //{{AFX_MSG(CDirTreeCtrl) + afx_msg void OnDestroy(); + afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() + +// members +protected: + void InitControl(); + HTREEITEM RegularSelect(HTREEITEM hStart, LPCTSTR lpszPath); +// HTREEITEM TraverseNetNode(HTREEITEM hItem, LPCTSTR lpszPath, LPTSTR lpszBuffer); + bool ComparePaths(LPCTSTR lpszFull, LPCTSTR lpszPartial); +// bool SetRemotePath(LPCTSTR lpszPath); + bool SetLocalPath(LPCTSTR lpszPath); + bool FillNode(HTREEITEM hParent, LPSHELLFOLDER lpsf, LPITEMIDLIST lpidl, bool bSilent=false); + + bool m_bIgnoreShellDialogs; // ignore dialogs of type 'insert floppy disk' + HIMAGELIST m_hImageList; // system img list + HTREEITEM m_hDrives, m_hNetwork; // my computer's and net neighbourhood's handles + bool m_bIgnore; // ignore the nearest adding of items in OnItemexpanding + int m_iEditType; // type of item editing (0-doesn't exist (nothing for edit), 1-new folder) +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/DstFileErrorDlg.cpp =================================================================== diff -u --- Copy Handler/DstFileErrorDlg.cpp (revision 0) +++ Copy Handler/DstFileErrorDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,120 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "DstFileErrorDlg.h" +#include "btnIDs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CDstFileErrorDlg dialog + +CDstFileErrorDlg::CDstFileErrorDlg() + : CHLanguageDialog(CDstFileErrorDlg::IDD) +{ + //{{AFX_DATA_INIT(CDstFileErrorDlg) + m_strMessage = _T(""); + m_strFilename = _T(""); + //}}AFX_DATA_INIT + m_bEnableTimer=false; + m_iDefaultOption=ID_RECOPY; + m_iTime=30000; +} + + +void CDstFileErrorDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CDstFileErrorDlg) + DDX_Text(pDX, IDC_MESSAGE_EDIT, m_strMessage); + DDX_Text(pDX, IDC_FILENAME_EDIT, m_strFilename); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CDstFileErrorDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CDstFileErrorDlg) + ON_BN_CLICKED(IDC_RETRY_BUTTON, OnRetryButton) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + ON_BN_CLICKED(IDC_WAIT_BUTTON, OnWaitButton) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_IGNORE_ALL_BUTTON, OnIgnoreAllButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CDstFileErrorDlg message handlers + +void CDstFileErrorDlg::OnRetryButton() +{ + EndDialog(ID_RETRY); +} + +void CDstFileErrorDlg::OnIgnoreButton() +{ + EndDialog(ID_IGNORE); +} + +void CDstFileErrorDlg::OnWaitButton() +{ + EndDialog(ID_WAIT); +} + +void CDstFileErrorDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 1601) + { + m_iTime-=1000; + if (m_iTime < 0) + EndDialog(m_iDefaultOption); + + TCHAR xx[16]; + SetWindowText(m_strTitle+_T(" [")+CString(_itot(m_iTime/1000, xx, 10))+_T("]")); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} + +BOOL CDstFileErrorDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // make this dialog on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + // remember title + GetWindowText(m_strTitle); + + if (m_bEnableTimer) + SetTimer(1601, 1000, NULL); + + return TRUE; +} + +void CDstFileErrorDlg::OnIgnoreAllButton() +{ + EndDialog(ID_IGNOREALL); +} Index: Copy Handler/DstFileErrorDlg.h =================================================================== diff -u --- Copy Handler/DstFileErrorDlg.h (revision 0) +++ Copy Handler/DstFileErrorDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,70 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __DSTFILEERRORDLG_H__ +#define __DSTFILEERRORDLG_H__ + +///////////////////////////////////////////////////////////////////////////// +// CDstFileErrorDlg dialog + +class CDstFileErrorDlg : public CHLanguageDialog +{ +// Construction +public: + CDstFileErrorDlg(); // standard constructor + + CString m_strTitle; + bool m_bEnableTimer; + int m_iTime; + int m_iDefaultOption; + +// Dialog Data + //{{AFX_DATA(CDstFileErrorDlg) + enum { IDD = IDD_FEEDBACK_DSTFILE_DIALOG }; + CString m_strMessage; + CString m_strFilename; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CDstFileErrorDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CDstFileErrorDlg) + afx_msg void OnRetryButton(); + afx_msg void OnIgnoreButton(); + afx_msg void OnWaitButton(); + afx_msg void OnTimer(UINT nIDEvent); + virtual BOOL OnInitDialog(); + afx_msg void OnIgnoreAllButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/FFListCtrl.cpp =================================================================== diff -u --- Copy Handler/FFListCtrl.cpp (revision 0) +++ Copy Handler/FFListCtrl.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,105 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "FFListCtrl.h" +#include "MemDC.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CFFListCtrl + +CFFListCtrl::CFFListCtrl() +{ +} + +CFFListCtrl::~CFFListCtrl() +{ +} + + +BEGIN_MESSAGE_MAP(CFFListCtrl, CListCtrl) + //{{AFX_MSG_MAP(CFFListCtrl) + ON_WM_ERASEBKGND() + ON_WM_PAINT() + ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemchanged) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CFFListCtrl message handlers + +BOOL CFFListCtrl::OnEraseBkgnd(CDC*) +{ + return FALSE;/*CListCtrl::OnEraseBkgnd(pDC);*/ +} + +void CFFListCtrl::OnPaint() +{ + CPaintDC dc(this); // device context for painting + + CRect headerRect; + GetHeaderCtrl()->GetWindowRect(&headerRect); + ScreenToClient(&headerRect); + dc.ExcludeClipRect(&headerRect); + + CRect rect; + GetClientRect(&rect); + CMemDC memDC(&dc, rect); + + CRect clip; + memDC.GetClipBox(&clip); + memDC.FillSolidRect(clip, GetSysColor(COLOR_WINDOW)); + + DefWindowProc(WM_PAINT, (WPARAM)memDC.m_hDC, (LPARAM)0); +} + +void CFFListCtrl::LimitItems(int iLimit) +{ + if (GetItemCount() > iLimit) + { + while (GetItemCount() > iLimit) + DeleteItem(iLimit); + } +} + +void CFFListCtrl::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; + + if ( /*((pNMListView->uOldState & LVIS_SELECTED) && !(pNMListView->uNewState & LVIS_SELECTED)) + ||*/ (!(pNMListView->uOldState & LVIS_SELECTED) && (pNMListView->uNewState & LVIS_SELECTED)) ) + SendSelChangedToParent(); + + *pResult = 0; +} + +void CFFListCtrl::SendSelChangedToParent() +{ + NMHDR nmhdr; + nmhdr.hwndFrom=m_hWnd; + nmhdr.idFrom=GetDlgCtrlID(); + nmhdr.code=LVN_CHANGEDSELECTION; + GetParent()->SendMessage(WM_NOTIFY, static_cast(nmhdr.idFrom), reinterpret_cast(&nmhdr)); +} Index: Copy Handler/FFListCtrl.h =================================================================== diff -u --- Copy Handler/FFListCtrl.h (revision 0) +++ Copy Handler/FFListCtrl.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,66 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __FFLISTCTRL_H__ +#define __FFLISTCTRL_H__ + +///////////////////////////////////////////////////////////////////////////// +// CFFListCtrl window +#define LVN_CHANGEDSELECTION WM_USER+10 + +class CFFListCtrl : public CListCtrl +{ +// Construction +public: + CFFListCtrl(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CFFListCtrl) + //}}AFX_VIRTUAL + +// Implementation +public: + void SendSelChangedToParent(); + void LimitItems(int iLimit); + virtual ~CFFListCtrl(); + + // Generated message map functions +protected: + //{{AFX_MSG(CFFListCtrl) + afx_msg BOOL OnEraseBkgnd(CDC*); + afx_msg void OnPaint(); + afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/FileInfo.cpp =================================================================== diff -u --- Copy Handler/FileInfo.cpp (revision 0) +++ Copy Handler/FileInfo.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1089 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + FileInfo.cpp: implementation of the CFileInfo class. + (c) Codeguru & friends + Coded by Antonio Tejada Lacaci. 1999, modified by Ixen Gerthannes + atejada@espanet.com +*************************************************************************/ + +#include "stdafx.h" +#include "FileInfo.h" +#include "resource.h" +#include "DataBuffer.h" +#include "Device IO.h" +#include "imagehlp.h" +#include "Copy Handler.h" + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// +// finds another name for a copy of src file(folder) in dest location +void FindFreeSubstituteName(CString strSrcPath, CString strDstPath, CString* pstrResult) +{ + // get the name from srcpath + if (strSrcPath.Right(1) == _T("\\")) + strSrcPath=strSrcPath.Left(strSrcPath.GetLength()-1); + + int iBarPos=strSrcPath.ReverseFind(_T('\\')); + CString strFolderName; + if (iBarPos != -1) + strFolderName=strSrcPath.Mid(iBarPos+1); + else + strFolderName=strSrcPath; // it shouldn't happen at all + + if (strDstPath.Right(1) != _T("\\")) + strDstPath+=_T("\\"); + + // set the dest path + CString strCheckPath; + strCheckPath.Format(GetResManager()->LoadString(IDS_FIRSTCOPY_STRING), strFolderName); + if (strCheckPath.GetLength() > _MAX_PATH) + strCheckPath=strCheckPath.Left(_MAX_PATH); // max - 260 chars + + // when adding to strDstPath check if the path already exists - if so - try again + int iCounter=1; + while (CFileInfo::Exist(strDstPath+strCheckPath)) + strCheckPath.Format(GetResManager()->LoadString(IDS_NEXTCOPY_STRING), ++iCounter, strFolderName); + + *pstrResult=strCheckPath; +} + +bool _tcicmp(TCHAR c1, TCHAR c2) +{ + TCHAR ch1[2]={c1, 0}, ch2[2]={c2, 0}; + return (_tcsicmp(ch1, ch2) == 0); +} + +//////////////////////////////////////////////////////////////////////////// +CFileFilter::CFileFilter() +{ + // files mask + m_bUseMask=false; + m_astrMask.RemoveAll(); + + m_bUseExcludeMask=false; + m_astrExcludeMask.RemoveAll(); + + // size filtering + m_bUseSize=false; + m_iSizeType1=GT; + m_ullSize1=0; + m_bUseSize2=false; + m_iSizeType2=LT; + m_ullSize2=0; + + // date filtering + m_bUseDate=false; + m_iDateType=DATE_CREATED; + m_iDateType1=GT; + m_bDate1=false; + m_tDate1=CTime::GetCurrentTime(); + m_bTime1=false; + m_tTime1=CTime::GetCurrentTime(); + + m_bUseDate2=false; + m_iDateType2=LT; + m_bDate2=false; + m_tDate2=CTime::GetCurrentTime(); + m_bTime2=false; + m_tTime2=CTime::GetCurrentTime(); + + // attribute filtering + m_bUseAttributes=false; + m_iArchive=2; + m_iReadOnly=2; + m_iHidden=2; + m_iSystem=2; + m_iDirectory=2; +} + +CFileFilter::CFileFilter(const CFileFilter& rFilter) +{ + *this=rFilter; +} + +CFileFilter& CFileFilter::operator=(const CFileFilter& rFilter) +{ + // files mask + m_bUseMask=rFilter.m_bUseMask; + m_astrMask.Copy(rFilter.m_astrMask); + + m_bUseExcludeMask=rFilter.m_bUseExcludeMask; + m_astrExcludeMask.Copy(rFilter.m_astrExcludeMask); + + // size filtering + m_bUseSize=rFilter.m_bUseSize; + m_iSizeType1=rFilter.m_iSizeType1; + m_ullSize1=rFilter.m_ullSize1; + m_bUseSize2=rFilter.m_bUseSize2; + m_iSizeType2=rFilter.m_iSizeType2; + m_ullSize2=rFilter.m_ullSize2; + + // date filtering + m_bUseDate=rFilter.m_bUseDate; + m_iDateType=rFilter.m_iDateType; + m_iDateType1=rFilter.m_iDateType1; + m_bDate1=rFilter.m_bDate1; + m_tDate1=rFilter.m_tDate1; + m_bTime1=rFilter.m_bTime1; + m_tTime1=rFilter.m_tTime1; + + m_bUseDate2=rFilter.m_bUseDate2; + m_iDateType2=rFilter.m_iDateType2; + m_bDate2=rFilter.m_bDate2; + m_tDate2=rFilter.m_tDate2; + m_bTime2=rFilter.m_bTime2; + m_tTime2=rFilter.m_tTime2; + + // attribute filtering + m_bUseAttributes=rFilter.m_bUseAttributes; + m_iArchive=rFilter.m_iArchive; + m_iReadOnly=rFilter.m_iReadOnly; + m_iHidden=rFilter.m_iHidden; + m_iSystem=rFilter.m_iSystem; + m_iDirectory=rFilter.m_iDirectory; + + return *this; +} + +void CFileFilter::Serialize(CArchive& ar) +{ + ULARGE_INTEGER li; + if (ar.IsStoring()) + { + // store + // files mask + ar<(m_bUseMask); + m_astrMask.Serialize(ar); + + ar<(m_bUseExcludeMask); + m_astrExcludeMask.Serialize(ar); + + // size filtering + ar<(m_bUseSize); + ar<(m_bUseSize2); + ar<(m_bUseDate); + ar<(m_bDate1); + ar<(m_bTime1); + ar<(m_bUseDate2); + ar<(m_bDate2); + ar<(m_bTime2); + ar<(m_bUseAttributes); + ar<>tmp; + m_bUseMask=(tmp != 0); + m_astrMask.Serialize(ar); + + ar>>tmp; + m_bUseExcludeMask=(tmp != 0); + m_astrExcludeMask.Serialize(ar); + + // size + ar>>tmp; + m_bUseSize=(tmp != 0); + ar>>m_iSizeType1; + ar>>li.LowPart; + ar>>li.HighPart; + m_ullSize1=li.QuadPart; + ar>>tmp; + m_bUseSize2=(tmp != 0); + ar>>m_iSizeType2; + ar>>li.LowPart; + ar>>li.HighPart; + m_ullSize2=li.QuadPart; + + // date + ar>>tmp; + m_bUseDate=(tmp != 0); + ar>>m_iDateType; + ar>>m_iDateType1; + ar>>tmp; + m_bDate1=(tmp != 0); + ar>>m_tDate1; + ar>>tmp; + m_bTime1=(tmp != 0); + ar>>m_tTime1; + + ar>>tmp; + m_bUseDate2=(tmp != 0); + ar>>m_iDateType2; + ar>>tmp; + m_bDate2=(tmp != 0); + ar>>m_tDate2; + ar>>tmp; + m_bTime2=(tmp != 0); + ar>>m_tTime2; + + // attributes + ar>>tmp; + m_bUseAttributes=(tmp != 0); + ar>>m_iArchive; + ar>>m_iReadOnly; + ar>>m_iHidden; + ar>>m_iSystem; + ar>>m_iDirectory; + } +} + +CString& CFileFilter::GetCombinedMask(CString& pMask) const +{ + pMask.Empty(); + if (m_astrMask.GetSize() > 0) + { + pMask=m_astrMask.GetAt(0); + for (int i=1;i 0) + { + pMask=m_astrExcludeMask.GetAt(0); + for (int i=1;i rInfo.GetLength64()) + return false; + break; + case GT: + if (m_ullSize1 >= rInfo.GetLength64()) + return false; + break; + } + + // second part + if (m_bUseSize2) + { + switch (m_iSizeType2) + { + case LT: + if (m_ullSize2 <= rInfo.GetLength64()) + return false; + break; + case LE: + if (m_ullSize2 < rInfo.GetLength64()) + return false; + break; + case EQ: + if (m_ullSize2 != rInfo.GetLength64()) + return false; + break; + case GE: + if (m_ullSize2 > rInfo.GetLength64()) + return false; + break; + case GT: + if (m_ullSize2 >= rInfo.GetLength64()) + return false; + break; + } + } + } + + // date - get the time from rInfo + if (m_bUseDate) + { + COleDateTime tm; + switch (m_iDateType) + { + case DATE_CREATED: + tm=rInfo.GetCreationTime(); + break; + case DATE_MODIFIED: + tm=rInfo.GetLastWriteTime(); + break; + case DATE_LASTACCESSED: + tm=rInfo.GetLastAccessTime(); + break; + } + + // counting... + unsigned long ulInfo=0, ulCheck=0; + if (m_bDate1) + { + ulInfo=(tm.GetYear()-1970)*32140800+tm.GetMonth()*2678400+tm.GetDay()*86400; + ulCheck=(m_tDate1.GetYear()-1970)*32140800+m_tDate1.GetMonth()*2678400+m_tDate1.GetDay()*86400; + } + + if (m_bTime1) + { + ulInfo+=tm.GetHour()*3600+tm.GetMinute()*60+tm.GetSecond(); + ulCheck+=m_tTime1.GetHour()*3600+m_tTime1.GetMinute()*60+m_tTime1.GetSecond(); + } + + // ... and comparing + switch (m_iDateType1) + { + case LT: + if (ulInfo >= ulCheck) + return false; + break; + case LE: + if (ulInfo > ulCheck) + return false; + break; + case EQ: + if (ulInfo != ulCheck) + return false; + break; + case GE: + if (ulInfo < ulCheck) + return false; + break; + case GT: + if (ulInfo <= ulCheck) + return false; + break; + } + + if (m_bUseDate2) + { + // counting... + ulInfo=0, ulCheck=0; + if (m_bDate2) + { + ulInfo=(tm.GetYear()-1970)*32140800+tm.GetMonth()*2678400+tm.GetDay()*86400; + ulCheck=(m_tDate2.GetYear()-1970)*32140800+m_tDate2.GetMonth()*2678400+m_tDate2.GetDay()*86400; + } + + if (m_bTime2) + { + ulInfo+=tm.GetHour()*3600+tm.GetMinute()*60+tm.GetSecond(); + ulCheck+=m_tTime2.GetHour()*3600+m_tTime2.GetMinute()*60+m_tTime2.GetSecond(); + } + + // ... comparing + switch (m_iDateType2) + { + case LT: + if (ulInfo >= ulCheck) + return false; + break; + case LE: + if (ulInfo > ulCheck) + return false; + break; + case EQ: + if (ulInfo != ulCheck) + return false; + break; + case GE: + if (ulInfo < ulCheck) + return false; + break; + case GT: + if (ulInfo <= ulCheck) + return false; + break; + } + } + } // of m_bUseDate + + // attributes + if (m_bUseAttributes) + { + if ( (m_iArchive == 1 && !rInfo.IsArchived()) || (m_iArchive == 0 && rInfo.IsArchived())) + return false; + if ( (m_iReadOnly == 1 && !rInfo.IsReadOnly()) || (m_iReadOnly == 0 && rInfo.IsReadOnly())) + return false; + if ( (m_iHidden == 1 && !rInfo.IsHidden()) || (m_iHidden == 0 && rInfo.IsHidden())) + return false; + if ( (m_iSystem == 1 && !rInfo.IsSystem()) || (m_iSystem == 0 && rInfo.IsSystem())) + return false; + if ( (m_iDirectory == 1 && !rInfo.IsDirectory()) || (m_iDirectory == 0 && rInfo.IsDirectory())) + return false; + } + + return true; +} + +bool CFileFilter::MatchMask(LPCTSTR lpszMask, LPCTSTR lpszString) const +{ + bool bMatch = 1; + + //iterate and delete '?' and '*' one by one + while(*lpszMask != _T('\0') && bMatch && *lpszString != _T('\0')) + { + if (*lpszMask == _T('?')) lpszString++; + else if (*lpszMask == _T('*')) + { + bMatch = Scan(lpszMask, lpszString); + lpszMask--; + } + else + { + bMatch = _tcicmp(*lpszMask, *lpszString); + lpszString++; + } + lpszMask++; + } + while (*lpszMask == _T('*') && bMatch) lpszMask++; + + return bMatch && *lpszString == _T('\0') && *lpszMask == _T('\0'); +} + +// scan '?' and '*' +bool CFileFilter::Scan(LPCTSTR& lpszMask, LPCTSTR& lpszString) const +{ + // remove the '?' and '*' + for(lpszMask++; *lpszString != _T('\0') && (*lpszMask == _T('?') || *lpszMask == _T('*')); lpszMask++) + if (*lpszMask == _T('?')) lpszString++; + while ( *lpszMask == _T('*')) lpszMask++; + + // if lpszString is empty and lpszMask has more characters or, + // lpszMask is empty, return + if (*lpszString == _T('\0') && *lpszMask != _T('\0')) return false; + if (*lpszString == _T('\0') && *lpszMask == _T('\0')) return true; + // else search substring + else + { + LPCTSTR wdsCopy = lpszMask; + LPCTSTR lpszStringCopy = lpszString; + bool bMatch = true; + do + { + if (!MatchMask(lpszMask, lpszString)) lpszStringCopy++; + lpszMask = wdsCopy; + lpszString = lpszStringCopy; + while (!(_tcicmp(*lpszMask, *lpszString)) && (*lpszString != '\0')) lpszString++; + wdsCopy = lpszMask; + lpszStringCopy = lpszString; + } + while ((*lpszString != _T('\0')) ? !MatchMask(lpszMask, lpszString) : (bMatch = false) != false); + + if (*lpszString == _T('\0') && *lpszMask == _T('\0')) return true; + + return bMatch; + } +} + +bool CFiltersArray::Match(const CFileInfo& rInfo) const +{ + if (GetSize() == 0) + return true; + + // if only one of the filters matches - return true + for (int i=0;i>iSize; + SetSize(iSize); + for (int i=0;icFileName; + + // if proper index has been passed - reduce the path + if (iSrcIndex >= 0) + m_strFilePath=m_strFilePath.Mid(m_pClipboard->GetAt(iSrcIndex)->GetPath().GetLength()); // wytnij �cie�k� z clipboarda + + m_iSrcIndex=iSrcIndex; + m_dwAttributes = pwfd->dwFileAttributes; + m_uhFileSize = (((ULONGLONG) pwfd->nFileSizeHigh) << 32) + pwfd->nFileSizeLow; + m_timCreation = pwfd->ftCreationTime; + m_timLastAccess = pwfd->ftLastAccessTime; + m_timLastWrite = pwfd->ftLastWriteTime; +} + +bool CFileInfo::Create(CString strFilePath, int iSrcIndex) +{ + WIN32_FIND_DATA wfd; + HANDLE hFind; + int nBarPos; + + hFind = FindFirstFile(strFilePath, &wfd); + if (hFind != INVALID_HANDLE_VALUE) + { + FindClose(hFind); + + // add data to members + nBarPos = strFilePath.ReverseFind(TCHAR('\\')); + Create(&wfd, strFilePath.Left(nBarPos+1), iSrcIndex); + + return true; + } + else + { + m_strFilePath=GetResManager()->LoadString(IDS_NOTFOUND_STRING); + m_iSrcIndex=-1; + m_dwAttributes = (DWORD)-1; + m_uhFileSize = (unsigned __int64)-1; + m_timCreation.SetDateTime(100, 1, 1, 0, 0, 0); + m_timLastAccess.SetDateTime(100, 1, 1, 0, 0, 0); + m_timLastWrite.SetDateTime(100, 1, 1, 0, 0, 0); + return false; + } +} + +CString CFileInfo::GetFileDrive(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + TCHAR szDrive[_MAX_DRIVE]; + _tsplitpath(strPath, szDrive, NULL, NULL, NULL); + return CString(szDrive); +} + +int CFileInfo::GetDriveNumber() const +{ + ASSERT(m_pClipboard); + + if (m_iSrcIndex != -1) + { + // read data stored in CClipboardEntry + return m_pClipboard->GetAt(m_iSrcIndex)->GetDriveNumber(); + } + else + { + // manually + int iNum; + GetDriveData(m_strFilePath, &iNum, NULL); + return iNum; + } +} + +UINT CFileInfo::GetDriveType() const +{ + ASSERT(m_pClipboard); + + if (m_iSrcIndex != -1) + { + // read data contained in CClipboardEntry + return m_pClipboard->GetAt(m_iSrcIndex)->GetDriveType(); + } + else + { + // manually + UINT uiType; + GetDriveData(m_strFilePath, NULL, &uiType); + return uiType; + } +} + +CString CFileInfo::GetFileDir(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + TCHAR szDir[_MAX_DIR]; + _tsplitpath(strPath, NULL, szDir,NULL, NULL); + return CString(szDir); +} + +CString CFileInfo::GetFileTitle(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + TCHAR szName[_MAX_FNAME]; + _tsplitpath(strPath, NULL, NULL, szName, NULL); + return CString(szName); +} + +CString CFileInfo::GetFileExt(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + TCHAR szExt[_MAX_EXT]; + _tsplitpath(strPath, NULL, NULL, NULL, szExt); + return CString(szExt); +} + +CString CFileInfo::GetFileRoot(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + + TCHAR szDrive[_MAX_DRIVE]; + TCHAR szDir[_MAX_DIR]; + _tsplitpath(strPath, szDrive, szDir, NULL, NULL); + return CString(szDrive)+szDir; +} + +CString CFileInfo::GetFileName(void) const +{ + ASSERT(m_pClipboard); + + CString strPath=(m_iSrcIndex != -1) ? m_pClipboard->GetAt(m_iSrcIndex)->GetPath()+m_strFilePath : m_strFilePath; + + TCHAR szName[_MAX_FNAME]; + TCHAR szExt[_MAX_EXT]; + _tsplitpath(strPath, NULL, NULL, szName, szExt); + return CString(szName)+szExt; +} + +void CFileInfo::Store(CArchive& ar) +{ + ar<((m_uhFileSize & 0xFFFFFFFF00000000) >> 32); + ar<(m_uhFileSize & 0x00000000FFFFFFFF); + ar<>m_strFilePath; + ar>>m_iSrcIndex; + ar>>m_dwAttributes; + unsigned long part; + ar>>part; + m_uhFileSize=(static_cast(part) << 32); + ar>>part; + m_uhFileSize+=part; + ar>>m_timCreation; + ar>>m_timLastAccess; + ar>>m_timLastWrite; +} + +bool CFileInfo::operator==(const CFileInfo& rInfo) +{ + return (rInfo.m_dwAttributes == m_dwAttributes && rInfo.m_timCreation == m_timCreation + && rInfo.m_timLastWrite == m_timLastWrite && rInfo.m_uhFileSize == m_uhFileSize); +} + +CString CFileInfo::GetDestinationPath(CString strPath, unsigned char ucCopyNumber, int iFlags) +{ + // add '\\' + if (strPath.Right(1) != _T("\\")) + strPath+=_T("\\"); + + // iFlags: bit 0-ignore folders; bit 1-force creating directories + if (iFlags & 0x02) + { + // force create directories + TCHAR dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + _tsplitpath(GetFullFilePath(), NULL, dir, fname, ext); + + CString str=dir; + str.TrimLeft(_T("\\")); + + // force create directory +// AfxMessageBox("Created multiple level of paths for %s"+strPath+str); + MakeSureDirectoryPathExists(strPath+str); + +// AfxMessageBox(strPath+str+fname+CString(ext)); + return strPath+str+fname+CString(ext); + } + else + { + if (!(iFlags & 0x01) && m_iSrcIndex != -1) + { + // generate new dest name + while (ucCopyNumber >= m_pClipboard->GetAt(m_iSrcIndex)->m_astrDstPaths.GetSize()) + { + CString strNewPath; + FindFreeSubstituteName(GetFullFilePath(), strPath, &strNewPath); + m_pClipboard->GetAt(m_iSrcIndex)->m_astrDstPaths.Add(strNewPath); + } + + return strPath+m_pClipboard->GetAt(m_iSrcIndex)->m_astrDstPaths.GetAt(ucCopyNumber)+m_strFilePath; + } + else + return strPath+GetFileName(); + } +} + +CString CFileInfo::GetFullFilePath() const +{ + CString strPath; + if (m_iSrcIndex >= 0) + { + ASSERT(m_pClipboard); + strPath+=m_pClipboard->GetAt(m_iSrcIndex)->GetPath(); + } + strPath+=m_strFilePath; + + return strPath; +} + +int CFileInfo::GetBufferIndex() const +{ + if (m_iSrcIndex != -1) + return m_pClipboard->GetAt(m_iSrcIndex)->GetBufferIndex(); + else + return BI_DEFAULT; +} + +/////////////////////////////////////////////////////////////////////// +// Array + +void CFileInfoArray::AddDir(CString strDirName, const CFiltersArray* pFilters, int iSrcIndex, + const bool bRecurse, const bool bIncludeDirs, + const volatile bool* pbAbort) +{ + WIN32_FIND_DATA wfd; + CString strText; + + // init CFileInfo + CFileInfo finf; + finf.SetClipboard(m_pClipboard); // this is the link table (CClipboardArray) + + // append '\\' at the end of path if needed + if (strDirName.Right(1) != _T("\\")) + strDirName+=_T("\\"); + + strText = strDirName + _T("*"); + // Iterate through dirs & files + HANDLE hFind = FindFirstFile(strText, &wfd); + if (hFind != INVALID_HANDLE_VALUE) + { + do + { + if ( !(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ) + { + finf.Create(&wfd, strDirName, iSrcIndex); + if (pFilters->Match(finf)) + Add(finf); + } + else if ( strcmp(wfd.cFileName, _T(".")) != 0 && strcmp(wfd.cFileName, _T("..")) != 0) + { + if (bIncludeDirs) + { + // Add directory itself + finf.Create(&wfd, strDirName, iSrcIndex); + Add(finf); + } + if (bRecurse) + { + strText = strDirName + wfd.cFileName+_T("\\"); + // Recurse Dirs + AddDir(strText, pFilters, iSrcIndex, bRecurse, bIncludeDirs, pbAbort); + } + } + } + while (((pbAbort == NULL) || (!*pbAbort)) && (FindNextFile(hFind, &wfd))); + + FindClose(hFind); + } +} + +int CFileInfoArray::AddFile(CString strFilePath, int iSrcIndex) +{ + CFileInfo finf; + + // CUSTOMIZATION3 - cut '\\' at the end of strFilePath, set relative path + if (strFilePath.Right(1) == _T("\\")) + strFilePath=strFilePath.Left(strFilePath.GetLength()-1); + + finf.Create(strFilePath, iSrcIndex); + return Add(finf); +} + + +////////////////////////////////////////////////////////////////////////////// +// CClipboardArray + +void CClipboardArray::Serialize(CArchive& ar, bool bData) +{ + if (ar.IsStoring()) + { + // write data + int iSize=GetSize(); + ar<Serialize(ar, bData); + } + else + { + int iSize; + ar>>iSize; + + CClipboardEntry* pEntry; + for (int i=0;iSerialize(ar, bData); + } + } +} + +///////////////////////////////////////////////////////////////////////////// +// CClipboardEntry + +void CClipboardEntry::SetPath(const CString& strPath) +{ + m_strPath=strPath; // guaranteed without ending '\\' + if (m_strPath.Right(1) == _T('\\')) + m_strPath=m_strPath.Left(m_strPath.GetLength()-1); + + GetDriveData(m_strPath, &m_iDriveNumber, &m_uiDriveType); +} + +void CClipboardEntry::CalcBufferIndex(const CDestPath& dpDestPath) +{ + // what kind of buffer + if (m_uiDriveType == DRIVE_REMOTE || dpDestPath.GetDriveType() == DRIVE_REMOTE) + m_iBufferIndex=BI_LAN; + else if (m_uiDriveType == DRIVE_CDROM || dpDestPath.GetDriveType() == DRIVE_CDROM) + m_iBufferIndex=BI_CD; + else if (m_uiDriveType == DRIVE_FIXED && dpDestPath.GetDriveType() == DRIVE_FIXED) + { + // two hdd's - is this the same physical disk ? + if (m_iDriveNumber == dpDestPath.GetDriveNumber() || IsSamePhysicalDisk(m_iDriveNumber, dpDestPath.GetDriveNumber())) + m_iBufferIndex=BI_ONEDISK; + else + m_iBufferIndex=BI_TWODISKS; + } + else + m_iBufferIndex=BI_DEFAULT; +} + +void CClipboardEntry::Serialize(CArchive& ar, bool bData) +{ + if (bData) + { + if (ar.IsStoring()) + { + ar<(m_bMove); + ar<>m_strPath; + unsigned char ucData; + ar>>ucData; + m_bMove=ucData != 0; + ar>>m_iDriveNumber; + ar>>m_uiDriveType; + ar>>m_iBufferIndex; + } + } + else + m_astrDstPaths.Serialize(ar); +} Index: Copy Handler/FileInfo.h =================================================================== diff -u --- Copy Handler/FileInfo.h (revision 0) +++ Copy Handler/FileInfo.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,382 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/** + * @doc FILEINFO + * @module FileInfo.h 1.3 - Interface for the CFileInfo and CFileInfoArray classes | + * The classes contained in this file allow to gather recursively file information + * through directories. + * + * Codeguru & friends + * Coded by Antonio Tejada Lacaci. 1999 + * atejada@espanet.com + * CRC32 code by Floor A.C. Naaijkens + * + * Updates (aaaa-mm-dd): + * MANY CHANGES by Ixen Gerthannes... + * 1999-9-23 ATL: Opensource works! Again, Mr. Szucs (rszucs@cygron.hu) gets another bug: + * Missing "4-(dwRead & 0x3)" in the same lines as before, when calc'ing the padding mask. + * 1999-9-16 ATL: Corrected bug in GetCRC and GetChecksum as suggested by R�bert Szucs (rszucs@cygron.hu): + * There was a buffer overflow and checksum and crc for last dword +1 was calc'ed instead + * of the ones for last dword. Instead accessing buffer[dwRead +3...] it ought to access + * buffer[dwRead...] (shame on me! :'(). + * 1999-9-2 ATL: Corrected bug in AddFile(CString, LPARAM) as suggested by Nhycoh (Nhycoh44@yahoo.com): + * There was some weird stuff at CFileInfo::Create(strFilePath) + * stating strFilePath.GetLength()-nBarPos instead of nBarPos+1 + * (I'm quite sure I left my head on my pillow the day I did that %-#). + * 1999-6-27 ATL: Updated GetCRC & GetChecksum to avoid some bug cases + * 1999-4-7 ATL: Updated source code doc to conform Autoduck 2.0 standard + * 1999-4-7 ATL: Corrected bug in AddDir as suggested by Zhuang Yuyao (zhuangyy@koal.com): + * bIncludeDirs wasn't used if bRecurse was false. + * + * Keep this comment if you redistribute this file. And credit where credit's due! + */ + +#ifndef __FILEINFO_H__ +#define __FILEINFO_H__ + +#include +#include "afxdisp.h" +#include "DestPath.h" + +void FindFreeSubstituteName(CString strSrcPath, CString strDstPath, CString* pstrResult); +extern void GetDriveData(LPCTSTR lpszPath, int *piDrvNum, UINT *puiDrvType); + +// definitions for comparing sizes and dates +#define LT 0 +#define LE 1 +#define EQ 2 +#define GE 3 +#define GT 4 + +// date type defs +#define DATE_CREATED 0 +#define DATE_MODIFIED 1 +#define DATE_LASTACCESSED 2 + +class CFileInfo; + +class CFileFilter +{ +public: + CFileFilter(); + CFileFilter(const CFileFilter& rFilter); + CFileFilter& operator=(const CFileFilter& rFilter); + + bool Match(const CFileInfo& rInfo) const; + + CString& GetCombinedMask(CString& pMask) const; + void SetCombinedMask(const CString& pMask); + + CString& GetCombinedExcludeMask(CString& pMask) const; + void SetCombinedExcludeMask(const CString& pMask); + + void Serialize(CArchive& ar); + +protected: + bool MatchMask(LPCTSTR lpszMask, LPCTSTR lpszString) const; + bool Scan(LPCTSTR& lpszMask, LPCTSTR& lpszString) const; + +public: + // files mask + bool m_bUseMask; + CStringArray m_astrMask; + + // files mask- + bool m_bUseExcludeMask; + CStringArray m_astrExcludeMask; + + // size filtering + bool m_bUseSize; + int m_iSizeType1; + unsigned __int64 m_ullSize1; + bool m_bUseSize2; + int m_iSizeType2; + unsigned __int64 m_ullSize2; + + // date filtering + bool m_bUseDate; + int m_iDateType; // created/last modified/last accessed + int m_iDateType1; // before/after + bool m_bDate1; + CTime m_tDate1; + bool m_bTime1; + CTime m_tTime1; + + bool m_bUseDate2; + int m_iDateType2; + bool m_bDate2; + CTime m_tDate2; + bool m_bTime2; + CTime m_tTime2; + + // attribute filtering + bool m_bUseAttributes; + int m_iArchive; + int m_iReadOnly; + int m_iHidden; + int m_iSystem; + int m_iDirectory; +}; + +class CFiltersArray : public CArray +{ +public: + bool Match(const CFileInfo& rInfo) const; + void Serialize(CArchive& ar); +}; + +///////////////////////////////////////////////////////////////////////////// +// CClipboardEntry + +class CClipboardEntry +{ +public: + CClipboardEntry() { m_bMove=true; m_iDriveNumber=-1; m_uiDriveType=static_cast(-1); m_iBufferIndex=0; }; + CClipboardEntry(const CClipboardEntry& rEntry) { m_strPath=rEntry.m_strPath; m_bMove=rEntry.m_bMove; m_iDriveNumber=rEntry.m_iDriveNumber; m_uiDriveType=rEntry.m_uiDriveType; m_astrDstPaths.Copy(rEntry.m_astrDstPaths); }; + + void SetPath(const CString& strPath); + void CalcBufferIndex(const CDestPath& dpDestPath); + const CString& GetPath() const { return m_strPath; }; + + void SetMove(bool bValue) { m_bMove=bValue; }; + bool GetMove() { return m_bMove; }; + + int GetDriveNumber() const { return m_iDriveNumber; }; + UINT GetDriveType() const { return m_uiDriveType; }; + + int GetBufferIndex() const { return m_iBufferIndex; }; + + void Serialize(CArchive& ar, bool bData); + +private: + CString m_strPath; // path (ie. c:\\windows\\) - always with ending '\\' + bool m_bMove; // specifies if we can use MoveFile (if will be moved) + + int m_iDriveNumber; // disk number (-1 - none) + UINT m_uiDriveType; // path type + + int m_iBufferIndex; // buffer number, with which we'll copy this data + +public: + CStringArray m_astrDstPaths; // dest paths table for this group of paths +}; + +////////////////////////////////////////////////////////////////////////// +// CClipboardArray + +class CClipboardArray : public CArray +{ +public: + ~CClipboardArray() { RemoveAll(); }; + + void Serialize(CArchive& ar, bool bData); + + void SetAt(int nIndex, CClipboardEntry* pEntry) { delete [] GetAt(nIndex); SetAt(nIndex, pEntry); }; + void RemoveAt(int nIndex, int nCount = 1) { while (nCount--) { delete GetAt(nIndex); static_cast*>(this)->RemoveAt(nIndex, 1); } }; + void RemoveAll() { for (int i=0;i*>(this)->RemoveAll(); }; +}; + +class CFileInfo +{ +public: + CFileInfo(); + CFileInfo(const CFileInfo& finf); + ~CFileInfo(); + + // static member + static bool Exist(CString strPath); // check for file or folder existence + + void Create(const WIN32_FIND_DATA* pwfd, LPCTSTR pszFilePath, int iSrcIndex); + bool Create(CString strFilePath, int iSrcIndex); + + DWORD GetLength(void) const { return (DWORD) m_uhFileSize; }; + ULONGLONG GetLength64(void) const { return m_uhFileSize; }; + void SetLength64(ULONGLONG uhSize) { m_uhFileSize=uhSize; }; + + // disk - path and disk number (-1 if none - ie. net disk) + CString GetFileDrive(void) const; // returns string with src disk + int GetDriveNumber() const; // disk number A - 0, b-1, c-2, ... + UINT GetDriveType() const; // drive type + + CString GetFileDir(void) const; // @rdesc Returns \WINDOWS\ for C:\WINDOWS\WIN.INI + CString GetFileTitle(void) const; // @cmember returns WIN for C:\WINDOWS\WIN.INI + CString GetFileExt(void) const; /** @cmember returns INI for C:\WINDOWS\WIN.INI */ + CString GetFileRoot(void) const; /** @cmember returns C:\WINDOWS\ for C:\WINDOWS\WIN.INI */ + CString GetFileName(void) const; /** @cmember returns WIN.INI for C:\WINDOWS\WIN.INI */ + + const CString& GetFilePath(void) const { return m_strFilePath; } // returns path with m_strFilePath (probably not full) + CString GetFullFilePath() const; /** @cmember returns C:\WINDOWS\WIN.INI for C:\WINDOWS\WIN.INI */ + void SetFilePath(LPCTSTR lpszPath) { m_strFilePath=lpszPath; }; + + /* Get File times info (equivalent to CFindFile members) */ + const COleDateTime& GetCreationTime(void) const { return m_timCreation; }; /** @cmember returns creation time */ + const COleDateTime& GetLastAccessTime(void) const { return m_timLastAccess; }; /** @cmember returns last access time */ + const COleDateTime& GetLastWriteTime(void) const { return m_timLastWrite; }; /** @cmember returns las write time */ + + /* Get File attributes info (equivalent to CFindFile members) */ + DWORD GetAttributes(void) const { return m_dwAttributes; }; /** @cmember returns file attributes */ + bool IsDirectory(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }; /** @cmember returns TRUE if the file is a directory */ + bool IsArchived(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_ARCHIVE) != 0; }; /** @cmember Returns TRUE if the file has archive bit set */ + bool IsReadOnly(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_READONLY) != 0; }; /** @cmember Returns TRUE if the file is read-only */ + bool IsCompressed(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_COMPRESSED) != 0; }; /** @cmember Returns TRUE if the file is compressed */ + bool IsSystem(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_SYSTEM) != 0; }; /** @cmember Returns TRUE if the file is a system file */ + bool IsHidden(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_HIDDEN) != 0; }; /** @cmember Returns TRUE if the file is hidden */ + bool IsTemporary(void) const { return (m_dwAttributes & FILE_ATTRIBUTE_TEMPORARY) != 0; }; /** @cmember Returns TRUE if the file is temporary */ + bool IsNormal(void) const { return m_dwAttributes == 0; }; /** @cmember Returns TRUE if the file is a normal file */ + + // operations + void SetClipboard(CClipboardArray *pClipboard) { m_pClipboard=pClipboard; }; + CString GetDestinationPath(CString strPath, unsigned char ucCopyNumber, int iFlags); + + void SetSrcIndex(int iIndex) { m_iSrcIndex=iIndex; }; + int GetSrcIndex() const { return m_iSrcIndex; }; + + bool GetMove() { if (m_iSrcIndex != -1) return m_pClipboard->GetAt(m_iSrcIndex)->GetMove(); else return true; }; + + int GetBufferIndex() const; + + // operators + bool operator==(const CFileInfo& rInfo); + + // (re)/store data + void Store(CArchive& ar); + void Load(CArchive& ar); +private: + CString m_strFilePath; // contains relative path (first path is in CClipboardArray) + int m_iSrcIndex; // index in CClipboardArray table (which contains the first part of the path) + + DWORD m_dwAttributes; // attributes + ULONGLONG m_uhFileSize; /** @cmember File of size. (COM states LONGLONG as hyper, so "uh" means unsigned hyper) */ + COleDateTime m_timCreation; /** @cmember Creation time */ + COleDateTime m_timLastAccess; /** @cmember Last Access time */ + COleDateTime m_timLastWrite; /** @cmember Last write time */ + + // ptrs to elements providing data + CClipboardArray *m_pClipboard; +}; + +/** +* @class Allows to retrieve s from files/directories in a directory +*/ +class CFileInfoArray : public CArray +{ +public: + /** @access Public members */ + + /** + * @cmember Default constructor + */ + CFileInfoArray() { m_pClipboard=NULL; SetSize(0, 5000); }; + void Init(CClipboardArray* pClipboard) { m_pClipboard=pClipboard; }; + + /** + * @cmember Adds a file or all contained in a directory to the CFileInfoArray + * Only "static" data for CFileInfo is filled (by default CRC and checksum are NOT + * calculated when inserting CFileInfos). Returns the number of s added to the array + * @parm Name of the directory, ended in backslash. + * @parm Mask of files to add in case that strDirName is a directory + * @parm Wether to recurse or not subdirectories + * @parmopt Parameter to pass to protected member function AddFileInfo + * @parmopt Wether to add or not CFileInfos for directories + * @parmopt Pointer to a variable to signal abort of directory retrieval + * (multithreaded apps). + * @parmopt pulCount Pointer to a variable incremented each time a CFileInfo is added to the + * array (multithreaded apps). + * @xref + */ + void AddDir(CString strDirName, const CFiltersArray* pFilters, int iSrcIndex, + const bool bRecurse, const bool bIncludeDirs, const volatile bool* pbAbort=NULL); + + /** + * @cmember Adds a single file or directory to the CFileInfoArray. In case of directory, files + * contained in the directory are NOT added to the array. + * Returns the position in the array where the was added (-1 if + * wasn't added) + * @parm Name of the file or directory to add. NOT ended with backslash. + * @parm Parameter to pass to protected member function AddFileInfo. + * @xref + */ + int AddFile(CString strFilePath, int iSrcIndex); + + // store/restore + void Store(CArchive& ar) { int iSize=GetSize(); ar<>iSize; SetSize(iSize, 5000); CFileInfo fi; fi.SetClipboard(m_pClipboard); + for (int i=0;iLoadString(IDS_BYTE_STRING+i); + m_ctlSize1Multi.AddString(pszData); + m_ctlSize2Multi.AddString(pszData); + } + + // strings <, <=, ... + for (i=0;i<5;i++) + { + pszData=GetResManager()->LoadString(IDS_LT_STRING+i); + m_ctlSizeType1.AddString(pszData); + m_ctlSizeType2.AddString(pszData); + m_ctlDateType1.AddString(pszData); + m_ctlDateType2.AddString(pszData); + } + + for (i=0;i<3;i++) + { + m_ctlDateType.AddString(GetResManager()->LoadString(IDS_DATECREATED_STRING+i)); + } + + // copy data from CFileFilter to a dialog - mask + m_bFilter=m_ffFilter.m_bUseMask; + + CString strData; + m_ctlFilter.SetCurSel(m_ctlFilter.AddString(m_ffFilter.GetCombinedMask(strData))); + for (i=0;iLoadString(IDS_BYTE_STRING+i); + m_ctlSize1Multi.AddString(pszData); + m_ctlSize2Multi.AddString(pszData); + } + + // selection + m_ctlSize1Multi.SetCurSel(iPos[0]); + m_ctlSize2Multi.SetCurSel(iPos[1]); + + iPos[0]=m_ctlSizeType1.GetCurSel(); + iPos[1]=m_ctlSizeType2.GetCurSel(); + iPos[2]=m_ctlDateType1.GetCurSel(); + iPos[3]=m_ctlDateType2.GetCurSel(); + + m_ctlSizeType1.ResetContent(); + m_ctlSizeType2.ResetContent(); + m_ctlDateType1.ResetContent(); + m_ctlDateType2.ResetContent(); + + // strings <, <=, ... + for (i=0;i<5;i++) + { + pszData=GetResManager()->LoadString(IDS_LT_STRING+i); + m_ctlSizeType1.AddString(pszData); + m_ctlSizeType2.AddString(pszData); + m_ctlDateType1.AddString(pszData); + m_ctlDateType2.AddString(pszData); + } + + m_ctlSizeType1.SetCurSel(iPos[0]); + m_ctlSizeType2.SetCurSel(iPos[1]); + m_ctlDateType1.SetCurSel(iPos[2]); + m_ctlDateType2.SetCurSel(iPos[3]); + + iPos[0]=m_ctlDateType.GetCurSel(); + m_ctlDateType.ResetContent(); + for (i=0;i<3;i++) + { + m_ctlDateType.AddString(GetResManager()->LoadString(IDS_DATECREATED_STRING+i)); + } + m_ctlDateType.SetCurSel(iPos[0]); +} + +void CFilterDlg::SetSize1(unsigned __int64 ullSize) +{ + if ((ullSize % 1048576) == 0 && ullSize != 0) + { + m_uiSize1=static_cast(ullSize/1048576); + m_ctlSize1Multi.SetCurSel(2); + } + else if ((ullSize % 1024) == 0 && ullSize != 0) + { + m_uiSize1=static_cast(ullSize/1024); + m_ctlSize1Multi.SetCurSel(1); + } + else + { + m_uiSize1=static_cast(ullSize); + m_ctlSize1Multi.SetCurSel(0); + } +} + +void CFilterDlg::SetSize2(unsigned __int64 ullSize) +{ + if ((ullSize % 1048576) == 0 && ullSize != 0) + { + m_uiSize2=static_cast(ullSize/1048576); + m_ctlSize2Multi.SetCurSel(2); + } + else if ((ullSize % 1024) == 0 && ullSize != 0) + { + m_uiSize2=static_cast(ullSize/1024); + m_ctlSize2Multi.SetCurSel(1); + } + else + { + m_uiSize2=static_cast(ullSize); + m_ctlSize2Multi.SetCurSel(0); + } +} + +void CFilterDlg::EnableControls() +{ + UpdateData(TRUE); + // mask + m_ctlFilter.EnableWindow(m_bFilter); + + m_ctlExcludeMask.EnableWindow(m_bExclude); + + // size + m_ctlSizeType1.EnableWindow(m_bSize); + m_ctlSizeType2.EnableWindow(m_bSize && m_bSize2); + GetDlgItem(IDC_SIZE1_EDIT)->EnableWindow(m_bSize); + GetDlgItem(IDC_SIZE2_EDIT)->EnableWindow(m_bSize && m_bSize2); + GetDlgItem(IDC_SIZE1_SPIN)->EnableWindow(m_bSize); + GetDlgItem(IDC_SIZE2_SPIN)->EnableWindow(m_bSize && m_bSize2); + GetDlgItem(IDC_SIZE2_CHECK)->EnableWindow(m_bSize); + m_ctlSize1Multi.EnableWindow(m_bSize); + m_ctlSize2Multi.EnableWindow(m_bSize && m_bSize2); + + // date + CTime tmTemp; + bool bSecond=((m_ctlDate1.GetTime(tmTemp) == GDT_VALID) || (m_ctlTime1.GetTime(tmTemp) == GDT_VALID)); + m_ctlDateType.EnableWindow(m_bDate); + GetDlgItem(IDC_DATE2_CHECK)->EnableWindow(m_bDate && bSecond); + m_ctlDateType1.EnableWindow(m_bDate); + m_ctlDateType2.EnableWindow(m_bDate && m_bDate2 && bSecond); + m_ctlDate1.EnableWindow(m_bDate); + m_ctlDate2.EnableWindow(m_bDate && m_bDate2 && bSecond); + m_ctlTime1.EnableWindow(m_bDate); + m_ctlTime2.EnableWindow(m_bDate && m_bDate2 && bSecond); + + // attrib + GetDlgItem(IDC_ARCHIVE_CHECK)->EnableWindow(m_bAttributes); + GetDlgItem(IDC_READONLY_CHECK)->EnableWindow(m_bAttributes); + GetDlgItem(IDC_HIDDEN_CHECK)->EnableWindow(m_bAttributes); + GetDlgItem(IDC_SYSTEM_CHECK)->EnableWindow(m_bAttributes); + GetDlgItem(IDC_DIRECTORY_CHECK)->EnableWindow(m_bAttributes); +} + +void CFilterDlg::OnOK() +{ + UpdateData(TRUE); + + // CFileFilter --> dialogu - mask + CString strText; + m_ctlFilter.GetWindowText(strText); + m_ffFilter.m_bUseMask=((m_bFilter != 0) && !strText.IsEmpty()); + m_ffFilter.SetCombinedMask(strText); + + m_ctlExcludeMask.GetWindowText(strText); + m_ffFilter.m_bUseExcludeMask=(m_bExclude != 0) && !strText.IsEmpty(); + m_ffFilter.SetCombinedExcludeMask(strText); + + // size + m_ffFilter.m_bUseSize=(m_bSize != 0); + m_ffFilter.m_bUseSize2=(m_bSize2 != 0); + + m_ffFilter.m_iSizeType1=m_ctlSizeType1.GetCurSel(); + m_ffFilter.m_iSizeType2=m_ctlSizeType2.GetCurSel(); + + m_ffFilter.m_ullSize1=static_cast(m_uiSize1)*static_cast(GetMultiplier(m_ctlSize1Multi.GetCurSel())); + m_ffFilter.m_ullSize2=static_cast(m_uiSize2)*static_cast(GetMultiplier(m_ctlSize2Multi.GetCurSel())); + + // date + m_ffFilter.m_iDateType=m_ctlDateType.GetCurSel(); + + m_ffFilter.m_iDateType1=m_ctlDateType1.GetCurSel(); + m_ffFilter.m_iDateType2=m_ctlDateType2.GetCurSel(); + + m_ffFilter.m_bDate1=m_ctlDate1.GetTime(m_ffFilter.m_tDate1) == GDT_VALID; + m_ffFilter.m_bDate2=m_ctlDate2.GetTime(m_ffFilter.m_tDate2) == GDT_VALID; + m_ffFilter.m_bTime1=m_ctlTime1.GetTime(m_ffFilter.m_tTime1) == GDT_VALID; + m_ffFilter.m_bTime2=m_ctlTime2.GetTime(m_ffFilter.m_tTime2) == GDT_VALID; + + m_ffFilter.m_bUseDate=(m_bDate != 0) && (m_ffFilter.m_bDate1 || m_ffFilter.m_bTime1); + m_ffFilter.m_bUseDate2=(m_bDate2 != 0) && (m_ffFilter.m_bDate2 || m_ffFilter.m_bTime2); + + // attributes + m_ffFilter.m_bUseAttributes=(m_bAttributes != 0); + m_ffFilter.m_iArchive=m_iArchive; + m_ffFilter.m_iReadOnly=m_iReadOnly; + m_ffFilter.m_iHidden=m_iHidden; + m_ffFilter.m_iSystem=m_iSystem; + m_ffFilter.m_iDirectory=m_iDirectory; + + CHLanguageDialog::OnOK(); +} + +int CFilterDlg::GetMultiplier(int iIndex) +{ + switch (iIndex) + { + case 0: + return 1; + case 1: + return 1024; + case 2: + return 1048576; + default: + ASSERT(true); // bad index + return 1; + } +} + +void CFilterDlg::OnAttributesCheck() +{ + EnableControls(); +} + +void CFilterDlg::OnDateCheck() +{ + EnableControls(); +} + +void CFilterDlg::OnDate2Check() +{ + EnableControls(); +} + +void CFilterDlg::OnFilterCheck() +{ + EnableControls(); +} + +void CFilterDlg::OnSizeCheck() +{ + EnableControls(); +} + +void CFilterDlg::OnSize2Check() +{ + EnableControls(); +} + +void CFilterDlg::OnExcludemaskCheck() +{ + EnableControls(); +} + +void CFilterDlg::OnDatetimechangeTime1Datetimepicker(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + EnableControls(); + + *pResult = 0; +} + +void CFilterDlg::OnDatetimechangeDate1Datetimepicker(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + EnableControls(); + + *pResult = 0; +} Index: Copy Handler/FilterDlg.h =================================================================== diff -u --- Copy Handler/FilterDlg.h (revision 0) +++ Copy Handler/FilterDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,110 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __FILTERDLG_H__ +#define __FILTERDLG_H__ + +#include "FileInfo.h" +#include + +///////////////////////////////////////////////////////////////////////////// +// CFilterDlg dialog + +class CFilterDlg : public CHLanguageDialog +{ +// Construction +public: + CFilterDlg(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CFilterDlg) + enum { IDD = IDD_FILTER_DIALOG }; + CComboBox m_ctlExcludeMask; + CSpinButtonCtrl m_ctlSpin2; + CSpinButtonCtrl m_ctlSpin1; + CDateTimeCtrl m_ctlTime2; + CDateTimeCtrl m_ctlTime1; + CComboBox m_ctlSizeType2; + CComboBox m_ctlSizeType1; + CComboBox m_ctlSize2Multi; + CComboBox m_ctlSize1Multi; + CComboBox m_ctlFilter; + CComboBox m_ctlDateType; + CComboBox m_ctlDateType2; + CDateTimeCtrl m_ctlDate2; + CComboBox m_ctlDateType1; + CDateTimeCtrl m_ctlDate1; + int m_iArchive; + BOOL m_bAttributes; + BOOL m_bDate; + BOOL m_bDate2; + int m_iDirectory; + BOOL m_bFilter; + int m_iHidden; + int m_iReadOnly; + BOOL m_bSize; + UINT m_uiSize1; + BOOL m_bSize2; + UINT m_uiSize2; + int m_iSystem; + BOOL m_bExclude; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CFilterDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +public: + void SetSize2(unsigned __int64 ullSize); + CFileFilter m_ffFilter; + CStringArray m_astrAddMask; + CStringArray m_astrAddExcludeMask; + +protected: + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + int GetMultiplier(int iIndex); + void EnableControls(); + void SetSize1(unsigned __int64 ullSize); + + // Generated message map functions + //{{AFX_MSG(CFilterDlg) + virtual BOOL OnInitDialog(); + virtual void OnOK(); + afx_msg void OnAttributesCheck(); + afx_msg void OnDateCheck(); + afx_msg void OnDate2Check(); + afx_msg void OnFilterCheck(); + afx_msg void OnSizeCheck(); + afx_msg void OnSize2Check(); + afx_msg void OnExcludemaskCheck(); + afx_msg void OnDatetimechangeTime1Datetimepicker(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnDatetimechangeDate1Datetimepicker(NMHDR* pNMHDR, LRESULT* pResult); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/FolderDialog.cpp =================================================================== diff -u --- Copy Handler/FolderDialog.cpp (revision 0) +++ Copy Handler/FolderDialog.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1295 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" +#include "DirTreeCtrl.h" +#include "FolderDialog.h" +#include "memdc.h" +#include "Theme Helpers.h" +#include "shlobj.h" +#include "..\Common\FileSupport.h" +#include "StringHelpers.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +// dialog jako taki +const unsigned long __g_DlgTemplate[]={ + 0x82cf0040, 0x00000000, 0x00000000, 0x011b0000, 0x000000b4, 0x00000000, 0x00540008, 0x00680061, + 0x006d006f, 0x00000061 }; + +///////////////////////////////////////////////////////////////////////////// +// additional messages +#ifndef WM_THEMECHANGED +#define WM_THEMECHANGED 0x031A +#endif + +///////////////////////////////////////////////////////////////////////////// +// widow procedures - group subclassing for flicker free drawing +WNDPROC __g_pfButton; +WNDPROC __g_pfStatic; +WNDPROC __g_pfList; +WNDPROC __g_pfCombo; +WNDPROC __g_pfBaseCombo; +WNDPROC __g_pfEdit; + +///////////////////////////////////////////////////////////////////////////// +// Draws and calls the old window proc +LRESULT CALLBACK InternalWindowProc(WNDPROC pfWndProc, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_ERASEBKGND: + return (LRESULT)0; + break; + case WM_PAINT: + CWnd* pWnd=CWnd::FromHandle(hwnd); + CPaintDC dc(pWnd); + + // exclude header from update rect (only in report view) + int iID=GetDlgCtrlID(hwnd); + if (iID == IDC_SHORTCUT_LIST) + { + DWORD dwStyle = GetWindowLong(hwnd, GWL_STYLE); + if ((dwStyle & LVS_TYPEMASK) == LVS_REPORT) + { + CRect headerRect; + HWND hHeader=ListView_GetHeader(hwnd); + GetWindowRect(hHeader, &headerRect); + CPoint pt=headerRect.TopLeft(); + ScreenToClient(hwnd, &pt); + headerRect.left=pt.x; + headerRect.top=pt.y; + pt=headerRect.BottomRight(); + ScreenToClient(hwnd, &pt); + headerRect.right=pt.x; + headerRect.bottom=pt.y; + dc.ExcludeClipRect(&headerRect); + } + } + + CMemDC memdc(&dc, &dc.m_ps.rcPaint); + + if (dc.m_ps.fErase) + memdc.FillSolidRect(&dc.m_ps.rcPaint, GetSysColor(COLOR_WINDOW)); + + CallWindowProc(pfWndProc, hwnd, WM_PAINT, (WPARAM)memdc.GetSafeHdc(), 0); + return 0; + break; + } + + return CallWindowProc(pfWndProc, hwnd, uMsg, wParam, lParam); +} + +//////////////////////////////////////////////////////////////////////////// +// window proc for edit ctrl contained in combo +LRESULT CALLBACK EditWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + return InternalWindowProc(__g_pfEdit, hwnd, uMsg, wParam, lParam); +}; + +//////////////////////////////////////////////////////////////////////////// +// procedure for combo box contained in comboboxex +LRESULT CALLBACK ComboWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + return InternalWindowProc(__g_pfBaseCombo, hwnd, uMsg, wParam, lParam); +}; + +//////////////////////////////////////////////////////////////////////////// +// other visual elements' window proc +LRESULT CALLBACK CustomWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + int iID=GetDlgCtrlID(hwnd); + WNDPROC pfOld=NULL; + switch(iID) + { + case IDC_TOGGLE_BUTTON: + case IDOK: + case IDCANCEL: + pfOld=__g_pfButton; + break; + case IDC_TITLE_STATIC: + pfOld=__g_pfStatic; + break; + case IDC_PATH_COMBOBOXEX: + pfOld=__g_pfCombo; + break; + case IDC_SHORTCUT_LIST: + pfOld=__g_pfList; + break; + default: + ASSERT(false); // used CustomWindowProc, but no ID has been recognized + } + + return InternalWindowProc(pfOld, hwnd, uMsg, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////// +// CFolderDialog dialog + +CFolderDialog::CFolderDialog(CWnd* /*pParent*/ /*=NULL*/) + : CHLanguageDialog() +{ + //{{AFX_DATA_INIT(CFolderDialog) + //}}AFX_DATA_INIT + m_hImages=NULL; + m_hLargeImages=NULL; + m_bIgnoreUpdate=false; + m_bIgnoreTreeRefresh=false; +} + +CFolderDialog::~CFolderDialog() +{ +} + +BEGIN_MESSAGE_MAP(CFolderDialog, CHLanguageDialog) + //{{AFX_MSG_MAP(CFolderDialog) + ON_NOTIFY(LVN_ENDLABELEDIT, IDC_SHORTCUT_LIST, OnEndLabelEditShortcutList) + ON_BN_CLICKED(IDC_ADDSHORTCUT_BUTTON, OnAddShortcut) + ON_BN_CLICKED(IDC_REMOVESHORTCUT_BUTTON, OnRemoveShortcut) + ON_BN_CLICKED(IDC_TOGGLE_BUTTON, OnToggleButton) + ON_NOTIFY(TVN_SELCHANGED, IDC_FOLDER_TREE, OnSelchangedFolderTree) + ON_NOTIFY(TVN_GETINFOTIP, IDC_FOLDER_TREE, OnGetInfoTipFolderTree) + ON_BN_CLICKED(IDC_NEWFOLDER_BUTTON, OnNewfolderButton) + ON_CBN_EDITCHANGE(IDC_PATH_COMBOBOXEX, OnPathChanging) + ON_BN_CLICKED(IDC_LARGEICONS_BUTTON, OnIconsRadio) + ON_BN_CLICKED(IDC_SMALLICONS_BUTTON, OnSmalliconsRadio) + ON_BN_CLICKED(IDC_LIST_BUTTON, OnListRadio) + ON_BN_CLICKED(IDC_REPORT_BUTTON, OnReportRadio) + ON_NOTIFY(LVN_ITEMCHANGED, IDC_SHORTCUT_LIST, OnItemchangedShortcutList) + ON_NOTIFY(LVN_GETINFOTIP, IDC_SHORTCUT_LIST, OnGetShortcutInfoTip) + ON_NOTIFY(LVN_KEYDOWN, IDC_SHORTCUT_LIST, OnShortcutKeyDown) + ON_WM_PAINT() + ON_WM_NCHITTEST() + ON_WM_SIZE() + ON_WM_GETMINMAXINFO() + ON_WM_SYSCOLORCHANGE() + ON_WM_CREATE() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CFolderDialog message handlers + +///////////////////////////////////////////////////////////////////////////// +// creating all needed controls + +int CFolderDialog::CreateControls() +{ + // std rect - size doesn't matter for now + CRect rc(0, 0, 0, 0); + + if (!m_ctlTitle.Create(_T(""), WS_CHILD | WS_VISIBLE, rc, this, IDC_TITLE_STATIC) || + (__g_pfStatic=(WNDPROC)SetWindowLong(m_ctlTitle.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc)) == 0) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlTitle.SetFont(GetFont()); + + // buttons - small with bitmaps + if (!m_ctlLargeIcons.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_LARGEICONS_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlLargeIcons.SetImage(&m_ilList, 0); + + if (!m_ctlSmallIcons.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_SMALLICONS_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlSmallIcons.SetImage(&m_ilList, 1); + + if (!m_ctlList.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_LIST_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlList.SetImage(&m_ilList, 2); + + if (!m_ctlReport.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_REPORT_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlReport.SetImage(&m_ilList, 3); + + if (!m_ctlNewFolder.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_NEWFOLDER_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlNewFolder.SetImage(&m_ilList, 4); + + // listview + if (!m_ctlShortcuts.Create(WS_CHILD | WS_VISIBLE | LVS_SINGLESEL | LVS_SHAREIMAGELISTS | LVS_EDITLABELS | WS_TABSTOP | LVS_SMALLICON | LVS_SHOWSELALWAYS, rc, this, IDC_SHORTCUT_LIST) || + (__g_pfList=(WNDPROC)SetWindowLong(m_ctlShortcuts.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc)) == 0) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlShortcuts.SetExtendedStyle( LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_INFOTIP | LVS_EX_UNDERLINEHOT); + m_ctlShortcuts.ModifyStyleEx(0, WS_EX_CLIENTEDGE); + + // dir tree ctrl + if (!m_ctlTree.Create(WS_CHILD | WS_VISIBLE | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS + | TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_SINGLEEXPAND | TVS_INFOTIP | + WS_TABSTOP | WS_VSCROLL, rc, this, IDC_FOLDER_TREE) + || !m_ctlTree.ModifyStyleEx(0, WS_EX_NOPARENTNOTIFY | WS_EX_CLIENTEDGE)) + { + TRACE("Error creating control..."); + return -1; + } + + // combobox + rc.bottom=rc.top+200; + if (!m_ctlPath.Create(WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWN | CBS_SORT | CBS_OWNERDRAWFIXED | CBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, rc, this, IDC_PATH_COMBOBOXEX) || + (__g_pfCombo=(WNDPROC)SetWindowLong(m_ctlPath.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc)) == 0) + { + TRACE("Error creating control..."); + return -1; + } + HWND hCombo=(HWND)m_ctlPath.SendMessage(CBEM_GETCOMBOCONTROL, 0, 0); + if ((__g_pfBaseCombo=(WNDPROC)SetWindowLong(hCombo, GWL_WNDPROC, (LONG)ComboWindowProc)) == 0) + return -1; + HWND hEdit=(HWND)m_ctlPath.SendMessage(CBEM_GETEDITCONTROL, 0, 0); + if ((__g_pfEdit=(WNDPROC)SetWindowLong(hEdit, GWL_WNDPROC, (LONG)EditWindowProc)) == 0) + return -1; + + // buttons OK & Cancel + rc.bottom=rc.top; + if (!m_ctlOk.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, rc, this, IDOK) || + (__g_pfButton=(WNDPROC)SetWindowLong(m_ctlOk.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc)) == 0) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlOk.SetFont(GetFont()); + + if (!m_ctlCancel.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, rc, this, IDCANCEL) || + !((WNDPROC)SetWindowLong(m_ctlCancel.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc))) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlCancel.SetFont(GetFont()); + + if (!m_ctlToggle.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, rc, this, IDC_TOGGLE_BUTTON) || + !((WNDPROC)SetWindowLong(m_ctlToggle.GetSafeHwnd(), GWL_WNDPROC, (LONG)CustomWindowProc))) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlToggle.SetFont(GetFont()); + + // add&remove shortcut + if (!m_ctlRemoveShortcut.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_REMOVESHORTCUT_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlRemoveShortcut.SetImage(&m_ilList, 6); + + if (!m_ctlAddShortcut.Create(_T(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, rc, this, IDC_ADDSHORTCUT_BUTTON)) + { + TRACE("Error creating control..."); + return -1; + } + m_ctlAddShortcut.SetImage(&m_ilList, 5); + + return 0; +} + +/////////////////////////////////////////////////////////////////////////// +// tworzy image list� z wszystkimi potrzebnymi ikonami +void CFolderDialog::InitImageList() +{ + m_ilList.Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); + + HICON hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_LARGEICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_SMALLICONS_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_LIST_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_REPORT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_NEWFOLDER_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_ADDSHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); + + hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDI_DELETESHORTCUT_ICON), IMAGE_ICON, 16, 16, LR_VGACOLOR); + m_ilList.Add(hIcon); +} + +//////////////////////////////////////////////////////////////////////////// +// applies showing/hiding shortcuts list +void CFolderDialog::ApplyExpandState(bool bExpand) +{ + // change button text and hide/show needed elements + m_ctlToggle.SetWindowText(GetResManager()->LoadString(bExpand ? IDS_BDRIGHT_STRING : IDS_BDLEFT_STRING)); + m_ctlShortcuts.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlLargeIcons.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlSmallIcons.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlList.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlReport.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlAddShortcut.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); + m_ctlRemoveShortcut.ShowWindow(bExpand ? SW_SHOW : SW_HIDE); +} + +//////////////////////////////////////////////////////////////////////////// +// toggle extended view +void CFolderDialog::OnToggleButton() +{ + m_bdData.bExtended=!m_bdData.bExtended; + ApplyExpandState(m_bdData.bExtended); + + CRect rcDialog; + GetClientRect(&rcDialog); + ResizeControls(rcDialog.Width(), rcDialog.Height()); +} + +///////////////////////////////////////////////////////////////////////////// +// initialization of most important params - reading text, bitmaps +BOOL CFolderDialog::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // image list + InitImageList(); + + if (CreateControls() == -1) + EndDialog(-1); + + // size of a dialog + CRect rcDialog; + GetClientRect(&rcDialog); + if (m_bdData.cx != 0) + rcDialog.right=rcDialog.left+m_bdData.cx; + if (m_bdData.cy != 0) + rcDialog.bottom=rcDialog.top+m_bdData.cy; + if (m_bdData.cy != 0 || m_bdData.cx != 0) + SetWindowPos(&wndTop, rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height(), SWP_NOMOVE); + + // show needed text + SetWindowText(m_bdData.strCaption); + m_ctlTitle.SetWindowText(m_bdData.strText); + m_ctlTree.SetIgnoreShellDialogs(m_bdData.bIgnoreDialogs); + m_ctlTree.PostMessage(WM_SETPATH, 0, (LPARAM)((LPCTSTR)m_bdData.strInitialDir)); + + // buttons text + m_ctlOk.SetWindowText(GetResManager()->LoadString(IDS_BDOK_STRING)); + m_ctlCancel.SetWindowText(GetResManager()->LoadString(IDS_BDCANCEL_STRING)); + ApplyExpandState(m_bdData.bExtended); + + // sys img list + SHFILEINFO sfi; + m_hImages = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + m_hLargeImages=(HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX); + m_ctlPath.SendMessage(CBEM_SETIMAGELIST, 0, (LPARAM)m_hImages); + m_ctlShortcuts.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_SMALL, (LPARAM)m_hImages); + m_ctlShortcuts.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)m_hLargeImages); + + // add all the paths from m_bdData.astrRecent + COMBOBOXEXITEM cbi; + CString strText; + cbi.mask=CBEIF_IMAGE | CBEIF_TEXT; + + for (int i=0;i<(int)m_bdData.cvRecent.size();i++) + { + cbi.iItem=i; + cbi.pszText=m_bdData.cvRecent.at(i); + sfi.iIcon=-1; + SHGetFileInfo(m_bdData.cvRecent.at(i), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + cbi.iImage=sfi.iIcon; + + m_ctlPath.InsertItem(&cbi); + } + + // additional columns in a list + LVCOLUMN lvc; + lvc.mask=LVCF_SUBITEM | LVCF_WIDTH | LVCF_TEXT; + lvc.iSubItem=-1; + lvc.cx=80; + lvc.pszText=(LPTSTR)GetResManager()->LoadString(IDS_BDNAME_STRING); + m_ctlShortcuts.InsertColumn(0, &lvc); + lvc.iSubItem=0; + lvc.cx=110; + lvc.pszText=(LPTSTR)GetResManager()->LoadString(IDS_BDPATH_STRING); + m_ctlShortcuts.InsertColumn(1, &lvc); + + // select view-style button + SetView(m_bdData.iView); + + // update shortcuts' list + CShortcut sc; + for (i=0;i<(int)m_bdData.cvShortcuts.size();i++) + { + sc=CString(m_bdData.cvShortcuts.at(i)); + sfi.iIcon=-1; + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.InsertItem(i, sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(i, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + } + + // now resize and ok. + GetClientRect(&rcDialog); + ResizeControls(rcDialog.Width(), rcDialog.Height()); + + // set to top - the strange way + SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + SetFocus(); + SetForegroundWindow(); + + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////// +// tooltip handling for controls in this dialog +BOOL CFolderDialog::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip) +{ + switch (uiID) + { + case IDC_NEWFOLDER_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDNEWFOLDER_STRING); + break; + case IDC_LARGEICONS_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDLARGEICONS_STRING); + break; + case IDC_SMALLICONS_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDSMALLICONS_STRING); + break; + case IDC_LIST_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDLIST_STRING); + break; + case IDC_REPORT_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDREPORT_STRING); + break; + case IDC_TOGGLE_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDDETAILS_STRING); + break; + case IDC_ADDSHORTCUT_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDADDSHORTCUT_STRING); + break; + case IDC_REMOVESHORTCUT_BUTTON: + pTip->lpszText=(LPTSTR)GetResManager()->LoadString(IDS_BDREMOVESHORTCUT_STRING); + break; + default: + return FALSE; + } + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// cancels the dialog or cancels editing of an item +void CFolderDialog::OnCancel() +{ + if (m_ctlTree.IsEditing()) + { + TreeView_EndEditLabelNow(m_ctlTree.GetSafeHwnd(), TRUE); + return; + } + + CRect rcDlg; + GetWindowRect(&rcDlg); + m_bdData.cx=rcDlg.Width(); + m_bdData.cy=rcDlg.Height(); + + CHLanguageDialog::OnCancel(); +} + +/////////////////////////////////////////////////////////////////////////// +// finishes dialog's work or finished editing of an item +void CFolderDialog::OnOK() +{ + // if we edit an item in m_ctlTree + if (m_ctlTree.IsEditing()) + { + TreeView_EndEditLabelNow(m_ctlTree.GetSafeHwnd(), FALSE); + return; + } + + // update path, get rid of '\\' + m_ctlPath.GetWindowText(m_strPath); + if (m_strPath.Right(1) == _T('\\') || m_strPath.Right(1) == _T('/')) + m_strPath=m_strPath.Left(m_strPath.GetLength()-1); + + // does it exist as a folder ? +/* CFileFind fnd; + BOOL bExist=fnd.FindFile(m_strPath+_T("\\*")); + fnd.Close();*/ +// WIN32_FIND_DATA wfd; +// HANDLE hFind; + +// if (!bExist) + if ( GetFileAttributes(m_strPath) == INVALID_FILE_ATTRIBUTES) + { + MsgBox(IDS_BDPATHDOESNTEXIST_STRING, MB_OK | MB_ICONERROR); + return; + } + + m_bdData.cvRecent.insert(m_bdData.cvRecent.begin(), (const PTSTR)(LPCTSTR)(m_strPath+_T('\\')), true); + + CRect rcDlg; + GetWindowRect(&rcDlg); + m_bdData.cx=rcDlg.Width(); + m_bdData.cy=rcDlg.Height(); + + CHLanguageDialog::OnOK(); +} + +/////////////////////////////////////////////////////////////////////////// +// Displays dialog from __g_DlgTemplate +int CFolderDialog::DoModal() +{ + if (!InitModalIndirect((LPCDLGTEMPLATE)__g_DlgTemplate)) + return -1; + else + return CHLanguageDialog::DoModal(); +} + +/////////////////////////////////////////////////////////////////////////// +// handles creation of a new folder +void CFolderDialog::OnNewfolderButton() +{ + // currently selected item + HTREEITEM hItem=m_ctlTree.GetSelectedItem(); + if (hItem == NULL) + return; + + // insert child item + m_ctlTree.InsertNewFolder(hItem, _T("")); +} + +///////////////////////////////////////////////////////////////////////////// +// other messages +LRESULT CFolderDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_CREATEFOLDERRESULT: + if (((int)lParam) != 1) + MsgBox(IDS_BDCANNOTCREATEFOLDER_STRING); + break; + case WM_THEMECHANGED: + CRect rcDialog; + GetClientRect(&rcDialog); + ResizeControls(rcDialog.Width(), rcDialog.Height()); + break; + } + + return CHLanguageDialog::WindowProc(message, wParam, lParam); +} + +////////////////////////////////////////////////////////////////////////////// +// tooltips for folder tree +void CFolderDialog::OnGetInfoTipFolderTree(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMTVGETINFOTIP* pit = (NMTVGETINFOTIP*)pNMHDR; + *pResult = 0; + + // get rid of old tip + m_strTip.Empty(); + + // get type of an item - for floppy skip + SHDESCRIPTIONID shdi; + bool bSkipFreeSpace=false; + if (m_ctlTree.GetItemShellData(pit->hItem, SHGDFIL_DESCRIPTIONID, &shdi, sizeof(SHDESCRIPTIONID)) + && ( shdi.dwDescriptionId == SHDID_COMPUTER_DRIVE35 + || shdi.dwDescriptionId == SHDID_COMPUTER_DRIVE525 ) ) + bSkipFreeSpace=true; + + + // some about network + bool bNet; + CString strData; + NETRESOURCE* pnet=(NETRESOURCE*)m_szBuffer; + if ( (bNet=m_ctlTree.GetItemShellData(pit->hItem, SHGDFIL_NETRESOURCE, pnet, 2048)) == true) + { + if (pnet->lpRemoteName && _tcscmp(pnet->lpRemoteName, _T("")) != 0) + m_strTip+=GetResManager()->LoadString(IDS_BDREMOTENAME_STRING)+CString(pnet->lpRemoteName)+_T("\n"); + if ( pnet->lpLocalName && _tcscmp(pnet->lpLocalName, _T("")) != 0) + m_strTip+=GetResManager()->LoadString(IDS_BDLOCALNAME_STRING)+CString(pnet->lpLocalName)+_T("\n"); + if ( pnet->dwDisplayType != 0) + m_strTip+=GetResManager()->LoadString(IDS_BDTYPE_STRING)+CString(GetResManager()->LoadString(IDS_BDDOMAIN_STRING+pnet->dwDisplayType))+_T("\n"); + if ( pnet->lpProvider && _tcscmp(pnet->lpProvider, _T("")) != 0) + m_strTip+=GetResManager()->LoadString(IDS_BDNETTYPE_STRING)+CString(pnet->lpProvider)+_T("\n"); + if ( pnet->lpComment && _tcscmp(pnet->lpComment, _T("")) != 0) + m_strTip+=GetResManager()->LoadString(IDS_BDDESCRIPTION_STRING)+CString(pnet->lpComment)+_T("\n"); + } + + // try to get path + CString strPath, strMask; + TCHAR szSizeFree[32], szSizeTotal[32]; + bool bPath; + if ( (bPath=m_ctlTree.GetPath(pit->hItem, strPath.GetBuffer(_MAX_PATH))) == true ) + { + strPath.ReleaseBuffer(); + if (!bNet && !strPath.IsEmpty()) + m_strTip+=strPath+_T("\n"); + + if (!bSkipFreeSpace) + { + // get disk free space + __int64 llFree, llTotal; + if (GetDynamicFreeSpace(strPath, &llFree, &llTotal)) + { + m_strTip+=GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(llFree, szSizeFree, false))+_T("\n"); + m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(llTotal, szSizeTotal, false))+_T("\n"); + } + } + } + + if (!bNet && !bPath) + { + // get std shell msg + m_ctlTree.GetItemInfoTip(pit->hItem, &m_strTip); + } + else + { + // get rid of '\n' + m_strTip=m_strTip.Left(m_strTip.GetLength()-1); + } + + // set + pit->pszText=m_strTip.GetBuffer(1); // tip doesn't change - skip RelaseBuffer + pit->cchTextMax=lstrlen(pit->pszText); +} + +///////////////////////////////////////////////////////////////////////////// +// tooltip support for shortcuts list +void CFolderDialog::OnGetShortcutInfoTip(NMHDR* pNMHDR, LRESULT* /*pResult*/) +{ + NMLVGETINFOTIP* pit=(NMLVGETINFOTIP*)pNMHDR; + m_strTip.Empty(); + + if (pit->iItem < 0 || pit->iItem >= (int)m_bdData.cvShortcuts.size()) + return; // out of range + + CShortcut sc=CString(m_bdData.cvShortcuts.at(pit->iItem)); + m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager()->LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; + + // get disk free space + __int64 llFree, llTotal; + if (GetDynamicFreeSpace(sc.m_strPath, &llFree, &llTotal)) + { + m_strTip+=CString(_T("\r\n"))+GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(llFree, m_szBuffer, false))+_T("\n"); + m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(llTotal, m_szBuffer, false)); + } + + pit->pszText=(LPTSTR)(LPCTSTR)m_strTip; + pit->cchTextMax=m_strTip.GetLength()+1; +} + +//////////////////////////////////////////////////////////////////////////// +// updates text in combo when the selection in a tree changes +void CFolderDialog::OnSelchangedFolderTree(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; + TCHAR szPath[_MAX_PATH]; + + if (m_bIgnoreUpdate) + return; + + if (m_ctlTree.GetPath(pNMTreeView->itemNew.hItem, szPath)) + SetComboPath(szPath); + + *pResult = 0; +} + +//////////////////////////////////////////////////////////////////////////// +// updates folder tree when combo text changes +void CFolderDialog::OnPathChanging() +{ + if (m_bIgnoreTreeRefresh) + return; + + COMBOBOXEXITEM cbi; + cbi.mask=CBEIF_TEXT; + cbi.iItem=-1; + cbi.pszText=m_szBuffer; + cbi.cchTextMax=_MAX_PATH; + + if (!m_ctlPath.GetItem(&cbi)) + return; + + UpdateComboIcon(); + + m_bIgnoreUpdate=true; + m_ctlTree.SetPath(cbi.pszText); + m_bIgnoreUpdate=false; +} + +///////////////////////////////////////////////////////////////////////// +// sets text in comboboxex edit and updates icon +void CFolderDialog::SetComboPath(LPCTSTR lpszPath) +{ + // set current select to -1 + m_bIgnoreTreeRefresh=true; + m_ctlPath.SetCurSel(-1); + m_bIgnoreTreeRefresh=false; + + SHFILEINFO sfi; + sfi.iIcon=-1; + + COMBOBOXEXITEM cbi; + + cbi.mask=CBEIF_TEXT | CBEIF_IMAGE; + cbi.iItem=-1; + _tcscpy(m_szBuffer, lpszPath); + cbi.pszText=m_szBuffer; + SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SMALLICON | SHGFI_SYSICONINDEX); + cbi.iImage=sfi.iIcon; + m_bIgnoreTreeRefresh=true; + m_ctlPath.SetItem(&cbi); + m_bIgnoreTreeRefresh=false; +} + +////////////////////////////////////////////////////////////////////////// +// updates icon in comboex +void CFolderDialog::UpdateComboIcon() +{ + // get text from combo + COMBOBOXEXITEM cbi; + cbi.mask=CBEIF_TEXT; + cbi.iItem=m_ctlPath.GetCurSel()/*-1*/; + cbi.pszText=m_szBuffer; + cbi.cchTextMax=_MAX_PATH; + + if (!m_ctlPath.GetItem(&cbi)) + return; + + // select no item + m_bIgnoreTreeRefresh=true; + m_ctlPath.SetCurSel(-1); + m_bIgnoreTreeRefresh=false; + + // icon update + SHFILEINFO sfi; + sfi.iIcon=-1; + + cbi.mask |= CBEIF_IMAGE; + cbi.iItem=-1; + + CString str=(LPCTSTR)m_szBuffer; + if (str.Left(2) != _T("\\\\") || str.Find(_T('\\'), 2) != -1) + SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SMALLICON | SHGFI_SYSICONINDEX); + + cbi.iImage=sfi.iIcon; + + m_bIgnoreTreeRefresh=true; + m_ctlPath.SetItem(&cbi); + m_bIgnoreTreeRefresh=false; + + // unselect text in combo's edit + CEdit* pEdit=m_ctlPath.GetEditCtrl(); + if (!pEdit) + return; + + pEdit->SetSel(-1, -1); +} + +///////////////////////////////////////////////////////////////////////////// +// combo and treeview update +void CFolderDialog::OnItemchangedShortcutList(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMLISTVIEW* plv=(NMLISTVIEW*)pNMHDR; + + // current selection + if (plv->iItem >= 0 && plv->iItem < (int)m_bdData.cvShortcuts.size()) + { + CShortcut sc=CString(m_bdData.cvShortcuts.at(plv->iItem)); + m_ctlTree.SetPath(sc.m_strPath); + SetComboPath(sc.m_strPath); + } + + *pResult = 0; +} + +///////////////////////////////////////////////////////////////////////////// +// adding shortcut +void CFolderDialog::OnAddShortcut() +{ + // get current text + COMBOBOXEXITEM cbi; + cbi.mask=CBEIF_TEXT; + cbi.iItem=m_ctlPath.GetCurSel()/*-1*/; + cbi.pszText=m_szBuffer; + cbi.cchTextMax=_MAX_PATH; + + if (!m_ctlPath.GetItem(&cbi)) + { + MsgBox(IDS_BDNOSHORTCUTPATH_STRING); + return; + } + + // create new item - update shortcut list + CShortcut sc; + sc.m_strPath=cbi.pszText; + SHFILEINFO sfi; + sfi.iIcon=-1; + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + + // add to an array and to shortcuts list + m_bdData.cvShortcuts.push_back((const PTSTR)(LPCTSTR)(CString)(sc), true); + int iIndex=m_bdData.cvShortcuts.size()-1; + m_ctlShortcuts.InsertItem(iIndex, sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(iIndex, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + + // edit item + m_ctlShortcuts.SetFocus(); + if (m_ctlShortcuts.EditLabel(iIndex) == NULL) + { + TRACE("Couldn't edit shortcut list's item label\n"); + return; + } +} + +//////////////////////////////////////////////////////////////////////////// +// keyboard's delete button handling +void CFolderDialog::OnShortcutKeyDown(NMHDR* pNMHDR, LRESULT* /*pResult*/) +{ + LPNMLVKEYDOWN lpkd=(LPNMLVKEYDOWN)pNMHDR; + if (lpkd->wVKey == VK_DELETE) + OnRemoveShortcut(); +} + +//////////////////////////////////////////////////////////////////////////// +// deleting shortcut from list +void CFolderDialog::OnRemoveShortcut() +{ + POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); + if (pos) + { + int iSel=m_ctlShortcuts.GetNextSelectedItem(pos); + m_ctlShortcuts.DeleteItem(iSel); + m_bdData.cvShortcuts.erase(m_bdData.cvShortcuts.begin()+iSel, true); + + m_ctlShortcuts.Arrange(LVA_DEFAULT); + } +} + +/////////////////////////////////////////////////////////////////////////// +// finishing editing shortcut name +void CFolderDialog::OnEndLabelEditShortcutList(NMHDR* pNMHDR, LRESULT* pResult) +{ + NMLVDISPINFO* pdi = (NMLVDISPINFO*)pNMHDR; + + // editing has been cancelled - delete item + if (pdi->item.pszText == NULL) + { + m_ctlShortcuts.DeleteItem(pdi->item.iItem); + m_bdData.cvShortcuts.erase(m_bdData.cvShortcuts.begin()+pdi->item.iItem, true); + + *pResult=0; + return; + } + + // std editing - success + CShortcut sc=CString(m_bdData.cvShortcuts.at(pdi->item.iItem)); + sc.m_strName=pdi->item.pszText; + + m_bdData.cvShortcuts.replace(m_bdData.cvShortcuts.begin()+pdi->item.iItem, (const PTSTR)(LPCTSTR)(CString)sc, true, true); + + *pResult=1; +} + +//////////////////////////////////////////////////////////////////////////// +// sets the style of a shortcuts list +void CFolderDialog::SetView(int iView) +{ + DWORD dwView=0; + switch (iView) + { + case 0: + dwView=LVS_ICON; + break; + case 2: + dwView=LVS_SMALLICON; + break; + case 3: + dwView=LVS_REPORT; + break; + default: + dwView=LVS_LIST; + break; + } + + DWORD dwStyle = GetWindowLong(m_ctlShortcuts.GetSafeHwnd(), GWL_STYLE); + + // Only set the window style if the view bits have changed. + if ((dwStyle & LVS_TYPEMASK) != dwView) + SetWindowLong(m_ctlShortcuts.GetSafeHwnd(), GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | dwView); + m_ctlShortcuts.Arrange(LVA_ALIGNTOP); +} + +/////////////////////////////////////////////////////////////////////////// +// large icons +void CFolderDialog::OnIconsRadio() +{ + m_bdData.iView=0; + SetView(0); + m_ctlLargeIcons.Invalidate(); + m_ctlSmallIcons.Invalidate(); + m_ctlList.Invalidate(); + m_ctlReport.Invalidate(); +} + +/////////////////////////////////////////////////////////////////////////// +// small icons +void CFolderDialog::OnSmalliconsRadio() +{ + m_bdData.iView=1; + SetView(1); + m_ctlLargeIcons.Invalidate(); + m_ctlSmallIcons.Invalidate(); + m_ctlList.Invalidate(); + m_ctlReport.Invalidate(); +} + +/////////////////////////////////////////////////////////////////////////// +// list button +void CFolderDialog::OnListRadio() +{ + m_bdData.iView=2; + SetView(2); + m_ctlLargeIcons.Invalidate(); + m_ctlSmallIcons.Invalidate(); + m_ctlList.Invalidate(); + m_ctlReport.Invalidate(); +} + +/////////////////////////////////////////////////////////////////////////// +// report button +void CFolderDialog::OnReportRadio() +{ + m_bdData.iView=3; + SetView(3); + m_ctlLargeIcons.Invalidate(); + m_ctlSmallIcons.Invalidate(); + m_ctlList.Invalidate(); + m_ctlReport.Invalidate(); +} + +//////////////////////////////////////////////////////////////////////////// +// resize handling +void CFolderDialog::OnSize(UINT nType, int cx, int cy) +{ + CHLanguageDialog::OnSize(nType, cx, cy); + + ResizeControls(cx, cy); + InvalidateRect(&m_rcGripper); +} + +//////////////////////////////////////////////////////////////////////////// +// repositions controls within the dialog +void CFolderDialog::ResizeControls(int cx, int cy) +{ + // is app themed ? + CUxThemeSupport uxt; + bool bThemed=uxt.IsThemeSupported() && uxt.IsAppThemed(); + + // settings + const int iMargin=7; // dialog units + const int iTextCount=3; // ilo�� linii textu w staticu + + // small buttons + const int iBmpMargin=1; // margin between button and a bitmap within + const int iButtonWidth=(bThemed ? 20 : 16)+2*GetSystemMetrics(SM_CXEDGE)+2*iBmpMargin; // fixed size + const int iButtonHeight=(bThemed ? 20 : 16)+2*GetSystemMetrics(SM_CYEDGE)+2*iBmpMargin; + + // large buttons + const int iLargeButtonHeight=14; // OK&Cancel buttons (dialog units) + const int iLargeButtonWidth=50; // width in DU + const int iToggleButtonWidth=18; // toggle size + + // combo + const int iComboHeight=12; + const int iComboExpandedHeight=100; + + // static text at the top of dialog + CRect rcStatic( iMargin, iMargin, 0, iMargin+iTextCount*8 ); + MapDialogRect(&rcStatic); + rcStatic.right=cx-rcStatic.left; + + CWnd* pWnd=GetDlgItem(IDC_TITLE_STATIC); + if (pWnd) + { + pWnd->MoveWindow(&rcStatic); + pWnd->Invalidate(); + } + + // 4*button (**********) + CRect rcButton(iMargin, iMargin+iTextCount*8+5, 0, 0); + MapDialogRect(&rcButton); + rcButton.right=rcButton.left+iButtonWidth; + rcButton.bottom=rcButton.top+iButtonHeight; + pWnd=GetDlgItem(IDC_LARGEICONS_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + rcButton.left+=iButtonWidth; + rcButton.right+=iButtonWidth; + pWnd=GetDlgItem(IDC_SMALLICONS_BUTTON); + if (pWnd) + pWnd->MoveWindow(&rcButton); + + rcButton.left+=iButtonWidth; + rcButton.right+=iButtonWidth; + pWnd=GetDlgItem(IDC_LIST_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + rcButton.left+=iButtonWidth; + rcButton.right+=iButtonWidth; + pWnd=GetDlgItem(IDC_REPORT_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + // new folder button + rcButton=CRect(iMargin, iMargin+iTextCount*8+5, iMargin, 0); + MapDialogRect(&rcButton); + rcButton.left=cx-rcButton.left-iButtonWidth-1; // off by 1 - better looks + rcButton.right=cx-rcButton.right-1; + rcButton.bottom=rcButton.top+iButtonHeight; + pWnd=GetDlgItem(IDC_NEWFOLDER_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + // shortcuts list (**********) + CRect rcShortcuts(iMargin, iMargin+iTextCount*8+5+1, 2*iMargin+5, iMargin+iLargeButtonHeight+5+iComboHeight+3); + MapDialogRect(&rcShortcuts); + rcShortcuts.top+=iButtonHeight; // small button size + rcShortcuts.right=MulDiv((cx-rcShortcuts.right), 35, 120); + rcShortcuts.bottom=cy-rcShortcuts.bottom; + pWnd=GetDlgItem(IDC_SHORTCUT_LIST); + if (pWnd) + { + pWnd->MoveWindow(&rcShortcuts); + pWnd->Invalidate(); + } + + // button toggle + rcButton=CRect(iMargin+(m_bdData.bExtended ? 5 : 0), iMargin+iTextCount*8+5, iToggleButtonWidth, iLargeButtonHeight); + MapDialogRect(&rcButton); + if (m_bdData.bExtended) + rcButton.left+=rcShortcuts.Width()+1; + rcButton.right+=rcButton.left; + rcButton.bottom+=rcButton.top; + pWnd=GetDlgItem(IDC_TOGGLE_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + // tree ctrl + CRect rcTree(iMargin+(m_bdData.bExtended ? 5 : 0), iMargin+iTextCount*8+5+1, iMargin, iMargin+iLargeButtonHeight+5+iComboHeight+3 ); + MapDialogRect(&rcTree); + rcTree.top+=iButtonHeight; + rcTree.bottom=cy-rcTree.bottom; + rcTree.right=cx-rcTree.right; + if (m_bdData.bExtended) + rcTree.left+=rcShortcuts.Width(); + pWnd=GetDlgItem(IDC_FOLDER_TREE); + if (pWnd) + { + pWnd->MoveWindow(&rcTree); + pWnd->Invalidate(); + } + + // combo + CRect rcCombo(iMargin+(m_bdData.bExtended ? 5 : 0), iMargin+iLargeButtonHeight+5+iComboHeight, iMargin, iComboExpandedHeight/*iMargin+iLargeButtonHeight+5*/); + MapDialogRect(&rcCombo); + if (m_bdData.bExtended) + rcCombo.left+=rcShortcuts.Width(); + rcCombo.top=cy-rcCombo.top; + rcCombo.right=cx-rcCombo.right; + rcCombo.bottom+=rcCombo.top; + pWnd=GetDlgItem(IDC_PATH_COMBOBOXEX); + if (pWnd) + { + pWnd->MoveWindow(&rcCombo); + pWnd->Invalidate(); + } + + // button - add shortcut/remove shortcut + rcButton=CRect(0, iMargin+iLargeButtonHeight+5+iComboHeight, 0, 0); + MapDialogRect(&rcButton); + rcButton.top=cy-rcButton.top; + rcButton.left=rcShortcuts.right-iButtonWidth; + rcButton.right=rcButton.left+iButtonWidth; + rcButton.bottom=rcButton.top+iButtonHeight; + pWnd=GetDlgItem(IDC_ADDSHORTCUT_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + rcButton.left-=iButtonWidth; + rcButton.right-=iButtonWidth; + pWnd=GetDlgItem(IDC_REMOVESHORTCUT_BUTTON); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + // buttony - ok & cancel + rcButton=CRect(iMargin+2*iLargeButtonWidth+3, iMargin+iLargeButtonHeight, iMargin+iLargeButtonWidth+3, iMargin); + MapDialogRect(&rcButton); + rcButton.left=cx-rcButton.left; + rcButton.top=cy-rcButton.top; + rcButton.right=cx-rcButton.right; + rcButton.bottom=cy-rcButton.bottom; + pWnd=GetDlgItem(IDOK); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } + + rcButton=CRect(iMargin+iLargeButtonWidth, iMargin+iLargeButtonHeight, iMargin, iMargin); + MapDialogRect(&rcButton); + rcButton.left=cx-rcButton.left; + rcButton.top=cy-rcButton.top; + rcButton.right=cx-rcButton.right; + rcButton.bottom=cy-rcButton.bottom; + pWnd=GetDlgItem(IDCANCEL); + if (pWnd) + { + pWnd->MoveWindow(&rcButton); + pWnd->Invalidate(); + } +} + +/////////////////////////////////////////////////////////////////////////// +// minimum size of a window +void CFolderDialog::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) +{ + CRect rcMin(0, 0, 200, 160); + MapDialogRect(&rcMin); + lpMMI->ptMinTrackSize=rcMin.BottomRight(); +} + +///////////////////////////////////////////////////////////////////////////// +// paints a gripper +void CFolderDialog::OnPaint() +{ + if (!IsZoomed()) + { + CPaintDC dc(this); // device context for painting + + CRect rc; + GetClientRect(rc); + + rc.left = rc.right-GetSystemMetrics(SM_CXHSCROLL); + rc.top = rc.bottom-GetSystemMetrics(SM_CYVSCROLL); + m_rcGripper=rc; + dc.DrawFrameControl(rc, DFC_SCROLL, DFCS_SCROLLSIZEGRIP); + } + else + { + CPaintDC dc(this); + DefWindowProc(WM_PAINT, (WPARAM)dc.GetSafeHdc(), 0); + } +} + +//////////////////////////////////////////////////////////////////////////// +// hit testing in a gripper cause +UINT CFolderDialog::OnNcHitTest(CPoint point) +{ + UINT uiRes=CHLanguageDialog::OnNcHitTest(point); + if (uiRes == HTCLIENT) + { + CRect rc; + GetWindowRect(&rc); + rc.left = rc.right-GetSystemMetrics(SM_CXHSCROLL); + rc.top = rc.bottom-GetSystemMetrics(SM_CYVSCROLL); + if (rc.PtInRect(point)) + uiRes = HTBOTTOMRIGHT; + } + + return uiRes; +} + +//////////////////////////////////////////////////////////////////////////// +// returns combo's path after dialog finishes +void CFolderDialog::GetPath(LPTSTR pszPath) +{ + _tcscpy(pszPath, m_strPath); +} + +//////////////////////////////////////////////////////////////////////////// +// returns combo's path after dialog finishes +void CFolderDialog::GetPath(CString &rstrPath) +{ + rstrPath=m_strPath; +} + +//////////////////////////////////////////////////////////////////////////// +// opens choose folder dialog +int BrowseForFolder(CFolderDialog::BROWSEDATA* pData, LPTSTR pszPath) +{ + ASSERT(pData); + ASSERT(pszPath); + CFolderDialog dlg; + dlg.m_bdData=*pData; + + int iResult=dlg.DoModal(); + if (iResult == IDOK) + { + dlg.GetPath(pszPath); // returned path + *pData=dlg.m_bdData; // future + } + else + _tcscpy(pszPath, _T("")); + + return iResult; +} Index: Copy Handler/FolderDialog.h =================================================================== diff -u --- Copy Handler/FolderDialog.h (revision 0) +++ Copy Handler/FolderDialog.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,167 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + CFolderDialog dialog control + + Files: FolderDialog.h, FolderDialog.cpp + Author: Ixen Gerthannes + Usage: + 1. Construct variable of type CFolderDialog + 2. Fill m_bdData member with appropriate information + 3. Call DoModal() + Functions: + void GetPath(CString& rstrPath); - returns chosen path + void GetPath(LPTSTR pszPath); - returns chosen path +*************************************************************************/ +#ifndef __FOLDERDIALOG_H__ +#define __FOLDERDIALOG_H__ + +#include "afxtempl.h" +#include "DirTreeCtrl.h" +#include "ThemedButton.h" +#include "shortcuts.h" +#include "charvect.h" +#include "LanguageDialog.h" + +///////////////////////////////////////////////////////////////////////////// +// CFolderDialog dialog + +class CFolderDialog : public CHLanguageDialog +{ +// Construction +public: + CFolderDialog(CWnd* pParent = NULL); // standard constructor + virtual ~CFolderDialog(); + +// Dialog Data + //{{AFX_DATA(CFolderDialog) + //}}AFX_DATA + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CFolderDialog) + public: + virtual int DoModal(); + protected: + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +public: + virtual BOOL OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip); + + // structure used for passing parameters + struct BROWSEDATA + { + BROWSEDATA() { cx=0; cy=0; iView=2; bExtended=false; }; +// BROWSEDATA& operator=(const BROWSEDATA& data) { strCaption=data.strCaption; strText=data.strText; strInitialDir=data.strInitialDir; astrRecent.Copy(data.astrRecent); +// ascShortcuts.Copy(data.ascShortcuts); cx=data.cx; cy=data.cy; iView=data.iView; bExtended=data.bExtended; return *this;}; + + CString strCaption; + CString strText; + CString strInitialDir; + char_vector cvRecent; + char_vector cvShortcuts; + + int cx, cy; // pixels + int iView; // type of view (large icons, small icons, ...) + bool bExtended; // with the shortcuts or not + bool bIgnoreDialogs; // if tree ctrl should show shell dialogs in style 'insert floppy' + } m_bdData; + + // getting path - after dialog exits + void GetPath(CString& rstrPath); + void GetPath(LPTSTR pszPath); + + // function displays dialog with some parameters + friend int BrowseForFolder(BROWSEDATA* pData, LPTSTR pszPath); + +// Implementation +protected: + void InitImageList(); + void ApplyExpandState(bool bExpand); + int CreateControls(); + void SetView(int iView); + void UpdateComboIcon(); + void SetComboPath(LPCTSTR lpszPath); + void ResizeControls(int cx, int cy); + + CString m_strTip; // for tooltip storage + TCHAR m_szBuffer[2048]; // shell functions buffer + CString m_strPath; // for path after dialog exits + + bool m_bIgnoreUpdate; // ignores nearest edit update (with path) + bool m_bIgnoreTreeRefresh; // ignores nearest refreshing of tree ctrl + HIMAGELIST m_hImages, m_hLargeImages; // two system image lists - large and small icons + + // button bitmaps + CImageList m_ilList; // image list with buttons' images + + // last position in which gripper has been drawn + CRect m_rcGripper; + + // controls that'll be diaplyed in a dialog + CStatic m_ctlTitle; + CDirTreeCtrl m_ctlTree; + CComboBoxEx m_ctlPath; + CListCtrl m_ctlShortcuts; + CThemedButton m_ctlLargeIcons; + CThemedButton m_ctlSmallIcons; + CThemedButton m_ctlList; + CThemedButton m_ctlReport; + CThemedButton m_ctlNewFolder; + CButton m_ctlOk; + CButton m_ctlCancel; + CThemedButton m_ctlToggle; + CThemedButton m_ctlAddShortcut; + CThemedButton m_ctlRemoveShortcut; + + + // Generated message map functions + //{{AFX_MSG(CFolderDialog) + afx_msg void OnEndLabelEditShortcutList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnAddShortcut(); + afx_msg void OnRemoveShortcut(); + afx_msg void OnToggleButton(); + afx_msg void OnSelchangedFolderTree(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnGetInfoTipFolderTree(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnShortcutKeyDown(NMHDR* pNMHDR, LRESULT* pResult); + virtual BOOL OnInitDialog(); + afx_msg void OnNewfolderButton(); + virtual void OnCancel(); + virtual void OnOK(); + afx_msg void OnPathChanging(); + afx_msg void OnIconsRadio(); + afx_msg void OnSmalliconsRadio(); + afx_msg void OnListRadio(); + afx_msg void OnReportRadio(); + afx_msg void OnItemchangedShortcutList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnGetShortcutInfoTip(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnPaint(); + afx_msg UINT OnNcHitTest(CPoint point); + afx_msg void OnSize(UINT nType, int cx, int cy); + afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/HelpLngDialog.cpp =================================================================== diff -u --- Copy Handler/HelpLngDialog.cpp (revision 0) +++ Copy Handler/HelpLngDialog.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,61 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "HelpLngDialog.h" +#include "Copy Handler.h" + +///////////////////////////////////////////////////////////////////////////// +// CHLanguageDialog dialog + +BEGIN_MESSAGE_MAP(CHLanguageDialog, CLanguageDialog) + ON_WM_HELPINFO() + ON_WM_CONTEXTMENU() + ON_BN_CLICKED(IDC_HELP_BUTTON, OnHelpButton) +END_MESSAGE_MAP() + +BOOL CHLanguageDialog::OnHelpInfo(HELPINFO* pHelpInfo) +{ + if (pHelpInfo->iContextType == HELPINFO_WINDOW) + { + pHelpInfo->dwContextId=(m_uiResID << 16) | pHelpInfo->iCtrlId; + return GetApp()->HtmlHelp(HH_DISPLAY_TEXT_POPUP, (LPARAM)pHelpInfo); + } + else + return false; +} + +void CHLanguageDialog::OnContextMenu(CWnd* pWnd, CPoint point) +{ + HELPINFO hi; + hi.cbSize=sizeof(HELPINFO); + hi.iCtrlId=pWnd->GetDlgCtrlID(); + hi.dwContextId=(m_uiResID << 16) | hi.iCtrlId; + hi.hItemHandle=pWnd->m_hWnd; + hi.iContextType=HELPINFO_WINDOW; + hi.MousePos=point; + + GetApp()->HtmlHelp(HH_DISPLAY_TEXT_POPUP, (LPARAM)&hi); +} + +void CHLanguageDialog::OnHelpButton() +{ + GetApp()->HtmlHelp(HH_HELP_CONTEXT, m_uiResID+0x20000); +} Index: Copy Handler/HelpLngDialog.h =================================================================== diff -u --- Copy Handler/HelpLngDialog.h (revision 0) +++ Copy Handler/HelpLngDialog.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,40 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#pragma once + +#include "LanguageDialog.h" + +///////////////////////////////////////////////////////////////////////////// +// CHLanguageDialog dialog + +class CHLanguageDialog : public CLanguageDialog +{ +// Construction +public: + CHLanguageDialog(bool* pLock=NULL) : CLanguageDialog(pLock) { }; + CHLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL, bool* pLock=NULL) : CLanguageDialog(lpszTemplateName, pParent, pLock) { }; // standard constructor + CHLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL, bool* pLock=NULL) : CLanguageDialog(uiIDTemplate, pParent, pLock) { }; // standard constructor + + BOOL OnHelpInfo(HELPINFO* pHelpInfo); + void OnContextMenu(CWnd* pWnd, CPoint point); + void OnHelpButton(); + + DECLARE_MESSAGE_MAP() +}; \ No newline at end of file Index: Copy Handler/MainWnd.cpp =================================================================== diff -u --- Copy Handler/MainWnd.cpp (revision 0) +++ Copy Handler/MainWnd.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2088 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" + +#include "MainWnd.h" +#include "OptionsDlg.h" + +#include "shlobj.h" +#include "tchar.h" +#include "structs.h" +#include "dialogs.h" + +#pragma warning (disable : 4201) +#include "mmsystem.h" +#pragma warning (default : 4201) + +#include "FolderDialog.h" + +#include "CustomCopyDlg.h" +#include "ReplaceFilesDlg.h" +#include "btnIDs.h" +#include "SmallReplaceFilesDlg.h" +#include "ReplaceOnlyDlg.h" +#include "DstFileErrorDlg.h" +#include "..\Common\FileSupport.h" +#include "AboutDlg.h" +#include "NotEnoughRoomDlg.h" +#include "register.h" +#include "ShutdownDlg.h" +#include "StringHelpers.h" +#include "..\common\ipcstructs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define WM_ICON_NOTIFY WM_USER+4 +#define WM_SHOWMINIVIEW WM_USER+3 +#define WM_IDENTIFY WM_USER+11 + +#define TM_AUTOREMOVE 1000 +#define TM_AUTORESUME 1000 +#define TM_ACCEPTING 100 + +// assume max sectors of 4kB (for rounding) +#define MAXSECTORSIZE 4096 + +extern CSharedConfigStruct* g_pscsShared; + +extern int iCount; +extern unsigned short msg[]; + +extern int iOffCount; +extern unsigned char off[]; +extern unsigned short _hash[]; + + +///////////////////////////////////////////////////////////////////////////// +// CMainWnd +// registers main window class +ATOM CMainWnd::RegisterClass() +{ + WNDCLASS wc; + + wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = (WNDPROC)::DefWindowProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = AfxGetInstanceHandle(); + wc.hIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(AFX_IDI_STD_FRAME)); + wc.hCursor = ::LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wc.lpszMenuName = NULL; + wc.lpszClassName = _T("Copy Handler Wnd Class"); + + return ::RegisterClass(&wc); +} + +// creates this window +BOOL CMainWnd::Create() +{ + ATOM at=RegisterClass(); + + return CreateEx(WS_EX_TOOLWINDOW, (LPCTSTR)at, _T("Copy Handler"), WS_OVERLAPPED, 10, 10, 10, 10, NULL, (HMENU)NULL, NULL); +} + +int CMainWnd::ShowTrayIcon() +{ + // create system tray icon + HICON hIcon=(HICON)GetResManager()->LoadImage(MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR | LR_VGACOLOR); + bool bRes=m_ctlTray.CreateIcon(m_hWnd, WM_TRAYNOTIFY, GetApp()->GetAppNameVer(), hIcon, 0); + if (!bRes) + { + GetLog()->Log(_T("[CMainWnd] ... creating tray icon failed.")); + return -1; + } + +/* if (!m_ctlTray.ShowIcon()) + GetLog()->Log(_T("[CMainWnd] ... showing tray icon failed.")); + else + GetLog()->Log(_T("[CMainWnd] ... showing tray icon succeeded.")); +*/ + return 0; +} + +IMPLEMENT_DYNCREATE(CMainWnd, CWnd) + +BEGIN_MESSAGE_MAP(CMainWnd, CWnd) + //{{AFX_MSG_MAP(CMainWnd) + ON_COMMAND(ID_POPUP_SHOW_STATUS, OnPopupShowStatus) + ON_COMMAND(ID_POPUP_OPTIONS, OnPopupShowOptions) + ON_WM_CLOSE() + ON_WM_TIMER() + ON_WM_COPYDATA() + ON_WM_CREATE() + ON_COMMAND(ID_SHOW_MINI_VIEW, OnShowMiniView) + ON_COMMAND(ID_POPUP_CUSTOM_COPY, OnPopupCustomCopy) + ON_COMMAND(ID_APP_ABOUT, OnAppAbout) + ON_COMMAND(ID_POPUP_MONITORING, OnPopupMonitoring) + ON_COMMAND(ID_POPUP_SHUTAFTERFINISHED, OnPopupShutafterfinished) + ON_COMMAND(ID_POPUP_REGISTERDLL, OnPopupRegisterdll) + ON_COMMAND(ID_POPUP_UNREGISTERDLL, OnPopupUnregisterdll) + ON_COMMAND(ID_APP_EXIT, OnAppExit) + ON_COMMAND(ID_POPUP_HELP, OnPopupHelp) + //}}AFX_MSG_MAP + ON_MESSAGE(WM_ICON_NOTIFY, OnTrayNotification) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMainWnd construction/destruction + +CMainWnd::CMainWnd() +{ + m_pdlgStatus=NULL; + m_pdlgMiniView=NULL; + m_dwLastTime=0; +} + +CMainWnd::~CMainWnd() +{ +} + +// case insensitive replacement +inline void ReplaceNoCase(CString& rString, CString strOld, CString strNew) +{ + if (rString.Left(strOld.GetLength()).CompareNoCase(strOld) == 0) + rString=strNew+rString.Right(rString.GetLength()-strOld.GetLength()); +} + +bool TimeToFileTime(const COleDateTime& time, LPFILETIME pFileTime) +{ + SYSTEMTIME sysTime; + sysTime.wYear = (WORD)time.GetYear(); + sysTime.wMonth = (WORD)time.GetMonth(); + sysTime.wDay = (WORD)time.GetDay(); + sysTime.wHour = (WORD)time.GetHour(); + sysTime.wMinute = (WORD)time.GetMinute(); + sysTime.wSecond = (WORD)time.GetSecond(); + sysTime.wMilliseconds = 0; + + // convert system time to local file time + FILETIME localTime; + if (!SystemTimeToFileTime((LPSYSTEMTIME)&sysTime, &localTime)) + return false; + + // convert local file time to UTC file time + if (!LocalFileTimeToFileTime(&localTime, pFileTime)) + return false; + + return true; +} + +bool SetFileDirectoryTime(LPCTSTR lpszName, CFileInfo* pSrcInfo) +{ + FILETIME creation, lastAccess, lastWrite; + + if (!TimeToFileTime(pSrcInfo->GetCreationTime(), &creation) + || !TimeToFileTime(pSrcInfo->GetLastAccessTime(), &lastAccess) + || !TimeToFileTime(pSrcInfo->GetLastWriteTime(), &lastWrite) ) + return false; + + HANDLE handle=CreateFile(lpszName, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (handle == INVALID_HANDLE_VALUE) + return false; + + if (!SetFileTime(handle, &creation, &lastAccess, &lastWrite)) + { + CloseHandle(handle); + return false; + } + + if (!CloseHandle(handle)) + return false; + + return true; +} + +// searching for files +inline void RecurseDirectories(CTask* pTask) +{ + TRACE("Searching for files...\n"); + + // log + pTask->m_log.Log(IDS_OTFSEARCHINGFORFILES_STRING); + + // update status + pTask->SetStatus(ST_SEARCHING, ST_STEP_MASK); + + // delete the content of m_files + pTask->FilesRemoveAll(); + + // enter some data to m_files + int nSize=pTask->GetClipboardDataSize(); // size of m_clipboard + const CFiltersArray* pFilters=pTask->GetFilters(); + int iDestDrvNumber=pTask->GetDestDriveNumber(); + bool bIgnoreDirs=(pTask->GetStatus(ST_SPECIAL_MASK) & ST_IGNORE_DIRS) != 0; + bool bForceDirectories=(pTask->GetStatus(ST_SPECIAL_MASK) & ST_FORCE_DIRS) != 0; + bool bMove=pTask->GetStatus(ST_OPERATION_MASK) == ST_MOVE; + CFileInfo fi; + fi.SetClipboard(pTask->GetClipboard()); + + // add everything + for (int i=0;iGetClipboardData(i)->GetPath(), i)) + { + // log + pTask->m_log.Log(IDS_OTFMISSINGCLIPBOARDINPUT_STRING, pTask->GetClipboardData(i)->GetPath()); + continue; + } + else + { + // log + pTask->m_log.Log(IDS_OTFADDINGCLIPBOARDFILE_STRING, pTask->GetClipboardData(i)->GetPath()); + } + + // found file/folder - check if the dest name has been generated + if (pTask->GetClipboardData(i)->m_astrDstPaths.GetSize() == 0) + { + // generate something - if dest folder == src folder - search for copy + if (pTask->GetDestPath().GetPath() == fi.GetFileRoot()) + { + CString strSubst; + FindFreeSubstituteName(fi.GetFullFilePath(), pTask->GetDestPath().GetPath(), &strSubst); + pTask->GetClipboardData(i)->m_astrDstPaths.Add(strSubst); + } + else + pTask->GetClipboardData(i)->m_astrDstPaths.Add(fi.GetFileName()); + } + + // add if needed + if (fi.IsDirectory()) + { + // add if folder's aren't ignored + if (!bIgnoreDirs && !bForceDirectories) + { + pTask->FilesAdd(fi); + + // log + pTask->m_log.Log(IDS_OTFADDEDFOLDER_STRING, fi.GetFullFilePath()); + } + + // don't add folder contents when moving inside one disk boundary + if (bIgnoreDirs || !bMove || pTask->GetCopies() > 1 || iDestDrvNumber == -1 + || iDestDrvNumber != fi.GetDriveNumber() || CFileInfo::Exist(fi.GetDestinationPath(pTask->GetDestPath().GetPath(), 0, ((int)bForceDirectories) << 1)) ) + { + // log + pTask->m_log.Log(IDS_OTFRECURSINGFOLDER_STRING, fi.GetFullFilePath()); + + // no movefile possibility - use CustomCopyFile + pTask->GetClipboardData(i)->SetMove(false); + + pTask->FilesAddDir(fi.GetFullFilePath(), pFilters, i, true, !bIgnoreDirs || bForceDirectories); + } + + // check for kill need + if (pTask->GetKillFlag()) + { + // log + pTask->m_log.Log(IDS_OTFADDINGKILLREQEST_STRING); + throw new CProcessingException(E_KILL_REQUEST, pTask); + } + } + else + { + if (bMove && pTask->GetCopies() == 1 && iDestDrvNumber != -1 && iDestDrvNumber == fi.GetDriveNumber() && + !CFileInfo::Exist(fi.GetDestinationPath(pTask->GetDestPath().GetPath(), 0, ((int)bForceDirectories) << 1)) ) + { + // if moving within one partition boundary set the file size to 0 so the overall size will + // be ok + fi.SetLength64(0); + } + else + pTask->GetClipboardData(i)->SetMove(false); // no MoveFile + + pTask->FilesAdd(fi); // file - add + + // log + pTask->m_log.Log(IDS_OTFADDEDFILE_STRING, fi.GetFullFilePath()); + } + } + + // calc size of all files + pTask->CalcAllSize(); + + // update *m_pnTasksAll; + pTask->IncreaseAllTasksSize(pTask->GetAllSize()); + + // change state to ST_COPYING - finished searching for files + pTask->SetStatus(ST_COPYING, ST_STEP_MASK); + + // save task status + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + pTask->Store(szPath, true); + pTask->Store(szPath, false); + + // log + pTask->m_log.Log(IDS_OTFSEARCHINGFINISHED_STRING); +} + +// delete files - after copying +void DeleteFiles(CTask* pTask) +{ + // log + pTask->m_log.Log(IDS_OTFDELETINGFILES_STRING); + + // current processed path + BOOL bSuccess; + CFileInfo fi; + + // index points to 0 or next item to process + for (int i=pTask->GetCurrentIndex();iFilesGetSize();i++) + { + // set index in pTask to currently deleted element + pTask->SetCurrentIndex(i); + + // check for kill flag + if (pTask->GetKillFlag()) + { + // log + pTask->m_log.Log(IDS_OTFDELETINGKILLREQUEST_STRING); + throw new CProcessingException(E_KILL_REQUEST, pTask); + } + + // current processed element + fi=pTask->FilesGetAt(pTask->FilesGetSize()-i-1); + + // delete data + if (fi.IsDirectory()) + { + if (!GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY); + bSuccess=RemoveDirectory(fi.GetFullFilePath()); + } + else + { + // set files attributes to normal - it'd slow processing a bit, but it's better. + if (!GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); + bSuccess=DeleteFile(fi.GetFullFilePath()); + } + + // operation failed + DWORD dwLastError=GetLastError(); + if (!bSuccess && dwLastError != ERROR_PATH_NOT_FOUND && dwLastError != ERROR_FILE_NOT_FOUND) + { + // log + pTask->m_log.LogError(IDS_OTFDELETINGERROR_STRING, dwLastError, fi.GetFullFilePath()); + throw new CProcessingException(E_ERROR, pTask, IDS_CPEDELETINGERROR_STRING, dwLastError, fi.GetFullFilePath()); + } + }//for + + // change status to finished + pTask->SetStatus(ST_FINISHED, ST_STEP_MASK); + + // add 1 to current index - looks better + pTask->IncreaseCurrentIndex(); + + // log + pTask->m_log.Log(IDS_OTFDELETINGFINISHED_STRING); +} + +void CustomCopyFile(PCUSTOM_COPY_PARAMS pData) +{ + HANDLE hSrc=INVALID_HANDLE_VALUE, hDst=INVALID_HANDLE_VALUE; + try + { + // do we copy rest or recopy ? + bool bCopyRest=GetConfig()->GetBoolValue(PP_CMUSEAUTOCOMPLETEFILES); + UINT uiNotificationType=GetConfig()->GetIntValue(PP_CMSHOWVISUALFEEDBACK); + + // Data regarding dest file + CFileInfo fiDest; + bool bExist=fiDest.Create(pData->strDstFile, -1); + + int iDlgCode=-1; + int *piLastDlgDesc=NULL; // ptr to int describing last used dialog + + // don't ask for copy rest + bool bDontAsk=(pData->pTask->GetCurrentIndex() == pData->pTask->GetLastProcessedIndex()); + pData->pTask->SetLastProcessedIndex(-1); + + // if dest file size >0 - we can do somethng more than usual + if ( bExist ) + { + // src and dst files are the same + if (fiDest == *pData->pfiSrcFile) + { + // copy automatically or ask + if (uiNotificationType > 1 && !bDontAsk) + { + if (pData->pTask->m_iIdentical == -1) + { + // show feedback + CSmallReplaceFilesDlg dlg; + dlg.m_pfiSource=pData->pfiSrcFile; + dlg.m_pfiDest=&fiDest; + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + dlg.m_iDefaultOption=ID_IGNORE; + iDlgCode=dlg.DoModal(); + + piLastDlgDesc=&pData->pTask->m_iIdentical; + } + else + iDlgCode=pData->pTask->m_iIdentical; + } + else + { + // increase progress + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + + return; // don't continue if NC==0 or 1 + } + } + else // iDst != *pData->pfiSrcFile + { + // src and dst are different - check sizes + if (fiDest.GetLength64() < pData->pfiSrcFile->GetLength64()) + { + // we can copy rest + if (uiNotificationType > 0 && !bDontAsk) + { + if (pData->pTask->m_iDestinationLess == -1) + { + // show dialog + CReplaceFilesDlg dlg; + dlg.m_pfiSource=pData->pfiSrcFile; + dlg.m_pfiDest=&fiDest; + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + dlg.m_iDefaultOption=ID_COPYREST; + + iDlgCode=dlg.DoModal(); + + piLastDlgDesc=&pData->pTask->m_iDestinationLess; + } + else + iDlgCode=pData->pTask->m_iDestinationLess; + } + // else do nothing - bCopyRest has been initialized + } + else + { + // dst >= src size + if (uiNotificationType > 1 && !bDontAsk) + { + if (pData->pTask->m_iDestinationGreater == -1) + { + CSmallReplaceFilesDlg dlg; + dlg.m_pfiSource=pData->pfiSrcFile; + dlg.m_pfiDest=&fiDest; + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + dlg.m_iDefaultOption=ID_RECOPY; + iDlgCode=dlg.DoModal(); // wy�wietl + + piLastDlgDesc=&pData->pTask->m_iDestinationGreater; + } + else + iDlgCode=pData->pTask->m_iDestinationGreater; + } + else + bCopyRest=false; // this case - recopy + } + } // iDst == *pData->pfiSrcFile + } // bExist + + // check for dialog result + switch (iDlgCode) + { + case -1: + break; + case ID_IGNOREALL: + if (piLastDlgDesc != NULL) + *piLastDlgDesc=ID_IGNOREALL; + case ID_IGNORE: + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + return; + break; + case ID_COPYRESTALL: + if (piLastDlgDesc != NULL) + *piLastDlgDesc=ID_COPYRESTALL; + case ID_COPYREST: + bCopyRest=true; + break; + case IDCANCEL: + // log + if (GetConfig()->GetBoolValue(PP_CMCREATELOG)) + pData->pTask->m_log.Log(IDS_OTFPRECHECKCANCELREQUEST_STRING, pData->pfiSrcFile->GetFullFilePath()); + throw new CProcessingException(E_CANCEL, pData->pTask); + break; + case ID_RECOPYALL: + if (piLastDlgDesc != NULL) + *piLastDlgDesc=ID_RECOPYALL; + case ID_RECOPY: + bCopyRest=false; + break; + } + + // change attributes of a dest file + if (!GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); + + // first or second pass ? only for FFNB + bool bFirstPass=true; + + // check size of src file to know whether use flag FILE_FLAG_NOBUFFERING +l_start: + bool bNoBuffer=(bFirstPass && GetConfig()->GetBoolValue(PP_BFUSENOBUFFERING) && pData->pfiSrcFile->GetLength64() >= GetConfig()->GetIntValue(PP_BFBOUNDARYLIMIT)); + + // refresh data about file + if (!bFirstPass) + bExist=fiDest.Create(pData->strDstFile, -1); + + // open src +l_openingsrc: + hSrc=CreateFile(pData->pfiSrcFile->GetFullFilePath(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); + if (hSrc == INVALID_HANDLE_VALUE) + { + DWORD dwLastError=GetLastError(); + if (uiNotificationType < 1) + { + // log + pData->pTask->m_log.LogError(IDS_OTFOPENINGERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEOPENINGERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + } + else + { + if (pData->pTask->m_iMissingInput == -1) + { + // no source file - feedback + CFileInfo fiRealSrc; + fiRealSrc.Create(pData->pfiSrcFile->GetFullFilePath(), -1); + + CReplaceOnlyDlg dlg; + dlg.m_pfiSource=pData->pfiSrcFile; + dlg.m_pfiDest=&fiRealSrc; + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + dlg.m_iDefaultOption=ID_WAIT; + + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, dlg.m_strMessage.GetBuffer(_MAX_PATH), _MAX_PATH, NULL); + dlg.m_strMessage.ReleaseBuffer(); + + iDlgCode=dlg.DoModal(); + } + else + iDlgCode=pData->pTask->m_iMissingInput; + + switch (iDlgCode) + { + case ID_IGNOREALL: + pData->pTask->m_iMissingInput=ID_IGNOREALL; + case ID_IGNORE: + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + return; + break; + case IDCANCEL: + // log + pData->pTask->m_log.LogError(IDS_OTFOPENINGCANCELREQUEST_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + throw new CProcessingException(E_CANCEL, pData->pTask); + break; + case ID_WAIT: + // log + pData->pTask->m_log.LogError(IDS_OTFOPENINGWAITREQUEST_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEOPENINGERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + break; + case ID_RETRY: + // log + pData->pTask->m_log.LogError(IDS_OTFOPENINGRETRY_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath()); + goto l_openingsrc; + break; + } + } + } + + // open dest +l_openingdst: + hDst=CreateFile(pData->strDstFile, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | (bNoBuffer ? FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH : 0), NULL); + if (hDst == INVALID_HANDLE_VALUE) + { + DWORD dwLastError=GetLastError(); + if (uiNotificationType < 1) + { + // log + pData->pTask->m_log.LogError(IDS_OTFDESTOPENINGERROR_STRING, dwLastError, pData->strDstFile); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEDESTOPENINGERROR_STRING, dwLastError, pData->strDstFile); + } + else + { + if (pData->pTask->m_iOutputError == -1) + { + CDstFileErrorDlg dlg; + dlg.m_strFilename=pData->strDstFile; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, dlg.m_strMessage.GetBuffer(_MAX_PATH), _MAX_PATH, NULL); + dlg.m_strMessage.ReleaseBuffer(); + + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + dlg.m_iDefaultOption=ID_WAIT; + iDlgCode=dlg.DoModal(); + } + else + iDlgCode=pData->pTask->m_iOutputError; + + switch (iDlgCode) + { + case ID_RETRY: + // change attributes + if (!GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); + + // log + pData->pTask->m_log.LogError(IDS_OTFDESTOPENINGRETRY_STRING, dwLastError, pData->strDstFile); + goto l_openingdst; + break; + case IDCANCEL: + // log + pData->pTask->m_log.LogError(IDS_OTFDESTOPENINGCANCELREQUEST_STRING, dwLastError, pData->strDstFile); + throw new CProcessingException(E_CANCEL, pData->pTask); + break; + case ID_IGNOREALL: + pData->pTask->m_iOutputError=ID_IGNOREALL; + case ID_IGNORE: + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + return; + break; + case ID_WAIT: + // log + pData->pTask->m_log.LogError(IDS_OTFDESTOPENINGWAITREQUEST_STRING, dwLastError, pData->strDstFile); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEDESTOPENINGERROR_STRING, dwLastError, pData->strDstFile); + break; + } + } + } + + // seeking + DWORD dwLastError=0; + if (!pData->bOnlyCreate) + { + if ( bCopyRest ) // if copy rest + { + if (!bFirstPass || (bExist && fiDest.GetLength64() > 0)) + { + // try to move file pointers to the end + ULONGLONG ullMove=(bNoBuffer ? ROUNDDOWN(fiDest.GetLength64(), MAXSECTORSIZE) : fiDest.GetLength64()); + if (SetFilePointer64(hSrc, ullMove, FILE_BEGIN) == -1 || SetFilePointer64(hDst, ullMove, FILE_BEGIN) == -1) + { + // log + pData->pTask->m_log.LogError(IDS_OTFMOVINGPOINTERSERROR_STRING, GetLastError(), pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile, ullMove); + + // seek failed - seek to begin + if (SetFilePointer64(hSrc, 0, FILE_BEGIN) == -1 || SetFilePointer64(hDst, 0, FILE_BEGIN) == -1) + { + // log + dwLastError=GetLastError(); + pData->pTask->m_log.LogError(IDS_OTFRESTORINGPOINTERSERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPERESTORINGPOINTERSERROR_STRING, dwLastError, pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + } + else + { + // file pointers restored - if second pass subtract what's needed + if (!bFirstPass) + { + pData->pTask->IncreaseProcessedSize(-static_cast<__int64>(ullMove)); + pData->pTask->IncreaseProcessedTasksSize(-static_cast<__int64>(ullMove)); + } + } + } + else + { + // file pointers moved - so we have skipped some work - update positions + if (bFirstPass) // przy drugim obiegu jest ju� uwzgl�dnione + { + pData->pTask->IncreaseProcessedSize(ullMove); + pData->pTask->IncreaseProcessedTasksSize(ullMove); + } + } + } + } + else + if (!SetEndOfFile(hDst)) // if recopying - reset the dest file + { + // log + dwLastError=GetLastError(); + pData->pTask->m_log.LogError(IDS_OTFSETTINGZEROSIZEERROR_STRING, dwLastError, pData->strDstFile); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPESETTINGZEROSIZEERROR_STRING, dwLastError, pData->strDstFile); + } + + // copying + unsigned long tord, rd, wr; + int iBufferIndex; + do + { + // kill flag checks + if (pData->pTask->GetKillFlag()) + { + // log + pData->pTask->m_log.Log(IDS_OTFCOPYINGKILLREQUEST_STRING, pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + throw new CProcessingException(E_KILL_REQUEST, pData->pTask); + } + + // recreate buffer if needed + if (!(*pData->dbBuffer.GetSizes() == *pData->pTask->GetBufferSizes())) + { + // log + const BUFFERSIZES *pbs1=pData->dbBuffer.GetSizes(), *pbs2=pData->pTask->GetBufferSizes(); + + pData->pTask->m_log.Log(IDS_OTFCHANGINGBUFFERSIZE_STRING, + pbs1->m_uiDefaultSize, pbs1->m_uiOneDiskSize, pbs1->m_uiTwoDisksSize, pbs1->m_uiCDSize, pbs1->m_uiLANSize, + pbs2->m_uiDefaultSize, pbs2->m_uiOneDiskSize, pbs2->m_uiTwoDisksSize, pbs2->m_uiCDSize, pbs2->m_uiLANSize, + pData->pfiSrcFile->GetFullFilePath(), pData->strDstFile); + pData->pTask->SetBufferSizes(pData->dbBuffer.Create(pData->pTask->GetBufferSizes())); + } + + // establish count of data to read + iBufferIndex=pData->pTask->GetBufferSizes()->m_bOnlyDefault ? 0 : pData->pfiSrcFile->GetBufferIndex(); + tord=bNoBuffer ? ROUNDUP(pData->dbBuffer.GetSizes()->m_auiSizes[iBufferIndex], MAXSECTORSIZE) : pData->dbBuffer.GetSizes()->m_auiSizes[iBufferIndex]; + + // read + if (!ReadFile(hSrc, pData->dbBuffer, tord, &rd, NULL)) + { + // log + dwLastError=GetLastError(); + pData->pTask->m_log.LogError(IDS_OTFREADINGERROR_STRING, dwLastError, tord, pData->pfiSrcFile->GetFullFilePath()); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEREADINGERROR_STRING, dwLastError, tord, pData->pfiSrcFile->GetFullFilePath()); + } + + // change count of stored data + if (bNoBuffer && (ROUNDUP(rd, MAXSECTORSIZE)) != rd) + { + // we need to copy rest so do the second pass + // close files + CloseHandle(hSrc); + CloseHandle(hDst); + + // second pass + bFirstPass=false; + bCopyRest=true; // nedd to copy rest + + goto l_start; + } + + // zapisz + if (!WriteFile(hDst, pData->dbBuffer, rd, &wr, NULL) || wr != rd) + { + // log + dwLastError=GetLastError(); + pData->pTask->m_log.LogError(IDS_OTFWRITINGERROR_STRING, dwLastError, rd, pData->strDstFile); + throw new CProcessingException(E_ERROR, pData->pTask, IDS_CPEWRITINGERROR_STRING, dwLastError, rd, pData->strDstFile); + } + + // increase count of processed data + pData->pTask->IncreaseProcessedSize(rd); + pData->pTask->IncreaseProcessedTasksSize(rd); +// TRACE("Read: %d, Written: %d\n", rd, wr); + } + while ( rd != 0 ); + } + else + { + // we don't copy contents, but need to increase processed size + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + } + + // close files + CloseHandle(hSrc); + CloseHandle(hDst); + } + catch(...) + { + // log + pData->pTask->m_log.LogError(IDS_OTFCAUGHTEXCEPTIONCCF_STRING, GetLastError()); + + // close handles + if (hSrc != INVALID_HANDLE_VALUE) + CloseHandle(hSrc); + if (hDst != INVALID_HANDLE_VALUE) + CloseHandle(hDst); + + throw; + } +} + +// function processes files/folders +void ProcessFiles(CTask* pTask) +{ + // log + pTask->m_log.Log(IDS_OTFPROCESSINGFILES_STRING); + + // count how much has been done (updates also a member in CTaskArray) + pTask->CalcProcessedSize(); + + // create a buffer of size pTask->m_nBufferSize + CUSTOM_COPY_PARAMS ccp; + ccp.pTask=pTask; + ccp.bOnlyCreate=(pTask->GetStatus(ST_SPECIAL_MASK) & ST_IGNORE_CONTENT) != 0; + ccp.dbBuffer.Create(pTask->GetBufferSizes()); + + // helpers + CFileInfo fi; // for currently processed element + DWORD dwLastError; + + // begin at index which wasn't processed previously + int nSize=pTask->FilesGetSize(); // wielko�� tablicy + int iCopiesCount=pTask->GetCopies(); // ilo�� kopii + bool bIgnoreFolders=(pTask->GetStatus(ST_SPECIAL_MASK) & ST_IGNORE_DIRS) != 0; + bool bForceDirectories=(pTask->GetStatus(ST_SPECIAL_MASK) & ST_FORCE_DIRS) != 0; + const CDestPath& dpDestPath=pTask->GetDestPath(); + + // log + const BUFFERSIZES* pbs=ccp.dbBuffer.GetSizes(); + pTask->m_log.Log(IDS_OTFPROCESSINGFILESDATA_STRING, ccp.bOnlyCreate, + pbs->m_uiDefaultSize, pbs->m_uiOneDiskSize, pbs->m_uiTwoDisksSize, pbs->m_uiCDSize, pbs->m_uiLANSize, + nSize, iCopiesCount, bIgnoreFolders, dpDestPath.GetPath(), pTask->GetCurrentCopy(), pTask->GetCurrentIndex()); + + for (unsigned char j=pTask->GetCurrentCopy();jSetCurrentCopy(j); + for (int i=pTask->GetCurrentIndex();iSetCurrentIndex(i); + fi=pTask->FilesGetAtCurrentIndex(); + + // should we kill ? + if (pTask->GetKillFlag()) + { + // log + pTask->m_log.Log(IDS_OTFPROCESSINGKILLREQUEST_STRING); + throw new CProcessingException(E_KILL_REQUEST, pTask); + } + + // set dest path with filename + ccp.strDstFile=fi.GetDestinationPath(dpDestPath.GetPath(), j, ((int)bForceDirectories) << 1 | (int)bIgnoreFolders); + + // are the files/folders lie on the same partition ? + bool bMove=pTask->GetStatus(ST_OPERATION_MASK) == ST_MOVE; + if (bMove && dpDestPath.GetDriveNumber() != -1 && dpDestPath.GetDriveNumber() == fi.GetDriveNumber() && iCopiesCount == 1 && fi.GetMove()) + { + if (!MoveFile(fi.GetFullFilePath(), ccp.strDstFile)) + { + dwLastError=GetLastError(); + //log + pTask->m_log.LogError(IDS_OTFMOVEFILEERROR_STRING, dwLastError, fi.GetFullFilePath(), ccp.strDstFile); + throw new CProcessingException(E_ERROR, pTask, IDS_CPEMOVEFILEERROR_STRING, dwLastError, fi.GetFullFilePath(), ccp.strDstFile); + } + } + else + { + // if folder - create it + if ( fi.IsDirectory() ) + { + if (!CreateDirectory(ccp.strDstFile, NULL) && (dwLastError=GetLastError()) != ERROR_ALREADY_EXISTS ) + { + // log + pTask->m_log.LogError(IDS_OTFCREATEDIRECTORYERROR_STRING, dwLastError, ccp.strDstFile); + throw new CProcessingException(E_ERROR, pTask, IDS_CPECREATEDIRECTORYERROR_STRING, dwLastError, ccp.strDstFile); + } + + pTask->IncreaseProcessedSize(fi.GetLength64()); + pTask->IncreaseProcessedTasksSize(fi.GetLength64()); + } + else + { + // start copying/moving file + ccp.pfiSrcFile=&fi; + + // kopiuj dane + CustomCopyFile(&ccp); + + // if moving - delete file (only if config flag is set) + if (bMove && !GetConfig()->GetBoolValue(PP_CMDELETEAFTERFINISHED) && j == iCopiesCount-1) + { + if (!GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + SetFileAttributes(fi.GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); + DeleteFile(fi.GetFullFilePath()); // there will be another try later, so I don't check + // if succeeded + } + } + + // set a time + if (GetConfig()->GetBoolValue(PP_CMSETDESTDATE)) + SetFileDirectoryTime(ccp.strDstFile, &fi); // no error check - ma�o istotne + + // attributes + if (GetConfig()->GetBoolValue(PP_CMSETDESTATTRIBUTES)) + SetFileAttributes(ccp.strDstFile, fi.GetAttributes()); // j.w. + } + } + + // current copy finished - change what's needed + pTask->SetCurrentIndex(0); + } + + // delete buffer - it's not needed + ccp.dbBuffer.Delete(); + + // change status + if (pTask->GetStatus(ST_OPERATION_MASK) == ST_MOVE) + { + pTask->SetStatus(ST_DELETING, ST_STEP_MASK); + // set the index to 0 before deleting + pTask->SetCurrentIndex(0); + } + else + { + pTask->SetStatus(ST_FINISHED, ST_STEP_MASK); + + // to look better - increase current index by 1 + pTask->SetCurrentIndex(nSize); + } + // log + pTask->m_log.Log(IDS_OTFPROCESSINGFINISHED_STRING); +} + +void CheckForWaitState(CTask* pTask) +{ + // limiting operation count + pTask->SetStatus(ST_WAITING, ST_WAITING_MASK); + bool bContinue=false; + while (!bContinue) + { + if (pTask->CanBegin()) + { + TRACE("CAN BEGIN ALLOWED TO CONTINUE...\n"); + pTask->SetStatus(0, ST_WAITING); + bContinue=true; + + pTask->m_log.Log(IDS_OTFWAITINGFINISHED_STRING); + +// return; // skips sleep and kill flag checking + } + + Sleep(50); // not to make it too hard for processor + + if (pTask->GetKillFlag()) + { + // log + pTask->m_log.Log(IDS_OTFWAITINGKILLREQUEST_STRING); + throw new CProcessingException(E_KILL_REQUEST, pTask); + } + } +} + +UINT ThrdProc(LPVOID pParam) +{ + TRACE("\n\nENTERING ThrdProc (new task started)...\n"); + CTask* pTask=static_cast(pParam); + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + _tcscat(szPath, pTask->GetUniqueName()+_T(".log")); + pTask->m_log.Init(szPath, GetResManager(), GetConfig()->GetBoolValue(PP_CMCREATELOG)); + + // set thread boost + HANDLE hThread=GetCurrentThread(); + ::SetThreadPriorityBoost(hThread, GetConfig()->GetBoolValue(PP_CMDISABLEPRIORITYBOOST)); + + CTime tm=CTime::GetCurrentTime(); + pTask->m_log.Log(IDS_OTFTHREADSTART_STRING, tm.GetDay(), tm.GetMonth(), tm.GetYear(), tm.GetHour(), tm.GetMinute(), tm.GetSecond()); + + try + { + // to make the value stable + bool bReadTasksSize=GetConfig()->GetBoolValue(PP_CMREADSIZEBEFOREBLOCKING); + + if (!bReadTasksSize) + CheckForWaitState(pTask); // operation limiting + + // set what's needed + pTask->m_lLastTime=time(NULL); // last time (start counting) + + // search for files if needed + if ((pTask->GetStatus(ST_STEP_MASK) == ST_NULL_STATUS + || pTask->GetStatus(ST_STEP_MASK) == ST_SEARCHING)) + { + // get rid of info about processed sizes + pTask->DecreaseProcessedTasksSize(pTask->GetProcessedSize()); + pTask->SetProcessedSize(0); + pTask->DecreaseAllTasksSize(pTask->GetAllSize()); + pTask->SetAllSize(0); + + // start searching + RecurseDirectories(pTask); + } + + // check for free space + __int64 i64Needed, i64Available; +l_showfeedback: + pTask->m_log.Log(IDS_OTFCHECKINGSPACE_STRING); + + if (!pTask->GetRequiredFreeSpace(&i64Needed, &i64Available)) + { + pTask->m_log.Log(IDS_OTFNOTENOUGHFREESPACE_STRING, i64Needed, i64Available); + + // default + int iResult=ID_IGNORE; + + if (GetConfig()->GetIntValue(PP_CMSHOWVISUALFEEDBACK) > 0) + { + // make user know that some place is missing + CNotEnoughRoomDlg dlg; + dlg.m_bEnableTimer=GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK); + dlg.m_iTime=GetConfig()->GetIntValue(PP_CMFEEDBACKTIME); + + dlg.m_llRequired=i64Needed; + + for (int i=0;iGetClipboardDataSize();i++) + dlg.m_strFiles.Add(pTask->GetClipboardData(i)->GetPath()); + + dlg.m_strDisk=pTask->GetDestPath().GetPath(); + + // show + iResult=dlg.DoModal(); + } + + switch (iResult) + { + case IDCANCEL: + { + pTask->m_log.Log(IDS_OTFFREESPACECANCELREQUEST_STRING); + throw new CProcessingException(E_CANCEL, pTask); + break; + } + case ID_RETRY: + pTask->m_log.Log(IDS_OTFFREESPACERETRYING_STRING); + goto l_showfeedback; + break; + case ID_IGNORE: + pTask->m_log.Log(IDS_OTFFREESPACEIGNORE_STRING); + break; + } + } + + if (bReadTasksSize) + { + pTask->UpdateTime(); + pTask->m_lLastTime=-1; + + CheckForWaitState(pTask); + + pTask->m_lLastTime=time(NULL); + } + + // Phase II - copying/moving + if (pTask->GetStatus(ST_STEP_MASK) == ST_COPYING) + { + // decrease processed in ctaskarray - the rest will be done in ProcessFiles + pTask->DecreaseProcessedTasksSize(pTask->GetProcessedSize()); + ProcessFiles(pTask); + } + + // deleting data - III phase + if (pTask->GetStatus(ST_STEP_MASK) == ST_DELETING) + DeleteFiles(pTask); + + // refresh time + pTask->UpdateTime(); + + // save progress before killed + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + pTask->Store(szPath, false); + + // we are ending + pTask->DecreaseOperationsPending(); + + // play sound + if (GetConfig()->GetBoolValue(PP_SNDPLAYSOUNDS)) + { + GetConfig()->GetStringValue(PP_SNDFINISHEDSOUNDPATH, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); + } + + CTime tm=CTime::GetCurrentTime(); + pTask->m_log.Log(IDS_OTFTHREADFINISHED_STRING, tm.GetDay(), tm.GetMonth(), tm.GetYear(), tm.GetHour(), tm.GetMinute(), tm.GetSecond()); + + // we have been killed - the last operation + InterlockedIncrement(pTask->m_plFinished); + pTask->CleanupAfterKill(); + pTask->SetKilledFlag(); + } + catch(CProcessingException* e) + { + // increment count of beginnings + InterlockedIncrement(pTask->m_plFinished); + + // refresh time + pTask->UpdateTime(); + + // log + pTask->m_log.LogError(IDS_OTFCAUGHTEXCEPTIONMAIN_STRING, e->m_dwError, e->m_iType); + + if (e->m_iType == E_ERROR && GetConfig()->GetBoolValue(PP_SNDPLAYSOUNDS)) + { + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_SNDERRORSOUNDPATH, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); + } + + // cleanup changes flags and calls cleanup for a task + e->Cleanup(); + delete e; + + if (pTask->GetStatus(ST_WAITING_MASK) & ST_WAITING) + pTask->SetStatus(0, ST_WAITING); + + pTask->DecreaseOperationsPending(); + pTask->SetContinueFlag(false); + pTask->SetForceFlag(false); + + return 0xffffffff; // almost like -1 + } + + TRACE("TASK FINISHED - exiting ThrdProc.\n"); + return 0; +} + +UINT ClipboardMonitorProc(LPVOID pParam) +{ + volatile CLIPBOARDMONITORDATA* pData=static_cast(pParam); + ASSERT(pData->m_hwnd); + + // bufor + TCHAR path[_MAX_PATH]; + UINT i; // counter + CTask *pTask; // ptr to a task + CClipboardEntry* pEntry=NULL; + + // register clipboard format + UINT nFormat=RegisterClipboardFormat(_T("Preferred DropEffect")); + UINT uiCounter=0, uiShutCounter=0;; + LONG lFinished=0; + bool bEnd=false; + + while (!pData->bKill) + { + if (uiCounter == 0 && GetConfig()->GetBoolValue(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) + { + // get data from clipboard + OpenClipboard(pData->m_hwnd); + HANDLE handle=GetClipboardData(CF_HDROP); + + UINT nCount=DragQueryFile(static_cast(handle), 0xffffffff, NULL, 0); + + pTask=new CTask(&pData->m_pTasks->m_tcd); + + for (i=0;i(handle), i, path, _MAX_PATH); + pEntry=new CClipboardEntry; + pEntry->SetPath(path); + pTask->AddClipboardData(pEntry); + } + + if (IsClipboardFormatAvailable(nFormat)) + { + HANDLE handle=GetClipboardData(nFormat); + LPVOID addr=GlobalLock(handle); + + DWORD dwData=((DWORD*)addr)[0]; + if (dwData & DROPEFFECT_COPY) + pTask->SetStatus(ST_COPY, ST_OPERATION_MASK); // copy + else if (dwData & DROPEFFECT_MOVE) + pTask->SetStatus(ST_MOVE, ST_OPERATION_MASK); // move + + GlobalUnlock(handle); + } + else + pTask->SetStatus(ST_COPY, ST_OPERATION_MASK); // default - copy + + EmptyClipboard(); + CloseClipboard(); + + BUFFERSIZES bs; + bs.m_bOnlyDefault=GetConfig()->GetBoolValue(PP_BFUSEONLYDEFAULT); + bs.m_uiDefaultSize=GetConfig()->GetIntValue(PP_BFDEFAULT); + bs.m_uiOneDiskSize=GetConfig()->GetIntValue(PP_BFONEDISK); + bs.m_uiTwoDisksSize=GetConfig()->GetIntValue(PP_BFTWODISKS); + bs.m_uiCDSize=GetConfig()->GetIntValue(PP_BFCD); + bs.m_uiLANSize=GetConfig()->GetIntValue(PP_BFLAN); + + pTask->SetBufferSizes(&bs); + pTask->SetPriority(GetConfig()->GetIntValue(PP_CMDEFAULTPRIORITY)); + + // get dest folder + CFolderDialog dlg; + GetConfig()->GetStringArrayValue(PP_SHORTCUTS, &dlg.m_bdData.cvShortcuts); + GetConfig()->GetStringArrayValue(PP_RECENTPATHS, &dlg.m_bdData.cvRecent); + dlg.m_bdData.bExtended=GetConfig()->GetBoolValue(PP_FDEXTENDEDVIEW); + dlg.m_bdData.cx=GetConfig()->GetIntValue(PP_FDWIDTH); + dlg.m_bdData.cy=GetConfig()->GetIntValue(PP_FDHEIGHT); + dlg.m_bdData.iView=GetConfig()->GetIntValue(PP_FDSHORTCUTLISTSTYLE); + dlg.m_bdData.bIgnoreDialogs=GetConfig()->GetBoolValue(PP_FDIGNORESHELLDIALOGS); + + dlg.m_bdData.strInitialDir=(dlg.m_bdData.cvRecent.size() > 0) ? dlg.m_bdData.cvRecent.at(0) : _T(""); + + int iStatus=pTask->GetStatus(ST_OPERATION_MASK); + if (iStatus == ST_COPY) + dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLECOPY_STRING); + else if (iStatus == ST_MOVE) + dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLEMOVE_STRING); + else + dlg.m_bdData.strCaption=GetResManager()->LoadString(IDS_TITLEUNKNOWNOPERATION_STRING); + dlg.m_bdData.strText=GetResManager()->LoadString(IDS_MAINBROWSETEXT_STRING); + + // set count of data to display + int iClipboardSize=pTask->GetClipboardDataSize(); + int iEntries=(iClipboardSize > 3) ? 2 : iClipboardSize; + for (int i=0;iGetClipboardData(i)->GetPath()+_T("\n"); + + // add ... + if (iEntries < iClipboardSize) + dlg.m_bdData.strText+=_T("..."); + + // show window + int iResult=dlg.DoModal(); + + // set data to config + GetConfig()->SetStringArrayValue(PP_SHORTCUTS, &dlg.m_bdData.cvShortcuts); + GetConfig()->SetStringArrayValue(PP_RECENTPATHS, &dlg.m_bdData.cvRecent); + GetConfig()->SetBoolValue(PP_FDEXTENDEDVIEW, dlg.m_bdData.bExtended); + GetConfig()->SetIntValue(PP_FDWIDTH, dlg.m_bdData.cx); + GetConfig()->SetIntValue(PP_FDHEIGHT, dlg.m_bdData.cy); + GetConfig()->SetIntValue(PP_FDSHORTCUTLISTSTYLE, dlg.m_bdData.iView); + GetConfig()->SetBoolValue(PP_FDIGNORESHELLDIALOGS, dlg.m_bdData.bIgnoreDialogs); + GetConfig()->Save(); + + if ( iResult != IDOK ) + delete pTask; + else + { + // get dest path + CString strData; + dlg.GetPath(strData); + pTask->SetDestPath(strData); + + // get the relationship between src and dst paths + for (int i=0;iGetClipboard()->GetSize();i++) + pTask->GetClipboard()->GetAt(i)->CalcBufferIndex(pTask->GetDestPath()); + + // write pTask to a file + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + pTask->Store(szPath, true); + pTask->Store(szPath, false); + + // add task to a list of tasks and start + pData->m_pTasks->Add(pTask); + + // start processing + pTask->BeginProcessing(); + } + } + + // do we need to check for turning computer off + if (GetConfig()->GetBoolValue(PP_PSHUTDOWNAFTREFINISHED)) + { + if (uiShutCounter == 0) + { + if (lFinished != pData->m_pTasks->m_lFinished) + { + bEnd=true; + lFinished=pData->m_pTasks->m_lFinished; + } + + if (bEnd && pData->m_pTasks->IsFinished()) + { + TRACE("Shut down windows\n"); + bool bShutdown=true; + if (GetConfig()->GetIntValue(PP_PTIMEBEFORESHUTDOWN) != 0) + { + CShutdownDlg dlg; + dlg.m_iOverallTime=GetConfig()->GetIntValue(PP_PTIMEBEFORESHUTDOWN); + if (dlg.m_iOverallTime < 0) + dlg.m_iOverallTime=-dlg.m_iOverallTime; + bShutdown=(dlg.DoModal() != IDCANCEL); + } + + GetConfig()->SetBoolValue(PP_PSHUTDOWNAFTREFINISHED, false); + GetConfig()->Save(); + if (bShutdown) + { + // we're killed + pData->bKilled=true; + + // adjust token privileges for NT + HANDLE hToken=NULL; + TOKEN_PRIVILEGES tp; + if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken) + && LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tp.Privileges[0].Luid)) + { + tp.PrivilegeCount=1; + tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED; + + AdjustTokenPrivileges(hToken, FALSE, &tp, NULL, NULL, NULL); + } + + BOOL bExit=ExitWindowsEx(EWX_POWEROFF | EWX_SHUTDOWN | (GetConfig()->GetBoolValue(PP_PFORCESHUTDOWN) ? EWX_FORCE : 0), 0); + if (bExit) + return 1; + else + { + pData->bKilled=false; + + // some kind of error + CString strErr; + strErr.Format(GetResManager()->LoadString(IDS_SHUTDOWNERROR_STRING), GetLastError()); + AfxMessageBox(strErr, MB_ICONERROR | MB_OK | MB_SYSTEMMODAL); + } + } + } + } + } + else + { + bEnd=false; + lFinished=pData->m_pTasks->m_lFinished; + } + + // sleep for some time + const int iSleepCount=200; + Sleep(iSleepCount); + uiCounter+=iSleepCount; + uiShutCounter+=iSleepCount; + if (uiCounter >= (UINT)GetConfig()->GetIntValue(PP_PMONITORSCANINTERVAL)) + uiCounter=0; + if (uiShutCounter >= 800) + uiShutCounter=0; + } + + pData->bKilled=true; + TRACE("Monitoring clipboard proc aborted...\n"); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// CMainWnd message handlers + +int CMainWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + lpCreateStruct->dwExStyle |= WS_EX_TOPMOST; + if (CWnd::OnCreate(lpCreateStruct) == -1) + return -1; + + // get msg id of taskbar created message + m_uiTaskbarRestart=RegisterWindowMessage(_T("TaskbarCreated")); + + // Create the tray icon + ShowTrayIcon(); + + // initialize CTaskArray + m_tasks.Create(&ThrdProc); + + // load last state + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + m_tasks.LoadDataProgress(szPath); + m_tasks.TasksRetryProcessing(); + + // start clipboard monitoring + cmd.bKill=false; + cmd.bKilled=false; + cmd.m_hwnd=this->m_hWnd; + cmd.m_pTasks=&m_tasks; + + AfxBeginThread(&ClipboardMonitorProc, static_cast(&cmd), THREAD_PRIORITY_IDLE); + + // start saving timer + SetTimer(1023, GetConfig()->GetIntValue(PP_PAUTOSAVEINTERVAL), NULL); + + SetTimer(7834, TM_AUTORESUME/*GetConfig()->GetAutoRetryInterval()*/, NULL); + SetTimer(3245, TM_AUTOREMOVE, NULL); + SetTimer(8743, TM_ACCEPTING, NULL); // ends wait state in tasks + + if (GetConfig()->GetBoolValue(PP_MVAUTOSHOWWHENRUN)) + PostMessage(WM_SHOWMINIVIEW); + + return 0; +} + +LRESULT CMainWnd::OnTrayNotification(WPARAM wParam, LPARAM lParam) +{ + if (wParam != m_ctlTray.m_tnd.uID) + return (LRESULT)FALSE; + + TCHAR text[_MAX_PATH]; + switch(LOWORD(lParam)) + { + case WM_LBUTTONDOWN: + { + ::SetForegroundWindow(this->m_hWnd); + break; + } + case WM_LBUTTONDBLCLK: + { + CMenu mMenu, *pSubMenu; + HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); + if (!mMenu.Attach(hMenu)) + return (LRESULT)FALSE; + + if ((pSubMenu = mMenu.GetSubMenu(0)) == NULL) + return (LRESULT)FALSE; + + // double click received, the default action is to execute first menu item + ::SetForegroundWindow(this->m_hWnd); + ::SendMessage(this->m_hWnd, WM_COMMAND, pSubMenu->GetMenuItemID(0), 0); + + pSubMenu->DestroyMenu(); + mMenu.DestroyMenu(); + break; + } + case WM_RBUTTONUP: + { + // load main menu + HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_POPUP_MENU)); + CMenu mMenu, *pSubMenu; + if (!mMenu.Attach(hMenu)) + return (LRESULT)FALSE; + + if ((pSubMenu = mMenu.GetSubMenu(0)) == NULL) + return (LRESULT)FALSE; + + // set menu default item + pSubMenu->SetDefaultItem(0, TRUE); + + // make window foreground + SetForegroundWindow(); + + // get current cursor pos + POINT pt; + GetCursorPos(&pt); + + pSubMenu->CheckMenuItem(ID_POPUP_MONITORING, MF_BYCOMMAND | (GetConfig()->GetBoolValue(PP_PCLIPBOARDMONITORING) ? MF_CHECKED : MF_UNCHECKED)); + pSubMenu->CheckMenuItem(ID_POPUP_SHUTAFTERFINISHED, MF_BYCOMMAND | (GetConfig()->GetBoolValue(PP_PSHUTDOWNAFTREFINISHED) ? MF_CHECKED : MF_UNCHECKED)); + + // track the menu + pSubMenu->TrackPopupMenu(TPM_LEFTBUTTON, pt.x, pt.y, this); + + // destroy + pSubMenu->DestroyMenu(); + mMenu.DestroyMenu(); + + break; + } + case WM_MOUSEMOVE: + { + if (m_tasks.GetSize() != 0) + { + _stprintf(text, _T("%s - %d %%"), GetApp()->GetAppName(), m_tasks.GetPercent()); + m_ctlTray.SetTooltipText(text); + } + else + m_ctlTray.SetTooltipText(GetApp()->GetAppNameVer()); + break; + } + } + + return (LRESULT)TRUE; +} + +///////////////////////////////////////////////////////////////////////////// +// CMainWnd/CTrayIcon menu message handlers + +void CMainWnd::ShowStatusWindow(const CTask *pSelect) +{ + m_pdlgStatus=new CStatusDlg(&m_tasks, this); // self deleting + m_pdlgStatus->m_pInitialSelection=pSelect; + m_pdlgStatus->m_bLockInstance=true; + m_pdlgStatus->m_bAutoDelete=true; + m_pdlgStatus->Create(); + + // hide miniview if showing status + if (m_pdlgMiniView != NULL && m_pdlgMiniView->m_bLock) + { + if (::IsWindow(m_pdlgMiniView->m_hWnd)) + m_pdlgMiniView->HideWindow(); + } +} + +void CMainWnd::OnPopupShowStatus() +{ + ShowStatusWindow(); +} + +void CMainWnd::OnClose() +{ + PrepareToExit(); + CWnd::OnClose(); +} + +void CMainWnd::OnTimer(UINT nIDEvent) +{ + switch (nIDEvent) + { + case 1023: + // autosave timer + KillTimer(1023); + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + m_tasks.SaveProgress(szPath); + SetTimer(1023, GetConfig()->GetIntValue(PP_PAUTOSAVEINTERVAL), NULL); + break; + case 7834: + { + // auto-resume timer + KillTimer(7834); + DWORD dwTime=GetTickCount(); + DWORD dwInterval=(m_dwLastTime == 0) ? TM_AUTORESUME : dwTime-m_dwLastTime; + m_dwLastTime=dwTime; + + if (GetConfig()->GetBoolValue(PP_CMAUTORETRYONERROR)) + { + if (m_tasks.TasksRetryProcessing(true, dwInterval) && m_pdlgStatus && m_pdlgStatus->m_bLock && IsWindow(m_pdlgStatus->m_hWnd)) + m_pdlgStatus->SendMessage(WM_UPDATESTATUS); + } + SetTimer(7834, TM_AUTORESUME/*GetConfig()->GetAutoRetryInterval()*/, NULL); + } + break; + case 3245: + // auto-delete finished tasks timer + KillTimer(3245); + if (GetConfig()->GetBoolValue(PP_STATUSAUTOREMOVEFINISHED)) + { + int iSize=m_tasks.GetSize(); + m_tasks.RemoveAllFinished(); + if (m_tasks.GetSize() != iSize && m_pdlgStatus && m_pdlgStatus->m_bLock && IsWindow(m_pdlgStatus->m_hWnd)) + m_pdlgStatus->SendMessage(WM_UPDATESTATUS); + } + + SetTimer(3245, TM_AUTOREMOVE, NULL); + break; + case 8743: + { + // wait state handling section + CTask* pTask; + if (GetConfig()->GetIntValue(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig()->GetIntValue(PP_CMLIMITMAXOPERATIONS)) + { + for (int i=0;iGetStatus(ST_WAITING_MASK) & ST_WAITING && (GetConfig()->GetIntValue(PP_CMLIMITMAXOPERATIONS) == 0 || m_tasks.GetOperationsPending() < (UINT)GetConfig()->GetIntValue(PP_CMLIMITMAXOPERATIONS))) + { + TRACE("Enabling task %ld\n", i); + pTask->SetContinueFlag(true); + pTask->IncreaseOperationsPending(); + pTask->SetStatus(0, ST_WAITING); // turn off wait state + } + } + } + break; + } + } + + CWnd::OnTimer(nIDEvent); +} + +void CMainWnd::OnPopupShowOptions() +{ + COptionsDlg *pDlg=new COptionsDlg(this); + pDlg->m_bAutoDelete=true; + pDlg->m_bLockInstance=true; + pDlg->Create(); +} + +BOOL CMainWnd::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) +{ + // copying or moving ? + bool bMove=false; + switch(pCopyDataStruct->dwData & OPERATION_MASK) + { + case DD_MOVE_FLAG: + case EC_MOVETO_FLAG: + bMove=true; + break; + case EC_PASTE_FLAG: + case EC_PASTESPECIAL_FLAG: + bMove=(pCopyDataStruct->dwData & ~OPERATION_MASK) != 0; + break; + } + + // buffer with: dst path and src paths separated by single '\0' + TCHAR *pBuffer=static_cast(pCopyDataStruct->lpData); + unsigned long ulLen=pCopyDataStruct->cbData; + + CString str, strDstPath; + CStringArray astrFiles; + UINT iOffset=0; + + do + { + str=pBuffer+iOffset; + if (iOffset == 0) + strDstPath=str; + else + astrFiles.Add(str); + + iOffset+=str.GetLength()+1; + } + while (iOffset < ulLen); + + // special operation - modify stuff + CFiltersArray ffFilters; + int iPriority=GetConfig()->GetIntValue(PP_CMDEFAULTPRIORITY); + BUFFERSIZES bsSizes; + bsSizes.m_bOnlyDefault=GetConfig()->GetBoolValue(PP_BFUSEONLYDEFAULT); + bsSizes.m_uiDefaultSize=GetConfig()->GetIntValue(PP_BFDEFAULT); + bsSizes.m_uiOneDiskSize=GetConfig()->GetIntValue(PP_BFONEDISK); + bsSizes.m_uiTwoDisksSize=GetConfig()->GetIntValue(PP_BFTWODISKS); + bsSizes.m_uiCDSize=GetConfig()->GetIntValue(PP_BFCD); + bsSizes.m_uiLANSize=GetConfig()->GetIntValue(PP_BFLAN); + + BOOL bOnlyCreate=FALSE; + BOOL bIgnoreDirs=FALSE; + BOOL bForceDirectories=FALSE; + unsigned char ucCopies=1; + switch(pCopyDataStruct->dwData & OPERATION_MASK) + { + case DD_COPYMOVESPECIAL_FLAG: + case EC_PASTESPECIAL_FLAG: + case EC_COPYMOVETOSPECIAL_FLAG: + CCustomCopyDlg dlg; + dlg.m_ccData.m_astrPaths.Copy(astrFiles); + dlg.m_ccData.m_iOperation=bMove ? 1 : 0; + dlg.m_ccData.m_iPriority=iPriority; + dlg.m_ccData.m_strDestPath=strDstPath; + dlg.m_ccData.m_bsSizes=bsSizes; + dlg.m_ccData.m_bIgnoreFolders=(bIgnoreDirs != 0); + dlg.m_ccData.m_bForceDirectories=(bForceDirectories != 0); + dlg.m_ccData.m_bCreateStructure=(bOnlyCreate != 0); + dlg.m_ccData.m_ucCount=ucCopies; + GetConfig()->GetStringArrayValue(PP_RECENTPATHS, &dlg.m_ccData.m_vRecent); // recent paths + + int iModalResult; + if ( (iModalResult=dlg.DoModal()) == IDCANCEL) + return CWnd::OnCopyData(pWnd, pCopyDataStruct); + else if (iModalResult == -1) // windows has been closed by a parent + return TRUE; + + astrFiles.Copy(dlg.m_ccData.m_astrPaths); + bMove=(dlg.m_ccData.m_iOperation != 0); + iPriority=dlg.m_ccData.m_iPriority; + strDstPath=dlg.m_ccData.m_strDestPath; + bsSizes=dlg.m_ccData.m_bsSizes; + ffFilters.Copy(dlg.m_ccData.m_afFilters); + bIgnoreDirs=dlg.m_ccData.m_bIgnoreFolders; + bForceDirectories=dlg.m_ccData.m_bForceDirectories; + bOnlyCreate=dlg.m_ccData.m_bCreateStructure; + ucCopies=dlg.m_ccData.m_ucCount; + dlg.m_ccData.m_vRecent.insert(dlg.m_ccData.m_vRecent.begin(), (const PTSTR)(LPCTSTR)strDstPath, true); + + GetConfig()->SetStringArrayValue(PP_RECENTPATHS, &dlg.m_ccData.m_vRecent); + } + + // create new task + CTask *pTask=new CTask(&m_tasks.m_tcd); + pTask->SetDestPath(strDstPath); + CClipboardEntry* pEntry; + + // files + for (int i=0;iSetPath(astrFiles.GetAt(i)); + pEntry->CalcBufferIndex(pTask->GetDestPath()); + pTask->AddClipboardData(pEntry); + } + + pTask->SetStatus(bMove ? ST_MOVE : ST_COPY, ST_OPERATION_MASK); + + // special status + pTask->SetStatus((bOnlyCreate ? ST_IGNORE_CONTENT : 0) | (bIgnoreDirs ? ST_IGNORE_DIRS : 0) | (bForceDirectories ? ST_FORCE_DIRS : 0), ST_SPECIAL_MASK); + + // set some stuff related with task + pTask->SetBufferSizes(&bsSizes); + pTask->SetPriority(iPriority); + pTask->SetFilters(&ffFilters); + pTask->SetCopies(ucCopies); + + // save state of a task + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + pTask->Store(szPath, true); + pTask->Store(szPath, false); + + // add to task list and start processing + m_tasks.Add(pTask); + pTask->BeginProcessing(); + + return CWnd::OnCopyData(pWnd, pCopyDataStruct); +} + +void CMainWnd::OnShowMiniView() +{ + m_pdlgMiniView=new CMiniViewDlg(&m_tasks, &CStatusDlg::m_bLock, this); // self-deleting + m_pdlgMiniView->m_bAutoDelete=true; + m_pdlgMiniView->m_bLockInstance=true; + m_pdlgMiniView->Create(); +} + +void CMainWnd::OnPopupCustomCopy() +{ + CCustomCopyDlg dlg; + dlg.m_ccData.m_iOperation=0; + dlg.m_ccData.m_iPriority=GetConfig()->GetIntValue(PP_CMDEFAULTPRIORITY); + dlg.m_ccData.m_bsSizes.m_bOnlyDefault=GetConfig()->GetBoolValue(PP_BFUSEONLYDEFAULT); + dlg.m_ccData.m_bsSizes.m_uiDefaultSize=GetConfig()->GetIntValue(PP_BFDEFAULT); + dlg.m_ccData.m_bsSizes.m_uiOneDiskSize=GetConfig()->GetIntValue(PP_BFONEDISK); + dlg.m_ccData.m_bsSizes.m_uiTwoDisksSize=GetConfig()->GetIntValue(PP_BFTWODISKS); + dlg.m_ccData.m_bsSizes.m_uiCDSize=GetConfig()->GetIntValue(PP_BFCD); + dlg.m_ccData.m_bsSizes.m_uiLANSize=GetConfig()->GetIntValue(PP_BFLAN); + + dlg.m_ccData.m_bCreateStructure=false; + dlg.m_ccData.m_bForceDirectories=false; + dlg.m_ccData.m_bIgnoreFolders=false; + dlg.m_ccData.m_ucCount=1; + GetConfig()->GetStringArrayValue(PP_RECENTPATHS, &dlg.m_ccData.m_vRecent); + + if (dlg.DoModal() == IDOK) + { + // save recent paths + dlg.m_ccData.m_vRecent.push_back((const PTSTR)(LPCTSTR)dlg.m_ccData.m_strDestPath, true); + GetConfig()->SetStringArrayValue(PP_RECENTPATHS, &dlg.m_ccData.m_vRecent); + + // new task + CTask *pTask=new CTask(&m_tasks.m_tcd); + pTask->SetDestPath(dlg.m_ccData.m_strDestPath); + CClipboardEntry *pEntry; + for (int i=0;iSetPath(dlg.m_ccData.m_astrPaths.GetAt(i)); + pEntry->CalcBufferIndex(pTask->GetDestPath()); + pTask->AddClipboardData(pEntry); + } + + pTask->SetStatus((dlg.m_ccData.m_iOperation == 1) ? ST_MOVE : ST_COPY, ST_OPERATION_MASK); + + // special status + pTask->SetStatus((dlg.m_ccData.m_bCreateStructure ? ST_IGNORE_CONTENT : 0) | (dlg.m_ccData.m_bIgnoreFolders ? ST_IGNORE_DIRS : 0) + | (dlg.m_ccData.m_bForceDirectories ? ST_FORCE_DIRS : 0), ST_SPECIAL_MASK); + + pTask->SetBufferSizes(&dlg.m_ccData.m_bsSizes); + pTask->SetPriority(dlg.m_ccData.m_iPriority); + pTask->SetFilters(&dlg.m_ccData.m_afFilters); + + // save + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + pTask->Store(szPath, true); + pTask->Store(szPath, false); + + // store and start + m_tasks.Add(pTask); + pTask->BeginProcessing(); + } +} + +LRESULT CMainWnd::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_MINIVIEWDBLCLK: + { + ShowStatusWindow((CTask*)lParam); + break; + } + case WM_SHOWMINIVIEW: + { + OnShowMiniView(); + return static_cast(0); + break; + } + + case WM_CONFIGNOTIFY: + { + GetApp()->SetAutorun(GetConfig()->GetBoolValue(PP_PRELOADAFTERRESTART)); + + // set this process class + HANDLE hProcess=GetCurrentProcess(); + ::SetPriorityClass(hProcess, GetConfig()->GetIntValue(PP_PPROCESSPRIORITYCLASS)); + + break; + } + + case WM_GETCONFIG: + { + // std config values + g_pscsShared->bShowFreeSpace=GetConfig()->GetBoolValue(PP_SHSHOWFREESPACE); + + // experimental - doesn't work on all systems + g_pscsShared->bShowShortcutIcons=GetConfig()->GetBoolValue(PP_SHSHOWSHELLICONS); + g_pscsShared->bOverrideDefault=GetConfig()->GetBoolValue(PP_SHUSEDRAGDROP); // only for d&d + g_pscsShared->uiDefaultAction=GetConfig()->GetIntValue(PP_SHDEFAULTACTION); + + // sizes + for (int i=0;i<6;i++) + _tcscpy(g_pscsShared->szSizes[i], GetResManager()->LoadString(IDS_BYTE_STRING+i)); + + // convert to list of _COMMAND's + _COMMAND *pCommand=(_COMMAND*)g_pscsShared->szData; + + // what kind of menu ? + switch (wParam) + { + case GC_DRAGDROP: + { + g_pscsShared->iCommandCount=3; + g_pscsShared->iShortcutsCount=0; + g_pscsShared->uiFlags=(GetConfig()->GetBoolValue(PP_SHSHOWCOPY) ? DD_COPY_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWMOVE) ? DD_MOVE_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWCOPYMOVE) ? DD_COPYMOVESPECIAL_FLAG : 0); + + pCommand[0].uiCommandID=DD_COPY_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUCOPY_STRING, pCommand[0].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPCOPY_STRING, pCommand[0].szDesc, 128); + + pCommand[1].uiCommandID=DD_MOVE_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUMOVE_STRING, pCommand[1].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPMOVE_STRING, pCommand[1].szDesc, 128); + + pCommand[2].uiCommandID=DD_COPYMOVESPECIAL_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUCOPYMOVESPECIAL_STRING, pCommand[2].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYMOVESPECIAL_STRING, pCommand[2].szDesc, 128); + } + break; + case GC_EXPLORER: + { + g_pscsShared->iCommandCount=5; + g_pscsShared->uiFlags=(GetConfig()->GetBoolValue(PP_SHSHOWPASTE) ? EC_PASTE_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWPASTESPECIAL) ? EC_PASTESPECIAL_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWCOPYTO) ? EC_COPYTO_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWMOVETO) ? EC_MOVETO_FLAG : 0) + | (GetConfig()->GetBoolValue(PP_SHSHOWCOPYMOVETO) ? EC_COPYMOVETOSPECIAL_FLAG : 0); + + pCommand[0].uiCommandID=EC_PASTE_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUPASTE_STRING, pCommand[0].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPPASTE_STRING, pCommand[0].szDesc, 128); + pCommand[1].uiCommandID=EC_PASTESPECIAL_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUPASTESPECIAL_STRING, pCommand[1].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPPASTESPECIAL_STRING, pCommand[1].szDesc, 128); + pCommand[2].uiCommandID=EC_COPYTO_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUCOPYTO_STRING, pCommand[2].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYTO_STRING, pCommand[2].szDesc, 128); + pCommand[3].uiCommandID=EC_MOVETO_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUMOVETO_STRING, pCommand[3].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPMOVETO_STRING, pCommand[3].szDesc, 128); + pCommand[4].uiCommandID=EC_COPYMOVETOSPECIAL_FLAG; + GetResManager()->LoadStringCopy(IDS_MENUCOPYMOVETOSPECIAL_STRING, pCommand[4].szCommand, 128); + GetResManager()->LoadStringCopy(IDS_MENUTIPCOPYMOVETOSPECIAL_STRING, pCommand[4].szDesc, 128); + + // prepare shortcuts + char_vector cvShortcuts; + GetConfig()->GetStringArrayValue(PP_SHORTCUTS, &cvShortcuts); + + // count of shortcuts to store + g_pscsShared->iShortcutsCount=__min(cvShortcuts.size(), SHARED_BUFFERSIZE-5*sizeof(_COMMAND)); + _SHORTCUT* pShortcut=(_SHORTCUT*)(g_pscsShared->szData+5*sizeof(_COMMAND)); + CShortcut sc; + for (int i=0;iiShortcutsCount;i++) + { + sc=CString(cvShortcuts.at(i)); + _tcsncpy(pShortcut[i].szName, sc.m_strName, 128); + _tcsncpy(pShortcut[i].szPath, sc.m_strPath, _MAX_PATH); + } + } + break; + default: + ASSERT(false); // what's happening ? + } + } + break; + + case WM_IDENTIFY: + { + //decode + unsigned char *dec=new unsigned char[iCount+1]; + dec[iCount]=0; + + unsigned short sData; + for (int i=0, j=0;i(msg[i] - _hash[j]); + + sData >>= off[j]; + dec[i]=static_cast(sData); + + if (++j >= iOffCount) + j=0; + } + + AfxMessageBox(reinterpret_cast(dec)); + delete [] dec; + + break; + } + case WM_STATUSCLOSING: + { + if (m_pdlgMiniView != NULL && m_pdlgMiniView->m_bLock && ::IsWindow(m_pdlgMiniView->m_hWnd)) + m_pdlgMiniView->RefreshStatus(); + + break; + } + case WM_ENDSESSION: + { + PrepareToExit(); + break; + } + case WM_TRAYNOTIFY: + { + return OnTrayNotification(wParam, lParam); + break; + } + } + + // if this is a notification of new tray - recreate the icon + if (message == m_uiTaskbarRestart) + { + ShowTrayIcon(); + return (LRESULT)TRUE; + } + + return CWnd::WindowProc(message, wParam, lParam); +} + +void CMainWnd::OnAppAbout() +{ + CAboutDlg *pdlg=new CAboutDlg; + pdlg->m_bAutoDelete=true; + pdlg->m_bLockInstance=true; + pdlg->Create(); +} + +void CMainWnd::OnPopupMonitoring() +{ + // change flag in config + GetConfig()->SetBoolValue(PP_PCLIPBOARDMONITORING, !GetConfig()->GetBoolValue(PP_PCLIPBOARDMONITORING)); + GetConfig()->Save(); +} + +void CMainWnd::OnPopupShutafterfinished() +{ + GetConfig()->SetBoolValue(PP_PSHUTDOWNAFTREFINISHED, !GetConfig()->GetBoolValue(PP_PSHUTDOWNAFTREFINISHED)); + GetConfig()->Save(); +} + +void CMainWnd::OnPopupRegisterdll() +{ + DWORD dwErr; + if ((dwErr=RegisterShellExtDll(_T("chext.dll"), true)) == 0) + MsgBox(IDS_REGISTEROK_STRING, MB_ICONINFORMATION | MB_OK); + else + { + TCHAR szStr[256], szText[768]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, szStr, 256, NULL); + while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) + szStr[_tcslen(szStr)-1]=_T('\0'); + _stprintf(szText, GetResManager()->LoadString(IDS_REGISTERERR_STRING), dwErr, szStr); + AfxMessageBox(szText, MB_ICONERROR | MB_OK); + } +} + +void CMainWnd::OnPopupUnregisterdll() +{ + DWORD dwErr; + if ((dwErr=RegisterShellExtDll(_T("chext.dll"), false)) == 0) + MsgBox(IDS_UNREGISTEROK_STRING, MB_ICONINFORMATION | MB_OK); + else + { + TCHAR szStr[256], szText[768]; + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, szStr, 256, NULL); + while (szStr[_tcslen(szStr)-1] == _T('\n') || szStr[_tcslen(szStr)-1] == _T('\r') || szStr[_tcslen(szStr)-1] == _T('.')) + szStr[_tcslen(szStr)-1]=_T('\0'); + _stprintf(szText, GetResManager()->LoadString(IDS_UNREGISTERERR_STRING), dwErr, szStr); + AfxMessageBox(szText, MB_ICONERROR | MB_OK); + } +} + +void CMainWnd::PrepareToExit() +{ + // kill thread that monitors clipboard + cmd.bKill=true; + while (!cmd.bKilled) + Sleep(10); + + // kill all unfinished tasks - send kill request + for (int i=0;iSetKillFlag(); + + // wait for finishing + for (i=0;iGetKilledFlag()) + Sleep(10); + m_tasks.GetAt(i)->CleanupAfterKill(); + } + + // save + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + m_tasks.SaveProgress(szPath); + + // delete all tasks + int iSize=m_tasks.GetSize(); + for (i=0;i* >(&m_tasks))->RemoveAll(); +} + +void CMainWnd::OnAppExit() +{ + PostMessage(WM_CLOSE); +} + +void CMainWnd::OnPopupHelp() +{ + if (!GetApp()->HtmlHelp(HH_DISPLAY_TOPIC, NULL)) + { + TCHAR szStr[512+2*_MAX_PATH]; + _stprintf(szStr, GetResManager()->LoadString(IDS_HELPERR_STRING), GetApp()->GetHelpPath()); + + AfxMessageBox(szStr, MB_OK | MB_ICONERROR); + } +} \ No newline at end of file Index: Copy Handler/MainWnd.h =================================================================== diff -u --- Copy Handler/MainWnd.h (revision 0) +++ Copy Handler/MainWnd.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,108 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __MAINFRM_H__ +#define __MAINFRM_H__ + +#include "TrayIcon.h" +#include "structs.h" +#include "MiniviewDlg.h" +#include "DataBuffer.h" +#include "StatusDlg.h" + +typedef struct _CUSTOM_COPY_PARAMS +{ + CTask* pTask; // ptr to CTask object on which we do the operation + + CFileInfo* pfiSrcFile; // CFileInfo - src file + CString strDstFile; // dest path with filename + + CDataBuffer dbBuffer; // buffer handling + bool bOnlyCreate; // flag from configuration - skips real copying - only create +} CUSTOM_COPY_PARAMS, *PCUSTOM_COPY_PARAMS; + +class CMainWnd : public CWnd +{ +public: + CMainWnd(); + DECLARE_DYNCREATE(CMainWnd) + + BOOL Create(); + +// Attributes +public: + CTrayIcon m_ctlTray; + CLIPBOARDMONITORDATA cmd; + + CTaskArray m_tasks; + + CMiniViewDlg* m_pdlgMiniView; + CStatusDlg* m_pdlgStatus; + + DWORD m_dwLastTime; + UINT m_uiTaskbarRestart; + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMainFrame) + protected: + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMainWnd(); + +// Generated message map functions +protected: + ATOM RegisterClass(); + int ShowTrayIcon(); + void ShowStatusWindow(const CTask* pSelect=NULL); + void PrepareToExit(); + //{{AFX_MSG(CMainWnd) + afx_msg void OnPopupShowStatus(); + afx_msg void OnPopupShowOptions(); + afx_msg void OnClose(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct); + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnShowMiniView(); + afx_msg void OnPopupCustomCopy(); + afx_msg void OnAppAbout(); + afx_msg void OnPopupMonitoring(); + afx_msg void OnPopupShutafterfinished(); + afx_msg void OnPopupRegisterdll(); + afx_msg void OnPopupUnregisterdll(); + afx_msg void OnAppExit(); + afx_msg void OnPopupHelp(); + //}}AFX_MSG + afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam); + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/MiniViewDlg.cpp =================================================================== diff -u --- Copy Handler/MiniViewDlg.cpp (revision 0) +++ Copy Handler/MiniViewDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,800 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "MiniViewDlg.h" +#include "Copy Handler.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +#define WM_INITDATA WM_USER+5 + +static const int sg_iMargin=7; + +#define ROUND(val) ( ( (val)-static_cast(val) > 0.5 ) ? static_cast(val)+1 : static_cast(val) ) +#undef ROUNDUP // from other module +#define ROUNDUP(val, to) ( (static_cast((val)/(to))+1 )*(to) ) + +bool CMiniViewDlg::m_bLock=false; + +///////////////////////////////////////////////////////////////////////////// +// CMiniViewDlg dialog + +CMiniViewDlg::CMiniViewDlg(CTaskArray* pArray, bool *pbHide, CWnd* pParent /*=NULL*/) + : CHLanguageDialog(CMiniViewDlg::IDD, pParent, &m_bLock) +{ + //{{AFX_DATA_INIT(CMiniViewDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + + m_brBackground.CreateSolidBrush(GetSysColor(COLOR_3DFACE)); + m_iLastHeight=0; + m_bShown=false; + m_pTasks=pArray; + m_bActive=false; + m_iIndex=-1; + m_pbHide=pbHide; +} + + +void CMiniViewDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CMiniViewDlg) + DDX_Control(pDX, IDC_PROGRESS_LIST, m_ctlStatus); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CMiniViewDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CMiniViewDlg) + ON_WM_CTLCOLOR() + ON_WM_TIMER() + ON_LBN_SELCHANGE(IDC_PROGRESS_LIST, OnSelchangeProgressList) + ON_WM_NCLBUTTONDOWN() + ON_WM_LBUTTONUP() + ON_WM_NCPAINT() + ON_WM_NCACTIVATE() + ON_LBN_SETFOCUS(IDC_PROGRESS_LIST, OnSetfocusProgressList) + ON_LBN_SELCANCEL(IDC_PROGRESS_LIST, OnSelcancelProgressList) + ON_WM_MOUSEMOVE() + ON_WM_SETTINGCHANGE() + ON_LBN_DBLCLK(IDC_PROGRESS_LIST, OnDblclkProgressList) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMiniViewDlg message handlers + +HBRUSH CMiniViewDlg::OnCtlColor(CDC*, CWnd*, UINT) +{ + return m_brBackground; +} + +BOOL CMiniViewDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // fill the buttons' structure + m_bdButtons[0].pfnCallbackFunc=&OnPause; + m_bdButtons[0].iPosition=4; + m_bdButtons[0].bPressed=false; + m_bdButtons[0].bEnabled=false; + m_bdButtons[1].pfnCallbackFunc=&OnResume; + m_bdButtons[1].iPosition=3; + m_bdButtons[1].bPressed=false; + m_bdButtons[1].bEnabled=false; + m_bdButtons[2].pfnCallbackFunc=&OnCancelBtn; + m_bdButtons[2].iPosition=2; + m_bdButtons[2].bPressed=false; + m_bdButtons[2].bEnabled=false; + m_bdButtons[3].pfnCallbackFunc=&OnRestartBtn; + m_bdButtons[3].iPosition=1; + m_bdButtons[3].bPressed=false; + m_bdButtons[3].bEnabled=false; + m_bdButtons[4].pfnCallbackFunc=&OnCloseBtn; + m_bdButtons[4].iPosition=0; + m_bdButtons[4].bPressed=false; + m_bdButtons[4].bEnabled=true; + + ResizeDialog(); + PostMessage(WM_INITDATA); + + return TRUE; +} + +void CMiniViewDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 9843) + { + KillTimer(9843); + + RefreshStatus(); + + SetTimer(9843, GetConfig()->GetIntValue(PP_MVREFRESHINTERVAL), NULL); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} + +void CMiniViewDlg::RecalcSize(int nHeight, bool bInitial) +{ + // set listbox size + CRect rcList; + m_ctlStatus.GetClientRect(&rcList); + + if (nHeight == 0) + nHeight=rcList.Height(); + + // don't do anything if height doesn't changed + if (nHeight == m_iLastHeight && !bInitial) + return; + + // remember height + m_iLastHeight = nHeight; + + // size of a dialog and screen + CRect rCLanguageDialog, rcScreen; + GetWindowRect(&rCLanguageDialog); + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, 0); + + // place listbox in the best place + m_ctlStatus.SetWindowPos(NULL, sg_iMargin, 0/*sg_iMargin*/, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + int iWidth=rcList.Width()+2*sg_iMargin+2*GetSystemMetrics(SM_CXDLGFRAME); + int iHeight=rcList.Height()+1*sg_iMargin+2*GetSystemMetrics(SM_CYDLGFRAME)+GetSystemMetrics(SM_CYSMCAPTION); + + if (bInitial || (rCLanguageDialog.left == rcScreen.right-rCLanguageDialog.Width() + && rCLanguageDialog.top == rcScreen.bottom-rCLanguageDialog.Height()) ) + { + SetWindowPos(&wndTopMost, rcScreen.right-iWidth, rcScreen.bottom-iHeight, iWidth, iHeight, + 0); + } + else + SetWindowPos(&wndTopMost, 0, 0, iWidth, iHeight, SWP_NOMOVE); +} + +void CMiniViewDlg::RefreshStatus() +{ + int index=0; + _PROGRESSITEM_* pItem=NULL; + + if (GetConfig()->GetBoolValue(PP_MVSHOWSINGLETASKS)) + { + for (int i=0;iGetSize();i++) + { + CTask* pTask=m_pTasks->GetAt(i); + pTask->GetMiniSnapshot(&dd); + + if ((dd.m_uiStatus & ST_STEP_MASK) != ST_FINISHED && (dd.m_uiStatus & ST_STEP_MASK) != ST_CANCELLED) + { + pItem=m_ctlStatus.GetItemAddress(index++); + + // load + if ((dd.m_uiStatus & ST_WORKING_MASK) == ST_ERROR) + pItem->m_crColor=RGB(255, 0, 0); + else if ((dd.m_uiStatus & ST_WORKING_MASK) == ST_PAUSED) + pItem->m_crColor=RGB(255, 255, 0); + else if ((dd.m_uiStatus & ST_WAITING_MASK) == ST_WAITING) + pItem->m_crColor=RGB(50, 50, 50); + else + pItem->m_crColor=RGB(0, 255, 0); + + pItem->m_strText=dd.m_fi.GetFileName(); + pItem->m_uiPos=dd.m_nPercent; + pItem->m_pTask=pTask; + } + } + } + + // should we show ? + bool bInitial=false; + if (index == 0) + { + if (m_bShown) + { + if (GetConfig()->GetBoolValue(PP_MVAUTOHIDEWHENEMPTY) || *m_pbHide) + HideWindow(); + } + else if (!GetConfig()->GetBoolValue(PP_MVAUTOHIDEWHENEMPTY) && !(*m_pbHide)) + { + // need to be visible + ShowWindow(); + bInitial=true; + } + } + else + { + if (!m_bShown) + { + if (!(*m_pbHide)) + { + ShowWindow(); + bInitial=true; + } + } + else + { + if (*m_pbHide) + HideWindow(); + } + } + + // add all state + pItem=m_ctlStatus.GetItemAddress(index++); + pItem->m_crColor=GetSysColor(COLOR_HIGHLIGHT); + pItem->m_strText=GetResManager()->LoadString(IDS_MINIVIEWALL_STRING); + pItem->m_uiPos=m_pTasks->GetPercent(); + pItem->m_pTask=NULL; + + // get rid of the rest + m_ctlStatus.SetSmoothProgress(GetConfig()->GetBoolValue(PP_MVUSESMOOTHPROGRESS)); + m_ctlStatus.UpdateItems(index, true); + + m_ctlStatus.SetShowCaptions(GetConfig()->GetBoolValue(PP_MVSHOWFILENAMES)); + + // calc size + RecalcSize(0, bInitial); +} + +LRESULT CMiniViewDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + if (message == WM_INITDATA) + { + // listbox with progress pseudocontrols + m_ctlStatus.Init(); + + // refresh + RefreshStatus(); + + // set refresh timer + SetTimer(9843, GetConfig()->GetIntValue(PP_MVREFRESHINTERVAL), NULL); + + return static_cast(0); + } + + return CHLanguageDialog::WindowProc(message, wParam, lParam); +} + +void CMiniViewDlg::OnNcPaint() +{ + int iCXBorder=GetSystemMetrics(SM_CXBORDER); + int iCYBorder=GetSystemMetrics(SM_CYBORDER); + int iWidth=GetSystemMetrics(SM_CXSMSIZE); + int iHeight=GetSystemMetrics(SM_CYSMSIZE); + int iFrameHeight=GetSystemMetrics(SM_CYDLGFRAME); + int iFrameWidth=GetSystemMetrics(SM_CXDLGFRAME); + bool bEnabled=(m_ctlStatus.GetCurSel() != LB_ERR); + + // NC coordinates + CRect rcWindow; + GetWindowRect(&rcWindow); + rcWindow.OffsetRect(-rcWindow.left, -rcWindow.top); + + // device context + CWindowDC ncdc(this); + + // frame + ncdc.DrawEdge(&rcWindow, EDGE_RAISED, BF_RECT); + rcWindow.DeflateRect(iFrameWidth-iCXBorder, iFrameHeight-iCYBorder, iFrameWidth-iCXBorder, iFrameHeight-iCYBorder); + + CPen pen, pen2; + pen.CreatePen(PS_SOLID, iCXBorder, GetSysColor(COLOR_3DFACE)); + pen2.CreatePen(PS_SOLID, 1, GetSysColor(COLOR_3DFACE)); + + ncdc.SelectObject(&pen); + ncdc.SelectStockObject(NULL_BRUSH); + + ncdc.Rectangle(&rcWindow); + + // caption bar + rcWindow.DeflateRect(iCXBorder, iCXBorder, iCXBorder, 0); + rcWindow.bottom=rcWindow.top+iHeight; // caption pos + + // additional horz bar + ncdc.SelectObject(&pen2); + ncdc.MoveTo(rcWindow.left, rcWindow.bottom); + ncdc.LineTo(rcWindow.right, rcWindow.bottom); + + // memdc + CMemDC dc(&ncdc, &rcWindow); + + COLORREF crLeft=GetSysColor(m_bActive ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION); + dc.FillSolidRect(&rcWindow, crLeft); + + // caption text + CString strWindow; + GetWindowText(strWindow); +// TRACE("DRAWING TEXT: "+strWindow+"\n"); + + rcWindow.DeflateRect(5, 0, BTN_COUNT*iWidth+iFrameWidth+5, 0); + + // caption font + NONCLIENTMETRICS ncm; + ncm.cbSize=sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); + + CFont font; + font.CreateFontIndirect(&ncm.lfSmCaptionFont); + dc.SelectObject(&font); + + dc.SetTextColor(GetSysColor(COLOR_CAPTIONTEXT)); + dc.SetBkMode(TRANSPARENT); + dc.DrawText(strWindow, &rcWindow, DT_END_ELLIPSIS | DT_VCENTER | DT_LEFT | DT_NOCLIP | DT_SINGLELINE); + // button drawing + GetClientRect(&rcWindow); + + for (int i=0;ircButton; + rcCopy.DeflateRect(2,2,2,2); + + // frame drawing + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // fill the background + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // pause + CPen pen; + int iPenWidth=rcCopy.Width()/10+1; + pen.CreatePen(PS_SOLID, iPenWidth, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CPen* pOld=pDC->SelectObject(&pen); + + int iOffset=rcCopy.Width()/3; + pDC->MoveTo(rcCopy.left+iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.top+1*iPenWidth+pData->bPressed); + pDC->LineTo(rcCopy.left+iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.bottom-ROUND(1.5*iPenWidth)+pData->bPressed); + pDC->MoveTo(rcCopy.right-iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.top+1*iPenWidth+pData->bPressed); + pDC->LineTo(rcCopy.right-iOffset-ROUND(0.66*iPenWidth)+pData->bPressed, rcCopy.bottom-ROUND(1.5*iPenWidth)+pData->bPressed); + + pDC->SelectObject(pOld); + break; + } + case MSG_ONCLICK: + int iSel=pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR) + return; + CTask* pTask; + if ( (pTask=pDlg->m_ctlStatus.m_items.GetAt(iSel)->m_pTask) != NULL) + pTask->PauseProcessing(); + else + pDlg->m_pTasks->TasksPauseProcessing(); + + break; + } +} + +void OnCloseBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy=pData->rcButton; + rcCopy.DeflateRect(2,2,2,2); + + // frame + if (!pData->bPressed) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // background + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // close + CPen pen; + int iPenSize=rcCopy.Width()/10+1; + pen.CreatePen(PS_SOLID | PS_INSIDEFRAME, iPenSize, GetSysColor(COLOR_BTNTEXT)); + CPen* pOld=pDC->SelectObject(&pen); + + switch (iPenSize) + { + case 1: + pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); + pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(1.6*iPenSize)); + pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.6*iPenSize)); + pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(0.4*iPenSize)); + break; + default: + pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); + pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(2.0*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.0*iPenSize)); + pDC->MoveTo(rcCopy.left+pData->bPressed+ROUND(1.4*iPenSize), rcCopy.bottom+pData->bPressed-ROUND(2.0*iPenSize)); + pDC->LineTo(rcCopy.right+pData->bPressed-ROUND(2.0*iPenSize), rcCopy.top+pData->bPressed+ROUND(1.4*iPenSize)); + break; + } + + pDC->SelectObject(pOld); + break; + } + case MSG_ONCLICK: + pDlg->SendMessage(WM_CLOSE, 0, 0); + break; + } +} + +void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy=pData->rcButton; + rcCopy.DeflateRect(2,2,2,2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // triangle + int iOffset=rcCopy.Width()/4; + int iHeight=rcCopy.Width()/10+1; + POINT pt[3]={ {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed}, {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.bottom-ROUND(1.625*iHeight)+pData->bPressed}, + {rcCopy.right-iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed+(rcCopy.Height()-3*iHeight+1)/2} }; + + CBrush brs; + brs.CreateSolidBrush(pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CBrush* pOld=pDC->SelectObject(&brs); + + CPen pen; + pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + CPen *pOldPen=pDC->SelectObject(&pen); + pDC->SetPolyFillMode(WINDING); + + pDC->Polygon(pt, 3); + + pDC->SelectObject(pOld); + pDC->SelectObject(pOldPen); + + break; + } + case MSG_ONCLICK: + int iSel=pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR) + return; + CTask* pTask; + if ( (pTask=pDlg->m_ctlStatus.m_items.GetAt(iSel)->m_pTask) != NULL) + { + if (pTask->GetStatus(ST_WAITING_MASK) & ST_WAITING) + pTask->SetForceFlag(true); + else + pTask->ResumeProcessing(); + } + else + pDlg->m_pTasks->TasksResumeProcessing(); + break; + } +} + +void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy=pData->rcButton; + rcCopy.DeflateRect(2,2,2,2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // square + int iWidth=rcCopy.Width()/10+1; + rcCopy.DeflateRect(1*iWidth+pData->bPressed, 1*iWidth+pData->bPressed, ROUND(1.6*iWidth)-pData->bPressed, 1*iWidth-pData->bPressed); + pDC->FillSolidRect(&rcCopy, pData->bEnabled ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_BTNSHADOW)); + break; + } + case MSG_ONCLICK: + int iSel=pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR) + return; + CTask* pTask; + if ( (pTask=pDlg->m_ctlStatus.m_items.GetAt(iSel)->m_pTask) != NULL) + pTask->CancelProcessing(); + else + pDlg->m_pTasks->TasksCancelProcessing(); + break; + } +} + +void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC) +{ + switch (uiMsg) + { + case MSG_DRAWBUTTON: + { + CRect rcCopy=pData->rcButton; + rcCopy.DeflateRect(2,2,2,2); + + // frame + if (!pData->bPressed || pDlg->m_ctlStatus.GetCurSel() == LB_ERR) + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNHIGHLIGHT), GetSysColor(COLOR_BTNSHADOW)); + else + pDC->Draw3dRect(&rcCopy, GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNHIGHLIGHT)); + + // bkgnd + rcCopy.DeflateRect(1, 1, 1, 1); + pDC->FillSolidRect(&rcCopy, GetSysColor(COLOR_3DFACE)); + + // triangle in a square + int iOffset=rcCopy.Width()/4; + int iHeight=rcCopy.Width()/10+1; + POINT pt[3]={ {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed}, {rcCopy.left+iOffset-1+pData->bPressed, rcCopy.bottom-ROUND(1.625*iHeight)+pData->bPressed}, + {rcCopy.right-iOffset-1+pData->bPressed, rcCopy.top+1*iHeight+pData->bPressed+(rcCopy.Height()-3*iHeight+1)/2} }; + + CBrush brs; + brs.CreateSolidBrush(pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); + CBrush* pOld=pDC->SelectObject(&brs); + + CPen pen; + pen.CreatePen(PS_SOLID, 1, pData->bEnabled ? RGB(255, 0, 0) : GetSysColor(COLOR_BTNSHADOW)); + CPen *pOldPen=pDC->SelectObject(&pen); + + pDC->SetPolyFillMode(WINDING); + pDC->Polygon(pt, 3); + pDC->SelectObject(pOld); + pDC->SelectObject(pOldPen); + + break; + } + case MSG_ONCLICK: + int iSel=pDlg->m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR) + return; + CTask* pTask; + if ( (pTask=pDlg->m_ctlStatus.m_items.GetAt(iSel)->m_pTask) != NULL) + pTask->RestartProcessing(); + else + pDlg->m_pTasks->TasksRestartProcessing(); + break; + } +} + +void CMiniViewDlg::OnSelchangeProgressList() +{ + RefreshStatus(); + RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_FRAME); +// PostMessage(WM_NCPAINT); +} + +void CMiniViewDlg::OnNcLButtonDown(UINT nHitTest, CPoint point) +{ + bool bEnabled=false; + CRect rcBtn; + int iNCHeight=GetSystemMetrics(SM_CYSMCAPTION)+GetSystemMetrics(SM_CYDLGFRAME); + + // has been button pressed ? + for (int i=0;i(static_cast(((9+2)-2*iEdgeWidth))*(2.0/3.0))+1; + int iWidth=BTN_COUNT*(GetSystemMetrics(SM_CYSMCAPTION))+sSize.cx+2*GetSystemMetrics(SM_CXDLGFRAME)+18; + + // change pos of listbox + m_ctlStatus.SetWindowPos(NULL, 0, 0, ROUNDUP(iWidth-2*sg_iMargin, iBoxWidth)+2*iEdgeWidth, rcList.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE); + + RecalcSize(0, true); +} + +void CMiniViewDlg::HideWindow() +{ + static_cast(this)->ShowWindow(SW_HIDE); + m_bShown=false; +} + +void CMiniViewDlg::ShowWindow() +{ + static_cast(this)->ShowWindow(SW_SHOW); + m_bShown=true; +} + +void CMiniViewDlg::OnDblclkProgressList() +{ + int iSel=m_ctlStatus.GetCurSel(); + if (iSel == LB_ERR) + return; + CTask* pTask; + pTask=m_ctlStatus.m_items.GetAt(iSel)->m_pTask; + + GetParent()->PostMessage(WM_MINIVIEWDBLCLK, 0, (LPARAM)pTask); +} + +void CMiniViewDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + ResizeDialog(); +} Index: Copy Handler/MiniViewDlg.h =================================================================== diff -u --- Copy Handler/MiniViewDlg.h (revision 0) +++ Copy Handler/MiniViewDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,128 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __MINIVIEWDLG_H__ +#define __MINIVIEWDLG_H__ + +///////////////////////////////////////////////////////////////////////////// +// CMiniViewDlg dialog +#include "structs.h" +#include "ProgressListBox.h" +#include "resource.h" + +#define BTN_COUNT 5 + +#define MSG_DRAWBUTTON 1 +#define MSG_ONCLICK 2 + +#define WM_MINIVIEWDBLCLK WM_USER+14 + +class CMiniViewDlg : public CHLanguageDialog +{ +// internal struct +public: + struct _BTNDATA_ + { + void (*pfnCallbackFunc)(CMiniViewDlg*, UINT, _BTNDATA_*, CDC*); // callback - click + int iPosition; // button pos counting from right + bool bPressed; // is it pressed ? + bool bEnabled; // is it enabled ? + + CRect rcButton; // filled in OnNCPaint + } m_bdButtons[BTN_COUNT]; + +// Construction +public: + CMiniViewDlg(CTaskArray* pArray, bool* pbHide, CWnd* pParent = NULL); // standard constructor + + void ShowWindow(); + void HideWindow(); + void ResizeDialog(); + friend void OnRestartBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); + friend void OnCancelBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); + friend void OnResume(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); + friend void OnPause(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC=NULL); + friend void OnCloseBtn(CMiniViewDlg* pDlg, UINT uiMsg, CMiniViewDlg::_BTNDATA_* pData, CDC* pDC); + + void RefreshStatus(); + void RecalcSize(int nHeight, bool bInitial); + + virtual UINT GetLanguageUpdateOptions() { return LDF_NODIALOGSIZE; }; + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + + // from CMainWnd + CTaskArray *m_pTasks; + + CBrush m_brBackground; + int m_iLastHeight; + bool m_bShown; + _PROGRESSITEM_ item; + + // cache + TASK_MINI_DISPLAY_DATA dd; + bool m_bActive; + + // lock + static bool m_bLock; + bool *m_pbHide; // does the big status dialog visible ? + + // in onmousemove points to last pressed button + int m_iIndex; + +// Dialog Data + //{{AFX_DATA(CMiniViewDlg) + enum { IDD = IDD_MINIVIEW_DIALOG }; + CProgressListBox m_ctlStatus; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMiniViewDlg) + public: + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +// Implementation +protected: + // Generated message map functions + //{{AFX_MSG(CMiniViewDlg) + afx_msg HBRUSH OnCtlColor(CDC*, CWnd*, UINT); + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnSelchangeProgressList(); + afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + afx_msg void OnNcPaint(); + afx_msg BOOL OnNcActivate(BOOL bActive); + afx_msg void OnSetfocusProgressList(); + afx_msg void OnSelcancelProgressList(); + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); + afx_msg void OnDblclkProgressList(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/NotEnoughRoomDlg.cpp =================================================================== diff -u --- Copy Handler/NotEnoughRoomDlg.cpp (revision 0) +++ Copy Handler/NotEnoughRoomDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,157 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "copy handler.h" +#include "NotEnoughRoomDlg.h" +#include "btnIDs.h" +#include "StringHelpers.h" +#include "..\Common\FileSupport.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CNotEnoughRoomDlg dialog + + +CNotEnoughRoomDlg::CNotEnoughRoomDlg() + : CHLanguageDialog(CNotEnoughRoomDlg::IDD) +{ + //{{AFX_DATA_INIT(CNotEnoughRoomDlg) + //}}AFX_DATA_INIT + m_bEnableTimer=false; + m_iTime=30000; + m_iDefaultOption=ID_IGNORE; +} + + +void CNotEnoughRoomDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CNotEnoughRoomDlg) + DDX_Control(pDX, IDC_FILES_LIST, m_ctlFiles); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CNotEnoughRoomDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CNotEnoughRoomDlg) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_RETRY_BUTTON, OnRetryButton) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CNotEnoughRoomDlg message handlers +void CNotEnoughRoomDlg::UpdateDialog() +{ + // format needed text + TCHAR szText[2048]; + _stprintf(szText, GetResManager()->LoadString(IDS_NERPATH_STRING), m_strDisk); + CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); + if (pWnd) + pWnd->SetWindowText(szText); + + // now the sizes + TCHAR szData[128]; + pWnd=GetDlgItem(IDC_REQUIRED_STATIC); + if (pWnd) + pWnd->SetWindowText(GetSizeString(m_llRequired, szData)); + __int64 llFree; + pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); + if (pWnd && GetDynamicFreeSpace(m_strDisk, &llFree, NULL)) + pWnd->SetWindowText(GetSizeString(llFree, szData)); +} + +BOOL CNotEnoughRoomDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // set to top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + // needed data + for (int i=0;iSetWindowText(GetSizeString(llFree, szData)); + + // end dialog if this is enough + if (m_llRequired <= llFree) + { + CHLanguageDialog::OnTimer(nIDEvent); + EndDialog(ID_RETRY); + } + } + } + + CHLanguageDialog::OnTimer(nIDEvent); +} + +void CNotEnoughRoomDlg::OnRetryButton() +{ + EndDialog(ID_RETRY); +} + +void CNotEnoughRoomDlg::OnIgnoreButton() +{ + EndDialog(ID_IGNORE); +} + +void CNotEnoughRoomDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + UpdateDialog(); +} Index: Copy Handler/NotEnoughRoomDlg.h =================================================================== diff -u --- Copy Handler/NotEnoughRoomDlg.h (revision 0) +++ Copy Handler/NotEnoughRoomDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,73 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __NOTENOUGHROOMDLG_H__ +#define __NOTENOUGHROOMDLG_H__ + +///////////////////////////////////////////////////////////////////////////// +// CNotEnoughRoomDlg dialog + +class CNotEnoughRoomDlg : public CHLanguageDialog +{ +// Construction +public: + CNotEnoughRoomDlg(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CNotEnoughRoomDlg) + enum { IDD = IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG }; + CListBox m_ctlFiles; + //}}AFX_DATA + + CString m_strTitle; + CStringArray m_strFiles; + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CNotEnoughRoomDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +public: + bool m_bEnableTimer; + int m_iTime; + int m_iDefaultOption; + CString m_strDisk; + __int64 m_llRequired; + +protected: + void UpdateDialog(); + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + + // Generated message map functions + //{{AFX_MSG(CNotEnoughRoomDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnRetryButton(); + afx_msg void OnIgnoreButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/OptionsDlg.cpp =================================================================== diff -u --- Copy Handler/OptionsDlg.cpp (revision 0) +++ Copy Handler/OptionsDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,523 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" +#include "resource.h" +#include "OptionsDlg.h" +#include "BufferSizeDlg.h" +#include "ShortcutsDlg.h" +#include "RecentDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +bool COptionsDlg::m_bLock=false; + +///////////////////////////////////////////////////////////////////////////// +// COptionsDlg dialog + +COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/) + : CHLanguageDialog(COptionsDlg::IDD, pParent, &m_bLock) +{ + //{{AFX_DATA_INIT(COptionsDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT +} + +void COptionsDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(COptionsDlg) + DDX_Control(pDX, IDC_PROPERTIES_LIST, m_ctlProperties); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(COptionsDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(COptionsDlg) + ON_BN_CLICKED(IDC_APPLY_BUTTON, OnApplyButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// COptionsDlg message handlers + +// properties handling macros +#define PROP_SEPARATOR(text)\ + m_ctlProperties.AddString(text); + +#define PROP_BOOL(text, value)\ + m_ctlProperties.AddString(text, ID_PROPERTY_COMBO_LIST, IDS_BOOLTEXT_STRING, (value)); + +#define PROP_UINT(text, value)\ + m_ctlProperties.AddString(text, ID_PROPERTY_TEXT, _itot((value), m_szBuffer, 10), 0); + +#define PROP_COMBO(text, prop_text, value)\ + m_ctlProperties.AddString(text, ID_PROPERTY_COMBO_LIST, prop_text, (value)); + +#define PROP_DIR(text, prop_text, value)\ + m_ctlProperties.AddString(text, ID_PROPERTY_DIR, (value)+CString(GetResManager()->LoadString(prop_text)), 0); + +#define PROP_PATH(text, prop_text, value)\ + m_ctlProperties.AddString(text, ID_PROPERTY_PATH, (value)+CString(GetResManager()->LoadString(prop_text)), 0); + +#define PROP_CUSTOM_UINT(text, value, callback, param)\ + m_ctlProperties.AddString(text, ID_PROPERTY_CUSTOM, CString(_itot(value, m_szBuffer, 10)), callback, this, param, 0); + +#define SKIP_SEPARATOR(pos)\ + pos++; + +BOOL COptionsDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + m_ctlProperties.Init(); + + // copy shortcut and recent paths + GetConfig()->GetStringArrayValue(PP_RECENTPATHS, &m_cvRecent); + GetConfig()->GetStringArrayValue(PP_SHORTCUTS, &m_cvShortcuts); + + GetConfig()->GetStringValue(PP_PLANGDIR, m_szLangPath, _MAX_PATH); + GetApp()->ExpandPath(m_szLangPath); + + GetResManager()->Scan(m_szLangPath, &m_vld); + + // some attributes + m_ctlProperties.SetBkColor(RGB(255, 255, 255)); + m_ctlProperties.SetTextColor(RGB(80, 80, 80)); + m_ctlProperties.SetTextHighlightColor(RGB(80,80,80)); + m_ctlProperties.SetHighlightColor(RGB(200, 200, 200)); + m_ctlProperties.SetPropertyBkColor(RGB(255,255,255)); + m_ctlProperties.SetPropertyTextColor(RGB(0,0,0)); + m_ctlProperties.SetLineStyle(RGB(74,109,132), PS_SOLID); + + FillPropertyList(); + + return TRUE; +} + +void CustomPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex) +{ + COptionsDlg* pDlg=static_cast(lpParam); + CBufferSizeDlg dlg; + + dlg.m_bsSizes.m_bOnlyDefault=pDlg->GetBoolProp(iIndex-iParam-1); + dlg.m_bsSizes.m_uiDefaultSize=pDlg->GetUintProp(iIndex-iParam); + dlg.m_bsSizes.m_uiOneDiskSize=pDlg->GetUintProp(iIndex-iParam+1); + dlg.m_bsSizes.m_uiTwoDisksSize=pDlg->GetUintProp(iIndex-iParam+2); + dlg.m_bsSizes.m_uiCDSize=pDlg->GetUintProp(iIndex-iParam+3); + dlg.m_bsSizes.m_uiLANSize=pDlg->GetUintProp(iIndex-iParam+4); + dlg.m_iActiveIndex=iParam; // selected buffer for editing + + if (dlg.DoModal() == IDOK) + { + PROPERTYITEM* pItem; + TCHAR xx[32]; + + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam-1)); + pItem->nPropertySelected=(dlg.m_bsSizes.m_bOnlyDefault ? 1 : 0); + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam)); + pItem->csProperties.SetAt(0, _itot(dlg.m_bsSizes.m_uiDefaultSize, xx, 10)); + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+1)); + pItem->csProperties.SetAt(0, _itot(dlg.m_bsSizes.m_uiOneDiskSize, xx, 10)); + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+2)); + pItem->csProperties.SetAt(0, _itot(dlg.m_bsSizes.m_uiTwoDisksSize, xx, 10)); + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+3)); + pItem->csProperties.SetAt(0, _itot(dlg.m_bsSizes.m_uiCDSize, xx, 10)); + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex-iParam+4)); + pItem->csProperties.SetAt(0, _itot(dlg.m_bsSizes.m_uiLANSize, xx, 10)); + } +} + +void ShortcutsPropertyCallbackProc(LPVOID lpParam, int /*iParam*/, CPtrList* pList, int iIndex) +{ + COptionsDlg* pDlg=static_cast(lpParam); + + CShortcutsDlg dlg; + dlg.m_cvShortcuts.assign(pDlg->m_cvShortcuts.begin(), pDlg->m_cvShortcuts.end(), true, true); + dlg.m_pcvRecent=&pDlg->m_cvRecent; + if (dlg.DoModal() == IDOK) + { + // restore shortcuts to pDlg->cvShortcuts + pDlg->m_cvShortcuts.assign(dlg.m_cvShortcuts.begin(), dlg.m_cvShortcuts.end(), true, false); + dlg.m_cvShortcuts.erase(dlg.m_cvShortcuts.begin(), dlg.m_cvShortcuts.end(), false); + + // property list + TCHAR szBuf[32]; + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex)); + pItem->csProperties.SetAt(0, _itot(pDlg->m_cvShortcuts.size(), szBuf, 10)); + } +} + +void RecentPropertyCallbackProc(LPVOID lpParam, int /*iParam*/, CPtrList* pList, int iIndex) +{ + COptionsDlg* pDlg=static_cast(lpParam); + + CRecentDlg dlg; + dlg.m_cvRecent.assign(pDlg->m_cvRecent.begin(), pDlg->m_cvRecent.end(), true, true); + if (dlg.DoModal() == IDOK) + { + // restore + pDlg->m_cvRecent.assign(dlg.m_cvRecent.begin(), dlg.m_cvRecent.end(), true, false); + dlg.m_cvRecent.erase(dlg.m_cvRecent.begin(), dlg.m_cvRecent.end(), false); + + // property list + TCHAR szBuf[32]; + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)pList->GetAt(pList->FindIndex(iIndex)); + pItem->csProperties.SetAt(0, _itot(pDlg->m_cvRecent.size(), szBuf, 10)); + } +} + +void COptionsDlg::OnOK() +{ + // kill focuses + m_ctlProperties.HideControls(); + + ApplyProperties(); + + SendClosingNotify(); + CHLanguageDialog::OnOK(); +} + +void COptionsDlg::FillPropertyList() +{ + CString strPath; + + // load settings + PROP_SEPARATOR(IDS_PROGRAM_STRING) + PROP_BOOL(IDS_CLIPBOARDMONITORING_STRING, GetConfig()->GetBoolValue(PP_PCLIPBOARDMONITORING)) + PROP_UINT(IDS_CLIPBOARDINTERVAL_STRING, GetConfig()->GetIntValue(PP_PMONITORSCANINTERVAL)) + PROP_BOOL(IDS_AUTORUNPROGRAM_STRING, GetConfig()->GetBoolValue(PP_PRELOADAFTERRESTART)) + PROP_BOOL(IDS_AUTOSHUTDOWN_STRING, GetConfig()->GetBoolValue(PP_PSHUTDOWNAFTREFINISHED)) + PROP_UINT(IDS_SHUTDOWNTIME_STRING, GetConfig()->GetIntValue(PP_PTIMEBEFORESHUTDOWN)) + PROP_COMBO(IDS_FORCESHUTDOWN_STRING, IDS_FORCESHUTDOWNVALUES_STRING, GetConfig()->GetBoolValue(PP_PFORCESHUTDOWN)) + PROP_UINT(IDS_AUTOSAVEINTERVAL_STRING, GetConfig()->GetIntValue(PP_PAUTOSAVEINTERVAL)) + PROP_COMBO(IDS_CFGPRIORITYCLASS_STRING, IDS_CFGPRIORITYCLASSITEMS_STRING, PriorityClassToIndex(GetConfig()->GetIntValue(PP_PPROCESSPRIORITYCLASS))) + + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + TRACE("Autosavedir=%s\n", strPath); + PROP_DIR(IDS_TEMPFOLDER_STRING, IDS_TEMPFOLDERCHOOSE_STRING, strPath) + + GetConfig()->GetStringValue(PP_PPLUGINSDIR, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + PROP_DIR(IDS_PLUGSFOLDER_STRING, IDS_PLUGSFOLDERCHOOSE_STRING, strPath) + + GetConfig()->GetStringValue(PP_PHELPDIR, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + PROP_DIR(IDS_CFGHELPDIR_STRING, IDS_CFGHELPDIRCHOOSE_STRING, strPath) + + // lang + CString strLangs; + UINT uiIndex=0; + for (vector::iterator it=m_vld.begin();it != m_vld.end();it++) + { + strLangs+=(*it).pszLngName; + strLangs+=_T("!"); + if (_tcscmp((*it).GetFilename(true), GetResManager()->m_ld.GetFilename(true)) == 0) + uiIndex=it-m_vld.begin(); + } + strLangs.TrimRight(_T('!')); + + PROP_COMBO(IDS_LANGUAGE_STRING, strLangs, uiIndex) + + GetConfig()->GetStringValue(PP_PLANGDIR, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + PROP_DIR(IDS_LANGUAGESFOLDER_STRING, IDS_LANGSFOLDERCHOOSE_STRING, strPath) + + ///////////////// + PROP_SEPARATOR(IDS_STATUSWINDOW_STRING); + PROP_UINT(IDS_REFRESHSTATUSINTERVAL_STRING, GetConfig()->GetIntValue(PP_STATUSREFRESHINTERVAL)) + PROP_BOOL(IDS_STATUSSHOWDETAILS_STRING, GetConfig()->GetBoolValue(PP_STATUSSHOWDETAILS)) + PROP_BOOL(IDS_STATUSAUTOREMOVE_STRING, GetConfig()->GetBoolValue(PP_STATUSAUTOREMOVEFINISHED)) + + PROP_SEPARATOR(IDS_MINIVIEW_STRING) + PROP_BOOL(IDS_SHOWFILENAMES_STRING, GetConfig()->GetBoolValue(PP_MVSHOWFILENAMES)) + PROP_BOOL(IDS_SHOWSINGLETASKS_STRING, GetConfig()->GetBoolValue(PP_MVSHOWSINGLETASKS)) + PROP_UINT(IDS_MINIVIEWREFRESHINTERVAL_STRING, GetConfig()->GetIntValue(PP_MVREFRESHINTERVAL)) + PROP_BOOL(IDS_MINIVIEWSHOWAFTERSTART_STRING, GetConfig()->GetBoolValue(PP_MVAUTOSHOWWHENRUN)) + PROP_BOOL(IDS_MINIVIEWAUTOHIDE_STRING, GetConfig()->GetBoolValue(PP_MVAUTOHIDEWHENEMPTY)) + PROP_BOOL(IDS_MINIVIEWSMOOTHPROGRESS_STRING, GetConfig()->GetBoolValue(PP_MVUSESMOOTHPROGRESS)) + + PROP_SEPARATOR(IDS_CFGFOLDERDIALOG_STRING) + PROP_BOOL(IDS_CFGFDEXTVIEW_STRING, GetConfig()->GetBoolValue(PP_FDEXTENDEDVIEW)) + PROP_UINT(IDS_CFGFDWIDTH_STRING, GetConfig()->GetIntValue(PP_FDWIDTH)) + PROP_UINT(IDS_CFGFDHEIGHT_STRING, GetConfig()->GetIntValue(PP_FDHEIGHT)) + PROP_COMBO(IDS_CFGFDSHORTCUTS_STRING, IDS_CFGFDSHORTCUTSSTYLES_STRING, GetConfig()->GetIntValue(PP_FDSHORTCUTLISTSTYLE)) + PROP_BOOL(IDS_CFGFDIGNOREDIALOGS_STRING, GetConfig()->GetBoolValue(PP_FDIGNORESHELLDIALOGS)) + + PROP_SEPARATOR(IDS_CFGSHELL_STRING) + PROP_BOOL(IDS_CFGSHCOPY_STRING, GetConfig()->GetBoolValue(PP_SHSHOWCOPY)) + PROP_BOOL(IDS_CFGSHMOVE_STRING, GetConfig()->GetBoolValue(PP_SHSHOWMOVE)) + PROP_BOOL(IDS_CFGSHCMSPECIAL_STRING, GetConfig()->GetBoolValue(PP_SHSHOWCOPYMOVE)) + PROP_BOOL(IDS_CFGSHPASTE_STRING, GetConfig()->GetBoolValue(PP_SHSHOWPASTE)) + PROP_BOOL(IDS_CFGSHPASTESPECIAL_STRING, GetConfig()->GetBoolValue(PP_SHSHOWPASTESPECIAL)) + PROP_BOOL(IDS_CFGSHCOPYTO_STRING, GetConfig()->GetBoolValue(PP_SHSHOWCOPYTO)) + PROP_BOOL(IDS_CFGSHMOVETO_STRING, GetConfig()->GetBoolValue(PP_SHSHOWMOVETO)) + PROP_BOOL(IDS_CFGSHCMTOSPECIAL_STRING, GetConfig()->GetBoolValue(PP_SHSHOWCOPYMOVETO)) + PROP_BOOL(IDS_CFGSHSHOWFREESPACE_STRING, GetConfig()->GetBoolValue(PP_SHSHOWFREESPACE)) + PROP_BOOL(IDS_CFGSHSHOWICONS_STRING, GetConfig()->GetBoolValue(PP_SHSHOWSHELLICONS)) + PROP_BOOL(IDS_CFGSHOVERRIDEDRAG_STRING, GetConfig()->GetBoolValue(PP_SHUSEDRAGDROP)) + PROP_COMBO(IDS_CFGOVERRIDEDEFACTION_STRING, IDS_CFGACTIONS_STRING, GetConfig()->GetIntValue(PP_SHDEFAULTACTION)); + + PROP_SEPARATOR(IDS_PROCESSINGTHREAD_STRING) + PROP_BOOL(IDS_AUTOCOPYREST_STRING, GetConfig()->GetBoolValue(PP_CMUSEAUTOCOMPLETEFILES)) + PROP_BOOL(IDS_SETDESTATTRIB_STRING, GetConfig()->GetBoolValue(PP_CMSETDESTATTRIBUTES)) + PROP_BOOL(IDS_SETDESTTIME_STRING, GetConfig()->GetBoolValue(PP_CMSETDESTDATE)) + PROP_BOOL(IDS_PROTECTROFILES_STRING, GetConfig()->GetBoolValue(PP_CMPROTECTROFILES)) + PROP_UINT(IDS_LIMITOPERATIONS_STRING, GetConfig()->GetIntValue(PP_CMLIMITMAXOPERATIONS)) + PROP_BOOL(IDS_READSIZEBEFOREBLOCK_STRING, GetConfig()->GetBoolValue(PP_CMREADSIZEBEFOREBLOCKING)) + PROP_COMBO(IDS_SHOWVISUALFEEDBACK_STRING, IDS_FEEDBACKTYPE_STRING, GetConfig()->GetIntValue(PP_CMSHOWVISUALFEEDBACK)) + PROP_BOOL(IDS_USETIMEDDIALOGS_STRING, GetConfig()->GetBoolValue(PP_CMUSETIMEDFEEDBACK)) + PROP_UINT(IDS_TIMEDDIALOGINTERVAL_STRING, GetConfig()->GetIntValue(PP_CMFEEDBACKTIME)) + PROP_BOOL(IDS_AUTORETRYONERROR_STRING, GetConfig()->GetBoolValue(PP_CMAUTORETRYONERROR)) + PROP_UINT(IDS_AUTORETRYINTERVAL_STRING, GetConfig()->GetIntValue(PP_CMAUTORETRYINTERVAL)) + PROP_COMBO(IDS_DEFAULTPRIORITY_STRING, MakeCompoundString(IDS_PRIORITY0_STRING, 7, _T("!")), PriorityToIndex(GetConfig()->GetIntValue(PP_CMDEFAULTPRIORITY))) + PROP_BOOL(IDS_CFGDISABLEPRIORITYBOOST_STRING, GetConfig()->GetBoolValue(PP_CMDISABLEPRIORITYBOOST)) + PROP_BOOL(IDS_DELETEAFTERFINISHED_STRING, GetConfig()->GetBoolValue(PP_CMDELETEAFTERFINISHED)) + PROP_BOOL(IDS_CREATELOGFILES_STRING, GetConfig()->GetBoolValue(PP_CMCREATELOG)) + + // Buffer + PROP_SEPARATOR(IDS_OPTIONSBUFFER_STRING) + PROP_BOOL(IDS_AUTODETECTBUFFERSIZE_STRING, GetConfig()->GetBoolValue(PP_BFUSEONLYDEFAULT)) + PROP_CUSTOM_UINT(IDS_DEFAULTBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_BFDEFAULT), &CustomPropertyCallbackProc, 0) + PROP_CUSTOM_UINT(IDS_ONEDISKBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_BFONEDISK), &CustomPropertyCallbackProc, 1) + PROP_CUSTOM_UINT(IDS_TWODISKSBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_BFTWODISKS), &CustomPropertyCallbackProc, 2) + PROP_CUSTOM_UINT(IDS_CDBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_BFCD), &CustomPropertyCallbackProc, 3) + PROP_CUSTOM_UINT(IDS_LANBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_BFLAN), &CustomPropertyCallbackProc, 4) + PROP_BOOL(IDS_USENOBUFFERING_STRING, GetConfig()->GetBoolValue(PP_BFUSENOBUFFERING)) + PROP_UINT(IDS_LARGEFILESMINSIZE_STRING, GetConfig()->GetIntValue(PP_BFBOUNDARYLIMIT)) + + + // Sounds + PROP_SEPARATOR(IDS_SOUNDS_STRING) + PROP_BOOL(IDS_PLAYSOUNDS_STRING, GetConfig()->GetBoolValue(PP_SNDPLAYSOUNDS)) + GetConfig()->GetStringValue(PP_SNDERRORSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + PROP_PATH(IDS_SOUNDONERROR_STRING, IDS_SOUNDSWAVFILTER_STRING, strPath) + GetConfig()->GetStringValue(PP_SNDFINISHEDSOUNDPATH, strPath.GetBuffer(_MAX_PATH), _MAX_PATH); + strPath.ReleaseBuffer(); + PROP_PATH(IDS_SOUNDONFINISH_STRING, IDS_SOUNDSWAVFILTER_STRING, strPath) + + PROP_SEPARATOR(IDS_CFGSHORTCUTS_STRING) + PROP_CUSTOM_UINT(IDS_CFGSCCOUNT_STRING, m_cvShortcuts.size(), &ShortcutsPropertyCallbackProc, 0) + + PROP_SEPARATOR(IDS_CFGRECENT_STRING) + PROP_CUSTOM_UINT(IDS_CFGRPCOUNT_STRING, m_cvRecent.size(), &RecentPropertyCallbackProc, 0) + + /* PROP_SEPARATOR(IDS_CFGLOGFILE_STRING) + PROP_BOOL(IDS_CFGENABLELOGGING_STRING, GetConfig()->GetBoolValue(PP_LOGENABLELOGGING)) + PROP_BOOL(IDS_CFGLIMITATION_STRING, GetConfig()->GetBoolValue(PP_LOGLIMITATION)) + PROP_UINT(IDS_CFGMAXLIMIT_STRING, GetConfig()->GetIntValue(PP_LOGMAXLIMIT)) + PROP_BOOL(IDS_CFGLOGPRECISELIMITING_STRING, GetConfig()->GetBoolValue(PP_LOGPRECISELIMITING)) + PROP_UINT(IDS_CFGTRUNCBUFFERSIZE_STRING, GetConfig()->GetIntValue(PP_LOGTRUNCBUFFERSIZE))*/ +} + +void COptionsDlg::ApplyProperties() +{ + // counter + int iPosition=0; + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_PCLIPBOARDMONITORING, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_PMONITORSCANINTERVAL, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_PRELOADAFTERRESTART, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_PSHUTDOWNAFTREFINISHED, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_PTIMEBEFORESHUTDOWN, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_PFORCESHUTDOWN, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_PAUTOSAVEINTERVAL, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_PPROCESSPRIORITYCLASS, IndexToPriorityClass(GetIndexProp(iPosition++))); + GetConfig()->SetStringValue(PP_PAUTOSAVEDIRECTORY, GetStringProp(iPosition++)); + GetConfig()->SetStringValue(PP_PPLUGINSDIR, GetStringProp(iPosition++)); + GetConfig()->SetStringValue(PP_PHELPDIR, GetStringProp(iPosition++)); + // language + PCTSTR pszSrc=m_vld.at(GetIndexProp(iPosition++)).GetFilename(true); + if (_tcsnicmp(pszSrc, GetApp()->GetProgramPath(), _tcslen(GetApp()->GetProgramPath())) == 0) + { + // replace the first part of path with + TCHAR szData[_MAX_PATH]; + _stprintf(szData, _T("%s"), pszSrc+_tcslen(GetApp()->GetProgramPath())); + GetConfig()->SetStringValue(PP_PLANGUAGE, szData); + } + else + GetConfig()->SetStringValue(PP_PLANGUAGE, pszSrc); + GetConfig()->SetStringValue(PP_PLANGDIR, GetStringProp(iPosition++)); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetIntValue(PP_STATUSREFRESHINTERVAL, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_STATUSSHOWDETAILS, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_STATUSAUTOREMOVEFINISHED, GetBoolProp(iPosition++)); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_MVSHOWFILENAMES, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_MVSHOWSINGLETASKS, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_MVREFRESHINTERVAL, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_MVAUTOSHOWWHENRUN, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_MVAUTOHIDEWHENEMPTY, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_MVUSESMOOTHPROGRESS, GetBoolProp(iPosition++)); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_FDEXTENDEDVIEW, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_FDWIDTH, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_FDHEIGHT, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_FDSHORTCUTLISTSTYLE, GetIndexProp(iPosition++)); + GetConfig()->SetBoolValue(PP_FDIGNORESHELLDIALOGS, GetBoolProp(iPosition++)); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_SHSHOWCOPY, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWMOVE, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWCOPYMOVE, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWPASTE, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWPASTESPECIAL, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWCOPYTO, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWMOVETO, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWCOPYMOVETO, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWFREESPACE, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHSHOWSHELLICONS, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_SHUSEDRAGDROP, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_SHDEFAULTACTION, GetIndexProp(iPosition++)); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_CMUSEAUTOCOMPLETEFILES, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMSETDESTATTRIBUTES, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMSETDESTDATE, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMPROTECTROFILES, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_CMLIMITMAXOPERATIONS, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMREADSIZEBEFOREBLOCKING, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_CMSHOWVISUALFEEDBACK, GetIndexProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMUSETIMEDFEEDBACK, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_CMFEEDBACKTIME, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMAUTORETRYONERROR, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_CMAUTORETRYINTERVAL, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_CMDEFAULTPRIORITY, IndexToPriority(GetIndexProp(iPosition++))); + GetConfig()->SetBoolValue(PP_CMDISABLEPRIORITYBOOST, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMDELETEAFTERFINISHED, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_CMCREATELOG, GetBoolProp(iPosition++)); + + // Buffer + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_BFUSEONLYDEFAULT, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFDEFAULT, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFONEDISK, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFTWODISKS, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFCD, GetUintProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFLAN, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_BFUSENOBUFFERING, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_BFBOUNDARYLIMIT, GetUintProp(iPosition++)); + + // log file +/* SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_LOGENABLELOGGING, GetBoolProp(iPosition++)); + GetConfig()->SetBoolValue(PP_LOGLIMITATION, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_LOGMAXLIMIT, GetUintProp(iPosition++)); + GetConfig()->SetBoolValue(PP_LOGPRECISELIMITING, GetBoolProp(iPosition++)); + GetConfig()->SetIntValue(PP_LOGTRUNCBUFFERSIZE, GetUintProp(iPosition++));*/ + + // Sounds + SKIP_SEPARATOR(iPosition) + GetConfig()->SetBoolValue(PP_SNDPLAYSOUNDS, GetBoolProp(iPosition++)); + GetConfig()->SetStringValue(PP_SNDERRORSOUNDPATH, GetStringProp(iPosition++)); + GetConfig()->SetStringValue(PP_SNDFINISHEDSOUNDPATH, GetStringProp(iPosition++)); + + // shortcuts & recent paths + SKIP_SEPARATOR(iPosition) + GetConfig()->SetStringArrayValue(PP_SHORTCUTS, &m_cvShortcuts); + + SKIP_SEPARATOR(iPosition) + GetConfig()->SetStringArrayValue(PP_RECENTPATHS, &m_cvRecent); + + GetConfig()->Save(); +} + +void COptionsDlg::OnCancel() +{ + SendClosingNotify(); + CHLanguageDialog::OnCancel(); +} + +void COptionsDlg::SendClosingNotify() +{ + GetParent()->PostMessage(WM_CONFIGNOTIFY); +} + +CString COptionsDlg::MakeCompoundString(UINT uiBase, int iCount, LPCTSTR lpszSeparator) +{ + _tcscpy(m_szBuffer, GetResManager()->LoadString(uiBase+0)); + for (int i=1;iLoadString(uiBase+i)); + } + + return CString((PCTSTR)m_szBuffer); +} + +bool COptionsDlg::GetBoolProp(int iPosition) +{ + m_ctlProperties.GetProperty(iPosition, &m_iSel); + return m_iSel != 0; +} + +UINT COptionsDlg::GetUintProp(int iPosition) +{ + m_ctlProperties.GetProperty(iPosition, &m_strTemp); + return _ttoi(m_strTemp); +} + +CString COptionsDlg::GetStringProp(int iPosition) +{ + m_ctlProperties.GetProperty(iPosition, &m_strTemp); + return m_strTemp; +} + +int COptionsDlg::GetIndexProp(int iPosition) +{ + m_ctlProperties.GetProperty(iPosition, &m_iSel); + return m_iSel; +} + +void COptionsDlg::OnApplyButton() +{ + // kill focuses + m_ctlProperties.HideControls(); + + ApplyProperties(); +} + +void COptionsDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + m_ctlProperties.Reinit(); + + // set attributes + m_ctlProperties.SetBkColor(RGB(255, 255, 255)); + m_ctlProperties.SetTextColor(RGB(80, 80, 80)); + m_ctlProperties.SetTextHighlightColor(RGB(80,80,80)); + m_ctlProperties.SetHighlightColor(RGB(200, 200, 200)); + m_ctlProperties.SetPropertyBkColor(RGB(255,255,255)); + m_ctlProperties.SetPropertyTextColor(RGB(0,0,0)); + m_ctlProperties.SetLineStyle(RGB(74,109,132), PS_SOLID); + + FillPropertyList(); +} Index: Copy Handler/OptionsDlg.h =================================================================== diff -u --- Copy Handler/OptionsDlg.h (revision 0) +++ Copy Handler/OptionsDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,98 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __OPTIONSDLG_H__ +#define __OPTIONSDLG_H__ + +#include "PropertyListCtrl.h" +#include "structs.h" +#include "shortcuts.h" +#include "charvect.h" + +#define WM_CONFIGNOTIFY WM_USER+13 + +///////////////////////////////////////////////////////////////////////////// +// COptionsDlg dialog + +class COptionsDlg : public CHLanguageDialog +{ +// Construction +public: + void SendClosingNotify(); + COptionsDlg(CWnd* pParent = NULL); // standard constructor + + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + + static bool m_bLock; // locker + + char_vector m_cvRecent; + char_vector m_cvShortcuts; + + // for languages + vector m_vld; + TCHAR m_szLangPath[_MAX_PATH]; // the full path to a folder with langs (@read) + + friend void CustomPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + friend void ShortcutsPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + friend void RecentPropertyCallbackProc(LPVOID lpParam, int iParam, CPtrList* pList, int iIndex); + +// Dialog Data + //{{AFX_DATA(COptionsDlg) + enum { IDD = IDD_OPTIONS_DIALOG }; + CPropertyListCtrl m_ctlProperties; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(COptionsDlg) + public: + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + void FillPropertyList(); + void ApplyProperties(); + + int GetIndexProp(int iPosition); + CString GetStringProp(int iPosition); + UINT GetUintProp(int iPosition); + bool GetBoolProp(int iPosition); + CString MakeCompoundString(UINT uiBase, int iCount, LPCTSTR lpszSeparator); + + TCHAR m_szBuffer[_MAX_PATH]; // for macro use + CString m_strTemp; + int m_iSel; + + // Generated message map functions + //{{AFX_MSG(COptionsDlg) + virtual BOOL OnInitDialog(); + virtual void OnOK(); + virtual void OnCancel(); + afx_msg void OnApplyButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/ProgressListBox.cpp =================================================================== diff -u --- Copy Handler/ProgressListBox.cpp (revision 0) +++ Copy Handler/ProgressListBox.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,246 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "ProgressListBox.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//#define USE_SMOOTH_PROGRESS + +///////////////////////////////////////////////////////////////////////////// +// CProgressListBox + +CProgressListBox::CProgressListBox() +{ + m_bShowCaptions=true; + m_bSmoothProgress=false; +} + +CProgressListBox::~CProgressListBox() +{ + for (int i=0;iitemID == -1) + return; + _PROGRESSITEM_* pItem=m_items.GetAt(lpDrawItemStruct->itemID); + + // device context + CDC* pDC=CDC::FromHandle(lpDrawItemStruct->hDC); + pDC->SetBkMode(TRANSPARENT); + + if (lpDrawItemStruct->itemState & ODS_SELECTED) + { + // fill with color, because in other way the trash appears + pDC->FillSolidRect(&lpDrawItemStruct->rcItem, GetSysColor(COLOR_3DFACE)); + CPoint apt[3]={ CPoint(lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top+(lpDrawItemStruct->rcItem.bottom-lpDrawItemStruct->rcItem.top)/4), + CPoint(lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top+3*((lpDrawItemStruct->rcItem.bottom-lpDrawItemStruct->rcItem.top)/4)), + CPoint(lpDrawItemStruct->rcItem.left+7, lpDrawItemStruct->rcItem.top+(lpDrawItemStruct->rcItem.bottom-lpDrawItemStruct->rcItem.top)/2) }; + pDC->Polygon(apt, 3); + lpDrawItemStruct->rcItem.left+=10; + } + + // draw text + if (m_bShowCaptions) + { + CRect rcText(lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top+2, + lpDrawItemStruct->rcItem.right, lpDrawItemStruct->rcItem.bottom-(9+2)); + pDC->SetTextColor(GetSysColor(COLOR_BTNTEXT)); + pDC->DrawText(pItem->m_strText, &rcText, + DT_PATH_ELLIPSIS | DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX); + } + + // frame sizes + int iEdgeWidth=1/*GetSystemMetrics(SM_CXEDGE)*/; + int iEdgeHeight=1/*GetSystemMetrics(SM_CYEDGE)*/; + + // progress like drawing + int iBoxWidth=static_cast(static_cast(((9+2)-2*iEdgeWidth))*(2.0/3.0))+1; + CRect rcProgress(lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.bottom-(9+2), + lpDrawItemStruct->rcItem.left+2*iEdgeWidth+((lpDrawItemStruct->rcItem.right-lpDrawItemStruct->rcItem.left-2*iEdgeWidth)/iBoxWidth)*iBoxWidth, + lpDrawItemStruct->rcItem.bottom); + + // edge + pDC->Draw3dRect(&rcProgress, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHIGHLIGHT)); + + if (!m_bSmoothProgress) + { + // boxes within edge + double dCount=static_cast(static_cast(((rcProgress.Width()-2*iEdgeHeight)/iBoxWidth)) + *(static_cast(pItem->m_uiPos)/static_cast(pItem->m_uiRange))); + int iBoxCount=((dCount-static_cast(dCount)) > 0.2) ? static_cast(dCount)+1 : static_cast(dCount); + + for (int i=0;iFillSolidRect(lpDrawItemStruct->rcItem.left+i*iBoxWidth+iEdgeWidth+1, + lpDrawItemStruct->rcItem.bottom-(9+2)+iEdgeHeight+1, + iBoxWidth-2, rcProgress.Height()-2*iEdgeHeight-2, pItem->m_crColor); + } + else + { + pDC->FillSolidRect(lpDrawItemStruct->rcItem.left+iEdgeWidth+1, lpDrawItemStruct->rcItem.bottom-(9+2)+iEdgeHeight+1, + static_cast((rcProgress.Width()-2*iEdgeHeight-3)*(static_cast(pItem->m_uiPos)/static_cast(pItem->m_uiRange))), + rcProgress.Height()-2*iEdgeHeight-2, pItem->m_crColor); + } +} + +bool CProgressListBox::GetShowCaptions() +{ + return m_bShowCaptions; +} + +void CProgressListBox::SetShowCaptions(bool bShow) +{ + if (bShow != m_bShowCaptions) + { + m_bShowCaptions=bShow; + if (bShow) + { + CClientDC dc(this); + dc.SelectObject(GetFont()); + TEXTMETRIC tm; + dc.GetTextMetrics(&tm); + int iHeight=MulDiv(tm.tmHeight+tm.tmExternalLeading, dc.GetDeviceCaps(LOGPIXELSY), tm.tmDigitizedAspectY); + + SetItemHeight(0, 9+2+2+iHeight); + } + else + SetItemHeight(0, 9+2+2); + + RecalcHeight(); + } +} + +void CProgressListBox::RecalcHeight() +{ + // new height + int iCtlHeight=m_items.GetSize()*GetItemHeight(0); + + // change control size + CRect rcCtl; + GetClientRect(&rcCtl); + this->SetWindowPos(NULL, 0, 0, rcCtl.Width(), iCtlHeight, SWP_NOZORDER | SWP_NOMOVE); +} + +void CProgressListBox::Init() +{ + // set new height of an item + CClientDC dc(this); + TEXTMETRIC tm; + dc.GetTextMetrics(&tm); + int iHeight=MulDiv(tm.tmHeight+tm.tmExternalLeading, dc.GetDeviceCaps(LOGPIXELSY), tm.tmDigitizedAspectY); + SetItemHeight(0, m_bShowCaptions ? iHeight+2+9+2 : 2+9+2); +} + +_PROGRESSITEM_* CProgressListBox::GetItemAddress(int iIndex) +{ + if (m_items.GetSize() > iIndex) + return m_items.GetAt(iIndex); + else + { + _PROGRESSITEM_* pItem=new _PROGRESSITEM_; + pItem->m_uiRange=100; + m_items.Add(pItem); + return pItem; + } +} + +void CProgressListBox::UpdateItems(int nLimit, bool bUpdateSize) +{ + // delete items from array + while (m_items.GetSize() > nLimit) + { + delete m_items.GetAt(nLimit); + m_items.RemoveAt(nLimit); + } + + // change count of elements in a listbox + if (GetCount() != m_items.GetSize()) + { + while (GetCount() < m_items.GetSize()) + AddString(""); + + while (GetCount() > m_items.GetSize()) + DeleteString(m_items.GetSize()); + } + + if (bUpdateSize) + { + Invalidate(); + RecalcHeight(); + } +} + +void CProgressListBox::OnPaint() +{ + CPaintDC dc(this); // device context for painting + CRect rcClip; + dc.GetClipBox(&rcClip); + + CMemDC memDC(&dc, &rcClip); + memDC.FillSolidRect(&rcClip, GetSysColor(COLOR_3DFACE)); + + DefWindowProc(WM_PAINT, reinterpret_cast(memDC.m_hDC), 0); +} + +BOOL CProgressListBox::OnEraseBkgnd(CDC*) +{ + return FALSE/*CListBox::OnEraseBkgnd(pDC)*/; +} + +int CProgressListBox::SetCurSel(int nSelect) +{ + int nResult=static_cast(this)->SetCurSel(nSelect); + if (nSelect == -1) + GetParent()->SendMessage(WM_COMMAND, (LBN_SELCANCEL << 16) | GetDlgCtrlID(), reinterpret_cast(this->m_hWnd)); + + return nResult; +} + +void CProgressListBox::OnKillfocus() +{ + SetCurSel(-1); +} + +void CProgressListBox::SetSmoothProgress(bool bSmoothProgress) +{ + m_bSmoothProgress=bSmoothProgress; +} Index: Copy Handler/ProgressListBox.h =================================================================== diff -u --- Copy Handler/ProgressListBox.h (revision 0) +++ Copy Handler/ProgressListBox.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,97 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PROGRESSLISTBOX_H__ +#define __PROGRESSLISTBOX_H__ + +#include "memdc.h" +#include "afxtempl.h" +#include "structs.h" + +///////////////////////////////////////////////////////////////////////////// +// CProgressListBox window +struct _PROGRESSITEM_ +{ + CString m_strText; + + UINT m_uiPos; + UINT m_uiRange; + + COLORREF m_crColor; + + CTask* m_pTask; +}; + +class CProgressListBox : public CListBox +{ +// Construction +public: + CProgressListBox(); + +// Attributes +public: + +// Operations +public: + CArray<_PROGRESSITEM_*, _PROGRESSITEM_*> m_items; + +protected: + bool m_bShowCaptions; + bool m_bSmoothProgress; + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CProgressListBox) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + //}}AFX_VIRTUAL + +// Implementation +public: + void SetSmoothProgress(bool bSmoothProgress); + int SetCurSel( int nSelect ); + void Init(); + + void UpdateItems(int nLimit, bool bUpdateSize); // updates items in listbox + void RecalcHeight(); // sets size of a listbox by counting szie of the items + + _PROGRESSITEM_* GetItemAddress(int iIndex); + + void SetShowCaptions(bool bShow=true); + bool GetShowCaptions(); + + virtual ~CProgressListBox(); + + // Generated message map functions +protected: + //{{AFX_MSG(CProgressListBox) + afx_msg void OnPaint(); + afx_msg BOOL OnEraseBkgnd(CDC*); + afx_msg void OnKillfocus(); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/PropertyListCtrl.cpp =================================================================== diff -u --- Copy Handler/PropertyListCtrl.cpp (revision 0) +++ Copy Handler/PropertyListCtrl.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1265 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" +#include "PropertyListCtrl.h" +#include "dialogs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CComboButton +CComboButton::CComboButton() +{ +} + +CComboButton::~CComboButton() +{ + // Delete the objects created + delete m_pBkBrush; + delete m_pBlackBrush; +// delete m_pGrayPen; + delete m_pBkPen; +} + +BEGIN_MESSAGE_MAP(CComboButton, CButton) + //{{AFX_MSG_MAP(CComboButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CComboButton message handlers +BOOL CComboButton::Create( CRect Rect, CWnd* pParent, UINT uID) +{ + // Create the Brushes and Pens + m_pBkBrush = new CBrush( GetSysColor(COLOR_BTNFACE)); + m_pBkPen = new CPen( PS_SOLID, 1, GetSysColor(COLOR_BTNFACE)); +// m_pGrayPen = new CPen( PS_SOLID, 1, RGB(128,128,128)); + m_pBlackBrush = new CBrush(GetSysColor(COLOR_BTNTEXT)); + + // Create the CButton + if( !CButton::Create("", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|BS_OWNERDRAW, Rect, pParent, uID )) + return FALSE; + + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// Draw the Button +void CComboButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct ) +{ + CDC* prDC = CDC::FromHandle(lpDrawItemStruct->hDC); + CRect ButtonRect = lpDrawItemStruct->rcItem; + CMemDC dc(prDC, ButtonRect); + CMemDC *pDC=&dc; + + // Fill the Background + CBrush* pOldBrush = (CBrush*)pDC->SelectObject( m_pBkBrush ); + CPen* pOldPen = (CPen*)pDC->SelectObject(m_pBkPen); + pDC->Rectangle(ButtonRect); + + // Draw the Correct Border + if(lpDrawItemStruct->itemState & ODS_SELECTED) + { + pDC->DrawEdge(ButtonRect, EDGE_SUNKEN, BF_RECT); + ButtonRect.left++; + ButtonRect.right++; + ButtonRect.bottom++; + ButtonRect.top++; + } + else + pDC->DrawEdge(ButtonRect, EDGE_RAISED, BF_RECT); + + // Draw the Triangle + ButtonRect.left += 3; + ButtonRect.right -= 4; + ButtonRect.top += 5; + ButtonRect.bottom -= 5; + DrawTriangle(pDC, ButtonRect); + + // Return what was used + pDC->SelectObject( pOldPen ); + pDC->SelectObject( pOldBrush ); +} + +void CComboButton::DrawTriangle(CDC* pDC, CRect Rect) +{ + POINT ptArray[3]; + + // Figure out the Top left + ptArray[0].x = Rect.left; + ptArray[0].y = Rect.top; + ptArray[1].x = Rect.right; + ptArray[1].y = Rect.top; + ptArray[2].x = Rect.right - (Rect.Width() / 2); + ptArray[2].y = Rect.bottom; + + // Select the Brush and Draw the triangle + /*CBrush* pOldBrush = (CBrush*)*/pDC->SelectObject(m_pBlackBrush); + pDC->Polygon(ptArray, 3 ); +} +void CComboButton::MeasureItem(LPMEASUREITEMSTRUCT/* lpMeasureItemStruct*/) +{ +} + +///////////////////////////////////////////////////////////////////////////// +// CPropertyListCtrl +CPropertyListCtrl::CPropertyListCtrl() +{ + m_nWidestItem = 0; + m_bDeleteFont = TRUE; + m_bBoldSelection = TRUE; + + m_pBkBrush = NULL; + m_pBkPropertyBrush = NULL; + m_pEditWnd = NULL; + m_pFontButton = NULL; + m_pPathButton = NULL; + m_pDirButton=NULL; + m_pCustomButton=NULL; + m_pComboButton = NULL; + m_pListBox = NULL; + m_pBkHighlightBrush = NULL; + m_pSelectedFont = NULL; + m_pBorderPen = NULL; + m_pCurItem = NULL; + m_pCurFont = NULL; + m_pCurDrawItem = NULL; + m_pTextFont = NULL; + m_pSelectedFont = NULL; + m_pBorderPen = NULL; + + m_crBorderColor = RGB(192,192,192); + m_crBkColor = GetSysColor(COLOR_WINDOW); + m_crPropertyBkColor = m_crBkColor; + m_crTextColor = GetSysColor(COLOR_WINDOWTEXT); + m_crPropertyTextColor = m_crTextColor; + m_crHighlightColor = GetSysColor(COLOR_HIGHLIGHT); + m_crTextHighlightColor = GetSysColor(COLOR_HIGHLIGHTTEXT); +} + +CPropertyListCtrl::~CPropertyListCtrl() +{ + if(m_bDeleteFont) delete m_pTextFont; + + if(m_pEditWnd) delete m_pEditWnd; + if(m_pFontButton) delete m_pFontButton; + if(m_pPathButton) delete m_pPathButton; + if (m_pDirButton) delete m_pDirButton; + if (m_pCustomButton) + delete m_pCustomButton; + if(m_pListBox) delete m_pListBox; + if(m_pComboButton) delete m_pComboButton; + + if(m_pBkBrush) delete m_pBkBrush; + if(m_pBkPropertyBrush) delete m_pBkPropertyBrush; + if(m_pBkHighlightBrush) delete m_pBkHighlightBrush; + if(m_pSelectedFont) delete m_pSelectedFont; + if(m_pBorderPen) delete m_pBorderPen; + + // Clear items + Reset(); +} + +void CPropertyListCtrl::Reinit() +{ + ResetContent(); + + // Clean up + if(m_bDeleteFont) delete m_pTextFont; + + if(m_pEditWnd) delete m_pEditWnd; + if(m_pFontButton) delete m_pFontButton; + if(m_pPathButton) delete m_pPathButton; + if (m_pDirButton) delete m_pDirButton; + if (m_pCustomButton) + delete m_pCustomButton; + if(m_pListBox) delete m_pListBox; + if(m_pComboButton) delete m_pComboButton; + + if(m_pBkBrush) delete m_pBkBrush; + if(m_pBkPropertyBrush) delete m_pBkPropertyBrush; + if(m_pBkHighlightBrush) delete m_pBkHighlightBrush; + if(m_pSelectedFont) delete m_pSelectedFont; + if(m_pBorderPen) delete m_pBorderPen; + + // Clear items + Reset(); + + m_nWidestItem = 0; + m_bDeleteFont = TRUE; + m_bBoldSelection = TRUE; + + m_pBkBrush = NULL; + m_pBkPropertyBrush = NULL; + m_pEditWnd = NULL; + m_pFontButton = NULL; + m_pPathButton = NULL; + m_pDirButton=NULL; + m_pCustomButton=NULL; + m_pComboButton = NULL; + m_pListBox = NULL; + m_pBkHighlightBrush = NULL; + m_pSelectedFont = NULL; + m_pBorderPen = NULL; + m_pCurItem = NULL; + m_pCurFont = NULL; + m_pCurDrawItem = NULL; + m_pTextFont = NULL; + m_pSelectedFont = NULL; + m_pBorderPen = NULL; + + m_crBorderColor = RGB(192,192,192); + m_crBkColor = GetSysColor(COLOR_WINDOW); + m_crPropertyBkColor = m_crBkColor; + m_crTextColor = GetSysColor(COLOR_WINDOWTEXT); + m_crPropertyTextColor = m_crTextColor; + m_crHighlightColor = GetSysColor(COLOR_HIGHLIGHT); + m_crTextHighlightColor = GetSysColor(COLOR_HIGHLIGHTTEXT); + + Init(); +} + +void CPropertyListCtrl::Reset() +{ + // Clear the List + POSITION Pos = m_Items.GetHeadPosition(); + while(Pos) + { + m_pCurItem = (PROPERTYITEM*)m_Items.GetNext(Pos); + if(m_pCurItem->pBrush) + delete m_pCurItem->pBrush; + delete m_pCurItem; + } + m_Items.RemoveAll(); +} + +BEGIN_MESSAGE_MAP(CPropertyListCtrl, CListBox) + //{{AFX_MSG_MAP(CPropertyListCtrl) + ON_WM_CREATE() + ON_WM_CTLCOLOR_REFLECT() + ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange) + ON_WM_CTLCOLOR() + ON_CONTROL_REFLECT(LBN_DBLCLK, OnDblclk) + ON_EN_KILLFOCUS( ID_PROPERTY_TEXT, OnEditLostFocus ) + ON_EN_CHANGE( ID_PROPERTY_TEXT, OnEditChange ) + ON_BN_CLICKED( ID_PROPERTY_FONT, OnFontPropertyClick ) + ON_BN_CLICKED( ID_PROPERTY_PATH, OnPathPropertyClick ) + ON_BN_CLICKED( ID_PROPERTY_DIR, OnDirPropertyClick ) + ON_BN_CLICKED( ID_PROPERTY_CUSTOM, OnCustomPropertyClick ) + ON_BN_CLICKED( ID_PROPERTY_COMBO_BTN, OnComboBoxClick ) + ON_LBN_SELCHANGE(ID_PROPERTY_COMBO_LIST, OnSelChange) + ON_LBN_KILLFOCUS(ID_PROPERTY_COMBO_LIST, OnListboxLostFocus) + ON_WM_LBUTTONDOWN() + ON_WM_VSCROLL() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CPropertyListCtrl message handlers + +HBRUSH CPropertyListCtrl::CtlColor(CDC* /*pDC*/, UINT/* nCtlColor*/) +{ + return (HBRUSH)m_pBkBrush->GetSafeHandle(); +} + +HBRUSH CPropertyListCtrl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) +{ + HBRUSH hbr = CListBox::OnCtlColor(pDC, pWnd, nCtlColor); + +/* if( nCtlColor == CTLCOLOR_EDIT) + { + pDC->SetBkColor(m_crPropertyBkColor); + pDC->SetTextColor(m_crPropertyTextColor); + }*/ + pDC->SetBkColor(m_crPropertyBkColor); + pDC->SetTextColor(m_crPropertyTextColor); + + if(m_pBkPropertyBrush) + return (HBRUSH)(m_pBkPropertyBrush->GetSafeHandle() ); + else + return hbr; +} +void CPropertyListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) +{ + // Make sure its a valid item + if( lpDrawItemStruct->itemID == LB_ERR ) + return; + + // Obtain the text for this item + m_csText.Empty(); + GetText(lpDrawItemStruct->itemID, m_csText); + + // Get the drawing DC + CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC); + + // Set the Current member we are drawing + m_pCurDrawItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(lpDrawItemStruct->itemID)); + + // Obtain the Item Rect + CRect ItemRect(lpDrawItemStruct->rcItem); + + // Draw This item + DrawItem( pDC, ItemRect, lpDrawItemStruct->itemState & ODS_SELECTED); +} +void CPropertyListCtrl::MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/) +{ +} +void CPropertyListCtrl::OnDblclk() +{ + // Get the Course Position + POINT pPoint; + GetCursorPos(&pPoint); + + // Convert this rect to coordinates of the desktop + CRect TempRect = m_CurRect; + MapWindowPoints(GetDesktopWindow(), TempRect); + + // Display the Correct Control + switch(m_pCurItem->nType) + { + case ID_PROPERTY_BOOL: + // Is the Mouse in this area + if(TempRect.PtInRect(pPoint)) + { + // Reverse the Selection + m_pCurItem->nPropertySelected = !m_pCurItem->nPropertySelected; + + // Redraw this item + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + } + break; + + case ID_PROPERTY_FONT: + m_pFontButton->SetFocus(); + OnFontPropertyClick(); + break; + + case ID_PROPERTY_PATH: + m_pPathButton->SetFocus(); + OnPathPropertyClick(); + break; + + case ID_PROPERTY_DIR: + m_pDirButton->SetFocus(); + OnDirPropertyClick(); + break; + + case ID_PROPERTY_CUSTOM: + m_pCustomButton->SetFocus(); + OnCustomPropertyClick(); + break; + + case ID_PROPERTY_COLOR: + LOGBRUSH lb; + m_pCurItem->pBrush->GetLogBrush(&lb); + CColorDialog ColorDialog(lb.lbColor, 0, GetParent()); + if(ColorDialog.DoModal() != IDOK) + return; + + // Destroy the Brush and create a new one + if(m_pCurItem->pBrush) delete m_pCurItem->pBrush; + m_pCurItem->pBrush = new CBrush(ColorDialog.GetColor()); + + // Redraw the Widow (Theres probably a better way) + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + break; + } + +} +void CPropertyListCtrl::OnSelchange() +{ + HideControls(); + + // Display the Correct Control + CRect TempRect = m_CurRect; + TempRect.InflateRect(-1,-1); + switch(m_pCurItem->nType) + { + case ID_PROPERTY_TEXT: + TempRect.left += 1; + m_pEditWnd->SetWindowText(m_pCurItem->csProperties.GetAt(0)); + m_pEditWnd->MoveWindow(TempRect); + m_pEditWnd->ShowWindow(SW_SHOWNORMAL); +// m_pEditWnd->SetFocus(); +// m_pEditWnd->SetSel(0,-1); + break; + + case ID_PROPERTY_FONT: + TempRect.left = TempRect.right - 17; + m_pFontButton->MoveWindow(TempRect); + m_pFontButton->ShowWindow(SW_SHOWNORMAL); + break; + + case ID_PROPERTY_PATH: + TempRect.left = TempRect.right - 17; + m_pPathButton->MoveWindow(TempRect); + m_pPathButton->ShowWindow(SW_SHOWNORMAL); + break; + + case ID_PROPERTY_DIR: + TempRect.left = TempRect.right - 17; + m_pDirButton->MoveWindow(TempRect); + m_pDirButton->ShowWindow(SW_SHOWNORMAL); + break; + + case ID_PROPERTY_CUSTOM: + TempRect.left = TempRect.right - 17; + m_pCustomButton->MoveWindow(TempRect); + m_pCustomButton->ShowWindow(SW_SHOWNORMAL); + break; + + case ID_PROPERTY_COMBO_LIST: + TempRect.left = TempRect.right - 17; + m_pComboButton->MoveWindow(TempRect); + m_pComboButton->ShowWindow(SW_SHOWNORMAL); + + TempRect.left = m_CurRect.left + 2; + TempRect.right -= 17; + if(m_pCurItem->bComboEditable) + { + m_pEditWnd->SetWindowText(m_pCurItem->csProperties.GetAt(m_pCurItem->nPropertySelected)); +// m_pEditWnd->SetFocus(); +// m_pEditWnd->SetSel(0,-1); + m_pEditWnd->MoveWindow(TempRect); + m_pEditWnd->ShowWindow(SW_SHOWNORMAL); + } + + // Move the Lsit box +// TempRect.left--; + TempRect.right += 18; + TempRect.top = TempRect.bottom; + + // Set the Bottom Height + if(m_pCurItem->csProperties.GetSize() > 5) + TempRect.bottom += GetItemHeight(0) * 5; + else + TempRect.bottom += GetItemHeight(0) * m_pCurItem->csProperties.GetSize(); + + // pobierz wsp�rz�dne tej kontrolki w stosunku do okna parenta +// CRect rcThisParent; +// GetWindowRect(&rcThisParent); +// GetParent()->ScreenToClient(&rcThisParent); + +// TempRect.OffsetRect(rcThisParent.left+2, rcThisParent.top+2); + m_pListBox->MoveWindow(TempRect); + + // Force the Expansion + OnComboBoxClick(); + break; + + } +} +void CPropertyListCtrl::OnEditLostFocus() +{ + // Get the text + CString csText; + m_pEditWnd->GetWindowText(csText); + + // Is the current item a text item + if(m_pCurItem->nType == ID_PROPERTY_TEXT) + { + // Did the text change + if(!m_bChanged) + return; + + m_pCurItem->csProperties.SetAt(0, csText); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + } + else + { + // Get the window that has the focus now + if(GetFocus() == m_pComboButton || !m_pListBox->GetCount()) + return; + + // Did the text change + if(!m_bChanged) + return; + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + + // Look for this text + m_bChanged = FALSE; + if( m_pListBox->FindStringExact(-1,csText) != LB_ERR) + return; + + // Add it and select it + m_pCurItem->nPropertySelected = m_pCurItem->csProperties.Add(csText); + } +} +void CPropertyListCtrl::OnEditChange() +{ + m_bChanged = TRUE; +} +void CPropertyListCtrl::OnFontPropertyClick() +{ + // Show the Dialog + CFontDialog FontDialog(&m_pCurItem->LogFont); + if(FontDialog.DoModal() != IDOK) + return; + + // Set the Font data + FontDialog.GetCurrentFont(&m_pCurItem->LogFont); + + // Redraw + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); +} +void CPropertyListCtrl::OnPathPropertyClick() +{ + // Look for a ending tag + CString csExt = "*"; + CString csPath = m_pCurItem->csProperties.GetAt(0); + int nPos = csPath.ReverseFind('.'); + if(nPos) + csExt = csPath.Right(csPath.GetLength() - nPos - 1); + + // Show the Dialog + CFileDialog QuizFileDlg(TRUE, "*", "*." + csExt, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, m_pCurItem->csProperties.GetAt(1) ); + QuizFileDlg.m_ofn.lpstrInitialDir = csPath; + if(QuizFileDlg.DoModal() != IDOK) + return; + + // Obtain the Path they selected + m_pCurItem->csProperties.SetAt(0, QuizFileDlg.GetPathName()); + + // Redraw + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); +} + +void CPropertyListCtrl::OnDirPropertyClick() +{ + CString strPath; + if (BrowseForFolder(m_pCurItem->csProperties.GetAt(1), &strPath)) + { + m_pCurItem->csProperties.SetAt(0, strPath); + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + } +} + +void CPropertyListCtrl::OnCustomPropertyClick() +{ + m_pCurItem->pfnCallback(m_pCurItem->lpParam, m_pCurItem->iParam, &m_Items, GetCurSel()); + RedrawWindow(); +} + +void CPropertyListCtrl::OnComboBoxClick() +{ + // Add the items + m_pListBox->ResetContent(); + + // Loop for all items + for( int nItem = 0; nItem < m_pCurItem->csProperties.GetSize(); nItem++) + m_pListBox->AddString(m_pCurItem->csProperties.GetAt(nItem)); + + // Select the correct item + m_pListBox->SetCurSel(m_pCurItem->nPropertySelected); + m_pListBox->SetTopIndex(m_pCurItem->nPropertySelected); + + // Show the List box + m_pListBox->ShowWindow(SW_NORMAL); +} +void CPropertyListCtrl::OnSelChange() +{ + // Set the new current item + m_pCurItem->nPropertySelected = m_pListBox->GetCurSel(); + + // Hide the Windows + m_pListBox->ShowWindow(SW_HIDE); + + if(m_pCurItem->bComboEditable) + m_pEditWnd->SetWindowText(m_pCurItem->csProperties.GetAt(m_pCurItem->nPropertySelected)); + else + RedrawWindow(); + + // Send the message that a property has changed + GetParent()->PostMessage(ID_PROPERTY_CHANGED, GetCurSel(), m_pCurItem->nType); + m_pComboButton->SetFocus(); +} +void CPropertyListCtrl::OnListboxLostFocus() +{ + m_pListBox->ShowWindow(SW_HIDE); +} +void CPropertyListCtrl::OnLButtonDown(UINT nFlags, CPoint point) +{ + // is there an item at this point + BOOL bOutside; + /*UINT uItem =*/ ItemFromPoint(point, bOutside); + + // Is this outside the client + if(bOutside) + HideControls(); + + CListBox::OnLButtonDown(nFlags, point); +} +void CPropertyListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) +{ + // Hide the Controls + HideControls(); + + CListBox::OnVScroll(nSBCode, nPos, pScrollBar); +} + +///////////////////////////////////////////////////////////////////////////// +// GUI User Functions +///////////////////////////////////////////////////////////////////////////// + +void CPropertyListCtrl::Init() +{ + // utw�rz czcionk� bazowan� na czcionce okna + LOGFONT lf; + GetFont()->GetLogFont(&lf); + + if(m_pTextFont) delete m_pTextFont; + if(m_pSelectedFont) delete m_pSelectedFont; + + m_pTextFont=new CFont(); + m_pTextFont->CreateFontIndirect(&lf); + + lf.lfWeight=FW_BOLD; + m_pSelectedFont=new CFont(); + m_pSelectedFont->CreateFontIndirect(&lf); + + m_bDeleteFont=TRUE; + + // Create the Border Pen + m_pBorderPen = new CPen(PS_SOLID, 1, m_crBorderColor); + + // Create the Selected Background brush + m_pBkHighlightBrush = new CBrush(m_crHighlightColor); + m_pBkBrush = new CBrush(m_crBkColor); + + // Set the row height - read text height + CClientDC dc(this); + dc.SelectObject(&m_pSelectedFont); + TEXTMETRIC tm; + dc.GetTextMetrics(&tm); + + SetItemHeight(-1, MulDiv(tm.tmHeight+tm.tmExternalLeading, dc.GetDeviceCaps(LOGPIXELSY), tm.tmDigitizedAspectY) ); +} + +void CPropertyListCtrl::SetFont(CFont* pFont) +{ + // Delete our font and set our font to theirs + if(m_pTextFont) delete m_pTextFont; + if(m_pSelectedFont) delete m_pSelectedFont; + m_pTextFont = pFont; + m_bDeleteFont = FALSE; + + // Figure out the text size + LOGFONT lpLogFont; + m_pTextFont->GetLogFont(&lpLogFont); + + // Set the font and redraw + CWnd::SetFont(m_pTextFont, FALSE); + + // Create the heading font with the bold attribute + lpLogFont.lfWeight = FW_BOLD; + m_pSelectedFont = new CFont(); + m_pSelectedFont->CreateFontIndirect(&lpLogFont); + + // Set the Row height + CClientDC dc(this); + dc.SelectObject(&m_pSelectedFont); + TEXTMETRIC tm; + dc.GetTextMetrics(&tm); + + SetItemHeight(-1, MulDiv(tm.tmHeight+tm.tmExternalLeading, dc.GetDeviceCaps(LOGPIXELSY), tm.tmDigitizedAspectY) ); + + // ** IMPLEMENT LATER ?? ** + // Recalculate the Width Position +} + +void CPropertyListCtrl::SetLineStyle(COLORREF crColor, int nStyle) +{ + // Delete the old Pen + if(m_pBorderPen) delete m_pBorderPen; + + // Create the brush + m_pBorderPen = new CPen(nStyle, 1, crColor); + m_crBorderColor = crColor; +} +void CPropertyListCtrl::SetBkColor(COLORREF crColor) +{ + // Delete the old brush + if(m_pBkBrush) delete m_pBkBrush; + + // Create the brush + m_pBkBrush = new CBrush(crColor); + m_crBkColor = crColor; +} +void CPropertyListCtrl::SetPropertyBkColor(COLORREF crColor) +{ + // Delete the old brush + if(m_pBkPropertyBrush) delete m_pBkPropertyBrush; + + // Create the brush + m_pBkPropertyBrush = new CBrush(crColor); + m_crPropertyBkColor = crColor; +} + +void CPropertyListCtrl::SetHighlightColor(COLORREF crColor) +{ + // Delete the old brush + if(m_pBkHighlightBrush) delete m_pBkHighlightBrush; + + // Create the brush + m_pBkHighlightBrush = new CBrush(crColor); + m_crHighlightColor = crColor; +} + +///////////////////////////////////////////////////////////////////////////// +// Add Properties Functions +///////////////////////////////////////////////////////////////////////////// +BOOL CPropertyListCtrl::AddString(CString csText) +{ + // Call our function (assume its a text Item) + return AddString(csText, ID_PROPERTY_STATIC, _T("")); +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString) +{ + return AddString(GetResManager()->LoadString(nIDString)); +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, CString csData, void (*pfnCallback)(LPVOID, int, CPtrList*, int), LPVOID lpParam, int iParam, int nPropertySelected, int nAlignment, BOOL bComboEditable) +{ + // Is this a valid Control type + if(nType > ID_PROPERTY_COMBO_LIST) + return FALSE; + + // load string + const TCHAR *pszText=GetResManager()->LoadString(nIDString); + + // Create a new Structure to hold it + PROPERTYITEM* pNewItem = new PROPERTYITEM; + pNewItem->nType = nType; + pNewItem->nAlignment = nAlignment; + pNewItem->pBrush = NULL; + pNewItem->bComboEditable = bComboEditable; + pNewItem->pfnCallback=pfnCallback; + pNewItem->iParam=iParam; + pNewItem->lpParam=lpParam; + + // Calculate the Width of the string based on the font set + CDC* pDC = GetDC(); + pDC->SelectObject(m_pSelectedFont); + CSize Size = pDC->GetTextExtent(pszText); + if(Size.cx + 10 > m_nWidestItem) + m_nWidestItem = Size.cx + 10; + ReleaseDC(pDC); + pNewItem->nWidth = Size.cx; + pNewItem->nPropertySelected = nPropertySelected; + + // Set Property + if(!SetProperty(pNewItem, nType, csData)) + { + delete pNewItem; + return FALSE; + } + + // Is the item set bigger than the number of properties + if(pNewItem->nPropertySelected > pNewItem->csProperties.GetSize()) + { + delete pNewItem; + return FALSE; + } + + // Add to the list + m_Items.AddTail(pNewItem); + + // Add the string to the list box + /*int nPos =*/ CListBox::AddString(pszText); + + // Create the Control if Needed + CreateControl(nType); + return TRUE; +} + +BOOL CPropertyListCtrl::AddString(CString csText, int nType, CString csData, int nPropertySelected, int nAlignment, BOOL bComboEditable) +{ + // Is this a valid Control type + if(nType > ID_PROPERTY_COMBO_LIST) + return FALSE; + + // Create a new Structure to hold it + PROPERTYITEM* pNewItem = new PROPERTYITEM; + pNewItem->nType = nType; + pNewItem->nAlignment = nAlignment; + pNewItem->pBrush = NULL; + pNewItem->bComboEditable = bComboEditable; + + // Calculate the Width of the string based on the font set + CDC* pDC = GetDC(); + pDC->SelectObject(m_pSelectedFont); + CSize Size = pDC->GetTextExtent(csText); + if(Size.cx + 10 > m_nWidestItem) + m_nWidestItem = Size.cx + 10; + ReleaseDC(pDC); + pNewItem->nWidth = Size.cx; + pNewItem->nPropertySelected = nPropertySelected; + + // Set Property + if(!SetProperty(pNewItem, nType, csData)) + { + delete pNewItem; + return FALSE; + } + + // Is the item set bigger than the number of properties + if(pNewItem->nPropertySelected > pNewItem->csProperties.GetSize()) + { + delete pNewItem; + return FALSE; + } + + // Add to the list + m_Items.AddTail(pNewItem); + + // Add the string to the list box + /*int nPos =*/ CListBox::AddString(csText); + + // Create the Control if Needed + CreateControl(nType); + return TRUE; +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, UINT nIDData, int nPropertySelected, int nAlignment, BOOL bComboEditable) +{ + return AddString(GetResManager()->LoadString(nIDString), nType, GetResManager()->LoadString(nIDData), nPropertySelected, nAlignment, bComboEditable); +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString, int nType, CString csData, int nPropertySelected, int nAlignment, BOOL bComboEditable) +{ + return AddString(GetResManager()->LoadString(nIDString), nType, csData, nPropertySelected, nAlignment, bComboEditable); +} + +BOOL CPropertyListCtrl::AddString(CString csText, COLORREF crColor, int nAlignment) +{ + // Create a new brush based on this color + m_pCurBrush = new CBrush(crColor); + + // Call the other functions + return AddString(csText, ID_PROPERTY_COLOR, _T(""), 0, nAlignment); +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString, COLORREF crColor, int nAlignment) +{ + return AddString(GetResManager()->LoadString(nIDString), crColor, nAlignment); +} + +BOOL CPropertyListCtrl::AddString(CString csText, CFont* pFont, int nAlignment) +{ + // Safe the Font + m_pCurFont = pFont; + + // Call the other functions + return AddString(csText, ID_PROPERTY_FONT, _T(""), 0, nAlignment); +} + +BOOL CPropertyListCtrl::AddString(UINT nIDString, CFont* pFont, int nAlignment) +{ + return AddString(GetResManager()->LoadString(nIDString), pFont, nAlignment); +} + +///////////////////////////////////////////////////////////////////////////// +// Helper Functions +///////////////////////////////////////////////////////////////////////////// +void CPropertyListCtrl::DrawItem(CDC* pDC, CRect ItemRect, BOOL bSelected) +{ + if (m_pCurDrawItem->nType != ID_PROPERTY_STATIC) + { + ///////////////////////////////////////// + // Paint the Background rectangle (Property Value) + if(m_pCurDrawItem->nType == ID_PROPERTY_COLOR) + pDC->SelectObject(m_pCurDrawItem->pBrush); + else + pDC->SelectObject(m_pBkBrush); + pDC->SelectObject(m_pBorderPen); + + // Draw the Rectangle + ItemRect.left = m_nWidestItem - 1; + ItemRect.top--; + ItemRect.right++; + pDC->Rectangle(ItemRect); + CRect OrginalRect = ItemRect; + + ///////////////////////////////////////// + // Draw the Property Text + pDC->SetBkMode(TRANSPARENT); + pDC->SelectObject(m_pBkBrush); + pDC->SelectObject(m_pTextFont); + pDC->SetTextColor(m_crTextColor); + DrawPropertyText(pDC, ItemRect); + + ///////////////////////////////////////// + // Paint the Background rectangle (Property Name) + if( bSelected ) + pDC->SelectObject(m_pBkHighlightBrush); + + // Draw the Rectangle + ItemRect.right = m_nWidestItem; + ItemRect.left = -1; + pDC->Rectangle(ItemRect); + + ///////////////////////////////////////// + // Paint the Property name Text + // Is this item selected? + if( bSelected ) + { + if(m_bBoldSelection) pDC->SelectObject(m_pSelectedFont); + pDC->SetTextColor(m_crTextHighlightColor); + m_pCurItem = m_pCurDrawItem; + m_CurRect = OrginalRect; + } + + // Draw the Text + ItemRect.left += 6; + ItemRect.right -= 5; + pDC->DrawText( m_csText, m_csText.GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX|m_pCurDrawItem->nAlignment); + } + else + { + ///////////////////////////////////////// + // Paint the Background rectangle (Property Value) + pDC->SelectObject(m_pBkHighlightBrush); + pDC->SelectObject(m_pBorderPen); + pDC->SelectObject(m_pSelectedFont); + + // Draw the Rectangle + pDC->Rectangle(ItemRect); + CRect OrginalRect = ItemRect; + + ///////////////////////////////////////// + // Draw + pDC->SetBkMode(TRANSPARENT); + pDC->SetTextColor(m_crTextHighlightColor); + if (bSelected) + { + m_pCurItem = m_pCurDrawItem; + m_CurRect = OrginalRect; + } + + // Draw the Text + pDC->DrawText( m_csText, m_csText.GetLength(), ItemRect, DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_CENTER); + } +} + +void CPropertyListCtrl::DrawPropertyText(CDC* pDC, CRect ItemRect) +{ + ItemRect.left += 5; + switch(m_pCurDrawItem->nType) + { + case ID_PROPERTY_BOOL: + case ID_PROPERTY_COMBO_LIST: + pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(m_pCurDrawItem->nPropertySelected), m_pCurDrawItem->csProperties.GetAt(m_pCurDrawItem->nPropertySelected).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + break; + + case ID_PROPERTY_TEXT: + case ID_PROPERTY_PATH: + case ID_PROPERTY_DIR: + case ID_PROPERTY_CUSTOM: + pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(0), m_pCurDrawItem->csProperties.GetAt(0).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + break; + case ID_PROPERTY_STATIC: + pDC->DrawText( m_pCurDrawItem->csProperties.GetAt(0), m_pCurDrawItem->csProperties.GetAt(0).GetLength(), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + break; + + case ID_PROPERTY_FONT: + if(m_pCurDrawItem->LogFont.lfHeight) + pDC->DrawText( m_pCurDrawItem->LogFont.lfFaceName, strlen(m_pCurDrawItem->LogFont.lfFaceName), ItemRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_NOPREFIX); + break; + } +} + +void CPropertyListCtrl::CreateControl(int nType) +{ + switch(nType) + { + // Edit Window + case ID_PROPERTY_TEXT: + if(!m_pEditWnd) + { + m_pEditWnd = new CEdit(); + m_pEditWnd->Create(WS_CHILD|ES_AUTOHSCROLL|ES_LEFT, CRect(0,0,100,100), this, ID_PROPERTY_TEXT); + m_pEditWnd->SetFont(m_pTextFont); + } + break; + + // Font Button + case ID_PROPERTY_FONT: + if(!m_pFontButton) + { + m_pFontButton = new CButton(); + m_pFontButton->Create("...", WS_CHILD|BS_PUSHBUTTON, CRect(0,0,100,100), this, ID_PROPERTY_FONT); + m_pFontButton->SetFont(m_pTextFont); + } + break; + + case ID_PROPERTY_PATH: + if(!m_pPathButton) + { + m_pPathButton = new CButton(); + m_pPathButton->Create("...", WS_CHILD|BS_PUSHBUTTON, CRect(0,0,100,100), this, ID_PROPERTY_PATH); + m_pPathButton->SetFont(m_pTextFont); + } + break; + + case ID_PROPERTY_DIR: + if(!m_pDirButton) + { + m_pDirButton = new CButton(); + m_pDirButton->Create("...", WS_CHILD|BS_PUSHBUTTON, CRect(0,0,100,100), this, ID_PROPERTY_DIR); + m_pDirButton->SetFont(m_pTextFont); + } + break; + + case ID_PROPERTY_CUSTOM: + if(!m_pCustomButton) + { + m_pCustomButton = new CButton(); + m_pCustomButton->Create("...", WS_CHILD|BS_PUSHBUTTON, CRect(0,0,100,100), this, ID_PROPERTY_CUSTOM); + m_pCustomButton->SetFont(m_pTextFont); + } + break; + + case ID_PROPERTY_COMBO_LIST: + if(!m_pEditWnd) + { + m_pEditWnd = new CEdit(); + m_pEditWnd->Create(WS_CHILD|ES_AUTOHSCROLL|ES_LEFT, CRect(0,0,100,100), this, ID_PROPERTY_TEXT); + m_pEditWnd->SetFont(m_pTextFont); + } + if(!m_pListBox) + { + m_pListBox = new CListBox(); + m_pListBox->Create(WS_CHILD|WS_BORDER|LBS_NOTIFY|WS_VSCROLL|LBS_HASSTRINGS, CRect(0,0,100,100), this, ID_PROPERTY_COMBO_LIST); + m_pListBox->SetFont(m_pTextFont); + + m_pComboButton = new CComboButton(); + m_pComboButton->Create(CRect(0,0,0,0), this, ID_PROPERTY_COMBO_BTN ); + } + break; + } +} + +BOOL CPropertyListCtrl::SetProperty(PROPERTYITEM* pPropertyItem, int nType, CString csData) +{ + switch(nType) + { + case ID_PROPERTY_BOOL: + case ID_PROPERTY_PATH: + case ID_PROPERTY_DIR: + ParseProperties(pPropertyItem, csData); + + // Is the item selected more than items in the array? + if(pPropertyItem->csProperties.GetSize() != 2 ) + return FALSE; + break; + + case ID_PROPERTY_TEXT: + case ID_PROPERTY_STATIC: + case ID_PROPERTY_CUSTOM: + pPropertyItem->csProperties.Add(csData); + break; + + case ID_PROPERTY_FONT: + memset(&pPropertyItem->LogFont, 0, sizeof(pPropertyItem->LogFont)); + if(m_pCurFont) + { + m_pCurFont->GetLogFont(&pPropertyItem->LogFont); + m_pCurFont = NULL; + } + break; + + case ID_PROPERTY_COLOR: + pPropertyItem->pBrush = m_pCurBrush; + break; + + case ID_PROPERTY_COMBO_LIST: + ParseProperties(pPropertyItem, csData); + break; + + } + + return TRUE; +} + +void CPropertyListCtrl::ParseProperties(PROPERTYITEM* pPropertyItem, CString csData) +{ + // Parse the Items + char* pText = csData.GetBuffer( csData.GetLength() ); + char* pWord; + char Separations[] = "!"; + + // Establish string and get the first token: + pWord = strtok( pText, Separations); + while( pWord != NULL ) + { + // Add this to the Array + pPropertyItem->csProperties.Add(pWord); + + // Get next token + pWord = strtok( NULL, Separations ); + } + + // Release the buffer + csData.ReleaseBuffer(); +} + +void CPropertyListCtrl::HideControls() +{ + // Hide the controls + if(m_pEditWnd) m_pEditWnd->ShowWindow(SW_HIDE); + if(m_pFontButton) m_pFontButton->ShowWindow(SW_HIDE); + if(m_pPathButton) m_pPathButton->ShowWindow(SW_HIDE); + if (m_pDirButton) m_pDirButton->ShowWindow(SW_HIDE); + if (m_pCustomButton) + m_pCustomButton->ShowWindow(SW_HIDE); + if(m_pListBox) m_pListBox->ShowWindow(SW_HIDE); + if(m_pComboButton) m_pComboButton->ShowWindow(SW_HIDE); +} + +///////////////////////////////////////////////////////////////////////////// +// Get Properties Functions +///////////////////////////////////////////////////////////////////////////// +bool CPropertyListCtrl::GetProperty(int nItem, CString* pText) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + if(pItem->nType != ID_PROPERTY_TEXT && pItem->nType != ID_PROPERTY_PATH && pItem->nType != ID_PROPERTY_DIR && pItem->nType != ID_PROPERTY_STATIC && pItem->nType != ID_PROPERTY_CUSTOM) + return false; + + // Copy the item + *pText = pItem->csProperties.GetAt(0); + return true; +} +bool CPropertyListCtrl::GetProperty(int nItem, bool* bValue) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + if(pItem->nType != ID_PROPERTY_BOOL) + return false; + + // Copy the item + *bValue = pItem->nPropertySelected != 0; + return true; +} +bool CPropertyListCtrl::GetProperty(int nItem, COLORREF* crColor) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + if(pItem->nType != ID_PROPERTY_COLOR) + return false; + + // Copy the item + LOGBRUSH LogBrush; + pItem->pBrush->GetLogBrush(&LogBrush); + *crColor = LogBrush.lbColor; + return true; +} +bool CPropertyListCtrl::GetProperty(int nItem, LOGFONT* LogFont) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + if(pItem->nType != ID_PROPERTY_FONT) + return false; + + // Copy the item + *LogFont = pItem->LogFont; + return true; +} +bool CPropertyListCtrl::GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem*/) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + if(pItem->nType != ID_PROPERTY_COMBO_LIST) + return false; + + // I do NOT want to send them a pointer to my array so I loop through and copy the item to thiers + for( int nString = 0; nString < pItem->csProperties.GetSize(); nString++) + pArray->Add(pItem->csProperties.GetAt(nString)); + return true; +} +bool CPropertyListCtrl::GetProperty(int nItem, int* SelectedItem, CString* pText) +{ + // is the item to high + if(nItem + 1 > GetCount()) + return false; + + // Make sure this item is the correct type + PROPERTYITEM* pItem; + pItem = (PROPERTYITEM*)m_Items.GetAt(m_Items.FindIndex(nItem)); + + // Copy the item + *SelectedItem = pItem->nPropertySelected; + + // Do they want the text + if(pText != NULL && pItem->nType == ID_PROPERTY_COMBO_LIST) + *pText = pItem->csProperties.GetAt(pItem->nPropertySelected); + return true; +} Index: Copy Handler/PropertyListCtrl.h =================================================================== diff -u --- Copy Handler/PropertyListCtrl.h (revision 0) +++ Copy Handler/PropertyListCtrl.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,231 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PROPERTYLIST_H__ +#define __PROPERTYLIST_H__ + +#include "memdc.h" + +// Property Type +#define ID_PROPERTY_TEXT 1 +#define ID_PROPERTY_BOOL 2 +#define ID_PROPERTY_COLOR 3 +#define ID_PROPERTY_FONT 4 +#define ID_PROPERTY_PATH 5 +#define ID_PROPERTY_DIR 6 +#define ID_PROPERTY_CUSTOM 7 +#define ID_PROPERTY_STATIC 8 +#define ID_PROPERTY_COMBO_BTN 9 +#define ID_PROPERTY_COMBO_LIST 10 + +// Message ID to parent +#define ID_PROPERTY_CHANGED WM_USER+15 + +// Holds an item +typedef struct PropertyItem_t +{ + int nType; + int nWidth; + int nAlignment; + int nPropertySelected; + BOOL bComboEditable; + LOGFONT LogFont; + CBrush* pBrush; + CStringArray csProperties; + + // custom + void (*pfnCallback)(LPVOID, int, CPtrList*, int); + LPVOID lpParam; // ptr to the dialog + int iParam; // other data + +} PROPERTYITEM; + +///////////////////////////////////////////////////////////////////////////// +// CComboButton window +class CComboButton : public CButton +{ + void DrawTriangle(CDC* pDC, CRect Rect); + +// Construction +public: + BOOL Create( CRect Rect, CWnd* pParent, UINT uID); + CComboButton(); + +// Attributes +public: + CPen* m_pBkPen; +// CPen* m_pGrayPen; + CBrush* m_pBkBrush; + CBrush* m_pBlackBrush; + +// Operations +public: + + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct ); + virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CComboButton) + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CComboButton(); + + // Generated message map functions +protected: + //{{AFX_MSG(CComboButton) + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// +// CPropertyListCtrl window +class CPropertyListCtrl : public CListBox +{ + int m_nWidestItem; + BOOL m_bDeleteFont; + BOOL m_bBoldSelection; + BOOL m_bChanged; + CPen* m_pBorderPen; + CRect m_CurRect; + CFont* m_pTextFont; + CFont* m_pSelectedFont; + CFont* m_pCurFont; + CString m_csText; + CBrush* m_pCurBrush; + CBrush* m_pBkBrush; + CBrush* m_pBkHighlightBrush; + CBrush* m_pBkPropertyBrush; + CButton* m_pFontButton; + CButton* m_pPathButton; + CButton* m_pDirButton; + CButton* m_pCustomButton; + CComboButton* m_pComboButton; + CListBox* m_pListBox; + + COLORREF m_crBorderColor; + COLORREF m_crBkColor; + COLORREF m_crTextColor; + COLORREF m_crTextHighlightColor; + COLORREF m_crHighlightColor; + COLORREF m_crPropertyBkColor; + COLORREF m_crPropertyTextColor; + + // Controls + CEdit* m_pEditWnd; + + // The item list + CPtrList m_Items; + PROPERTYITEM* m_pCurItem; + PROPERTYITEM* m_pCurDrawItem; + +// Construction +public: + CPropertyListCtrl(); + +// Attributes +private: + // Helper Functions + void DrawItem(CDC* pDC, CRect ItemRect, BOOL bSelected); + void DrawPropertyText(CDC* pDC, CRect ItemRect); + void CreateControl(int nType); + BOOL SetProperty(PROPERTYITEM* pPropertyItem, int nType, CString csData); + void ParseProperties(PROPERTYITEM* pPropertyItem, CString csData); +public: + void HideControls(); + +// Operations +public: + // GUI Functions + void SetFont(CFont* pFont); + void SetBkColor(COLORREF crColor); + void SetPropertyBkColor(COLORREF crColor); + void SetHighlightColor(COLORREF crColor); + void SetLineStyle(COLORREF crColor, int nStyle = PS_SOLID); + inline void SetBoldSelection(BOOL bBoldSelection) { m_bBoldSelection = bBoldSelection; }; + inline void SetTextColor(COLORREF crColor) { m_crTextColor = crColor; }; + inline void SetTextHighlightColor(COLORREF crColor) { m_crTextHighlightColor = crColor; }; + inline void SetPropertyTextColor(COLORREF crColor) { m_crPropertyTextColor = crColor; }; + + // Add the data + BOOL AddString(CString csText); + BOOL AddString(UINT nIDString); + + BOOL AddString(CString csText, int nType, CString csData, int nPropertySelected = 0, int nAlignment = DT_LEFT, BOOL bComboEditable = FALSE); + BOOL AddString(UINT nIDString, int nType, UINT nIDData, int nPropertySelected = 0, int nAlignment = DT_LEFT, BOOL bComboEditable = FALSE); + BOOL AddString(UINT nIDString, int nType, CString csData, int nPropertySelected = 0, int nAlignment = DT_LEFT, BOOL bComboEditable = FALSE); + BOOL AddString(UINT nIDString, int nType, CString csData, void (*pfnCallback)(LPVOID, int, CPtrList*, int), LPVOID lpParam, int iParam, int nPropertySelected, int nAlignment = DT_LEFT, BOOL bComboEditable = FALSE); + + BOOL AddString(CString csText, COLORREF crColor, int nAlignment = DT_LEFT); + BOOL AddString(UINT nIDString, COLORREF crColor, int nAlignment = DT_LEFT); + + BOOL AddString(CString csText, CFont* pFont, int nAlignment = DT_LEFT); + BOOL AddString(UINT nIDString, CFont* pFont, int nAlignment = DT_LEFT); + + // Get the Data + bool GetProperty(int nItem, CString* pText); + bool GetProperty(int nItem, bool* bValue); + bool GetProperty(int nItem, COLORREF* crColor); + bool GetProperty(int nItem, LOGFONT* LogFont); + bool GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem = NULL*/); + bool GetProperty(int nItem, int* SelectedItem, CString* csText = NULL); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CPropertyListCtrl) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/); + //}}AFX_VIRTUAL + +// Implementation +public: + void Init(); + virtual ~CPropertyListCtrl(); + void Reset(); + void Reinit(); + + // Generated message map functions +protected: + //{{AFX_MSG(CPropertyListCtrl) + afx_msg HBRUSH CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/); + afx_msg void OnSelchange(); + afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); + afx_msg void OnDblclk(); + afx_msg void OnEditLostFocus(); + afx_msg void OnEditChange(); + afx_msg void OnFontPropertyClick(); + afx_msg void OnPathPropertyClick(); + afx_msg void OnDirPropertyClick(); + afx_msg void OnCustomPropertyClick(); + afx_msg void OnComboBoxClick(); + afx_msg void OnSelChange(); + afx_msg void OnListboxLostFocus(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +#endif Index: Copy Handler/RecentDlg.cpp =================================================================== diff -u --- Copy Handler/RecentDlg.cpp (revision 0) +++ Copy Handler/RecentDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,175 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "copy handler.h" +#include "RecentDlg.h" +#include "dialogs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CRecentDlg dialog + + +CRecentDlg::CRecentDlg(CWnd* pParent /*=NULL*/) + : CHLanguageDialog(CRecentDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CRecentDlg) + m_strPath = _T(""); + //}}AFX_DATA_INIT +} + + +void CRecentDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CRecentDlg) + DDX_Control(pDX, IDC_RECENT_LIST, m_ctlRecent); + DDX_Text(pDX, IDC_PATH_EDIT, m_strPath); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CRecentDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CRecentDlg) + ON_NOTIFY(LVN_ITEMCHANGED, IDC_RECENT_LIST, OnItemchangedRecentList) + ON_BN_CLICKED(IDC_BROWSE_BUTTON, OnBrowseButton) + ON_BN_CLICKED(IDC_ADD_BUTTON, OnAddButton) + ON_BN_CLICKED(IDC_CHANGE_BUTTON, OnChangeButton) + ON_BN_CLICKED(IDC_DELETE_BUTTON, OnDeleteButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CRecentDlg message handlers + +BOOL CRecentDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // system image list + SHFILEINFO sfi; + m_himl = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + m_hliml=(HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX); + m_ctlRecent.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_SMALL, (LPARAM)m_himl); + m_ctlRecent.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)m_hliml); + + // modify list style + m_ctlRecent.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_INFOTIP | LVS_EX_UNDERLINEHOT); + + // update recent paths + for (int i=0;i<(int)m_cvRecent.size();i++) + { + sfi.iIcon=-1; + SHGetFileInfo(m_cvRecent.at(i), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlRecent.InsertItem(i, m_cvRecent.at(i), sfi.iIcon); + } + + return TRUE; +} + +void CRecentDlg::OnItemchangedRecentList(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_LISTVIEW* plv = (NM_LISTVIEW*)pNMHDR; + + // current selection + if (plv->iItem >= 0 && plv->iItem < (int)m_cvRecent.size()) + { + m_strPath=m_cvRecent.at(plv->iItem); + UpdateData(FALSE); + } + + *pResult = 0; +} + +void CRecentDlg::OnBrowseButton() +{ + CString strPath; + if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + { + m_strPath=strPath; + UpdateData(FALSE); + } +} + +void CRecentDlg::OnAddButton() +{ + UpdateData(TRUE); + if (m_strPath.IsEmpty()) + return; + + // add to a table + m_cvRecent.push_back((const PTSTR)(LPCTSTR)m_strPath, true); + + // add to list with an icon + SHFILEINFO sfi; + sfi.iIcon=-1; + SHGetFileInfo(m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlRecent.InsertItem(m_cvRecent.size()-1, m_strPath, sfi.iIcon); +} + +void CRecentDlg::OnChangeButton() +{ + // read selection index + POSITION pos=m_ctlRecent.GetFirstSelectedItemPosition(); + if (pos) + { + // index + int iPos=m_ctlRecent.GetNextSelectedItem(pos); + + UpdateData(TRUE); + + if (m_strPath.IsEmpty()) + return; + + // array update + m_cvRecent.replace(m_cvRecent.begin()+iPos, (const PTSTR)(LPCTSTR)m_strPath, true, true); + + // list + SHFILEINFO sfi; + sfi.iIcon=-1; + SHGetFileInfo(m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + + m_ctlRecent.DeleteItem(iPos); + m_ctlRecent.InsertItem(iPos, m_strPath, sfi.iIcon); + } +} + +void CRecentDlg::OnDeleteButton() +{ + POSITION pos=m_ctlRecent.GetFirstSelectedItemPosition(); + int iPos=-1; + while (pos) + { + iPos=m_ctlRecent.GetNextSelectedItem(pos); + m_cvRecent.erase(m_cvRecent.begin()+iPos, true); + m_ctlRecent.DeleteItem(iPos); + } + + if (iPos != -1) + m_ctlRecent.SetItemState(iPos, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); +} Index: Copy Handler/RecentDlg.h =================================================================== diff -u --- Copy Handler/RecentDlg.h (revision 0) +++ Copy Handler/RecentDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,72 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __RECENTDLG_H__ +#define __RECENTDLG_H__ + +#include "afxtempl.h" +#include "charvect.h" + +///////////////////////////////////////////////////////////////////////////// +// CRecentDlg dialog + +class CRecentDlg : public CHLanguageDialog +{ +// Construction +public: + CRecentDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CRecentDlg) + enum { IDD = IDD_RECENTEDIT_DIALOG }; + CListCtrl m_ctlRecent; + CString m_strPath; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CRecentDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +public: + char_vector m_cvRecent; + HIMAGELIST m_himl, m_hliml; + +protected: + + // Generated message map functions + //{{AFX_MSG(CRecentDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnItemchangedRecentList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnBrowseButton(); + afx_msg void OnAddButton(); + afx_msg void OnChangeButton(); + afx_msg void OnDeleteButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/ReplaceFilesDlg.cpp =================================================================== diff -u --- Copy Handler/ReplaceFilesDlg.cpp (revision 0) +++ Copy Handler/ReplaceFilesDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,148 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "ReplaceFilesDlg.h" +#include "btnIDs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CReplaceFilesDlg dialog + + +CReplaceFilesDlg::CReplaceFilesDlg() + : CHLanguageDialog(CReplaceFilesDlg::IDD) +{ + //{{AFX_DATA_INIT(CReplaceFilesDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + + m_pfiSource=NULL; + m_pfiDest=NULL; + m_bEnableTimer=false; + m_iDefaultOption=ID_RECOPY; + m_iTime=30000; +} + + +void CReplaceFilesDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CReplaceFilesDlg) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CReplaceFilesDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CReplaceFilesDlg) + ON_BN_CLICKED(IDC_COPY_REST_BUTTON, OnCopyRestButton) + ON_BN_CLICKED(IDC_COPY_REST_ALL_BUTTON, OnCopyRestAllButton) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + ON_BN_CLICKED(IDC_IGNORE_ALL_BUTTON, OnIgnoreAllButton) + ON_BN_CLICKED(IDC_RECOPY_BUTTON, OnRecopyButton) + ON_BN_CLICKED(IDC_RECOPY_ALL_BUTTON, OnRecopyAllButton) + ON_WM_TIMER() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CReplaceFilesDlg message handlers + +BOOL CReplaceFilesDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // make on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + ASSERT(m_pfiSource); + ASSERT(m_pfiDest); + + // show attribs of src and dest + TCHAR xx[64]; + GetDlgItem(IDC_FILENAME_EDIT)->SetWindowText(m_pfiSource->GetFullFilePath()); + GetDlgItem(IDC_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiSource->GetLength64(), xx, 10)); + GetDlgItem(IDC_CREATETIME_EDIT)->SetWindowText(m_pfiSource->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_MODIFY_TIME_EDIT)->SetWindowText(m_pfiSource->GetLastWriteTime().Format(_T("%x %X"))); + + GetDlgItem(IDC_DEST_FILENAME_EDIT)->SetWindowText(m_pfiDest->GetFullFilePath()); + GetDlgItem(IDC_DEST_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiDest->GetLength64(), xx, 10)); + GetDlgItem(IDC_DEST_CREATETIME_EDIT)->SetWindowText(m_pfiDest->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_DEST_MODIFYTIME_EDIT)->SetWindowText(m_pfiDest->GetLastWriteTime().Format(_T("%x %X"))); + + GetWindowText(m_strTitle); + + if (m_bEnableTimer) + SetTimer(1601, 1000, NULL); + + return TRUE; +} + +void CReplaceFilesDlg::OnCopyRestButton() +{ + EndDialog(ID_COPYREST); +} + +void CReplaceFilesDlg::OnCopyRestAllButton() +{ + EndDialog(ID_COPYRESTALL); +} + +void CReplaceFilesDlg::OnIgnoreButton() +{ + EndDialog(ID_IGNORE); +} + +void CReplaceFilesDlg::OnIgnoreAllButton() +{ + EndDialog(ID_IGNOREALL); +} + +void CReplaceFilesDlg::OnRecopyButton() +{ + EndDialog(ID_RECOPY); +} + +void CReplaceFilesDlg::OnRecopyAllButton() +{ + EndDialog(ID_RECOPYALL); +} + +void CReplaceFilesDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 1601) + { + m_iTime-=1000; + if (m_iTime < 0) + EndDialog(m_iDefaultOption); + + TCHAR xx[16]; + SetWindowText(m_strTitle+_T(" [")+CString(_itot(m_iTime/1000, xx, 10))+_T("]")); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} Index: Copy Handler/ReplaceFilesDlg.h =================================================================== diff -u --- Copy Handler/ReplaceFilesDlg.h (revision 0) +++ Copy Handler/ReplaceFilesDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,75 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __REPLACEFILESDLG_H__ +#define __REPLACEFILESDLG_H__ + +#include "FileInfo.h" + +///////////////////////////////////////////////////////////////////////////// +// CReplaceFilesDlg dialog + +class CReplaceFilesDlg : public CHLanguageDialog +{ +// Construction +public: + CReplaceFilesDlg(); // standard constructor + + CFileInfo *m_pfiSource, *m_pfiDest; + + CString m_strTitle; + bool m_bEnableTimer; + int m_iTime; + int m_iDefaultOption; + +// Dialog Data + //{{AFX_DATA(CReplaceFilesDlg) + enum { IDD = IDD_FEEDBACK_REPLACE_FILES_DIALOG }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CReplaceFilesDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CReplaceFilesDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnCopyRestButton(); + afx_msg void OnCopyRestAllButton(); + afx_msg void OnIgnoreButton(); + afx_msg void OnIgnoreAllButton(); + afx_msg void OnRecopyButton(); + afx_msg void OnRecopyAllButton(); + afx_msg void OnTimer(UINT nIDEvent); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/ReplaceOnlyDlg.cpp =================================================================== diff -u --- Copy Handler/ReplaceOnlyDlg.cpp (revision 0) +++ Copy Handler/ReplaceOnlyDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,136 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "ReplaceOnlyDlg.h" +#include "btnIDs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CReplaceOnlyDlg dialog + + +CReplaceOnlyDlg::CReplaceOnlyDlg() + : CHLanguageDialog(CReplaceOnlyDlg::IDD) +{ + //{{AFX_DATA_INIT(CReplaceOnlyDlg) + m_strMessage = _T(""); + //}}AFX_DATA_INIT + m_pfiSource=NULL; + m_pfiDest=NULL; + m_bEnableTimer=false; + m_iDefaultOption=ID_RECOPY; + m_iTime=30000; +} + + +void CReplaceOnlyDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CReplaceOnlyDlg) + DDX_Text(pDX, IDC_MESSAGE_EDIT, m_strMessage); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CReplaceOnlyDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CReplaceOnlyDlg) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + ON_BN_CLICKED(IDC_IGNORE_ALL_BUTTON, OnIgnoreAllButton) + ON_BN_CLICKED(IDC_WAIT_BUTTON, OnWaitButton) + ON_BN_CLICKED(IDC_RETRY_BUTTON, OnRetryButton) + ON_WM_TIMER() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CReplaceOnlyDlg message handlers + +BOOL CReplaceOnlyDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // make on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + ASSERT(m_pfiSource); + ASSERT(m_pfiDest); + + // show attributes + TCHAR xx[64]; + GetDlgItem(IDC_FILENAME_EDIT)->SetWindowText(m_pfiSource->GetFullFilePath()); + GetDlgItem(IDC_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiSource->GetLength64(), xx, 10)); + GetDlgItem(IDC_CREATETIME_EDIT)->SetWindowText(m_pfiSource->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_MODIFY_TIME_EDIT)->SetWindowText(m_pfiSource->GetLastWriteTime().Format(_T("%x %X"))); + + GetDlgItem(IDC_DEST_FILENAME_EDIT)->SetWindowText(m_pfiDest->GetFullFilePath()); + GetDlgItem(IDC_DEST_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiDest->GetLength64(), xx, 10)); + GetDlgItem(IDC_DEST_CREATETIME_EDIT)->SetWindowText(m_pfiDest->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_DEST_MODIFYTIME_EDIT)->SetWindowText(m_pfiDest->GetLastWriteTime().Format(_T("%x %X"))); + + // remember the title + GetWindowText(m_strTitle); + + if (m_bEnableTimer) + SetTimer(1601, 1000, NULL); + + return TRUE; +} + +void CReplaceOnlyDlg::OnIgnoreButton() +{ + EndDialog(ID_IGNORE); +} + +void CReplaceOnlyDlg::OnIgnoreAllButton() +{ + EndDialog(ID_IGNOREALL); +} + +void CReplaceOnlyDlg::OnWaitButton() +{ + EndDialog(ID_WAIT); +} + +void CReplaceOnlyDlg::OnRetryButton() +{ + EndDialog(ID_RETRY); +} + +void CReplaceOnlyDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 1601) + { + m_iTime-=1000; + if (m_iTime < 0) + EndDialog(m_iDefaultOption); + + TCHAR xx[16]; + SetWindowText(m_strTitle+_T(" [")+CString(_itot(m_iTime/1000, xx, 10))+_T("]")); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} Index: Copy Handler/ReplaceOnlyDlg.h =================================================================== diff -u --- Copy Handler/ReplaceOnlyDlg.h (revision 0) +++ Copy Handler/ReplaceOnlyDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,73 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __REPLACEONLYDLG_H__ +#define __REPLACEONLYDLG_H__ + +#include "FileInfo.h" + +///////////////////////////////////////////////////////////////////////////// +// CReplaceOnlyDlg dialog + +class CReplaceOnlyDlg : public CHLanguageDialog +{ +// Construction +public: + CReplaceOnlyDlg(); // standard constructor + + CFileInfo *m_pfiSource, *m_pfiDest; + + CString m_strTitle; + bool m_bEnableTimer; + int m_iTime; + int m_iDefaultOption; + +// Dialog Data + //{{AFX_DATA(CReplaceOnlyDlg) + enum { IDD = IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG }; + CString m_strMessage; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CReplaceOnlyDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CReplaceOnlyDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnIgnoreButton(); + afx_msg void OnIgnoreAllButton(); + afx_msg void OnWaitButton(); + afx_msg void OnRetryButton(); + afx_msg void OnTimer(UINT nIDEvent); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/ReplacePathsDlg.cpp =================================================================== diff -u --- Copy Handler/ReplacePathsDlg.cpp (revision 0) +++ Copy Handler/ReplacePathsDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,106 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "ReplacePathsDlg.h" +#include "dialogs.h" +#include "Copy Handler.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CReplacePathsDlg dialog + + +CReplacePathsDlg::CReplacePathsDlg() + : CHLanguageDialog(CReplacePathsDlg::IDD) +{ + //{{AFX_DATA_INIT(CReplacePathsDlg) + m_strDest = _T(""); + m_strSource = _T(""); + //}}AFX_DATA_INIT +} + + +void CReplacePathsDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CReplacePathsDlg) + DDX_Control(pDX, IDC_PATHS_LIST, m_ctlPathsList); + DDX_Text(pDX, IDC_DESTINATION_EDIT, m_strDest); + DDX_Text(pDX, IDC_SOURCE_EDIT, m_strSource); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CReplacePathsDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CReplacePathsDlg) + ON_LBN_SELCHANGE(IDC_PATHS_LIST, OnSelchangePathsList) + ON_BN_CLICKED(IDC_BROWSE_BUTTON, OnBrowseButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CReplacePathsDlg message handlers + +BOOL CReplacePathsDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + for (int i=0;iGetClipboardDataSize();i++) + m_ctlPathsList.AddString(m_pTask->GetClipboardData(i)->GetPath()); + + return TRUE; +} + +void CReplacePathsDlg::OnSelchangePathsList() +{ + int iSel=m_ctlPathsList.GetCurSel(); + if (iSel == LB_ERR) + return; + + m_ctlPathsList.GetText(iSel, m_strSource); + UpdateData(FALSE); +} + +void CReplacePathsDlg::OnOK() +{ + UpdateData(TRUE); + if (m_strSource.IsEmpty()) + MsgBox(IDS_SOURCESTRINGMISSING_STRING); + else + CHLanguageDialog::OnOK(); +} + +void CReplacePathsDlg::OnBrowseButton() +{ + CString strPath; + if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + { + UpdateData(TRUE); + m_strDest=strPath; + UpdateData(FALSE); + } +} Index: Copy Handler/ReplacePathsDlg.h =================================================================== diff -u --- Copy Handler/ReplacePathsDlg.h (revision 0) +++ Copy Handler/ReplacePathsDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,67 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __REPLACEPATHSDLG_H__ +#define __REPLACEPATHSDLG_H__ + +#include "structs.h" + +///////////////////////////////////////////////////////////////////////////// +// CReplacePathsDlg dialog + +class CReplacePathsDlg : public CHLanguageDialog +{ +// Construction +public: + CReplacePathsDlg(); // standard constructor + + CTask* m_pTask; +// Dialog Data + //{{AFX_DATA(CReplacePathsDlg) + enum { IDD = IDD_REPLACE_PATHS_DIALOG }; + CListBox m_ctlPathsList; + CString m_strDest; + CString m_strSource; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CReplacePathsDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CReplacePathsDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnSelchangePathsList(); + virtual void OnOK(); + afx_msg void OnBrowseButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/Scripts/header.lng =================================================================== diff -u --- Copy Handler/Scripts/header.lng (revision 0) +++ Copy Handler/Scripts/header.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,12 @@ +# Info section +[Info] +Lang Name=English +Lang Code=1033 +Base Language= +Font Face=Tahoma +Charset=1 +Size=8 +RTL reading order=0 +Help name=english.chm +Author=J�zef Starosczyk +Version=1.28 \ No newline at end of file Index: Copy Handler/ShortcutsDlg.cpp =================================================================== diff -u --- Copy Handler/ShortcutsDlg.cpp (revision 0) +++ Copy Handler/ShortcutsDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,357 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "copy handler.h" +#include "ShortcutsDlg.h" +#include "dialogs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CShortcutsDlg dialog + + +CShortcutsDlg::CShortcutsDlg(CWnd* pParent /*=NULL*/) + : CHLanguageDialog(CShortcutsDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CShortcutsDlg) + m_strName = _T(""); + //}}AFX_DATA_INIT + m_bActualisation=false; +} + + +void CShortcutsDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CShortcutsDlg) + DDX_Control(pDX, IDC_PATH_COMBOBOXEX, m_ctlPath); + DDX_Control(pDX, IDC_SHORTCUT_LIST, m_ctlShortcuts); + DDX_Text(pDX, IDC_NAME_EDIT, m_strName); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CShortcutsDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CShortcutsDlg) + ON_NOTIFY(LVN_ITEMCHANGED, IDC_SHORTCUT_LIST, OnItemchangedShortcutList) + ON_CBN_EDITCHANGE(IDC_PATH_COMBOBOXEX, OnEditchangePathComboboxex) + ON_BN_CLICKED(IDC_ADD_BUTTON, OnAddButton) + ON_BN_CLICKED(IDC_CHANGE_BUTTON, OnChangeButton) + ON_BN_CLICKED(IDC_DELETE_BUTTON, OnDeleteButton) + ON_BN_CLICKED(IDC_BROWSE_BUTTON, OnBrowseButton) + ON_BN_CLICKED(IDC_UP_BUTTON, OnUpButton) + ON_BN_CLICKED(IDC_DOWN_BUTTON, OnDownButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CShortcutsDlg message handlers + +BOOL CShortcutsDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // system image list + SHFILEINFO sfi; + m_himl = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + m_hliml=(HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), + SHGFI_SYSICONINDEX); + m_ctlPath.SendMessage(CBEM_SETIMAGELIST, 0, (LPARAM)m_himl); + m_ctlShortcuts.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_SMALL, (LPARAM)m_himl); + m_ctlShortcuts.SendMessage(LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)m_hliml); + + // copy all of the recent paths to combo + COMBOBOXEXITEM cbi; + cbi.mask=CBEIF_IMAGE | CBEIF_TEXT; + + for (int i=0;i<(int)m_pcvRecent->size();i++) + { + cbi.iItem=i; + cbi.pszText=m_pcvRecent->at(i); + sfi.iIcon=-1; + SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), SHGFI_SYSICONINDEX | SHGFI_SMALLICON); + cbi.iImage=sfi.iIcon; + + m_ctlPath.InsertItem(&cbi); + } + + // create columns in shortcuts list + LVCOLUMN lvc; + lvc.mask=LVCF_SUBITEM | LVCF_WIDTH | LVCF_TEXT; + lvc.iSubItem=-1; + lvc.cx=100; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTNAME_STRING); + m_ctlShortcuts.InsertColumn(0, &lvc); + lvc.iSubItem=0; + lvc.cx=200; + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_SHORTCUTPATH_STRING); + m_ctlShortcuts.InsertColumn(1, &lvc); + + // modify list style + m_ctlShortcuts.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_INFOTIP | LVS_EX_UNDERLINEHOT); + + // update shortcut list + CShortcut sc; + for (i=0;i<(int)m_cvShortcuts.size();i++) + { + sc=CString(m_cvShortcuts.at(i)); + sfi.iIcon=-1; + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.InsertItem(i, sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(i, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + } + + return TRUE; +} + +void CShortcutsDlg::OnItemchangedShortcutList(NMHDR* pNMHDR, LRESULT* pResult) +{ + NM_LISTVIEW* plv = (NM_LISTVIEW*)pNMHDR; + + // current selection + if (plv->iItem >= 0 && plv->iItem < (int)m_cvShortcuts.size()) + { + CShortcut sc(CString(m_cvShortcuts.at(plv->iItem))); + m_strName=sc.m_strName; + UpdateData(FALSE); + SetComboPath(sc.m_strPath); + } + + *pResult = 0; +} + +void CShortcutsDlg::SetComboPath(LPCTSTR lpszPath) +{ + // unselect + m_ctlPath.SetCurSel(-1); + + SHFILEINFO sfi; + sfi.iIcon=-1; + + COMBOBOXEXITEM cbi; + + cbi.mask=CBEIF_TEXT | CBEIF_IMAGE; + cbi.iItem=-1; + cbi.pszText=(LPTSTR)lpszPath; + SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SMALLICON | SHGFI_SYSICONINDEX); + cbi.iImage=sfi.iIcon; + + m_ctlPath.SetItem(&cbi); +} + +void CShortcutsDlg::UpdateComboIcon() +{ + // get combo text + COMBOBOXEXITEM cbi; + TCHAR szPath[_MAX_PATH]; + cbi.mask=CBEIF_TEXT; + cbi.iItem=m_ctlPath.GetCurSel()/*-1*/; + cbi.pszText=szPath; + cbi.cchTextMax=_MAX_PATH; + + if (!m_ctlPath.GetItem(&cbi)) + return; + + // unselect + m_ctlPath.SetCurSel(-1); + + // icon update + SHFILEINFO sfi; + sfi.iIcon=-1; + + cbi.mask |= CBEIF_IMAGE; + cbi.iItem=-1; + + CString str=(LPCTSTR)szPath; + if (str.Left(2) != _T("\\\\") || str.Find(_T('\\'), 2) != -1) + SHGetFileInfo(cbi.pszText, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SMALLICON | SHGFI_SYSICONINDEX); + + cbi.iImage=sfi.iIcon; + + m_ctlPath.SetItem(&cbi); + + // unselect text + CEdit* pEdit=m_ctlPath.GetEditCtrl(); + if (!pEdit) + return; + + pEdit->SetSel(-1, -1); +} + +void CShortcutsDlg::OnEditchangePathComboboxex() +{ + if (m_bActualisation) + return; + m_bActualisation=true; + UpdateComboIcon(); + m_bActualisation=false; +} + +void CShortcutsDlg::OnAddButton() +{ + // create new shortcut + UpdateData(TRUE); + CShortcut sc; + sc.m_strName=m_strName; + m_ctlPath.GetWindowText(sc.m_strPath); + + // add to an array + m_cvShortcuts.push_back((const PTSTR)(LPCTSTR)(CString)sc, true); + + // add with an icon + SHFILEINFO sfi; + sfi.iIcon=-1; + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.InsertItem(m_cvShortcuts.size()-1, sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(m_cvShortcuts.size()-1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); +} + +void CShortcutsDlg::OnChangeButton() +{ + // get selection index + POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); + if (pos) + { + // index + int iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + + // get new shortcut + UpdateData(TRUE); + CShortcut sc; + sc.m_strName=m_strName; + m_ctlPath.GetWindowText(sc.m_strPath); + + // array update + m_cvShortcuts.replace(m_cvShortcuts.begin()+iPos, (const PTSTR)(LPCTSTR)(CString)sc, true, true); + + // list + SHFILEINFO sfi; + sfi.iIcon=-1; + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + + m_ctlShortcuts.DeleteItem(iPos); + + m_ctlShortcuts.InsertItem(iPos, sc.m_strName, sfi.iIcon); + m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + } +} + +void CShortcutsDlg::OnDeleteButton() +{ + POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); + int iPos=-1; + while (pos) + { + iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + m_cvShortcuts.erase(m_cvShortcuts.begin()+iPos, true); + m_ctlShortcuts.DeleteItem(iPos); + } + + if (iPos != -1) + m_ctlShortcuts.SetItemState(iPos, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); +} + +void CShortcutsDlg::OnBrowseButton() +{ + CString strPath; + if (BrowseForFolder(GetResManager()->LoadString(IDS_BROWSE_STRING), &strPath)) + SetComboPath(strPath); +} + +void CShortcutsDlg::OnUpButton() +{ + POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); + int iPos=-1; + CShortcut sc; + while (pos) + { + // get current selected item + iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + + // if the first element is trying to go up to nowhere + if (iPos == 0) + break; + + // swap data in m_ascShortcuts + m_cvShortcuts.swap_items(m_cvShortcuts.begin()+iPos-1, m_cvShortcuts.begin()+iPos); + + // do the same with list + SHFILEINFO sfi; + sfi.iIcon=-1; + + sc=CString(m_cvShortcuts.at(iPos-1)); + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.SetItem(iPos-1, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); + m_ctlShortcuts.SetItem(iPos-1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + + sfi.iIcon=-1; + sc=CString(m_cvShortcuts.at(iPos)); + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); + m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + + m_ctlShortcuts.SetItemState(iPos, 0, LVIS_SELECTED | LVIS_FOCUSED); + m_ctlShortcuts.SetItemState(iPos-1, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); + } +} + +void CShortcutsDlg::OnDownButton() +{ + POSITION pos=m_ctlShortcuts.GetFirstSelectedItemPosition(); + int iPos=-1; + CShortcut sc; + while (pos) + { + // get current selected item + iPos=m_ctlShortcuts.GetNextSelectedItem(pos); + + // if the last element is trying to go down to nowhere + if (iPos == m_ctlShortcuts.GetItemCount()-1) + break; + + // swap data in m_ascShortcuts + m_cvShortcuts.swap_items(m_cvShortcuts.begin()+iPos, m_cvShortcuts.begin()+iPos+1); + + // do the same with list + SHFILEINFO sfi; + sfi.iIcon=-1; + + sc=CString(m_cvShortcuts.at(iPos)); + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.SetItem(iPos, -1, LVIF_TEXT | LVIF_IMAGE , sc.m_strName, sfi.iIcon, 0, 0, 0); + m_ctlShortcuts.SetItem(iPos, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + + sfi.iIcon=-1; + sc=CString(m_cvShortcuts.at(iPos+1)); + SHGetFileInfo(sc.m_strPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_LARGEICON); + m_ctlShortcuts.SetItem(iPos+1, -1, LVIF_TEXT | LVIF_IMAGE, sc.m_strName, sfi.iIcon, 0, 0, 0); + m_ctlShortcuts.SetItem(iPos+1, 1, LVIF_TEXT, sc.m_strPath, 0, 0, 0, 0); + + m_ctlShortcuts.SetItemState(iPos, 0, LVIS_SELECTED | LVIS_FOCUSED); + m_ctlShortcuts.SetItemState(iPos+1, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); + } +} Index: Copy Handler/ShutdownDlg.cpp =================================================================== diff -u --- Copy Handler/ShutdownDlg.cpp (revision 0) +++ Copy Handler/ShutdownDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,103 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "copy handler.h" +#include "ShutdownDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CShutdownDlg dialog + + +CShutdownDlg::CShutdownDlg() + : CHLanguageDialog(CShutdownDlg::IDD) +{ + //{{AFX_DATA_INIT(CShutdownDlg) + m_strTime = _T(""); + //}}AFX_DATA_INIT +} + + +void CShutdownDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CShutdownDlg) + DDX_Control(pDX, IDC_TIME_PROGRESS, m_ctlProgress); + DDX_Text(pDX, IDC_TIME_STATIC, m_strTime); + //}}AFX_DATA_MAP +} + + +BEGIN_MESSAGE_MAP(CShutdownDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CShutdownDlg) + ON_WM_TIMER() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CShutdownDlg message handlers + +BOOL CShutdownDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // make on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + // init progress + m_iTime=m_iOverallTime; + m_ctlProgress.SetRange32(0, m_iOverallTime); + + // init timer + SetTimer(6678, 200, NULL); + + return TRUE; +} + +void CShutdownDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 6678) + { + m_iTime-=200; + if (m_iTime < 0) + m_iTime=0; + + m_ctlProgress.SetPos(m_iOverallTime-m_iTime); + FormatTimeString(m_iTime, &m_strTime); + UpdateData(FALSE); + + if (m_iTime == 0) + EndDialog(IDOK); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} + +void CShutdownDlg::FormatTimeString(int iTime, CString *pstrData) +{ + _stprintf(pstrData->GetBuffer(32), _T("%lu s."), iTime/1000); + pstrData->ReleaseBuffer(); +} Index: Copy Handler/ShutdownDlg.h =================================================================== diff -u --- Copy Handler/ShutdownDlg.h (revision 0) +++ Copy Handler/ShutdownDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,65 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __SHUTDOWNDLG_H__ +#define __SHUTDOWNDLG_H__ + +///////////////////////////////////////////////////////////////////////////// +// CShutdownDlg dialog + +class CShutdownDlg : public CHLanguageDialog +{ +// Construction +public: + CShutdownDlg(); // standard constructor + + int m_iOverallTime; + +// Dialog Data + //{{AFX_DATA(CShutdownDlg) + enum { IDD = IDD_SHUTDOWN_DIALOG }; + CProgressCtrl m_ctlProgress; + CString m_strTime; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CShutdownDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + void FormatTimeString(int iTime, CString* pstrData); + int m_iTime; // czas w sekundach + + // Generated message map functions + //{{AFX_MSG(CShutdownDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT nIDEvent); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/SmallReplaceFilesDlg.cpp =================================================================== diff -u --- Copy Handler/SmallReplaceFilesDlg.cpp (revision 0) +++ Copy Handler/SmallReplaceFilesDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,134 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "resource.h" +#include "SmallReplaceFilesDlg.h" +#include "btnIDs.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CSmallReplaceFilesDlg dialog + + +CSmallReplaceFilesDlg::CSmallReplaceFilesDlg() + : CHLanguageDialog(CSmallReplaceFilesDlg::IDD) +{ + //{{AFX_DATA_INIT(CSmallReplaceFilesDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // zeruj zmienne + m_pfiSource=NULL; + m_pfiDest=NULL; + m_bEnableTimer=false; + m_iDefaultOption=ID_RECOPY; + m_iTime=30000; +} + +void CSmallReplaceFilesDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSmallReplaceFilesDlg) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CSmallReplaceFilesDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CSmallReplaceFilesDlg) + ON_BN_CLICKED(IDC_RECOPY_BUTTON, OnRecopyButton) + ON_BN_CLICKED(IDC_RECOPY_ALL_BUTTON, OnRecopyAllButton) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + ON_BN_CLICKED(IDC_IGNORE_ALL_BUTTON, OnIgnoreAllButton) + ON_WM_TIMER() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSmallReplaceFilesDlg message handlers + +BOOL CSmallReplaceFilesDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // set on top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + ASSERT(m_pfiSource); + ASSERT(m_pfiDest); + + // show attributes + TCHAR xx[64]; + GetDlgItem(IDC_FILENAME_EDIT)->SetWindowText(m_pfiSource->GetFullFilePath()); + GetDlgItem(IDC_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiSource->GetLength64(), xx, 10)); + GetDlgItem(IDC_CREATETIME_EDIT)->SetWindowText(m_pfiSource->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_MODIFY_TIME_EDIT)->SetWindowText(m_pfiSource->GetLastWriteTime().Format(_T("%x %X"))); + + GetDlgItem(IDC_DEST_FILENAME_EDIT)->SetWindowText(m_pfiDest->GetFullFilePath()); + GetDlgItem(IDC_DEST_FILESIZE_EDIT)->SetWindowText(_i64tot(m_pfiDest->GetLength64(), xx, 10)); + GetDlgItem(IDC_DEST_CREATETIME_EDIT)->SetWindowText(m_pfiDest->GetCreationTime().Format(_T("%x %X"))); + GetDlgItem(IDC_DEST_MODIFYTIME_EDIT)->SetWindowText(m_pfiDest->GetLastWriteTime().Format(_T("%x %X"))); + + GetWindowText(m_strTitle); + + if (m_bEnableTimer) + SetTimer(1601, 1000, NULL); + + return TRUE; +} + +void CSmallReplaceFilesDlg::OnRecopyButton() +{ + EndDialog(ID_RECOPY); +} + +void CSmallReplaceFilesDlg::OnRecopyAllButton() +{ + EndDialog(ID_RECOPYALL); +} + +void CSmallReplaceFilesDlg::OnIgnoreButton() +{ + EndDialog(ID_IGNORE); +} + +void CSmallReplaceFilesDlg::OnIgnoreAllButton() +{ + EndDialog(ID_IGNOREALL); +} + +void CSmallReplaceFilesDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 1601) + { + m_iTime-=1000; + if (m_iTime < 0) + EndDialog(m_iDefaultOption); + + TCHAR xx[16]; + SetWindowText(m_strTitle+_T(" [")+CString(_itot(m_iTime/1000, xx, 10))+_T("]")); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} Index: Copy Handler/SmallReplaceFilesDlg.h =================================================================== diff -u --- Copy Handler/SmallReplaceFilesDlg.h (revision 0) +++ Copy Handler/SmallReplaceFilesDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,71 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __SMALLREPLACEFILESDLG_H__ +#define __SMALLREPLACEFILESDLG_H__ + +#include "FileInfo.h" + +///////////////////////////////////////////////////////////////////////////// +// CSmallReplaceFilesDlg dialog + +class CSmallReplaceFilesDlg : public CHLanguageDialog +{ +// Construction +public: + CSmallReplaceFilesDlg(); // standard constructor + +// Dialog Data + //{{AFX_DATA(CSmallReplaceFilesDlg) + enum { IDD = IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + CFileInfo *m_pfiSource, *m_pfiDest; + + CString m_strTitle; + bool m_bEnableTimer; + int m_iTime; + int m_iDefaultOption; + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSmallReplaceFilesDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + + // Generated message map functions + //{{AFX_MSG(CSmallReplaceFilesDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnRecopyButton(); + afx_msg void OnRecopyAllButton(); + afx_msg void OnIgnoreButton(); + afx_msg void OnIgnoreAllButton(); + afx_msg void OnTimer(UINT nIDEvent); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/StaticEx.cpp =================================================================== diff -u --- Copy Handler/StaticEx.cpp (revision 0) +++ Copy Handler/StaticEx.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,349 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "StaticEx.h" + +#define STATICEX_CLASS _T("STATICEX") + +LRESULT CALLBACK StaticExWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + STATICEXSETTINGS* pSettings=(STATICEXSETTINGS*)GetWindowLongPtr(hwnd, 0); + switch (uMsg) + { + case WM_NCCREATE: + { + STATICEXSETTINGS* pSett=new STATICEXSETTINGS; + pSett->hFontNormal=NULL; + pSett->hFontUnderline=NULL; + pSett->pszLink=NULL; + pSett->pszText=NULL; + pSett->bActive=false; + pSett->bDown=false; + pSett->hLink=NULL; + pSett->hNormal=NULL; + pSett->rcText.left=0; + pSett->rcText.right=0; + pSett->rcText.top=0; + pSett->rcText.bottom=0; + ::SetWindowLongPtr(hwnd, 0, (LONG_PTR)pSett); + + // create cursors + pSett->hNormal=::LoadCursor(NULL, IDC_ARROW); + pSett->hLink=::LoadCursor(NULL, IDC_HAND); + + break; + } + case WM_CREATE: + { + CREATESTRUCT* pcs=(CREATESTRUCT*)lParam; + + TCHAR* pSep=_tcsrchr(pcs->lpszName, _T('|')); + + if (!(pcs->style & SES_LINK) || pSep == NULL || pSep-pcs->lpszName < 0) + { + pSettings->pszText=new TCHAR[_tcslen(pcs->lpszName)+1]; + _tcscpy(pSettings->pszText, pcs->lpszName); + pSettings->pszLink=NULL; + } + else + { + pSettings->pszText=new TCHAR[pSep-pcs->lpszName+1]; + _tcsncpy(pSettings->pszText, pcs->lpszName, pSep-pcs->lpszName); + pSettings->pszText[pSep-pcs->lpszName]=_T('\0'); + pSep++; + pSettings->pszLink=new TCHAR[_tcslen(pSep)+1]; + _tcscpy(pSettings->pszLink, pSep); + } + + break; + } + case WM_NCDESTROY: + { + if (pSettings->hFontNormal) + DeleteObject(pSettings->hFontNormal); + if (pSettings->hFontUnderline) + DeleteObject(pSettings->hFontUnderline); + if (pSettings->hLink) + DeleteObject(pSettings->hLink); + if (pSettings->hNormal) + DeleteObject(pSettings->hNormal); + delete [] pSettings->pszLink; + delete [] pSettings->pszText; + + delete pSettings; + break; + } + case WM_SETFONT: + { + // delete old fonts + if (pSettings->hFontNormal) + DeleteObject(pSettings->hFontNormal); + if (pSettings->hFontUnderline) + DeleteObject(pSettings->hFontUnderline); + + // new font - create a font based on it (the normal and the underlined one) + HFONT hfont=(HFONT)wParam; + LOGFONT lf; + if (GetObject(hfont, sizeof(LOGFONT), &lf) != 0) + { + // size + if (::GetWindowLong(hwnd, GWL_STYLE) & SES_LARGE) + lf.lfHeight=(long)(lf.lfHeight*1.25); + + // create a font + if (::GetWindowLong(hwnd, GWL_STYLE) & SES_BOLD) + lf.lfWeight=FW_BOLD; + pSettings->hFontNormal=CreateFontIndirect(&lf); + lf.lfUnderline=TRUE; + pSettings->hFontUnderline=CreateFontIndirect(&lf); + } + else + { + pSettings->hFontNormal=NULL; + pSettings->hFontUnderline=NULL; + } + + break; + } + case WM_SETTEXT: + { + // delete the old font + delete [] pSettings->pszText; + delete [] pSettings->pszLink; + + // style + LONG lStyle=::GetWindowLong(hwnd, GWL_STYLE); + + LPCTSTR psz=(LPCTSTR)lParam; + TCHAR* pSep=_tcsrchr(psz, _T('|')); + + if (!(lStyle & SES_LINK) || pSep == NULL || pSep-psz < 0) + { + pSettings->pszText=new TCHAR[_tcslen(psz)+1]; + _tcscpy(pSettings->pszText, psz); + pSettings->pszLink=NULL; + } + else + { + pSettings->pszText=new TCHAR[pSep-psz+1]; + _tcsncpy(pSettings->pszText, psz, pSep-psz); + pSettings->pszText[pSep-psz]=_T('\0'); + pSep++; + pSettings->pszLink=new TCHAR[_tcslen(pSep)+1]; + _tcscpy(pSettings->pszLink, pSep); + } + + ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + break; + } + case WM_ERASEBKGND: + { + return (LRESULT)FALSE; + break; + } + case WM_PAINT: + { + // draw anything + PAINTSTRUCT ps; + HDC hDC=BeginPaint(hwnd, &ps); + + // flicker-free drawing + HDC hdc=::CreateCompatibleDC(hDC); + HBITMAP hBmp=::CreateCompatibleBitmap(hDC, ps.rcPaint.right-ps.rcPaint.left+1, ps.rcPaint.bottom-ps.rcPaint.top+1); + HBITMAP hOldBitmap=(HBITMAP)::SelectObject(hdc, hBmp); + ::SetWindowOrgEx(hdc, ps.rcPaint.left, ps.rcPaint.top, NULL); + + // paint the background + ::FillRect(hdc, &ps.rcPaint, (HBRUSH)::SendMessage((HWND)::GetWindowLong(hwnd, GWL_HWNDPARENT), WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd)); + + // size of the all control + RECT rcCtl; + ::GetClientRect(hwnd, &rcCtl); + + // draw text + DWORD dwFlags=DT_LEFT | DT_VCENTER | (::GetWindowLong(hwnd, GWL_STYLE) & SES_PATHELLIPSIS ? DT_PATH_ELLIPSIS : 0) + | (::GetWindowLong(hwnd, GWL_STYLE) & SES_ELLIPSIS ? DT_END_ELLIPSIS : 0) + | (::GetWindowLong(hwnd, GWL_STYLE) & SES_WORDBREAK ? DT_WORDBREAK : 0); + + pSettings->rcText=rcCtl; + if (::GetWindowLong(hwnd, GWL_STYLE) & SES_LINK) + { + HFONT hOld=(HFONT)::SelectObject(hdc, pSettings->hFontUnderline); + ::SetBkMode(hdc, TRANSPARENT); + + COLORREF crColor=(pSettings->bActive ? (RGB(255, 0, 0)) : (RGB(0, 0, 255))); + ::SetTextColor(hdc, crColor); + + if (pSettings->pszText) + { + DrawText(hdc, pSettings->pszText, -1, &pSettings->rcText, dwFlags | DT_CALCRECT); + DrawText(hdc, pSettings->pszText, -1, &rcCtl, dwFlags); + } + else + { + pSettings->rcText.left=0; + pSettings->rcText.right=0; + pSettings->rcText.top=0; + pSettings->rcText.bottom=0; + } + + ::SelectObject(hdc, hOld); + } + else + { + // aesthetics + rcCtl.left+=3; + rcCtl.right-=3; + + // draw + HFONT hOld=(HFONT)::SelectObject(hdc, pSettings->hFontNormal); + ::SetBkMode(hdc, TRANSPARENT); + ::SetTextColor(hdc, ::GetSysColor(COLOR_BTNTEXT)); + + if (pSettings->pszText) + { + DWORD dwMod=(::GetWindowLong(hwnd, GWL_STYLE) & SES_RALIGN) ? DT_RIGHT : 0; + DrawText(hdc, pSettings->pszText, -1, &pSettings->rcText, dwFlags | DT_CALCRECT | dwMod); + DrawText(hdc, pSettings->pszText, -1, &rcCtl, dwFlags | dwMod); + } + else + { + pSettings->rcText.left=0; + pSettings->rcText.right=0; + pSettings->rcText.top=0; + pSettings->rcText.bottom=0; + } + + ::SelectObject(hdc, hOld); + } + + // free the compatible dc + ::BitBlt(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right-ps.rcPaint.left+1, ps.rcPaint.bottom-ps.rcPaint.top+1, + hdc, ps.rcPaint.left, ps.rcPaint.top, SRCCOPY); + ::SelectObject(hdc, hOldBitmap); + ::DeleteObject(hBmp); + ::DeleteDC(hdc); + + EndPaint(hwnd, &ps); + + break; + } + case WM_MOUSEMOVE: + { + if (::GetWindowLong(hwnd, GWL_STYLE) & SES_LINK) + { + POINT pt = { LOWORD(lParam), HIWORD(lParam) }; + + if (pSettings->bActive) + { + if (!::PtInRect(&pSettings->rcText, pt)) + { + pSettings->bActive=false; + ::ReleaseCapture(); + ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + + ::SetCursor(pSettings->hNormal); + } + } + else + { + if (::PtInRect(&pSettings->rcText, pt)) + { + pSettings->bActive=true; + ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); + ::SetCapture(hwnd); + ::SetCursor(pSettings->hLink); + } + } + } + break; + } + case WM_LBUTTONDOWN: + { + pSettings->bDown=true; + break; + } + case WM_LBUTTONUP: + { + POINT pt={ LOWORD(lParam), HIWORD(lParam) }; + if (pSettings->bDown && ::GetWindowLong(hwnd, GWL_STYLE) & SES_LINK && ::PtInRect(&pSettings->rcText, pt)) + { + if (::GetWindowLong(hwnd, GWL_STYLE) & SES_NOTIFY) + { + ::SendMessage((HWND)::GetWindowLong(hwnd, GWL_HWNDPARENT), WM_COMMAND, (WPARAM)(SEN_CLICKED << 16 | ::GetWindowLong(hwnd, GWL_ID)), (LPARAM)hwnd); + } + else + { + + TRACE("Executing %s...\n", pSettings->pszLink); + ShellExecute(NULL, "open", pSettings->pszLink, NULL, NULL, SW_SHOWNORMAL); + } + } + pSettings->bDown=false; + + break; + } + case WM_CANCELMODE: + { + pSettings->bActive=false; + pSettings->bDown=false; + break; + } + case SEM_GETLINK: + { + // wParam - count + // lParam - addr of a buffer + if (pSettings->pszLink) + _tcsncpy((PTSTR)lParam, pSettings->pszLink, (int)wParam); + else + _tcscpy((PTSTR)lParam, _T("")); + + return (LRESULT)TRUE; + break; + } + } + + return ::DefWindowProc(hwnd, uMsg, wParam, lParam); +} + +bool RegisterStaticExControl(HINSTANCE hInstance) +{ + WNDCLASS wndcls; + + if (!(::GetClassInfo(hInstance, STATICEX_CLASS, &wndcls))) + { + // need to register a new class + wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + wndcls.lpfnWndProc = ::StaticExWndProc; + wndcls.cbClsExtra = 0; + wndcls.cbWndExtra = sizeof(STATICEXSETTINGS*); + wndcls.hInstance = hInstance; + wndcls.hIcon = NULL; + wndcls.hCursor = NULL; // will load each time needed + wndcls.hbrBackground = NULL; + wndcls.lpszMenuName = NULL; + wndcls.lpszClassName = STATICEX_CLASS; + + if (!RegisterClass(&wndcls)) + return false; + } + + return true; +} Index: Copy Handler/StaticEx.h =================================================================== diff -u --- Copy Handler/StaticEx.h (revision 0) +++ Copy Handler/StaticEx.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,56 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __STATICEX_H__ +#define __STATICEX_H__ + +// styles +#define SES_LINK 0x0001 /* link instead of common static */ +#define SES_NOTIFY 0x0002 /* notifies parent about mouse messages */ +#define SES_PATHELLIPSIS 0x0004 +#define SES_ELLIPSIS 0x0008 +#define SES_BOLD 0x0010 +#define SES_LARGE 0x0020 +#define SES_RALIGN 0x0040 /* incompatible with SES_LINK */ +#define SES_WORDBREAK 0x0080 + +// messages +#define SEM_GETLINK (WM_USER+16) /* wParam - cnt of chars to copy, lParam - addr of text */ + +#define SEN_CLICKED 0x0001 + +bool RegisterStaticExControl(HINSTANCE hInstance); + +struct STATICEXSETTINGS +{ + HFONT hFontNormal; + HFONT hFontUnderline; + + HCURSOR hNormal; + HCURSOR hLink; + + bool bDown; // specifies if the mouse button has been pressed + bool bActive; // is the link hovered ? + RECT rcText; // current text position and size + + TCHAR *pszText; + TCHAR *pszLink; +}; + +#endif \ No newline at end of file Index: Copy Handler/StatusDlg.cpp =================================================================== diff -u --- Copy Handler/StatusDlg.cpp (revision 0) +++ Copy Handler/StatusDlg.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,977 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "Copy Handler.h" +#include "resource.h" +#include "StatusDlg.h" +#include "BufferSizeDlg.h" +#include "ReplacePathsDlg.h" +#include "StringHelpers.h" +#include "StaticEx.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +bool CStatusDlg::m_bLock=false; + +///////////////////////////////////////////////////////////////////////////// +// CStatusDlg dialog + +CStatusDlg::CStatusDlg(CTaskArray* pTasks, CWnd* pParent /*=NULL*/) + : CHLanguageDialog(CStatusDlg::IDD, pParent, &m_bLock) +{ + //{{AFX_DATA_INIT(CStatusDlg) + //}}AFX_DATA_INIT + m_i64LastProcessed=0; + m_i64LastAllTasksProcessed=0; + m_pTasks=pTasks; + m_dwLastUpdate=0; + + RegisterStaticExControl(AfxGetInstanceHandle()); +} + +CStatusDlg::~CStatusDlg() +{ + +} + +void CStatusDlg::DoDataExchange(CDataExchange* pDX) +{ + CHLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CStatusDlg) + DDX_Control(pDX, IDC_ERRORS_EDIT, m_ctlErrors); + DDX_Control(pDX, IDC_TASK_PROGRESS, m_ctlCurrentProgress); + DDX_Control(pDX, IDC_STATUS_LIST, m_ctlStatusList); + DDX_Control(pDX, IDC_ALL_PROGRESS, m_ctlProgressAll); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CStatusDlg, CHLanguageDialog) + //{{AFX_MSG_MAP(CStatusDlg) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_PAUSE_BUTTON, OnPauseButton) + ON_BN_CLICKED(IDC_CANCEL_BUTTON, OnCancelButton) + ON_BN_CLICKED(IDC_ROLL_UNROLL_BUTTON, OnRollUnrollButton) + ON_BN_CLICKED(IDC_SET_PRIORITY_BUTTON, OnSetPriorityButton) + ON_BN_CLICKED(IDC_SET_BUFFERSIZE_BUTTON, OnSetBuffersizeButton) + ON_BN_CLICKED(IDC_START_ALL_BUTTON, OnStartAllButton) + ON_BN_CLICKED(IDC_RESTART_BUTTON, OnRestartButton) + ON_BN_CLICKED(IDC_DELETE_BUTTON, OnDeleteButton) + ON_BN_CLICKED(IDC_PAUSE_ALL_BUTTON, OnPauseAllButton) + ON_BN_CLICKED(IDC_RESTART_ALL_BUTTON, OnRestartAllButton) + ON_BN_CLICKED(IDC_CANCEL_ALL_BUTTON, OnCancelAllButton) + ON_BN_CLICKED(IDC_REMOVE_FINISHED_BUTTON, OnRemoveFinishedButton) + ON_NOTIFY(LVN_KEYDOWN, IDC_STATUS_LIST, OnKeydownStatusList) + ON_NOTIFY(LVN_CHANGEDSELECTION, IDC_STATUS_LIST, OnSelectionChanged) + ON_BN_CLICKED(IDC_ADVANCED_BUTTON, OnAdvancedButton) + ON_COMMAND(ID_POPUP_REPLACE_PATHS, OnPopupReplacePaths) + ON_BN_CLICKED(IDC_SHOW_LOG_BUTTON, OnShowLogButton) + ON_BN_CLICKED(IDC_STICK_BUTTON, OnStickButton) + ON_BN_CLICKED(IDC_RESUME_BUTTON, OnResumeButton) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CStatusDlg message handlers + +BOOL CStatusDlg::OnInitDialog() +{ + CHLanguageDialog::OnInitDialog(); + + // get size of list ctrl + CRect rcList; + m_ctlStatusList.GetWindowRect(&rcList); + int iWidth=rcList.Width(); + + // set additional styles + m_ctlStatusList.SetExtendedStyle(m_ctlStatusList.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + + // add columns + LVCOLUMN lvc; + lvc.mask=LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt=LVCFMT_LEFT; + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); + lvc.iSubItem=-1; + m_ctlStatusList.InsertColumn(1, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3*iWidth); + lvc.iSubItem=0; + m_ctlStatusList.InsertColumn(2, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); + lvc.iSubItem=1; + m_ctlStatusList.InsertColumn(3, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15*iWidth); + lvc.iSubItem=2; + m_ctlStatusList.InsertColumn(4, &lvc); + + // images + m_images.Create(16, 16, ILC_COLOR16 | ILC_MASK, 0, 3); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_WORKING_ICON))); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_ERROR_ICON))); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_PAUSED_ICON))); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_FINISHED_ICON))); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_CANCELLED_ICON))); + m_images.Add(AfxGetApp()->LoadIcon(MAKEINTRESOURCE(IDI_WAITING_ICON))); + + m_ctlStatusList.SetImageList(&m_images, LVSIL_SMALL); + + // set fixed progresses ranges + m_ctlCurrentProgress.SetRange32(0, 100); + m_ctlProgressAll.SetRange32(0, 100); + + // change the size of a dialog + ApplyDisplayDetails(true); +// ApplyButtonsState(); +// EnableControls(false); + + // refresh data + RefreshStatus(); + + // select needed element + int i=0; + while (i < m_pTasks->GetSize()) + { + if (m_pTasks->GetAt(i) == m_pInitialSelection) + { + m_ctlStatusList.SetItemState(i, LVIS_SELECTED, LVIS_SELECTED); + break; + } + + i++; + }; + + // refresh data timer + SetTimer(777, GetConfig()->GetIntValue(PP_STATUSREFRESHINTERVAL), NULL); + + return TRUE; +} + +void CStatusDlg::EnableControls(bool bEnable) +{ + // enable/disable controls + GetDlgItem(IDC_SET_BUFFERSIZE_BUTTON)->EnableWindow(bEnable); + GetDlgItem(IDC_SET_PRIORITY_BUTTON)->EnableWindow(bEnable); + + if (!bEnable) + { + // get rid of text id disabling + GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYOPERATIONTEXT_STRING)); + GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYSOURCETEXT_STRING)); + GetDlgItem(IDC_DESTINATION_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYDESTINATIONTEXT_STRING)); + GetDlgItem(IDC_BUFFERSIZE_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYBUFFERSIZETEXT_STRING)); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYPRIORITYTEXT_STRING)); + + const TCHAR *pszText=GetResManager()->LoadString(IDS_EMPTYERRORTEXT_STRING); + m_ctlErrors.GetWindowText(m_strTemp); + if (m_strTemp != pszText) + m_ctlErrors.SetWindowText(pszText); + + GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYPROCESSEDTEXT_STRING)); + GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYTRANSFERTEXT_STRING)); + GetDlgItem(IDC_TIME_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYTIMETEXT_STRING)); + GetDlgItem(IDC_ASSOCIATEDFILES__STATIC)->SetWindowText(GetResManager()->LoadString(IDS_EMPTYASSOCFILE_STRING)); + + m_ctlCurrentProgress.SetPos(0); + } +} + +void CStatusDlg::OnTimer(UINT nIDEvent) +{ + if (nIDEvent == 777) // refreshing data + { + // turn off timer for some time + KillTimer(777); + + RefreshStatus(); + + // reenable + SetTimer(777, GetConfig()->GetIntValue(PP_STATUSREFRESHINTERVAL), NULL); + } + + CHLanguageDialog::OnTimer(nIDEvent); +} + +void CStatusDlg::AddTaskInfo(int nPos, CTask *pTask, DWORD dwCurrentTime) +{ + // index to string + _itot(nPos, m_szData, 10); + + // get data snapshot from task + pTask->GetSnapshot(&td); + + // index subitem + lvi.mask=LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; + lvi.iItem=nPos; + lvi.iSubItem=0; + lvi.pszText=td.m_szStatusText; + lvi.cchTextMax=lstrlen(lvi.pszText); + lvi.lParam=reinterpret_cast(pTask); + lvi.iImage=GetImageFromStatus(td.m_uiStatus); + if (nPos < m_ctlStatusList.GetItemCount()) + m_ctlStatusList.SetItem(&lvi); + else + m_ctlStatusList.InsertItem(&lvi); + + // status subitem + lvi.mask=LVIF_TEXT; // zmie� mask� + lvi.iSubItem=1; + m_strTemp=td.m_fi.GetFileName(); + lvi.pszText=m_strTemp.GetBuffer(0); + m_strTemp.ReleaseBuffer(); + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlStatusList.SetItem(&lvi); + + // insert 'file' subitem + lvi.iSubItem=2; + m_strTemp=td.m_pdpDestPath->GetPath(); + lvi.pszText=m_strTemp.GetBuffer(0); + m_strTemp.ReleaseBuffer(); + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlStatusList.SetItem(&lvi); + + // insert dest subitem + lvi.iSubItem=3; + _itot( td.m_nPercent, m_szData, 10 ); + _tcscat(m_szData, _T(" %")); + lvi.pszText=m_szData; + lvi.cchTextMax=lstrlen(lvi.pszText); + m_ctlStatusList.SetItem(&lvi); + + // right side update + if (pTask == pSelectedItem && GetConfig()->GetBoolValue(PP_STATUSSHOWDETAILS)) + { + // data that can be changed by a thread + GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(td.m_szStatusText); // operation + GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(td.m_fi.GetFullFilePath()); // src object + + // error message + if ( (td.m_uiStatus & ST_WORKING_MASK) == ST_ERROR ) + { + m_ctlErrors.GetWindowText(m_strTemp); + if (m_strTemp != td.m_strErrorDesc) + m_ctlErrors.SetWindowText(td.m_strErrorDesc); + } + else + { + const TCHAR *pszText=GetResManager()->LoadString(IDS_EMPTYERRORTEXT_STRING); + + m_ctlErrors.GetWindowText(m_strTemp2); + if (m_strTemp2 != pszText) + m_ctlErrors.SetWindowText(pszText); + } + + // count of processed data/overall count of data + _stprintf(m_szData, _T("%d/%d ("), td.m_iIndex, td.m_iSize); + m_strTemp=CString(m_szData); + m_strTemp+=GetSizeString(td.m_iProcessedSize, m_szData)+CString(_T("/")); + m_strTemp+=GetSizeString(td.m_iSizeAll, m_szData)+CString(_T(")")); + _stprintf(m_szData, _T(" (%s%d/%d)"), GetResManager()->LoadString(IDS_CURRENTPASS_STRING), td.m_ucCurrentCopy, td.m_ucCopies); + m_strTemp+=m_szData; + GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(m_strTemp); + + // transfer + if (m_i64LastProcessed == 0) // if first time - show average + m_strTemp=GetSizeString( td.m_lTimeElapsed ? td.m_iProcessedSize/td.m_lTimeElapsed : 0, m_szData ); // last avg + else + if ( (dwCurrentTime-m_dwLastUpdate) != 0) + m_strTemp=GetSizeString( (static_cast(td.m_iProcessedSize) - static_cast(m_i64LastProcessed))/(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData ); + else + m_strTemp=GetSizeString( 0I64, m_szData ); + + // avg transfer + GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s (")+CString(GetResManager()->LoadString(IDS_AVERAGEWORD_STRING)) + +CString(GetSizeString(td.m_lTimeElapsed ? td.m_iProcessedSize/td.m_lTimeElapsed : 0, m_szData))+_T("/s )") + ); + + // elapsed time/estimated time + FormatTime(td.m_lTimeElapsed, m_szTimeBuffer1); + FormatTime( (td.m_iProcessedSize == 0) ? 0 : static_cast((static_cast<__int64>(td.m_iSizeAll)*static_cast<__int64>(td.m_lTimeElapsed))/td.m_iProcessedSize), m_szTimeBuffer2); + + _stprintf(m_szData, _T("%s / %s"), m_szTimeBuffer1, m_szTimeBuffer2); + GetDlgItem(IDC_TIME_STATIC)->SetWindowText(m_szData); + + // remember current processed data (used for calculating transfer) + m_i64LastProcessed=td.m_iProcessedSize; + + // set progress + m_ctlCurrentProgress.SetPos(td.m_nPercent); + + SetBufferSizesString(td.m_pbsSizes->m_auiSizes[td.m_iCurrentBufferIndex], td.m_iCurrentBufferIndex); + + // data that can be changed only by user from outside the thread + // refresh only when there are new selected item +// if (pTask != m_pLastSelected) + { + GetDlgItem(IDC_DESTINATION_STATIC)->SetWindowText(td.m_pdpDestPath->GetPath()); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(td.m_nPriority))); + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, m_strTemp.GetBuffer(1024), 1024); + m_strTemp.ReleaseBuffer(); + GetDlgItem(IDC_ASSOCIATEDFILES__STATIC)->SetWindowText(m_strTemp+*td.m_pstrUniqueName+_T(".atd (.atp, .log)")); + } + + // refresh m_pLastSelected + m_pLastSelected=pTask; + } +} + +void CStatusDlg::OnSetBuffersizeButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + CBufferSizeDlg dlg; + dlg.m_bsSizes=*pTask->GetBufferSizes(); + dlg.m_iActiveIndex=pTask->GetCurrentBufferIndex(); + if (dlg.DoModal() == IDOK) + { + // if the task has been deleted - skip + if ( pTask != GetSelectedItemPointer() ) + { + TRACE("Task were finished and deleted when trying to change buffer sizes"); + return; + } + + TRACE("bOnlyDefault=%d\n", dlg.m_bsSizes.m_bOnlyDefault); + pTask->SetBufferSizes(&dlg.m_bsSizes); + } +} + +CTask* CStatusDlg::GetSelectedItemPointer() +{ +// TRACE("inside GetSelectedItemPointer()\n"); + // returns ptr to a CTask for a given element in listview + if (m_ctlStatusList.GetSelectedCount() == 1) + { + POSITION pos=m_ctlStatusList.GetFirstSelectedItemPosition(); + int nPos=m_ctlStatusList.GetNextSelectedItem(pos); + CTask* pSelectedItem=reinterpret_cast(m_ctlStatusList.GetItemData(nPos)); +// if (AfxIsValidAddress(pSelectedItem, sizeof(CTask))) + return pSelectedItem; + } +// TRACE("exiting GetSelectedItemPointer()\n"); + + return NULL; +} + +void CStatusDlg::OnRollUnrollButton() +{ + // change settings in config dialog + GetConfig()->SetBoolValue(PP_STATUSSHOWDETAILS, !GetConfig()->GetBoolValue(PP_STATUSSHOWDETAILS)); + + ApplyDisplayDetails(); +} + +void CStatusDlg::ApplyDisplayDetails(bool bInitial) +{ + // get coord of screen and window + CRect rcScreen, rect; + SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, 0); + GetWindowRect(&rect); + + bool bDetails=GetConfig()->GetBoolValue(PP_STATUSSHOWDETAILS); + + // stick cause + if (rect.right == rcScreen.right && rect.bottom == rcScreen.bottom) + bInitial=true; + + GetDlgItem(IDC_ROLL_UNROLL_BUTTON)->SetWindowText(bDetails ? _T("<<") : _T(">>")); + + CRect list, progress; + m_ctlProgressAll.GetWindowRect(&progress); + ScreenToClient(&progress); + m_ctlStatusList.GetWindowRect(&list); + ScreenToClient(&list); + + // set dialog size + CRect destRect; + if (!bInitial) + { + destRect.left=0; + destRect.top=0; + destRect.right=bDetails ? progress.right+list.left+3*GetSystemMetrics(SM_CXBORDER) : list.right+list.left+3*GetSystemMetrics(SM_CXBORDER); + destRect.bottom=rect.Height(); + SetWindowPos(NULL, destRect.left, destRect.top, destRect.right, destRect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER); + } + else + { + SetWindowPos(NULL, rcScreen.right-(bDetails ? progress.right+list.left+3*GetSystemMetrics(SM_CXBORDER) : list.right+list.left+3*GetSystemMetrics(SM_CXBORDER)), + rcScreen.bottom-rect.Height(), (bDetails ? progress.right+list.left+3*GetSystemMetrics(SM_CXBORDER) : list.right+list.left+3*GetSystemMetrics(SM_CXBORDER)), + rect.Height(), SWP_NOOWNERZORDER | SWP_NOZORDER); + } +} + +void CStatusDlg::ApplyButtonsState() +{ + // remember ptr to CTask + pSelectedItem=GetSelectedItemPointer(); + bool bShowLog=GetConfig()->GetBoolValue(PP_CMCREATELOG); + + // set status of buttons pause/resume/cancel + if (pSelectedItem != NULL) + { + GetDlgItem(IDC_RESTART_BUTTON)->EnableWindow(true); + GetDlgItem(IDC_SHOW_LOG_BUTTON)->EnableWindow(bShowLog); + GetDlgItem(IDC_DELETE_BUTTON)->EnableWindow(true); + + if (pSelectedItem->GetStatus(ST_STEP_MASK) == ST_FINISHED + || pSelectedItem->GetStatus(ST_STEP_MASK) == ST_CANCELLED) + { + GetDlgItem(IDC_CANCEL_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_PAUSE_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_RESUME_BUTTON)->EnableWindow(false); + } + else + { + // pause/resume + if (pSelectedItem->GetStatus(ST_WORKING_MASK) & ST_PAUSED) + { + GetDlgItem(IDC_PAUSE_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_RESUME_BUTTON)->EnableWindow(true); + } + else + { + GetDlgItem(IDC_PAUSE_BUTTON)->EnableWindow(true); + if (pSelectedItem->GetStatus(ST_WAITING_MASK) & ST_WAITING) + GetDlgItem(IDC_RESUME_BUTTON)->EnableWindow(true); + else + GetDlgItem(IDC_RESUME_BUTTON)->EnableWindow(false); + } + + GetDlgItem(IDC_CANCEL_BUTTON)->EnableWindow(true); + } + } + else + { + GetDlgItem(IDC_SHOW_LOG_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_PAUSE_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_RESUME_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_RESTART_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_CANCEL_BUTTON)->EnableWindow(false); + GetDlgItem(IDC_DELETE_BUTTON)->EnableWindow(false); + } +} + +void CStatusDlg::OnSetPriorityButton() +{ + CMenu menu; + HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_PRIORITY_MENU)); + if (!menu.Attach(hMenu)) + { + DestroyMenu(hMenu); + return; + } + + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); + + // set point in which to set menu + CRect rect; + GetDlgItem(IDC_SET_PRIORITY_BUTTON)->GetWindowRect(&rect); + + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); +} + +BOOL CStatusDlg::OnCommand(WPARAM wParam, LPARAM lParam) +{ + if (HIWORD(wParam) == 0) + { + if (LOWORD(wParam) >= ID_POPUP_TIME_CRITICAL && LOWORD(wParam) <= ID_POPUP_IDLE) + { + // processing priority + if ( (pSelectedItem=GetSelectedItemPointer()) == NULL ) + return CHLanguageDialog::OnCommand(wParam, lParam); + + switch (LOWORD(wParam)) + { + case ID_POPUP_TIME_CRITICAL: + pSelectedItem->SetPriority(THREAD_PRIORITY_TIME_CRITICAL); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_TIME_CRITICAL))); + break; + case ID_POPUP_HIGHEST: + pSelectedItem->SetPriority(THREAD_PRIORITY_HIGHEST); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_HIGHEST))); + break; + case ID_POPUP_ABOVE_NORMAL: + pSelectedItem->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_ABOVE_NORMAL))); + break; + case ID_POPUP_NORMAL: + pSelectedItem->SetPriority(THREAD_PRIORITY_NORMAL); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_NORMAL))); + break; + case ID_POPUP_BELOW_NORMAL: + pSelectedItem->SetPriority(THREAD_PRIORITY_BELOW_NORMAL); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_BELOW_NORMAL))); + break; + case ID_POPUP_LOWEST: + pSelectedItem->SetPriority(THREAD_PRIORITY_LOWEST); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_LOWEST))); + break; + case ID_POPUP_IDLE: + pSelectedItem->SetPriority(THREAD_PRIORITY_IDLE); + GetDlgItem(IDC_PRIORITY_STATIC)->SetWindowText(GetResManager()->LoadString(IDS_PRIORITY0_STRING+PriorityToIndex(THREAD_PRIORITY_IDLE))); + break; + } + } + } + return CHLanguageDialog::OnCommand(wParam, lParam); +} + +void CStatusDlg::OnPauseButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + TRACE("PauseProcessing call...\n"); + pTask->PauseProcessing(); + + RefreshStatus(); +} + +void CStatusDlg::OnResumeButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + TRACE("ResumeProcessing call "); + if (pTask->GetStatus(ST_WAITING_MASK) & ST_WAITING) + { + TRACE("by setting force flag\n"); + pTask->SetForceFlag(); + } + else + { + TRACE("by function ResumeProcessing\n"); + pTask->ResumeProcessing(); + } + + RefreshStatus(); +} + +void CStatusDlg::OnCancelButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) != NULL ) + { + TRACE("CancelProcessing call...\n"); + pTask->CancelProcessing(); + } + RefreshStatus(); +} + +void CStatusDlg::OnRestartButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + TRACE("RestartProcessing call...\n"); + pTask->RestartProcessing(); + RefreshStatus(); +} + +void CStatusDlg::OnDeleteButton() +{ + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + UINT uiStatus=pTask->GetStatus(ST_STEP_MASK); + if ( (uiStatus & ST_STEP_MASK) != ST_FINISHED && (uiStatus & ST_STEP_MASK) != ST_CANCELLED ) + { + // ask if cancel + if (MsgBox(IDS_CONFIRMCANCEL_STRING, MB_OKCANCEL | MB_ICONQUESTION) == IDOK) + { + // cancel + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + pTask->CancelProcessing(); + } + else + return; + } + + m_pTasks->RemoveFinished(&pTask); + RefreshStatus(); +} + +void CStatusDlg::OnPauseAllButton() +{ + TRACE("Pause All...\n"); + m_pTasks->TasksPauseProcessing(); + RefreshStatus(); +} + +void CStatusDlg::OnStartAllButton() +{ + TRACE("Resume Processing...\n"); + m_pTasks->TasksResumeProcessing(); + RefreshStatus(); +} + +void CStatusDlg::OnRestartAllButton() +{ + TRACE("Restart Processing...\n"); + m_pTasks->TasksRestartProcessing(); + RefreshStatus(); +} + +void CStatusDlg::OnCancelAllButton() +{ + TRACE("Cancel Processing...\n"); + m_pTasks->TasksCancelProcessing(); + RefreshStatus(); +} + +void CStatusDlg::OnRemoveFinishedButton() +{ + m_pTasks->RemoveAllFinished(); + RefreshStatus(); +} + +void CStatusDlg::OnKeydownStatusList(NMHDR* pNMHDR, LRESULT* pResult) +{ + LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR; + switch (pLVKeyDow->wVKey) + { + case VK_DELETE: + OnDeleteButton(); + break; + case VK_SPACE: + { + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL ) + return; + + if (pTask->GetStatus(ST_WORKING_MASK) & ST_PAUSED) + OnResumeButton(); + else + OnPauseButton(); + break; + } + } + + *pResult = 0; +} + +int CStatusDlg::GetImageFromStatus(UINT nStatus) +{ + if ( (nStatus & ST_STEP_MASK) == ST_CANCELLED ) + return 4; + if ( (nStatus & ST_STEP_MASK) == ST_FINISHED ) + return 3; + if ( (nStatus & ST_WAITING_MASK) == ST_WAITING ) + return 5; + if ( (nStatus & ST_WORKING_MASK) == ST_PAUSED ) + return 2; + if ( (nStatus & ST_WORKING_MASK) == ST_ERROR ) + return 1; + return 0; +} + +LPTSTR CStatusDlg::FormatTime(long lSeconds, LPTSTR lpszBuffer) +{ + long lDays=lSeconds/86400; + lSeconds%=86400; + long lHours=lSeconds/3600; + lSeconds%=3600; + long lMinutes=lSeconds/60; + lSeconds%=60; + + if (lDays != 0) + _stprintf(lpszBuffer, _T("%02d:%02d:%02d:%02d"), lDays, lHours, lMinutes, lSeconds); + else + if (lHours != 0) + _stprintf(lpszBuffer, _T("%02d:%02d:%02d"), lHours, lMinutes, lSeconds); + else + _stprintf(lpszBuffer, _T("%02d:%02d"), lMinutes, lSeconds); + + return lpszBuffer; +} + +void CStatusDlg::RefreshStatus() +{ + // remember address of a current selection + pSelectedItem=GetSelectedItemPointer(); + + // current time + DWORD dwCurrentTime=GetTickCount(); + + // get rid of item after the current part + m_ctlStatusList.LimitItems(m_pTasks->GetSize()); + + // add task info + for (int i=0;iGetSize();i++) + AddTaskInfo(i, m_pTasks->GetAt(i), dwCurrentTime); + + // percent + int nPercent=m_pTasks->GetPercent(); + + // set title + if (m_pTasks->GetSize() != 0) + _stprintf(m_szData, _T("%s [%d %%]"), GetResManager()->LoadString(IDS_STATUSTITLE_STRING), m_pTasks->GetPercent()); + else + _tcscpy(m_szData, GetResManager()->LoadString(IDS_STATUSTITLE_STRING)); + + // if changed + GetWindowText(m_strTemp); + if (m_strTemp != CString(m_szData)) + SetWindowText(m_szData); + + // refresh overall progress + if (GetConfig()->GetBoolValue(PP_STATUSSHOWDETAILS)) + { + m_ctlProgressAll.SetPos(nPercent); + + // progress - count of processed data/count of data + m_strTemp=GetSizeString(m_pTasks->GetPosition(), m_szData)+CString(_T("/")); + m_strTemp+=GetSizeString(m_pTasks->GetRange(), m_szData); + GetDlgItem(IDC_OVERALL_PROGRESS_STATIC)->SetWindowText(m_strTemp); + + // transfer + if (m_i64LastAllTasksProcessed == 0) + m_i64LastAllTasksProcessed=m_pTasks->GetPosition(); + + if (dwCurrentTime-m_dwLastUpdate != 0) + m_strTemp=GetSizeString( (static_cast(m_pTasks->GetPosition()) - static_cast(m_i64LastAllTasksProcessed))/static_cast(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData ); + else + m_strTemp=GetSizeString( 0I64, m_szData ); + + GetDlgItem(IDC_OVERALL_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s")); + m_i64LastAllTasksProcessed=m_pTasks->GetPosition(); + m_dwLastUpdate=dwCurrentTime; + } + + // if selection's missing - hide controls + if (m_ctlStatusList.GetSelectedCount() == 0) + { + EnableControls(false); + m_pLastSelected=NULL; + m_i64LastProcessed=0; + } + else + EnableControls(); // enable controls + + // apply state of the resume, cancel, ... buttons + ApplyButtonsState(); +} + +void CStatusDlg::OnSelectionChanged(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) +{ + TRACE("Received LVN_CHANGEDSELECTION\n"); + RefreshStatus(); +} + +void CStatusDlg::OnCancel() +{ + PostCloseMessage(); + CHLanguageDialog::OnCancel(); +} + +void CStatusDlg::OnAdvancedButton() +{ + CMenu menu; + HMENU hMenu=GetResManager()->LoadMenu(MAKEINTRESOURCE(IDR_ADVANCED_MENU)); + if (!menu.Attach(hMenu)) + { + DestroyMenu(hMenu); + return; + } + + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); + + // get the point to show menu at + CRect rect; + GetDlgItem(IDC_ADVANCED_BUTTON)->GetWindowRect(&rect); + + pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, this); +} + +void CStatusDlg::OnPopupReplacePaths() +{ + // check if there's a selection currently + if ( (pSelectedItem=GetSelectedItemPointer()) != NULL ) + { + if (pSelectedItem->GetStatus(ST_WORKING_MASK) & ST_PAUSED) + { + bool bContinue=false; + if (pSelectedItem->GetStatus(ST_WORKING_MASK) == ST_ERROR) + { + pSelectedItem->PauseProcessing(); + bContinue=true; + } + + // assuming here that there's selection and task is paused + CReplacePathsDlg dlg; + dlg.m_pTask=pSelectedItem; + if (dlg.DoModal() == IDOK) + { + // change 'no case' + int iClipboard=pSelectedItem->ReplaceClipboardStrings(dlg.m_strSource, dlg.m_strDest); + + CString strStats; + strStats.Format(IDS_REPLACEPATHSTEXT_STRING, iClipboard); + AfxMessageBox(strStats); + } + + // resume if earlier was an error + if (bContinue) + pSelectedItem->ResumeProcessing(); + } + else + MsgBox(IDS_TASKNOTPAUSED_STRING); + } + else + MsgBox(IDS_TASKNOTSELECTED_STRING); +} + +void CStatusDlg::OnShowLogButton() +{ + // show log + CTask* pTask; + if ( (pTask=GetSelectedItemPointer()) == NULL || !GetConfig()->GetBoolValue(PP_CMCREATELOG)) + return; + + // call what's needed + TCHAR szExec[1024]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szExec, 1024); + GetApp()->ExpandPath(szExec); + unsigned long lResult=(unsigned long)(ShellExecute(this->m_hWnd, _T("open"), _T("notepad.exe"), + CString(szExec)+pTask->GetUniqueName()+_T(".log"), szExec, SW_SHOWNORMAL)); + if (lResult < 32) + { + CString str=CString(szExec)+pTask->GetUniqueName()+_T(".log"); + _stprintf(szExec, GetResManager()->LoadString(IDS_SHELLEXECUTEERROR_STRING), lResult, str); + AfxMessageBox(szExec); + } +} + +LRESULT CStatusDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + if (message == WM_UPDATESTATUS) + { + TRACE("Received WM_UPDATESTATUS\n"); + RefreshStatus(); + } + return CHLanguageDialog::WindowProc(message, wParam, lParam); +} + +void CStatusDlg::OnStickButton() +{ + ApplyDisplayDetails(true); +} + +void CStatusDlg::SetBufferSizesString(UINT uiValue, int iIndex) +{ + TCHAR szData[1024]; + switch (iIndex) + { + case BI_DEFAULT: + GetResManager()->LoadStringCopy(IDS_BSDEFAULT_STRING, szData, 256); + break; + case BI_ONEDISK: + GetResManager()->LoadStringCopy(IDS_BSONEDISK_STRING, szData, 256); + break; + case BI_TWODISKS: + GetResManager()->LoadStringCopy(IDS_BSTWODISKS_STRING, szData, 256); + break; + case BI_CD: + GetResManager()->LoadStringCopy(IDS_BSCD_STRING, szData, 256); + break; + case BI_LAN: + GetResManager()->LoadStringCopy(IDS_BSLAN_STRING, szData, 256); + break; + } + + _tcscat(szData, GetSizeString((__int64)uiValue, m_szData)); + + GetDlgItem(IDC_BUFFERSIZE_STATIC)->SetWindowText(szData); +} + +void CStatusDlg::PostCloseMessage() +{ + GetParent()->PostMessage(WM_STATUSCLOSING); +} + +void CStatusDlg::OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) +{ + // remove all columns + int iCnt=m_ctlStatusList.GetHeaderCtrl()->GetItemCount(); + + // Delete all of the columns. + for (int i=0;iLoadString(IDS_COLUMNSTATUS_STRING); /*_T("Status")*/; + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); + lvc.iSubItem=-1; + m_ctlStatusList.InsertColumn(1, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNSOURCE_STRING);/*_T("File");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3*iWidth); + lvc.iSubItem=0; + m_ctlStatusList.InsertColumn(2, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNDESTINATION_STRING);/*_T("To:");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.27*iWidth); + lvc.iSubItem=1; + m_ctlStatusList.InsertColumn(3, &lvc); + + lvc.pszText=(PTSTR)GetResManager()->LoadString(IDS_COLUMNPROGRESS_STRING);/*_T("Progress");*/ + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15*iWidth); + lvc.iSubItem=2; + m_ctlStatusList.InsertColumn(4, &lvc); + + RefreshStatus(); +} Index: Copy Handler/StatusDlg.h =================================================================== diff -u --- Copy Handler/StatusDlg.h (revision 0) +++ Copy Handler/StatusDlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,126 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __STATUSDLG_H__ +#define __STATUSDLG_H__ + +#include "structs.h" +#include "FFListCtrl.h" + +#define WM_UPDATESTATUS WM_USER+6 +#define WM_STATUSCLOSING WM_USER+12 + +///////////////////////////////////////////////////////////////////////////// +// CStatusDlg dialog +class CStatusDlg : public CHLanguageDialog +{ +// Construction +public: + CStatusDlg(CTaskArray* pTasks, CWnd* pParent = NULL); // standard constructor + ~CStatusDlg(); + void PostCloseMessage(); + void SetBufferSizesString(UINT uiValue, int iIndex); + void RefreshStatus(); + LPTSTR FormatTime(long lSeconds, LPTSTR lpszBuffer); + int GetImageFromStatus(UINT nStatus); + + void ApplyButtonsState(); + void ApplyDisplayDetails(bool bInitial=false); + CTask* GetSelectedItemPointer(); + + void AddTaskInfo(int nPos, CTask *pTask, DWORD dwCurrentTime); + void EnableControls(bool bEnable=true); + + CTaskArray* m_pTasks; + CTask* pSelectedItem; + const CTask *m_pLastSelected; + const CTask* m_pInitialSelection; + + TCHAR m_szData[_MAX_PATH]; + TCHAR m_szTimeBuffer1[40]; + TCHAR m_szTimeBuffer2[40]; + + __int64 m_i64LastProcessed; + __int64 m_i64LastAllTasksProcessed; + DWORD m_dwLastUpdate; + + LVITEM lvi; + TASK_DISPLAY_DATA td; + CString m_strTemp, m_strTemp2; + + CImageList m_images; + + static bool m_bLock; // locker + +// Dialog Data + //{{AFX_DATA(CStatusDlg) + enum { IDD = IDD_STATUS_DIALOG }; + CEdit m_ctlErrors; + CProgressCtrl m_ctlCurrentProgress; + CFFListCtrl m_ctlStatusList; + CProgressCtrl m_ctlProgressAll; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CStatusDlg) + public: + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +// Implementation +protected: + virtual void OnLanguageChanged(WORD wOld, WORD wNew); + + // Generated message map functions + //{{AFX_MSG(CStatusDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT nIDEvent); + afx_msg void OnPauseButton(); + afx_msg void OnCancelButton(); + afx_msg void OnRollUnrollButton(); + afx_msg void OnSetPriorityButton(); + afx_msg void OnSetBuffersizeButton(); + afx_msg void OnStartAllButton(); + afx_msg void OnRestartButton(); + afx_msg void OnDeleteButton(); + afx_msg void OnPauseAllButton(); + afx_msg void OnRestartAllButton(); + afx_msg void OnCancelAllButton(); + afx_msg void OnRemoveFinishedButton(); + afx_msg void OnKeydownStatusList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnSelectionChanged(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/); + virtual void OnCancel(); + afx_msg void OnAdvancedButton(); + afx_msg void OnPopupReplacePaths(); + afx_msg void OnShowLogButton(); + afx_msg void OnStickButton(); + afx_msg void OnResumeButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/Stdafx.h =================================================================== diff -u --- Copy Handler/Stdafx.h (revision 0) +++ Copy Handler/Stdafx.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,44 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __STDAFX_H__ +#define __STDAFX_H__ + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT +#include "afxmt.h" + +#define DISABLE_CRYPT +#include "ConfigManager.h" + +#pragma warning (disable: 4711) +#include "HelpLngDialog.h" +#include "htmlhelp.h" +#include "debug.h" + +//{{AFX_INSERT_LOCATION}} +// Microsoft Developer Studio will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/StringHelpers.cpp =================================================================== diff -u --- Copy Handler/StringHelpers.cpp (revision 0) +++ Copy Handler/StringHelpers.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,73 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "Copy Handler.h" +#include "StringHelpers.h" +#include "stdio.h" + +#ifdef _MFC_VER +void ExpandFormatString(CString* pstrFmt, DWORD dwError) +{ + // replace strings %errnum & %errdesc to something else + TCHAR xx[_MAX_PATH]; + pstrFmt->Replace(_T("%errnum"), _itot(dwError, xx, 10)); + + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, 0, xx, _MAX_PATH, NULL); + + while (xx[_tcslen(xx)-1] == _T('\n') || xx[_tcslen(xx)-1] == _T('\r')) + xx[_tcslen(xx)-1] = _T('\0'); + + pstrFmt->Replace(_T("%errdesc"), xx); +} +#endif + +LPTSTR GetSizeString(double dData, LPTSTR pszBuffer) +{ + if (dData < 0.0) + dData=0.0; + + if (dData < 1200.0) + _stprintf(pszBuffer, _T("%.2f %s"), dData, GetResManager()->LoadString(IDS_BYTE_STRING)); + else if (dData < 1228800.0) + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1024.0, GetResManager()->LoadString(IDS_KBYTE_STRING)); + else if (dData < 1258291200.0) + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1048576.0, GetResManager()->LoadString(IDS_MBYTE_STRING)); + else + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1073741824.0, GetResManager()->LoadString(IDS_GBYTE_STRING)); + + return pszBuffer; +} + +LPTSTR GetSizeString(__int64 llData, LPTSTR pszBuffer, bool bStrict) +{ + if (llData < 0) + llData=0; + + if (llData >= 1258291200 && (!bStrict || (llData % 1073741824) == 0)) + _stprintf(pszBuffer, _T("%.2f %s"), (double)(llData/1073741824.0), GetResManager()->LoadString(IDS_GBYTE_STRING)); + else if (llData >= 1228800 && (!bStrict || (llData % 1048576) == 0)) + _stprintf(pszBuffer, _T("%.2f %s"), (double)(llData/1048576.0), GetResManager()->LoadString(IDS_MBYTE_STRING)); + else if (llData >= 1200 && (!bStrict || (llData % 1024) == 0)) + _stprintf(pszBuffer, _T("%.2f %s"), (double)(llData/1024.0), GetResManager()->LoadString(IDS_KBYTE_STRING)); + else + _stprintf(pszBuffer, _T("%I64u %s"), llData, GetResManager()->LoadString(IDS_BYTE_STRING)); + + return pszBuffer; +} Index: Copy Handler/StringHelpers.h =================================================================== diff -u --- Copy Handler/StringHelpers.h (revision 0) +++ Copy Handler/StringHelpers.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,31 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __STRINGHELPERS_H__ +#define __STRINGHELPERS_H__ + +// formatting routines +#ifdef _MFC_VER +void ExpandFormatString(CString* pstrFmt, DWORD dwError); +#endif + +LPTSTR GetSizeString(double dData, LPTSTR pszBuffer); +LPTSTR GetSizeString(__int64 llData, LPTSTR pszBuffer, bool bStrict=false); + +#endif Index: Copy Handler/Structs.cpp =================================================================== diff -u --- Copy Handler/Structs.cpp (revision 0) +++ Copy Handler/Structs.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1573 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "structs.h" +#include "resource.h" +#include "StringHelpers.h" +#include "..\common\FileSupport.h" +#include "Copy Handler.h" + +// global +int PriorityToIndex(int nPriority) +{ + switch(nPriority) + { + case THREAD_PRIORITY_TIME_CRITICAL: + return 0; + case THREAD_PRIORITY_HIGHEST: + return 1; + case THREAD_PRIORITY_ABOVE_NORMAL: + return 2; + case THREAD_PRIORITY_NORMAL: + return 3; + case THREAD_PRIORITY_BELOW_NORMAL: + return 4; + case THREAD_PRIORITY_LOWEST: + return 5; + case THREAD_PRIORITY_IDLE: + return 6; + default: + return 3; + } +} + +int IndexToPriority(int nIndex) +{ + switch(nIndex) + { + case 0: + return THREAD_PRIORITY_TIME_CRITICAL; + case 1: + return THREAD_PRIORITY_HIGHEST; + case 2: + return THREAD_PRIORITY_ABOVE_NORMAL; + case 3: + return THREAD_PRIORITY_NORMAL; + case 4: + return THREAD_PRIORITY_BELOW_NORMAL; + case 5: + return THREAD_PRIORITY_LOWEST; + case 6: + return THREAD_PRIORITY_IDLE; + default: + return THREAD_PRIORITY_NORMAL; + } +} + +int IndexToPriorityClass(int iIndex) +{ + switch(iIndex) + { + case 0: + return IDLE_PRIORITY_CLASS; + case 1: + return NORMAL_PRIORITY_CLASS; + case 2: + return HIGH_PRIORITY_CLASS; + case 3: + return REALTIME_PRIORITY_CLASS; + default: + return NORMAL_PRIORITY_CLASS; + } +} + +int PriorityClassToIndex(int iPriority) +{ + switch(iPriority) + { + case IDLE_PRIORITY_CLASS: + return 0; + case NORMAL_PRIORITY_CLASS: + return 1; + case HIGH_PRIORITY_CLASS: + return 2; + case REALTIME_PRIORITY_CLASS: + return 3; + default: + return 1; + } +} + +//////////////////////////////////////////////////////////////////////////// +// CTask members + +CTask::CTask(const TASK_CREATE_DATA *pCreateData) +{ + m_nCurrentIndex=0; + m_iLastProcessedIndex=-1; + m_nStatus=ST_NULL_STATUS; + m_bsSizes.m_uiDefaultSize=65536; + m_bsSizes.m_uiOneDiskSize=4194304; + m_bsSizes.m_uiTwoDisksSize=262144; + m_bsSizes.m_uiCDSize=262144; + m_bsSizes.m_uiLANSize=65536; + m_pThread=NULL; + m_nPriority=THREAD_PRIORITY_NORMAL; + m_nProcessed=0; + m_nAll=0; + m_pnTasksProcessed=pCreateData->pTasksProcessed; + m_pnTasksAll=pCreateData->pTasksAll; + m_bKill=false; + m_bKilled=true; + m_pcs=pCreateData->pcs; + m_pfnTaskProc=pCreateData->pfnTaskProc; + m_lTimeElapsed=0; + m_lLastTime=-1; + m_puiOperationsPending=pCreateData->puiOperationsPending; + m_bQueued=false; + m_ucCopies=1; + m_ucCurrentCopy=0; + m_files.Init(&m_clipboard); + m_uiResumeInterval=0; + m_plFinished=pCreateData->plFinished; + m_bForce=false; + m_bContinue=false; + m_bSaved=false; + + m_iIdentical=-1; + m_iDestinationLess=-1; + m_iDestinationGreater=-1; + m_iMissingInput=-1; + m_iOutputError=-1; + m_iMoveFile=-1; + + TCHAR xx[16]; + _itot(time(NULL), xx, 10); + m_strUniqueName=xx; +} + +CTask::~CTask() +{ + KillThread(); +} + +// m_clipboard +int CTask::AddClipboardData(CClipboardEntry* pEntry) +{ + m_cs.Lock(); + int retval=m_clipboard.Add(pEntry); + m_cs.Unlock(); + + return retval; +} + +CClipboardEntry* CTask::GetClipboardData(int nIndex) +{ + m_cs.Lock(); + CClipboardEntry* pEntry=m_clipboard.GetAt(nIndex); + m_cs.Unlock(); + + return pEntry; +} + +int CTask::GetClipboardDataSize() +{ + m_cs.Lock(); + int rv=m_clipboard.GetSize(); + m_cs.Unlock(); + + return rv; +} + +int CTask::ReplaceClipboardStrings(CString strOld, CString strNew) +{ + // small chars to make comparing case insensitive + strOld.MakeLower(); + + CString strText; + int iOffset; + int iCount=0; + m_cs.Lock(); + for (int i=0;iGetPath(); + strText.MakeLower(); + iOffset=strText.Find(strOld, 0); + if (iOffset != -1) + { + // found + strText=pEntry->GetPath(); + strText=strText.Left(iOffset)+strNew+strText.Mid(iOffset+strOld.GetLength()); + pEntry->SetPath(strText); + iCount++; + } + } + m_cs.Unlock(); + + return iCount; +} + +// m_files +int CTask::FilesAddDir(const CString strDirName, const CFiltersArray* pFilters, int iSrcIndex, + const bool bRecurse, const bool bIncludeDirs) +{ + // this uses much of memory, but resolves problem critical section hungs and m_bKill + CFileInfoArray fa; + fa.Init(&m_clipboard); + + fa.AddDir(strDirName, pFilters, iSrcIndex, bRecurse, bIncludeDirs, &m_bKill); + + m_cs.Lock(); + + m_files.Append(fa); + + m_cs.Unlock(); + + return 0; +} + +int CTask::FilesAdd(CFileInfo fi) +{ + int rv=-1; + m_cs.Lock(); + if (fi.IsDirectory() || m_afFilters.Match(fi)) + rv=m_files.Add(fi); + m_cs.Unlock(); + + return rv; +} + +CFileInfo CTask::FilesGetAt(int nIndex) +{ + m_cs.Lock(); + CFileInfo info=m_files.GetAt(nIndex); + m_cs.Unlock(); + + return info; +} + +CFileInfo CTask::FilesGetAtCurrentIndex() +{ + m_cs.Lock(); + CFileInfo info=m_files.GetAt(m_nCurrentIndex); + m_cs.Unlock(); + return info; +} + +void CTask::FilesRemoveAll() +{ + m_cs.Lock(); + m_files.RemoveAll(); + m_cs.Unlock(); +} + +int CTask::FilesGetSize() +{ + m_cs.Lock(); + int nSize=m_files.GetSize(); + m_cs.Unlock(); + + return nSize; +} + +// m_nCurrentIndex +void CTask::IncreaseCurrentIndex() +{ + m_cs.Lock(); + ++m_nCurrentIndex; + m_cs.Unlock(); +} + +int CTask::GetCurrentIndex() +{ + m_cs.Lock(); + int nIndex=m_nCurrentIndex; + m_cs.Unlock(); + + return nIndex; +} + +void CTask::SetCurrentIndex(int nIndex) +{ + m_cs.Lock(); + m_nCurrentIndex=nIndex; + m_cs.Unlock(); +} + +// m_strDestPath - adds '\\' +void CTask::SetDestPath(LPCTSTR lpszPath) +{ + m_dpDestPath.SetPath(lpszPath); +} + +// guaranteed '\\' +const CDestPath& CTask::GetDestPath() +{ + return m_dpDestPath; +} + +int CTask::GetDestDriveNumber() +{ + return m_dpDestPath.GetDriveNumber(); +} + +// m_nStatus +void CTask::SetStatus(UINT nStatus, UINT nMask) +{ + m_cs.Lock(); + m_nStatus &= ~nMask; + m_nStatus |= nStatus; + m_cs.Unlock(); +} + +UINT CTask::GetStatus(UINT nMask) +{ + m_cs.Lock(); + UINT nStatus=m_nStatus; + m_cs.Unlock(); + + return (nStatus & nMask); +} + +// m_nBufferSize +void CTask::SetBufferSizes(const BUFFERSIZES* bsSizes) +{ + m_cs.Lock(); + m_bsSizes=*bsSizes; + m_bSaved=false; + m_cs.Unlock(); +} + +const BUFFERSIZES* CTask::GetBufferSizes() +{ + m_cs.Lock(); + const BUFFERSIZES* pbsSizes=&m_bsSizes; + m_cs.Unlock(); + + return pbsSizes; +} + +int CTask::GetCurrentBufferIndex() +{ + int rv=0; + m_cs.Lock(); + int iSize=m_files.GetSize(); + if (iSize > 0 && m_nCurrentIndex != -1) + rv=m_bsSizes.m_bOnlyDefault ? 0 : m_files.GetAt((m_nCurrentIndex < iSize) ? m_nCurrentIndex : 0).GetBufferIndex(); + m_cs.Unlock(); + + return rv; +} + +// m_pThread +// m_nPriority +int CTask::GetPriority() +{ + m_cs.Lock(); + int nPriority=m_nPriority; + m_cs.Unlock(); + return nPriority; +} + +void CTask::SetPriority(int nPriority) +{ + m_cs.Lock(); + m_nPriority=nPriority; + m_bSaved=false; + if (m_pThread != NULL) + { + TRACE("Changing thread priority"); + m_pThread->SuspendThread(); + m_pThread->SetThreadPriority(nPriority); + m_pThread->ResumeThread(); + } + m_cs.Unlock(); +} + +// m_nProcessed +void CTask::IncreaseProcessedSize(__int64 nSize) +{ + m_cs.Lock(); + m_nProcessed+=nSize; + m_cs.Unlock(); +} + +void CTask::SetProcessedSize(__int64 nSize) +{ + m_cs.Lock(); + m_nProcessed=nSize; + m_cs.Unlock(); +} + +__int64 CTask::GetProcessedSize() +{ + m_cs.Lock(); + __int64 nSize=m_nProcessed; + m_cs.Unlock(); + + return nSize; +} + +// m_nAll +void CTask::SetAllSize(__int64 nSize) +{ + m_cs.Lock(); + m_nAll=nSize; + m_cs.Unlock(); +} + +__int64 CTask::GetAllSize() +{ + m_cs.Lock(); + __int64 nAll=m_nAll; + m_cs.Unlock(); + + return nAll; +} + +void CTask::CalcAllSize() +{ + m_cs.Lock(); + m_nAll=0; + + int nSize=m_files.GetSize(); + CFileInfo* pFiles=m_files.GetData(); + + for (int i=0;iLock(); + (*m_pnTasksProcessed)+=nSize; + m_pcs->Unlock(); +// m_cs.Unlock(); +} + +void CTask::DecreaseProcessedTasksSize(__int64 nSize) +{ +// m_cs.Lock(); + m_pcs->Lock(); + (*m_pnTasksProcessed)-=nSize; + m_pcs->Unlock(); +// m_cs.Unlock(); +} + +// m_pnTasksAll +void CTask::IncreaseAllTasksSize(__int64 nSize) +{ +// m_cs.Lock(); + m_pcs->Lock(); + (*m_pnTasksAll)+=nSize; + m_pcs->Unlock(); +// m_cs.Unlock(); +} + +void CTask::DecreaseAllTasksSize(__int64 nSize) +{ +// m_cs.Lock(); + m_pcs->Lock(); + (*m_pnTasksAll)-=nSize; + m_pcs->Unlock(); +// m_cs.Unlock(); +} + +// m_bKill +/*inline*/ void CTask::SetKillFlag(bool bKill) +{ + m_cs.Lock(); + m_bKill=bKill; + m_cs.Unlock(); +} + +bool CTask::GetKillFlag() +{ + m_cs.Lock(); + bool bKill=m_bKill; + m_cs.Unlock(); + + return bKill; +} + +// m_bKilled +/*inline*/ void CTask::SetKilledFlag(bool bKilled) +{ + m_cs.Lock(); + m_bKilled=bKilled; + m_cs.Unlock(); +} + +/*inline*/ bool CTask::GetKilledFlag() +{ + m_cs.Lock(); + bool bKilled=m_bKilled; + m_cs.Unlock(); + + return bKilled; +} + +// m_strUniqueName + +CString CTask::GetUniqueName() +{ + m_cs.Lock(); + CString name=m_strUniqueName; + m_cs.Unlock(); + + return name; +} + +void CTask::Load(CArchive& ar, bool bData) +{ + m_cs.Lock(); + try + { + if (bData) + { + m_clipboard.Serialize(ar, bData); + + m_files.Load(ar); + m_dpDestPath.Serialize(ar); + ar>>m_strUniqueName; + m_afFilters.Serialize(ar); + ar>>m_ucCopies; + } + else + { + int data; + unsigned long part; + + ar>>data; + m_nCurrentIndex=data; + ar>>data; + m_nStatus=data; + ar>>m_lOsError; + ar>>m_strErrorDesc; + m_bsSizes.Serialize(ar); + ar>>m_nPriority; + + ar>>part; + m_nAll=(static_cast(part) << 32); + ar>>part; + m_nAll|=part; + // czas + ar>>m_lTimeElapsed; + + ar>>part; + m_nProcessed=(static_cast(part) << 32); + ar>>part; + m_nProcessed|=part; + + ar>>m_ucCurrentCopy; + + m_clipboard.Serialize(ar, bData); + + unsigned char ucTmp; + ar>>ucTmp; + m_bSaved=ucTmp != 0; + } + } + catch(CException*) + { + m_cs.Unlock(); + throw; + } + m_cs.Unlock(); +} + +void CTask::Store(LPCTSTR lpszDirectory, bool bData) +{ + m_cs.Lock(); + if (!bData && m_bSaved) + { + m_cs.Unlock(); + TRACE("Saving locked - file not saved\n"); + return; + } + + if (!bData && !m_bSaved && ( (m_nStatus & ST_STEP_MASK) == ST_FINISHED || (m_nStatus & ST_STEP_MASK) == ST_CANCELLED + || (m_nStatus & ST_WORKING_MASK) == ST_PAUSED )) + { + TRACE("Last save - saving blocked\n"); + m_bSaved=true; + } + + try + { + CFile file(lpszDirectory+GetUniqueName()+( (bData) ? _T(".atd") : _T(".atp") ), CFile::modeWrite | CFile::modeCreate); + CArchive ar(&file, CArchive::store); + + if (bData) + { + m_clipboard.Serialize(ar, bData); + + if (GetStatus(ST_STEP_MASK) > ST_SEARCHING) + m_files.Store(ar); + else + ar<(0); + + m_dpDestPath.Serialize(ar); + ar<((m_nAll & 0xffffffff00000000) >> 32); + ar<(m_nAll & 0x00000000ffffffff); + ar<((m_nProcessed & 0xffffffff00000000) >> 32); + ar<(m_nProcessed & 0x00000000ffffffff); + ar<Delete(); + m_cs.Unlock(); + return; + } + m_cs.Unlock(); +} + +/*inline*/ void CTask::KillThread() +{ + if (!GetKilledFlag()) // protection from recalling Cleanup + { + SetKillFlag(); + while (!GetKilledFlag()) + Sleep(10); + + // cleanup + CleanupAfterKill(); + } +} + +void CTask::BeginProcessing() +{ + m_cs.Lock(); + if (m_pThread != NULL) + { + m_cs.Unlock(); + return; + } + m_cs.Unlock(); + + // create new thread + m_uiResumeInterval=0; // just in case + m_bSaved=false; // save + SetKillFlag(false); + SetKilledFlag(false); + CWinThread* pThread=AfxBeginThread(m_pfnTaskProc, this, GetPriority()); + + m_cs.Lock(); + m_pThread=pThread; + m_cs.Unlock(); +} + +void CTask::ResumeProcessing() +{ + // the same as retry but less demanding + if ( (GetStatus(ST_WORKING_MASK) & ST_PAUSED) && GetStatus(ST_STEP_MASK) != ST_FINISHED + && GetStatus(ST_STEP_MASK) != ST_CANCELLED) + { + SetStatus(0, ST_ERROR); + BeginProcessing(); + } +} + +bool CTask::RetryProcessing(bool bOnlyErrors/*=false*/, UINT uiInterval) +{ + // retry used to auto-resume, after loading + if ( (GetStatus(ST_WORKING_MASK) == ST_ERROR || (!bOnlyErrors && GetStatus(ST_WORKING_MASK) != ST_PAUSED)) + && GetStatus(ST_STEP_MASK) != ST_FINISHED && GetStatus(ST_STEP_MASK) != ST_CANCELLED) + { + if (uiInterval != 0) + { + m_uiResumeInterval+=uiInterval; + if (m_uiResumeInterval < (UINT)GetConfig()->GetIntValue(PP_CMAUTORETRYINTERVAL)) + return false; + else + m_uiResumeInterval=0; + } + + SetStatus(0, ST_ERROR); + BeginProcessing(); + return true; + } + return false; +} + +void CTask::RestartProcessing() +{ + KillThread(); + SetStatus(0, ST_ERROR); + SetStatus(ST_NULL_STATUS, ST_STEP_MASK); + m_lTimeElapsed=0; + SetCurrentIndex(0); + SetCurrentCopy(0); + BeginProcessing(); +} + +void CTask::PauseProcessing() +{ + if (GetStatus(ST_STEP_MASK) != ST_FINISHED && GetStatus(ST_STEP_MASK) != ST_CANCELLED) + { + KillThread(); + SetStatus(ST_PAUSED, ST_WORKING_MASK); + SetLastProcessedIndex(GetCurrentIndex()); + m_bSaved=false; + } +} + +void CTask::CancelProcessing() +{ + // change to ST_CANCELLED + if (GetStatus(ST_STEP_MASK) != ST_FINISHED) + { + KillThread(); + SetStatus(ST_CANCELLED, ST_STEP_MASK); + SetStatus(0, ST_ERROR); + m_bSaved=false; + } +} + +void CTask::GetMiniSnapshot(TASK_MINI_DISPLAY_DATA *pData) +{ + m_cs.Lock(); + if (m_nCurrentIndex >= 0 && m_nCurrentIndex < m_files.GetSize()) + pData->m_fi=m_files.GetAt(m_nCurrentIndex); + else + { + if (m_files.GetSize() > 0) + { + pData->m_fi=m_files.GetAt(0); + pData->m_fi.SetFilePath(pData->m_fi.GetFullFilePath()); + pData->m_fi.SetSrcIndex(-1); + } + else + { + if (m_clipboard.GetSize() > 0) + { + pData->m_fi.SetFilePath(m_clipboard.GetAt(0)->GetPath()); + pData->m_fi.SetSrcIndex(-1); + } + else + { + pData->m_fi.SetFilePath(GetResManager()->LoadString(IDS_NONEINPUTFILE_STRING)); + pData->m_fi.SetSrcIndex(-1); + } + } + } + + pData->m_uiStatus=m_nStatus; + + // percents + int iSize=m_files.GetSize()*m_ucCopies; + int iIndex=m_nCurrentIndex+m_ucCurrentCopy*m_files.GetSize(); + if (m_nAll != 0 && !((m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_CONTENT)) + pData->m_nPercent=static_cast( (static_cast(m_nProcessed)*100.0)/static_cast(m_nAll) ); + else + if (iSize != 0) + pData->m_nPercent=static_cast( static_cast(iIndex)*100.0/static_cast(iSize) ); + else + pData->m_nPercent=0; + + m_cs.Unlock(); +} + +void CTask::GetSnapshot(TASK_DISPLAY_DATA *pData) +{ + m_cs.Lock(); + if (m_nCurrentIndex >= 0 && m_nCurrentIndex < m_files.GetSize()) + pData->m_fi=m_files.GetAt(m_nCurrentIndex); + else + { + if (m_files.GetSize() > 0) + { + pData->m_fi=m_files.GetAt(0); + pData->m_fi.SetFilePath(pData->m_fi.GetFullFilePath()); + pData->m_fi.SetSrcIndex(-1); + } + else + { + if (m_clipboard.GetSize() > 0) + { + pData->m_fi.SetFilePath(m_clipboard.GetAt(0)->GetPath()); + pData->m_fi.SetSrcIndex(-1); + } + else + { + pData->m_fi.SetFilePath(GetResManager()->LoadString(IDS_NONEINPUTFILE_STRING)); + pData->m_fi.SetSrcIndex(-1); + } + } + } + + pData->m_pbsSizes=&m_bsSizes; + pData->m_nPriority=m_nPriority; + pData->m_pdpDestPath=&m_dpDestPath; + pData->m_pafFilters=&m_afFilters; + pData->m_dwOsErrorCode=m_lOsError; + pData->m_strErrorDesc=m_strErrorDesc; + pData->m_uiStatus=m_nStatus; + pData->m_iIndex=m_nCurrentIndex+m_ucCurrentCopy*m_files.GetSize(); + pData->m_iProcessedSize=m_nProcessed; + pData->m_iSize=m_files.GetSize()*m_ucCopies; + pData->m_iSizeAll=m_nAll; + pData->m_ucCurrentCopy=static_cast(m_ucCurrentCopy+1); // visual aspect + pData->m_ucCopies=m_ucCopies; + pData->m_pstrUniqueName=&m_strUniqueName; + + if (m_files.GetSize() > 0 && m_nCurrentIndex != -1) + pData->m_iCurrentBufferIndex=m_bsSizes.m_bOnlyDefault ? 0 : m_files.GetAt((m_nCurrentIndex < m_files.GetSize()) ? m_nCurrentIndex : 0).GetBufferIndex(); + else + pData->m_iCurrentBufferIndex=0; + + // percents + if (m_nAll != 0 && !((m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_CONTENT)) + pData->m_nPercent=static_cast( (static_cast(m_nProcessed)*100.0)/static_cast(m_nAll) ); + else + if (pData->m_iSize != 0) + pData->m_nPercent=static_cast( static_cast(pData->m_iIndex)*100.0/static_cast(pData->m_iSize) ); + else + pData->m_nPercent=0; + + // status string + // first + if ( (m_nStatus & ST_WORKING_MASK) == ST_ERROR ) + { + GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + } + else if ( (m_nStatus & ST_WORKING_MASK) == ST_PAUSED ) + { + GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + } + else if ( (m_nStatus & ST_STEP_MASK) == ST_FINISHED ) + { + GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + } + else if ( (m_nStatus & ST_WAITING_MASK) == ST_WAITING ) + { + GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + } + else if ( (m_nStatus & ST_STEP_MASK) == ST_CANCELLED ) + { + GetResManager()->LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + } + else + _tcscpy(pData->m_szStatusText, _T("")); + + // second part + if ( (m_nStatus & ST_STEP_MASK) == ST_DELETING ) + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+6)); + else if ( (m_nStatus & ST_STEP_MASK) == ST_SEARCHING ) + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+0)); + else if ((m_nStatus & ST_OPERATION_MASK) == ST_COPY ) + { + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+1)); + if (m_afFilters.GetSize()) + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_FILTERING_STRING)); + } + else if ( (m_nStatus & ST_OPERATION_MASK) == ST_MOVE ) + { + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+2)); + if (m_afFilters.GetSize()) + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_FILTERING_STRING)); + } + else + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+7)); + + // third part + if ( (m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_DIRS ) + { + _tcscat(pData->m_szStatusText, _T("/")); + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+10)); + } + if ( (m_nStatus & ST_SPECIAL_MASK) & ST_IGNORE_CONTENT ) + { + _tcscat(pData->m_szStatusText, _T("/")); + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_STATUS0_STRING+11)); + } + + // count of copies + if (m_ucCopies > 1) + { + _tcscat(pData->m_szStatusText, _T("/")); + TCHAR xx[4]; + _tcscat(pData->m_szStatusText, _itot(m_ucCopies, xx, 10)); + if (m_ucCopies < 5) + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_COPYWORDLESSFIVE_STRING)); + else + _tcscat(pData->m_szStatusText, GetResManager()->LoadString(IDS_COPYWORDMOREFOUR_STRING)); + } + + // time + UpdateTime(); + pData->m_lTimeElapsed=m_lTimeElapsed; + + m_cs.Unlock(); +} + +/*inline*/ void CTask::CleanupAfterKill() +{ + m_cs.Lock(); + m_pThread=NULL; + UpdateTime(); + m_lLastTime=-1; + m_cs.Unlock(); +} + +void CTask::DeleteProgress(LPCTSTR lpszDirectory) +{ + m_cs.Lock(); + DeleteFile(lpszDirectory+m_strUniqueName+_T(".atd")); + DeleteFile(lpszDirectory+m_strUniqueName+_T(".atp")); + DeleteFile(lpszDirectory+m_strUniqueName+_T(".log")); + m_cs.Unlock(); +} + +void CTask::SetOsErrorCode(DWORD dwError, LPCTSTR lpszErrDesc) +{ + m_cs.Lock(); + m_lOsError=dwError; + m_strErrorDesc=lpszErrDesc; + m_cs.Unlock(); +} + +void CTask::UpdateTime() +{ + m_cs.Lock(); + if (m_lLastTime != -1) + { + long lVal=time(NULL); + m_lTimeElapsed+=lVal-m_lLastTime; + m_lLastTime=lVal; + } + m_cs.Unlock(); +} + +void CTask::DecreaseOperationsPending(UINT uiBy) +{ + m_pcs->Lock(); + if (m_bQueued) + { + TRACE("Decreasing operations pending by %lu\n", uiBy); + (*m_puiOperationsPending)-=uiBy; + m_bQueued=false; + } + m_pcs->Unlock(); +} + +void CTask::IncreaseOperationsPending(UINT uiBy) +{ + TRACE("Trying to increase operations pending...\n"); + if (!m_bQueued) + { + TRACE("Increasing operations pending by %lu\n", uiBy); + m_pcs->Lock(); + (*m_puiOperationsPending)+=uiBy; + m_pcs->Unlock(); + m_bQueued=true; + } +} + +const CFiltersArray* CTask::GetFilters() +{ + return &m_afFilters; +} + +void CTask::SetFilters(const CFiltersArray* pFilters) +{ + m_cs.Lock(); + m_afFilters.Copy(*pFilters); + m_cs.Unlock(); +} + +bool CTask::CanBegin() +{ + bool bRet=true; + m_cs.Lock(); + if (GetContinueFlag() || GetForceFlag()) + { + TRACE("New operation Begins... continue: %d, force: %d\n", GetContinueFlag(), GetForceFlag()); + IncreaseOperationsPending(); + SetForceFlag(false); + SetContinueFlag(false); + } + else + bRet=false; + m_cs.Unlock(); + + return bRet; +} + +void CTask::SetCopies(unsigned char ucCopies) +{ + m_cs.Lock(); + m_ucCopies=ucCopies; + m_cs.Unlock(); +} + +unsigned char CTask::GetCopies() +{ + unsigned char ucCopies; + m_cs.Lock(); + ucCopies=m_ucCopies; + m_cs.Unlock(); + + return ucCopies; +} + +void CTask::SetCurrentCopy(unsigned char ucCopy) +{ + m_cs.Lock(); + m_ucCurrentCopy=ucCopy; + m_cs.Unlock(); +} + +unsigned char CTask::GetCurrentCopy() +{ + m_cs.Lock(); + unsigned char ucCopy=m_ucCurrentCopy; + m_cs.Unlock(); + + return ucCopy; +} + +void CTask::SetLastProcessedIndex(int iIndex) +{ + m_cs.Lock(); + m_iLastProcessedIndex=iIndex; + m_cs.Unlock(); +} + +int CTask::GetLastProcessedIndex() +{ + int iIndex; + m_cs.Lock(); + iIndex=m_iLastProcessedIndex; + m_cs.Unlock(); + + return iIndex; +} + +bool CTask::GetRequiredFreeSpace(__int64 *pi64Needed, __int64 *pi64Available) +{ + *pi64Needed=GetAllSize()-GetProcessedSize(); // it'd be nice to round up to take cluster size into consideration, + // but GetDiskFreeSpace returns flase values + + // get free space + if (!GetDynamicFreeSpace(GetDestPath().GetPath(), pi64Available, NULL)) + return true; + + return (*pi64Needed <= *pi64Available); +} + +void CTask::SetForceFlag(bool bFlag) +{ + m_cs.Lock(); + m_bForce=bFlag; + m_cs.Unlock(); +} + +bool CTask::GetForceFlag() +{ + return m_bForce; +} + +void CTask::SetContinueFlag(bool bFlag) +{ + m_cs.Lock(); + m_bContinue=bFlag; + m_cs.Unlock(); +} + +bool CTask::GetContinueFlag() +{ + return m_bContinue; +} + +CString CTask::GetLogName() +{ + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + return GetApp()->ExpandPath(szPath)+GetUniqueName()+_T(".log"); +} + +//////////////////////////////////////////////////////////////////////////////// +// CTaskArray members +void CTaskArray::Create(UINT (*pfnTaskProc)(LPVOID pParam)) +{ + m_tcd.pcs=&m_cs; + m_tcd.pfnTaskProc=pfnTaskProc; + m_tcd.pTasksAll=&m_uhRange; + m_tcd.pTasksProcessed=&m_uhPosition; + m_tcd.puiOperationsPending=&m_uiOperationsPending; + m_tcd.plFinished=&m_lFinished; +} + +CTaskArray::~CTaskArray() +{ +} + +int CTaskArray::GetSize( ) +{ + m_cs.Lock(); + int nSize=m_nSize; + m_cs.Unlock(); + + return nSize; +} + +int CTaskArray::GetUpperBound( ) +{ + m_cs.Lock(); + int upper=m_nSize; + m_cs.Unlock(); + + return upper-1; +} + +void CTaskArray::SetSize( int nNewSize, int nGrowBy ) +{ + m_cs.Lock(); + (static_cast*>(this))->SetSize(nNewSize, nGrowBy); + m_cs.Unlock(); +} + +CTask* CTaskArray::GetAt( int nIndex ) +{ + ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_cs.Lock(); + CTask* pTask=m_pData[nIndex]; + m_cs.Unlock(); + + return pTask; +} + +void CTaskArray::SetAt( int nIndex, CTask* newElement ) +{ + m_cs.Lock(); + ASSERT(nIndex >= 0 && nIndex < m_nSize); + m_uhRange-=m_pData[nIndex]->GetAllSize(); // subtract old element + m_pData[nIndex]=newElement; + m_uhRange+=m_pData[nIndex]->GetAllSize(); // add new + m_cs.Unlock(); +} + +int CTaskArray::Add( CTask* newElement ) +{ + m_cs.Lock(); + m_uhRange+=newElement->GetAllSize(); + m_uhPosition+=newElement->GetProcessedSize(); + int pos=(static_cast*>(this))->Add(newElement); + m_cs.Unlock(); + + return pos; +} + +void CTaskArray::RemoveAt(int nIndex, int nCount) +{ + m_cs.Lock(); + for (int i=nIndex;iKillThread(); + + m_uhRange-=pTask->GetAllSize(); + m_uhPosition-=pTask->GetProcessedSize(); + + delete pTask; + } + + // remove elements from array + (static_cast*>(this))->RemoveAt(nIndex, nCount); + m_cs.Unlock(); +} + +void CTaskArray::RemoveAll() +{ + m_cs.Lock(); + CTask* pTask; + + for (int i=0;iSetKillFlag(); // send an info about finishing + + // wait for finishing and get rid of it + for (i=0;iGetKilledFlag()) + Sleep(10); + + pTask->CleanupAfterKill(); + + m_uhRange-=pTask->GetAllSize(); + m_uhPosition-=pTask->GetProcessedSize(); + + // delete data + delete pTask; + } + + (static_cast*>(this))->RemoveAll(); + m_cs.Unlock(); +} + +void CTaskArray::RemoveAllFinished() +{ + m_cs.Lock(); + int i=GetSize(); + + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + while (i) + { + CTask* pTask=GetAt(i-1); + + // delete only when the thread is finished + if ( (pTask->GetStatus(ST_STEP_MASK) == ST_FINISHED || pTask->GetStatus(ST_STEP_MASK) == ST_CANCELLED) + && pTask->GetKilledFlag()) + { + m_uhRange-=pTask->GetAllSize(); + m_uhPosition-=pTask->GetProcessedSize(); + + // delete associated files + pTask->DeleteProgress(szPath); + + delete pTask; + + static_cast*>(this)->RemoveAt(i-1); + } + + --i; + } + + m_cs.Unlock(); +} + +void CTaskArray::RemoveFinished(CTask** pSelTask) +{ + m_cs.Lock(); + TCHAR szPath[_MAX_PATH]; + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + for (int i=0;iGetStatus(ST_STEP_MASK) == ST_FINISHED || pTask->GetStatus(ST_STEP_MASK) == ST_CANCELLED)) + { + // kill task if needed + pTask->KillThread(); + + m_uhRange-=pTask->GetAllSize(); + m_uhPosition-=pTask->GetProcessedSize(); + + // delete associated files + pTask->DeleteProgress(szPath); + + // delete data + delete pTask; + + static_cast*>(this)->RemoveAt(i); + + m_cs.Unlock(); + return; + } + } + m_cs.Unlock(); +} + +void CTaskArray::SaveData(LPCTSTR lpszDirectory) +{ + m_cs.Lock(); + for (int i=0;iStore(lpszDirectory, true); + m_cs.Unlock(); +} + +void CTaskArray::SaveProgress(LPCTSTR lpszDirectory) +{ + m_cs.Lock(); + for (int i=0;iStore(lpszDirectory, false); + m_cs.Unlock(); +} + +void CTaskArray::LoadDataProgress(LPCTSTR lpszDirectory) +{ + m_cs.Lock(); + CFileFind finder; + CTask* pTask; + + BOOL bWorking=finder.FindFile(CString(lpszDirectory)+_T("*.atd")); + while ( bWorking ) + { + bWorking=finder.FindNextFile(); + + // load data + pTask=new CTask(&m_tcd); + + try + { + CString strPath=finder.GetFilePath(); + + // load data file + CFile file(strPath, CFile::modeRead); + CArchive ar(&file, CArchive::load); + + pTask->Load(ar, true); + + ar.Close(); + file.Close(); + + // load progress file + strPath=strPath.Left(strPath.GetLength()-4); + strPath+=_T(".atp"); + CFile file2(strPath, CFile::modeRead); + CArchive ar2(&file2, CArchive::load); + + pTask->Load(ar2, false); + + ar2.Close(); + file2.Close(); + + // add read task to array + Add(pTask); + } + catch(CException* e) + { + e->Delete(); + delete pTask; + } + } + finder.Close(); + + m_cs.Unlock(); +} + +void CTaskArray::TasksBeginProcessing() +{ + for (int i=0;iBeginProcessing(); +} + +void CTaskArray::TasksPauseProcessing() +{ + for (int i=0;iPauseProcessing(); +} + +void CTaskArray::TasksResumeProcessing() +{ + for (int i=0;iResumeProcessing(); +} + +void CTaskArray::TasksRestartProcessing() +{ + for (int i=0;iRestartProcessing(); +} + +bool CTaskArray::TasksRetryProcessing(bool bOnlyErrors/*=false*/, UINT uiInterval) +{ + bool bChanged=false; + for (int i=0;iRetryProcessing(bOnlyErrors, uiInterval)) + bChanged=true; + } + + return bChanged; +} + +void CTaskArray::TasksCancelProcessing() +{ + for (int i=0;iCancelProcessing(); +} + +__int64 CTaskArray::GetPosition() +{ + m_cs.Lock(); + __int64 rv=m_uhPosition; + m_cs.Unlock(); + + return rv; +} + +__int64 CTaskArray::GetRange() +{ + m_cs.Lock(); + __int64 rv=m_uhRange; + m_cs.Unlock(); + + return rv; +} + +int CTaskArray::GetPercent() +{ + int pos; + m_cs.Lock(); + if (m_uhRange != 0) + pos=static_cast((static_cast(m_uhPosition)*100.0)/static_cast(m_uhRange)); + else + if (GetSize() != 0) // if anything is in an array, but size of it is 0 + pos=100; + else + pos=0; + m_cs.Unlock(); + + return pos; +} + +UINT CTaskArray::GetOperationsPending() +{ + m_cs.Lock(); + UINT uiOP=m_uiOperationsPending; + m_cs.Unlock(); + return uiOP; +} + +bool CTaskArray::IsFinished() +{ + bool bFlag=true; + UINT uiStatus; + + m_cs.Lock(); + if (m_uiOperationsPending != 0) + bFlag=false; + else + { + for (int i=0;iGetStatus(); + bFlag=((uiStatus & ST_STEP_MASK) == ST_FINISHED || (uiStatus & ST_STEP_MASK) == ST_CANCELLED + || (uiStatus & ST_WORKING_MASK) == ST_PAUSED + || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig()->GetBoolValue(PP_CMAUTORETRYONERROR))); + } + } + + m_cs.Unlock(); + return bFlag; +} + +/////////////////////////////////////////////////////////////////////// +// CProcessingException + +CProcessingException::CProcessingException(int iType, CTask* pTask, UINT uiFmtID, DWORD dwError, ...) +{ + // std values + m_iType=iType; + m_pTask=pTask; + m_dwError=dwError; + + // format some text + CString strFormat=GetResManager()->LoadString(uiFmtID); + ExpandFormatString(&strFormat, dwError); + + // get param list + va_list marker; + va_start(marker, dwError); + m_strErrorDesc.FormatV(strFormat, marker); + va_end(marker); +} + +void CProcessingException::Cleanup() +{ + TCHAR szPath[_MAX_PATH]; + switch (m_pTask->GetStatus(ST_STEP_MASK)) + { + case ST_NULL_STATUS: + case ST_SEARCHING: + // get rif of m_files contents + m_pTask->FilesRemoveAll(); + + // save state of a task + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + m_pTask->Store(szPath, true); + m_pTask->Store(szPath, false); + + m_pTask->SetKilledFlag(); + m_pTask->CleanupAfterKill(); + + break; + case ST_COPYING: + case ST_DELETING: + switch (m_iType) + { + case E_ERROR: + m_pTask->SetStatus(ST_ERROR, ST_WORKING_MASK); + m_pTask->SetOsErrorCode(m_dwError, this->m_strErrorDesc); + break; + case E_CANCEL: + m_pTask->SetStatus(ST_CANCELLED, ST_STEP_MASK); + break; + } + + GetConfig()->GetStringValue(PP_PAUTOSAVEDIRECTORY, szPath, _MAX_PATH); + GetApp()->ExpandPath(szPath); + m_pTask->Store(szPath, false); + + m_pTask->SetKilledFlag(); + m_pTask->CleanupAfterKill(); + + break; + } +} Index: Copy Handler/Structs.h =================================================================== diff -u --- Copy Handler/Structs.h (revision 0) +++ Copy Handler/Structs.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,420 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __STRUCTS_H__ +#define __STRUCTS_H__ + +#include "fileinfo.h" +#include "DestPath.h" +#include "DataBuffer.h" +#include "LogFile.h" + +#define ST_NULL_STATUS 0x00000000 + +#define ST_WRITE_MASK 0x000fffff + +//------------------------------------ +#define ST_STEP_MASK 0x000000ff +#define ST_SEARCHING 0x00000001 +#define ST_COPYING 0x00000002 +#define ST_DELETING 0x00000003 +#define ST_FINISHED 0x00000004 +#define ST_CANCELLED 0x00000005 + +//------------------------------------ +#define ST_OPERATION_MASK 0x00000f00 +#define ST_COPY 0x00000100 +// moving - delete after copying all files +#define ST_MOVE 0x00000200 + +//------------------------------------ +#define ST_SPECIAL_MASK 0x0000f000 +// simultaneous flags +#define ST_IGNORE_DIRS 0x00001000 +#define ST_IGNORE_CONTENT 0x00002000 +#define ST_FORCE_DIRS 0x00004000 + +//------------------------------------ +#define ST_WORKING_MASK 0x000f0000 +#define ST_ERROR 0x000C0000 +#define ST_PAUSED 0x00080000 + +//------------------------------------ +#define ST_WAITING_MASK 0x00f00000 +#define ST_WAITING 0x00100000 + + +///////////////////////////////////////////////////////////////////////////// +// priority + +int PriorityToIndex(int nPriority); +int IndexToPriority(int nIndex); +int IndexToPriorityClass(int iIndex); +int PriorityClassToIndex(int iPriority); + +/////////////////////////////////////////////////////////////////////////// +// Exceptions + +#define E_KILL_REQUEST 0x00 +#define E_ERROR 0x01 +#define E_CANCEL 0x02 + +///////////////////////////////////////////////////////////////////// +// CTask + +struct TASK_CREATE_DATA +{ + __int64 *pTasksProcessed; + __int64 *pTasksAll; + + UINT *puiOperationsPending; + LONG *plFinished; + + CCriticalSection* pcs; + + UINT (*pfnTaskProc)(LPVOID pParam); +}; + +// structure for gettings status of a task +struct TASK_DISPLAY_DATA +{ + CFileInfo m_fi; // fi at CurrIndex + int m_iCurrentBufferIndex; + int m_iIndex; + int m_iSize; + + CDestPath* m_pdpDestPath; + CFiltersArray* m_pafFilters; + + UINT m_uiStatus; + DWORD m_dwOsErrorCode; + CString m_strErrorDesc; + + const BUFFERSIZES* m_pbsSizes; + int m_nPriority; + + __int64 m_iProcessedSize; + __int64 m_iSizeAll; + int m_nPercent; + + long m_lTimeElapsed; + + unsigned char m_ucCurrentCopy; + unsigned char m_ucCopies; + + const CString* m_pstrUniqueName; // doesn't change from first setting + + TCHAR m_szStatusText[_MAX_PATH]; +}; + +struct TASK_MINI_DISPLAY_DATA +{ + CFileInfo m_fi; // fi at CurrIndex + + UINT m_uiStatus; + int m_nPercent; +}; + +class CTask +{ +public: + CTask(const TASK_CREATE_DATA *pCreateData); + ~CTask(); +public: + +// Attributes +public: + // m_clipboard + int AddClipboardData(CClipboardEntry* pEntry); + CClipboardEntry* GetClipboardData(int nIndex); + int GetClipboardDataSize(); + int ReplaceClipboardStrings(CString strOld, CString strNew); + + // m_files + int FilesAddDir(const CString strDirName, const CFiltersArray* pFilters, int iSrcIndex, + const bool bRecurse, const bool bIncludeDirs); + int FilesAdd(CFileInfo fi); + CFileInfo FilesGetAt(int nIndex); + CFileInfo FilesGetAtCurrentIndex(); + void FilesRemoveAll(); + int FilesGetSize(); + + // m_nCurrentIndex + void IncreaseCurrentIndex(); + int GetCurrentIndex(); + void SetCurrentIndex(int nIndex); + + // m_strDestPath + void SetDestPath(LPCTSTR lpszPath); + const CDestPath& GetDestPath(); + int GetDestDriveNumber(); + + // m_nStatus + void SetStatus(UINT nStatus, UINT nMask); + UINT GetStatus(UINT nMask=0xffffffff); + + // m_nBufferSize + void SetBufferSizes(const BUFFERSIZES* bsSizes); + const BUFFERSIZES* GetBufferSizes(); + int GetCurrentBufferIndex(); + + // m_pThread + // m_nPriority + int GetPriority(); + void SetPriority(int nPriority); + + // m_nProcessed + void IncreaseProcessedSize(__int64 nSize); + void SetProcessedSize(__int64 nSize); + __int64 GetProcessedSize(); + + // m_nAll + void SetAllSize(__int64 nSize); + __int64 GetAllSize(); + void CalcAllSize(); + + // m_pnTasksProcessed + void IncreaseProcessedTasksSize(__int64 nSize); + void DecreaseProcessedTasksSize(__int64 nSize); + + // m_pnTasksAll + void IncreaseAllTasksSize(__int64 nSize); + void DecreaseAllTasksSize(__int64 nSize); + + // m_bKill + void SetKillFlag(bool bKill=true); + bool GetKillFlag(); + + // m_bKilled + void SetKilledFlag(bool bKilled=true); + bool GetKilledFlag(); + + void KillThread(); + void CleanupAfterKill(); + + // m_strUniqueName + CString GetUniqueName(); + + void Load(CArchive& ar, bool bData); + void Store(LPCTSTR lpszDirectory, bool bData); + + void BeginProcessing(); + + void PauseProcessing(); // pause + void ResumeProcessing(); // resume + bool RetryProcessing(bool bOnlyErrors=false, UINT uiInterval=0); // retry + void RestartProcessing(); // from beginning + void CancelProcessing(); // cancel + + void GetSnapshot(TASK_DISPLAY_DATA *pData); + void GetMiniSnapshot(TASK_MINI_DISPLAY_DATA *pData); + + void DeleteProgress(LPCTSTR lpszDirectory); + + void SetOsErrorCode(DWORD dwError, LPCTSTR lpszErrDesc); + void CalcProcessedSize(); + + void DecreaseOperationsPending(UINT uiBy=1); + void IncreaseOperationsPending(UINT uiBy=1); + + bool CanBegin(); + + void UpdateTime(); + + void SetFilters(const CFiltersArray* pFilters); + const CFiltersArray* GetFilters(); + + void SetCopies(unsigned char ucCopies); + unsigned char GetCopies(); + void SetCurrentCopy(unsigned char ucCopy); + unsigned char GetCurrentCopy(); + + CClipboardArray* GetClipboard() { return &m_clipboard; }; + + void SetLastProcessedIndex(int iIndex); + int GetLastProcessedIndex(); + + CString GetLogName(); + + bool GetRequiredFreeSpace(__int64 *pi64Needed, __int64 *pi64Available); + +// Implementation +protected: + CClipboardArray m_clipboard; + CFileInfoArray m_files; + volatile int m_nCurrentIndex; + int m_iLastProcessedIndex; + + CDestPath m_dpDestPath; + + volatile UINT m_nStatus; + + // info about last error + DWORD m_lOsError; + CString m_strErrorDesc; + + // buffers + BUFFERSIZES m_bsSizes; + + CWinThread *m_pThread; + int m_nPriority; + + __int64 m_nProcessed; + __int64 m_nAll; + + __int64 *m_pnTasksProcessed; + __int64 *m_pnTasksAll; + + bool m_bQueued; // has operations pending for this task been increased ? + UINT *m_puiOperationsPending; + + volatile bool m_bKill; + volatile bool m_bKilled; + + // other stuff + CString m_strUniqueName; + + // mask (filter) + CFiltersArray m_afFilters; + + // copiees count + unsigned char m_ucCopies; + unsigned char m_ucCurrentCopy; + + bool m_bSaved; // has the state been saved ('til next modification) + +public: + UINT m_uiResumeInterval; // works only if the thread is off + // time + long m_lTimeElapsed; // store + long m_lLastTime; // not store + + // feedback + int m_iIdentical; + int m_iDestinationLess; + int m_iDestinationGreater; + int m_iMissingInput; + int m_iOutputError; + int m_iMoveFile; + + // ptr to count of currently started tasks + LONG* m_plFinished; + bool m_bForce; // if the continuation of tasks should be independent of limitation + bool m_bContinue; // used by ClipboardMonitorProc + +protected: + CCriticalSection* m_pcs; // protects *m_pnTasksProcessed & *m_pnTasksAll from external array + + UINT (*m_pfnTaskProc)(LPVOID pParam); // external function that processes this task +public: + void SetForceFlag(bool bFlag=true); + bool GetForceFlag(); + void SetContinueFlag(bool bFlag=true); + bool GetContinueFlag(); + + CLogFile m_log; + CCriticalSection m_cs; // protection for this class +}; + +/////////////////////////////////////////////////////////////////////////// +// CTaskArray + +class CTaskArray : public CArray +{ +public: + CTaskArray() : CArray() { m_uhRange=0; m_uhPosition=0; m_uiOperationsPending=0; m_lFinished=0; }; + ~CTaskArray(); + + void Create(UINT (*pfnTaskProc)(LPVOID pParam)); + + int GetSize( ); + int GetUpperBound( ); + void SetSize( int nNewSize, int nGrowBy = -1 ); + + CTask* GetAt( int nIndex ); + void SetAt( int nIndex, CTask* newElement ); + int Add( CTask* newElement ); + + void RemoveAt( int nIndex, int nCount = 1 ); + void RemoveAll(); + void RemoveAllFinished(); + void RemoveFinished(CTask** pSelTask); + + void SaveData(LPCTSTR lpszDirectory); + void SaveProgress(LPCTSTR lpszDirectory); + void LoadDataProgress(LPCTSTR lpszDirectory); + + void TasksBeginProcessing(); + void TasksPauseProcessing(); + void TasksResumeProcessing(); + void TasksRestartProcessing(); + bool TasksRetryProcessing(bool bOnlyErrors=false, UINT uiInterval=0); + void TasksCancelProcessing(); + + __int64 GetPosition(); + __int64 GetRange(); + int GetPercent(); + + UINT GetOperationsPending(); + void SetLimitOperations(UINT uiLimit); + UINT GetLimitOperations(); + + bool IsFinished(); + +public: + __int64 m_uhRange, m_uhPosition; + + UINT m_uiOperationsPending; // count of current operations + LONG m_lFinished; // count of finished tasks + + CCriticalSection m_cs; + TASK_CREATE_DATA m_tcd; +}; + +/////////////////////////////////////////////////////////////////////////// +// CLIPBOARDMONITORDATA + +struct CLIPBOARDMONITORDATA +{ + HWND m_hwnd; // hwnd to window + CTaskArray *m_pTasks; + + volatile bool bKill, bKilled; +}; + +/////////////////////////////////////////////////////////////////////////// +// CProcessingException + +class CProcessingException +{ +public: + CProcessingException(int iType, CTask* pTask) { m_iType=iType; m_pTask=pTask; m_dwError=0; }; + CProcessingException(int iType, CTask* pTask, UINT uiFmtID, DWORD dwError, ...); + void Cleanup(); + +// Implementation +public: + int m_iType; // kill request, error, ... + CTask* m_pTask; + + CString m_strErrorDesc; + DWORD m_dwError; +}; + +#endif \ No newline at end of file Index: Copy Handler/Theme Helpers.cpp =================================================================== diff -u --- Copy Handler/Theme Helpers.cpp (revision 0) +++ Copy Handler/Theme Helpers.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,105 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "Theme Helpers.h" + + +CUxThemeSupport::CUxThemeSupport() +{ + m_hThemesDll=LoadLibrary(_T("UxTheme.dll")); +} + +CUxThemeSupport::~CUxThemeSupport() +{ + if (m_hThemesDll) + FreeLibrary(m_hThemesDll); +} + +HTHEME CUxThemeSupport::OpenThemeData(HWND hwnd, LPCWSTR pszClassList) +{ + ASSERT(m_hThemesDll); + + PFNOPENTHEMEDATA pfnProc=(PFNOPENTHEMEDATA)GetProcAddress(m_hThemesDll, _T("OpenThemeData")); + + if (pfnProc) + return (*pfnProc)(hwnd, pszClassList); + else + return NULL; +} + +HRESULT CUxThemeSupport::CloseThemeData(HTHEME hTheme) +{ + ASSERT(m_hThemesDll); + + PFNCLOSETHEMEDATA pfnProc=(PFNCLOSETHEMEDATA)GetProcAddress(m_hThemesDll, _T("CloseThemeData")); + + if (pfnProc) + return (*pfnProc)(hTheme); + else + return E_UNEXPECTED; +} + +HRESULT CUxThemeSupport::DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect) +{ + ASSERT(m_hThemesDll); + + PFNDRAWTHEMEEDGE pfnProc=(PFNDRAWTHEMEEDGE)GetProcAddress(m_hThemesDll, _T("DrawThemeEdge")); + + if (pfnProc) + return (*pfnProc)(hTheme, hdc, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect); + else + return E_UNEXPECTED; +} + +HRESULT CUxThemeSupport::DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect) +{ + ASSERT(m_hThemesDll); + + PFNDRAWTHEMEBACKGROUND pfnProc=(PFNDRAWTHEMEBACKGROUND)GetProcAddress(m_hThemesDll, _T("DrawThemeBackground")); + + if (pfnProc) + return (*pfnProc)(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); + else + return E_UNEXPECTED; +} + +HRESULT CUxThemeSupport::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc) +{ + ASSERT(m_hThemesDll); + + PFNDRAWTHEMEPARENTBACKGROUND pfnProc=(PFNDRAWTHEMEPARENTBACKGROUND)GetProcAddress(m_hThemesDll, _T("DrawThemeParentBackground")); + + if (pfnProc) + return (*pfnProc)(hwnd, hdc, prc); + else + return E_UNEXPECTED; +} + +BOOL CUxThemeSupport::IsAppThemed() +{ + ASSERT(m_hThemesDll); + + PFNISAPPTHEMED pfnProc=(PFNISAPPTHEMED)GetProcAddress(m_hThemesDll, _T("IsAppThemed")); + + if (pfnProc) + return (*pfnProc)(); + else + return FALSE; +} Index: Copy Handler/Theme Helpers.h =================================================================== diff -u --- Copy Handler/Theme Helpers.h (revision 0) +++ Copy Handler/Theme Helpers.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,173 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __THEME_SUPPORT__ +#define __THEME_SUPPORT__ + +// definicja HTHEME - podobna do tej z UxTheme...h +#ifndef HTHEME +#define HTHEME HANDLE +#endif + +typedef HTHEME(_stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); +typedef HRESULT(_stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme); +typedef HRESULT(_stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect); +typedef HRESULT(_stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect); +typedef HRESULT(_stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc, RECT* prc); +typedef BOOL(_stdcall *PFNISAPPTHEMED)(); + +class CUxThemeSupport +{ +public: + CUxThemeSupport(); + ~CUxThemeSupport(); + + HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList); + HRESULT CloseThemeData(HTHEME hTheme); + + bool IsThemeSupported() { return m_hThemesDll != NULL; }; + BOOL IsAppThemed(); + + HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect); + + HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect); + HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc); + +/* HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect); + +THEMEAPI GetThemeBackgroundContentRect(HTHEME hTheme, OPTIONAL HDC hdc, + int iPartId, int iStateId, const RECT *pBoundingRect, + OUT RECT *pContentRect); + +THEMEAPI GetThemeBackgroundExtent(HTHEME hTheme, OPTIONAL HDC hdc, + int iPartId, int iStateId, const RECT *pContentRect, + OUT RECT *pExtentRect); + +THEMEAPI GetThemeTextMetrics(HTHEME hTheme, OPTIONAL HDC hdc, + int iPartId, int iStateId, OUT TEXTMETRIC* ptm); + +THEMEAPI GetThemeBackgroundRegion(HTHEME hTheme, OPTIONAL HDC hdc, + int iPartId, int iStateId, const RECT *pRect, OUT HRGN *pRegion); + +THEMEAPI HitTestThemeBackground(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, + int iStateId, DWORD dwOptions, const RECT *pRect, OPTIONAL HRGN hrgn, + POINT ptTest, OUT WORD *pwHitTestCode); + +THEMEAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, + const RECT *pDestRect, UINT uEdge, UINT uFlags, OPTIONAL OUT RECT *pContentRect); + +THEMEAPI DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, + int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex); + +THEMEAPI_(BOOL) IsThemePartDefined(HTHEME hTheme, int iPartId, + int iStateId); + +THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, + int iPartId, int iStateId); + +THEMEAPI GetThemeColor(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT COLORREF *pColor); + +THEMEAPI GetThemeMetric(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, + int iStateId, int iPropId, OUT int *piVal); + +THEMEAPI GetThemeString(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars); + +THEMEAPI GetThemeBool(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT BOOL *pfVal); + +THEMEAPI GetThemeInt(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT int *piVal); + +THEMEAPI GetThemeEnumValue(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT int *piVal); + +THEMEAPI GetThemePosition(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT POINT *pPoint); + +THEMEAPI GetThemeFont(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, + int iStateId, int iPropId, OUT LOGFONT *pFont); + +THEMEAPI GetThemeRect(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT RECT *pRect); + +THEMEAPI GetThemeMargins(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, + int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins); + +THEMEAPI GetThemeIntList(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT INTLIST *pIntList); + +THEMEAPI GetThemePropertyOrigin(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin); + +THEMEAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, + LPCWSTR pszSubIdList); + +THEMEAPI GetThemeFilename(HTHEME hTheme, int iPartId, + int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars); + +THEMEAPI_(COLORREF) GetThemeSysColor(HTHEME hTheme, int iColorId); + +THEMEAPI_(HBRUSH) GetThemeSysColorBrush(HTHEME hTheme, int iColorId); + +THEMEAPI_(BOOL) GetThemeSysBool(HTHEME hTheme, int iBoolId); + +THEMEAPI_(int) GetThemeSysSize(HTHEME hTheme, int iSizeId); + +THEMEAPI GetThemeSysFont(HTHEME hTheme, int iFontId, OUT LOGFONT *plf); + +THEMEAPI GetThemeSysString(HTHEME hTheme, int iStringId, + OUT LPWSTR pszStringBuff, int cchMaxStringChars); + +THEMEAPI GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue); + +THEMEAPI_(BOOL) IsThemeActive(); + + +THEMEAPI_(HTHEME) GetWindowTheme(HWND hwnd); + + +THEMEAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); + + +THEMEAPI_(BOOL) IsThemeDialogTextureEnabled(HWND hwnd); + +THEMEAPI_(DWORD) GetThemeAppProperties(); + +THEMEAPI_(void) SetThemeAppProperties(DWORD dwFlags); + +THEMEAPI GetCurrentThemeName( + OUT LPWSTR pszThemeFileName, int cchMaxNameChars, + OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, + OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars); + +THEMEAPI GetThemeDocumentationProperty(LPCWSTR pszThemeName, + LPCWSTR pszPropertyName, OUT LPWSTR pszValueBuff, int cchMaxValChars); + +THEMEAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, OPTIONAL RECT* prc); + +THEMEAPI EnableTheming(BOOL fEnable); +*/ +protected: + + HMODULE m_hThemesDll; +}; + +#endif Index: Copy Handler/ThemedButton.cpp =================================================================== diff -u --- Copy Handler/ThemedButton.cpp (revision 0) +++ Copy Handler/ThemedButton.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,142 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "ThemedButton.h" +#include "MemDC.h" +#include "Theme helpers.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CThemedButton + +// undefine this if use some internal windows files +#define TP_BUTTON 1 +#define TS_NORMAL 1 +#define TS_HOT 2 +#define TS_PRESSED 3 +#define TS_DISABLED 4 +#define TS_CHECKED 5 +#define TS_HOTCHECKED 6 + +CThemedButton::CThemedButton() +{ + m_bHovering=false; + m_iIndex=-1; + m_pilList=NULL; +} + +CThemedButton::~CThemedButton() +{ +} + + +BEGIN_MESSAGE_MAP(CThemedButton, CButton) + //{{AFX_MSG_MAP(CThemedButton) + ON_WM_MOUSEMOVE() + ON_WM_ERASEBKGND() + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CThemedButton message handlers + +void CThemedButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) +{ + CDC* pDC=CDC::FromHandle(lpDrawItemStruct->hDC); + CMemDC memdc(pDC, &lpDrawItemStruct->rcItem); + + bool bPushed=(lpDrawItemStruct->itemState & ODS_SELECTED); + CRect rcItem=lpDrawItemStruct->rcItem; + + // draw button's frame + CUxThemeSupport uxTheme; + if (uxTheme.IsThemeSupported() && uxTheme.IsAppThemed()) + { + HTHEME ht=uxTheme.OpenThemeData(lpDrawItemStruct->hwndItem, L"TOOLBAR"); + + uxTheme.DrawThemeParentBackground(lpDrawItemStruct->hwndItem, memdc.GetSafeHdc(), &rcItem); + uxTheme.DrawThemeBackground(ht, memdc.GetSafeHdc(), TP_BUTTON, bPushed ? TS_PRESSED : (m_bHovering ? TS_HOT : TS_NORMAL), &rcItem, NULL); + + uxTheme.CloseThemeData(ht); + } + else + DrawFrameControl(memdc.GetSafeHdc(), &rcItem, DFC_BUTTON, DFCS_ADJUSTRECT | DFCS_BUTTONPUSH | (bPushed ? DFCS_PUSHED : 0)); + + ASSERT(m_pilList); // make sure the image list exist + + int cx=16, cy=16; + ImageList_GetIconSize(m_pilList->m_hImageList, &cx, &cy); + + CRect rcBtn; + GetClientRect(&rcBtn); + m_pilList->Draw(&memdc, m_iIndex, CPoint( ((rcBtn.Width()-cx)/2)+(bPushed ? 1 : 0), (rcBtn.Height()-cy)/2+(bPushed ? 1 : 0)), ILD_TRANSPARENT); +} + +void CThemedButton::OnMouseMove(UINT nFlags, CPoint point) +{ + if (!m_bHovering) + { + TRACKMOUSEEVENT tme; + tme.cbSize=sizeof(TRACKMOUSEEVENT); + tme.dwFlags=TME_LEAVE; + tme.dwHoverTime=0; + tme.hwndTrack=this->GetSafeHwnd(); + + ::_TrackMouseEvent(&tme); + + m_bHovering=true; + Invalidate(); + } + + CButton::OnMouseMove(nFlags, point); +} + +LRESULT CThemedButton::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + switch(message) + { + case WM_LBUTTONDBLCLK: + message=WM_LBUTTONDOWN; + break; + case WM_MOUSELEAVE: + m_bHovering=false; + Invalidate(); + break; + } + + return CButton::WindowProc(message, wParam, lParam); +} + +BOOL CThemedButton::OnEraseBkgnd(CDC* /*pDC*/) +{ + return FALSE;/*CButton::OnEraseBkgnd(pDC);*/ +} + +void CThemedButton::SetImage(CImageList *pImgList, int iIndex) +{ + m_pilList=pImgList; + m_iIndex=iIndex; +} Index: Copy Handler/ThemedButton.h =================================================================== diff -u --- Copy Handler/ThemedButton.h (revision 0) +++ Copy Handler/ThemedButton.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,72 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __THEMEDBUTTON_H__ +#define __THEMEDBUTTON_H__ + +///////////////////////////////////////////////////////////////////////////// +// CThemedButton window + +class CThemedButton : public CButton +{ +// Construction +public: + CThemedButton(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CThemedButton) + public: + virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); + protected: + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + //}}AFX_VIRTUAL + +// Implementation +public: + void SetImage(CImageList *pImgList, int iIndex); + virtual ~CThemedButton(); + + // Generated message map functions +protected: + bool m_bHovering; + + CImageList* m_pilList; + int m_iIndex; + + //{{AFX_MSG(CThemedButton) + afx_msg void OnMouseMove(UINT nFlags, CPoint point); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + //}}AFX_MSG + + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/btnIDs.h =================================================================== diff -u --- Copy Handler/btnIDs.h (revision 0) +++ Copy Handler/btnIDs.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,36 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __BUTTON_IDENTIFIERS_H__ +#define __BUTTON_IDENTIFIERS_H__ + +#define ID_IGNORE 0x10 +#define ID_IGNOREALL 0x11 +#define ID_COPYREST 0x12 +#define ID_COPYRESTALL 0x13 +#define ID_RECOPY 0x14 +#define ID_RECOPYALL 0x15 +#define ID_REFRESHENTRY 0x16 +#define ID_REFRESHENTRYALL 0x17 +#define ID_WAIT 0x18 +#define ID_RETRY 0x19 +#define ID_YESALL 0x1a +#define ID_NOALL 0x1b + +#endif \ No newline at end of file Index: Copy Handler/register.cpp =================================================================== diff -u --- Copy Handler/register.cpp (revision 0) +++ Copy Handler/register.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,57 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "register.h" +#include "objbase.h" + +DWORD RegisterShellExtDll(LPCTSTR lpszPath, bool bRegister) +{ + DWORD dwErr=0; + CoInitialize(NULL); + + HINSTANCE hMod=LoadLibrary(lpszPath); // load the dll + if (hMod != NULL) + { + HRESULT (STDAPICALLTYPE *pfn)(void); + + (FARPROC&)pfn = GetProcAddress(hMod, (bRegister ? _T("DllRegisterServer") : _T("DllUnregisterServer"))); + if (pfn == NULL || (*pfn)() != S_OK) + { + dwErr=GetLastError(); + CoFreeLibrary(hMod); + CoUninitialize(); + return dwErr; + } + else + { + CoFreeLibrary(hMod); + + // shut down the COM Library. + CoUninitialize(); + return 0; + } + } + else + { + dwErr=GetLastError(); + CoUninitialize(); + return dwErr; + } +} Index: Copy Handler/register.h =================================================================== diff -u --- Copy Handler/register.h (revision 0) +++ Copy Handler/register.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __REGISTER_H__ +#define __REGISTER_H__ + +DWORD RegisterShellExtDll(LPCTSTR lpszPath, bool bRegister); + +#endif \ No newline at end of file Index: Copy Handler/res/COPY HANDLER.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/COPY HANDLER.rc2 =================================================================== diff -u --- Copy Handler/res/COPY HANDLER.rc2 (revision 0) +++ Copy Handler/res/COPY HANDLER.rc2 (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,13 @@ +// +// SYSTEMTRAY.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// Index: Copy Handler/res/Manifest.txt =================================================================== diff -u --- Copy Handler/res/Manifest.txt (revision 0) +++ Copy Handler/res/Manifest.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,22 @@ + + + +Program for copying files/folders in all 32-bit Windows systems + + + + + + Index: Copy Handler/res/Thanks.txt =================================================================== diff -u --- Copy Handler/res/Thanks.txt (revision 0) +++ Copy Handler/res/Thanks.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,18 @@ +[Program] +El Magico great ideas, beta-tests, ... + +[Home page] +Tomas S. Refsland page hosting, other help +Barnaba webmaster + +[Language packs] +%s + +[Additional software] +Markus Oberhumer & Laszlo Molnar UPX software +Antonio Tejada Lacaci CFileInfoArray +Keith Rule CMemDC +Brett R. Mitchell CPropertyListCtrl + +[Other] +Thanks for anybody that helped in any way... \ No newline at end of file Index: Copy Handler/res/addshort.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/cancelled.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/cd.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/delshort.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/err.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/error.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/finished.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/folder.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/hd.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/hd2.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/info.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/large.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/list.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/main_toolbar.bmp =================================================================== diff -u Binary files differ Index: Copy Handler/res/net.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/newdir.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/paused.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/question.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/report.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/shut.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/small.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/tribe.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/waiting.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/warning.ico =================================================================== diff -u Binary files differ Index: Copy Handler/res/working.ico =================================================================== diff -u Binary files differ Index: Copy Handler/resource.h =================================================================== diff -u --- Copy Handler/resource.h (revision 0) +++ Copy Handler/resource.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,641 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by Copy Handler.rc +// +#define IDR_MANIFEST 1 +#define RT_TEXT 25 +#define IDD_ABOUTBOX 100 +#define IDR_MAINFRAME 128 +#define IDR_SYSTEMTYPE 129 +#define IDR_POPUP_MENU 130 +#define IDD_STATUS_DIALOG 131 +#define IDR_PRIORITY_MENU 135 +#define IDR_BUFFERSIZE_MENU 136 +#define IDD_BUFFERSIZE_DIALOG 137 +#define IDR_PAUSE_LIST_MENU 138 +#define IDI_ERROR_ICON 139 +#define IDI_WORKING_ICON 140 +#define IDI_PAUSED_ICON 141 +#define IDI_FINISHED_ICON 142 +#define IDI_CANCELLED_ICON 143 +#define IDD_OPTIONS_DIALOG 144 +#define IDD_MINIVIEW_DIALOG 145 +#define IDI_WAITING_ICON 146 +#define IDD_CUSTOM_COPY_DIALOG 149 +#define IDD_FOLDER_BROWSING_DIALOG 150 +#define IDD_NEW_FOLDER_DIALOG 151 +#define IDD_NEW_QUICK_ACCESS_DIALOG 152 +#define IDR_ADVANCED_MENU 160 +#define IDD_REPLACE_PATHS_DIALOG 161 +#define IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 162 +#define IDI_QUESTION_ICON 163 +#define IDD_FEEDBACK_REPLACE_FILES_DIALOG 164 +#define IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 165 +#define IDD_FEEDBACK_DSTFILE_DIALOG 167 +#define IDR_POPUP_TOOLBAR 170 +#define IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 173 +#define IDI_INFO_ICON 175 +#define IDI_ERR_ICON 176 +#define IDI_WARNING_ICON 177 +#define IDD_SHUTDOWN_DIALOG 182 +#define IDI_SHUTDOWN_ICON 185 +#define IDI_NET_ICON 186 +#define IDI_HDD_ICON 188 +#define IDI_CD_ICON 189 +#define IDI_HDD2_ICON 190 +#define IDI_TRIBE_ICON 191 +#define IDI_FOLDER_ICON 192 +#define IDD_FILTER_DIALOG 195 +#define IDI_ADDSHORTCUT_ICON 198 +#define IDI_DELETESHORTCUT_ICON 199 +#define IDI_LARGEICONS_ICON 200 +#define IDI_LIST_ICON 201 +#define IDI_NEWFOLDER_ICON 202 +#define IDI_REPORT_ICON 203 +#define IDI_SMALLICONS_ICON 204 +#define IDD_SHORTCUTEDIT_DIALOG 208 +#define IDD_RECENTEDIT_DIALOG 209 +#define IDC_ABOUTBOX 210 +#define IDR_THANKS_TEXT 211 +#define IDC_PROGRAM_STATIC 1000 +#define IDC_ADDFILE_BUTTON 1002 +#define IDC_STATUS_LIST 1003 +#define IDC_REMOVEFILEFOLDER_BUTTON 1004 +#define IDC_ALL_PROGRESS 1005 +#define IDC_DESTPATH_EDIT 1006 +#define IDC_TASK_PROGRESS 1007 +#define IDC_DESTBROWSE_BUTTON 1008 +#define IDC_OPERATION_COMBO 1009 +#define IDC_FILTERS_LIST 1010 +#define IDC_ADDDIR_BUTTON 1011 +#define IDC_BUFFERSIZES_LIST 1012 +#define IDC_SET_BUFFERSIZE_BUTTON 1013 +#define IDC_FILTERS_CHECK 1014 +#define IDC_IGNOREFOLDERS_CHECK 1015 +#define IDC_SET_PRIORITY_BUTTON 1016 +#define IDC_ONLYSTRUCTURE_CHECK 1017 +#define IDC_PAUSE_BUTTON 1018 +#define IDC_STANDARD_CHECK 1019 +#define IDC_FORCEDIRECTORIES_CHECK 1020 +#define IDC_RESUME_BUTTON 1021 +#define IDC_CANCEL_BUTTON 1022 +#define IDC_ADVANCED_CHECK 1023 +#define IDC_BUFFERSIZES_BUTTON 1024 +#define IDC_ADDFILTER_BUTTON 1025 +#define IDC_REMOVEFILTER_BUTTON 1026 +#define IDC_SOURCE_STATIC 1027 +#define IDC_DESTINATION_STATIC 1028 +#define IDC_OPERATION_STATIC 1029 +#define IDC_BUFFERSIZE_STATIC 1030 +#define IDC_PRIORITY_STATIC 1031 +#define IDC_ERRORS_STATIC 1032 +#define IDC_PROGRESS_STATIC 1033 +#define IDC_TRANSFER_STATIC 1034 +#define IDC_OVERALL_PROGRESS_STATIC 1035 +#define IDC_OVERALL_TRANSFER_STATIC 1036 +#define IDC_TIME_STATIC 1037 +#define IDC_ROLL_UNROLL_BUTTON 1038 +#define IDC_SIZE_EDIT 1039 +#define IDC_ASSOCIATEDFILES__STATIC 1040 +#define IDC_START_ALL_BUTTON 1041 +#define IDC_RESTART_BUTTON 1042 +#define IDC_DELETE_BUTTON 1043 +#define IDC_PAUSE_ALL_BUTTON 1044 +#define IDC_RESTART_ALL_BUTTON 1045 +#define IDC_CANCEL_ALL_BUTTON 1046 +#define IDC_REMOVE_FINISHED_BUTTON 1047 +#define IDC_PROPERTIES_LIST 1048 +#define IDC_PROGRESS_LIST 1049 +#define IDC_SOURCE_EDIT 1050 +#define IDC_DESTINATION_EDIT 1051 +#define IDC_DIRECTORY_TREE 1053 +#define IDC_QUICK_ACCESS_LIST 1054 +#define IDC_PATH_EDIT 1055 +#define IDC_HEADER_TEXT_STATIC 1056 +#define IDC_FIND_PATH_BUTTON 1057 +#define IDC_NEW_FOLDER_BUTTON 1058 +#define IDC_PATH_STATIC 1059 +#define IDC_ADD_BUTTON 1060 +#define IDC_REMOVE_BUTTON 1061 +#define IDC_TITLE_EDIT 1062 +#define IDC_BROWSE_BUTTON 1064 +#define IDC_FILES_LIST 1065 +#define IDC_ADD_DIRECTORY_BUTTON 1066 +#define IDC_MASK_EDIT 1067 +#define IDC_OPERATION_TYPE_COMBO 1068 +#define IDC_ADD_FILES_BUTTON 1069 +#define IDC_BUFFERSIZE_EDIT 1070 +#define IDC_PRIORITY_COMBO 1071 +#define IDC_IGNORE_FOLDERS_CHECK 1073 +#define IDC_ONLY_CREATE_CHECK 1074 +#define IDC_ADVANCED_BUTTON 1077 +#define IDC_PATHS_LIST 1078 +#define IDC_FILENAME_EDIT 1088 +#define IDC_FILESIZE_EDIT 1089 +#define IDC_DESTFILENAME_EDIT 1090 +#define IDC_CREATETIME_EDIT 1091 +#define IDC_MODIFY_TIME_EDIT 1092 +#define IDC_DEST_FILENAME_EDIT 1093 +#define IDC_DEST_FILESIZE_EDIT 1094 +#define IDC_DEST_CREATETIME_EDIT 1095 +#define IDC_DEST_MODIFYTIME_EDIT 1096 +#define IDC_IGNORE_BUTTON 1097 +#define IDC_IGNORE_ALL_BUTTON 1098 +#define IDC_WAIT_BUTTON 1099 +#define IDC_RETRY_BUTTON 1100 +#define IDC_COPY_REST_BUTTON 1103 +#define IDC_RECOPY_BUTTON 1104 +#define IDC_COPY_REST_ALL_BUTTON 1106 +#define IDC_RECOPY_ALL_BUTTON 1107 +#define IDC_MESSAGE_EDIT 1112 +#define IDC_COUNT_EDIT 1119 +#define IDC_SHOW_LOG_BUTTON 1120 +#define IDC_STICK_BUTTON 1122 +#define IDC_FREESPACE_STATIC 1123 +#define IDC_DISK_STATIC 1124 +#define IDC_REQUIRED_STATIC 1127 +#define IDC_AVAILABLE_STATIC 1128 +#define IDC_TEST_BUTTON 1129 +#define IDC_SOURCEFILENAME_EDIT 1130 +#define IDC_YESALL_BUTTON 1131 +#define IDC_NOALL_BUTTON 1132 +#define IDC_DEFAULTMULTIPLIER_COMBO 1133 +#define IDC_DEFAULTSIZE_EDIT 1134 +#define IDC_ONEDISKSIZE_EDIT 1135 +#define IDC_CHANGEBUFFER_BUTTON 1137 +#define IDC_ONEDISKMULTIPLIER_COMBO 1138 +#define IDC_TWODISKSSIZE_EDIT 1139 +#define IDC_TWODISKSMULTIPLIER_COMBO 1140 +#define IDC_CDROMSIZE_EDIT 1141 +#define IDC_CDROMMULTIPLIER_COMBO 1142 +#define IDC_LANSIZE_EDIT 1143 +#define IDC_LANMULTIPLIER_COMBO 1144 +#define IDC_ONLYDEFAULT_CHECK 1145 +#define IDC_TIME_PROGRESS 1146 +#define IDC_ERRORS_EDIT 1147 +#define IDC_FILTER_COMBO 1149 +#define IDC_FILTER_CHECK 1150 +#define IDC_SIZE_CHECK 1151 +#define IDC_SIZE1_EDIT 1152 +#define IDC_SIZE1MULTI_COMBO 1153 +#define IDC_SIZETYPE1_COMBO 1154 +#define IDC_SIZE1_SPIN 1155 +#define IDC_SIZE2_EDIT 1156 +#define IDC_SIZE2MULTI_COMBO 1157 +#define IDC_SIZETYPE2_COMBO 1158 +#define IDC_SIZE2_SPIN 1159 +#define IDC_SIZE2_CHECK 1160 +#define IDC_DATE_CHECK 1161 +#define IDC_ATTRIBUTES_CHECK 1162 +#define IDC_ARCHIVE_CHECK 1163 +#define IDC_READONLY_CHECK 1164 +#define IDC_HIDDEN_CHECK 1165 +#define IDC_SYSTEM_CHECK 1166 +#define IDC_DATETYPE_COMBO 1167 +#define IDC_DATE1TYPE_COMBO 1168 +#define IDC_DATE1_DATETIMEPICKER 1169 +#define IDC_TIME1_DATETIMEPICKER 1170 +#define IDC_DATE2_CHECK 1171 +#define IDC_DATE2TYPE_COMBO 1172 +#define IDC_DATE2_DATETIMEPICKER 1173 +#define IDC_TIME2_DATETIMEPICKER 1174 +#define IDC_DIRECTORY_CHECK 1175 +#define IDC_FILTEREXCLUDE_COMBO 1176 +#define IDC_EXCLUDEMASK_CHECK 1177 +#define IDC_COUNT_SPIN 1178 +#define IDC_DESTPATH_COMBOBOXEX 1179 +#define IDC_SHORTCUT_LIST 1180 +#define IDC_NAME_EDIT 1181 +#define IDC_PATH_COMBOBOXEX 1182 +#define IDC_CHANGE_BUTTON 1185 +#define IDC_RECENT_LIST 1190 +#define IDC_IMPORT_BUTTON 1191 +#define IDC_UP_BUTTON 1192 +#define IDC_DOWN_BUTTON 1193 +#define IDC_THANX_EDIT 1198 +#define IDC_COPYRIGHT_STATIC 1199 +#define IDC_FOLDER_TREE 1200 +#define IDC_DISTRIBUTION_STATIC 1200 +#define IDC_NEWFOLDER_BUTTON 1201 +#define IDC_HOMEPAGE_STATIC 1201 +#define IDC_TITLE_STATIC 1202 +#define IDC_HOMEPAGELINK_STATIC 1202 +#define IDC_LARGEICONS_BUTTON 1203 +#define IDC_CONTACT_STATIC 1203 +#define IDC_HOMEPAGELINK2_STATIC 1203 +#define IDC_SMALLICONS_BUTTON 1204 +#define IDC_GENFORUM_STATIC 1204 +#define IDC_LIST_BUTTON 1205 +#define IDC_DEVFORUM_STATIC 1205 +#define IDC_REPORT_BUTTON 1206 +#define IDC_CONTACT1LINK_STATIC 1206 +#define IDC_CONTACT2LINK_STATIC 1207 +#define IDC_GENFORUMPAGELINK_STATIC 1208 +#define IDC_TOGGLE_BUTTON 1209 +#define IDC_GENFORUMSUBSCRIBELINK_STATIC 1209 +#define IDC_ADDSHORTCUT_BUTTON 1210 +#define IDC_GENFORUMUNSUBSCRIBELINK_STATIC 1210 +#define IDC_REMOVESHORTCUT_BUTTON 1211 +#define IDC_GENFORUMSENDLINK_STATIC 1211 +#define IDC_DEVFORUMPAGELINK_STATIC 1212 +#define IDC_DEVFORUMSUBSCRIBELINK_STATIC 1213 +#define IDC_DEVFORUMUNSUBSCRIBELINK_STATIC 1214 +#define IDC_DEVFORUMSENDLINK_STATIC 1215 +#define IDC_THANX_STATIC 1216 +#define IDC_UPX_STATIC 1217 +#define IDC_CONTACT3LINK_STATIC 1217 +#define IDC_APPLY_BUTTON 1218 +#define IDC_001_STATIC 1219 +#define IDC_002_STATIC 1220 +#define IDC_003_STATIC 1221 +#define IDC_004_STATIC 1222 +#define IDC_005_STATIC 1223 +#define IDC_006_STATIC 1224 +#define IDC_007_STATIC 1225 +#define IDC_008_STATIC 1226 +#define IDC_009_STATIC 1227 +#define IDC_010_STATIC 1228 +#define IDC_011_STATIC 1229 +#define IDC_012_STATIC 1230 +#define IDC_013_STATIC 1231 +#define IDC_014_STATIC 1232 +#define IDC_015_STATIC 1233 +#define IDC_016_STATIC 1234 +#define IDC_017_STATIC 1235 +#define IDC_018_STATIC 1236 +#define IDC_019_STATIC 1237 +#define IDC_020_STATIC 1238 +#define IDC_021_STATIC 1239 +#define IDC_022_STATIC 1240 +#define IDC_023_STATIC 1241 +#define IDC_024_STATIC 1242 +#define IDC_025_STATIC 1243 +#define IDC_026_STATIC 1244 +#define IDC_027_STATIC 1245 +#define IDC_028_STATIC 1246 +#define IDC_029_STATIC 1247 +#define IDC_030_STATIC 1248 +#define IDC_BAR1_STATIC 1249 +#define IDC_BAR2_STATIC 1250 +#define IDC_BAR3_STATIC 1251 +#define IDC_BAR4_STATIC 1252 +#define IDC_BAR5_STATIC 1253 +#define IDC_HEADER_STATIC 1254 +#define IDC_HOSTLINK_STATIC 1255 +#define IDC_HELP_BUTTON 1257 +#define IDC_PROGRAM_STATICEX 1263 +#define IDC_FULLVERSION_STATICEX 1264 +#define IDC_HOMEPAGE_STATICEX 1265 +#define IDC_CONTACT_STATICEX 1266 +#define IDC_LICENSE_STATICEX 1267 +#define IDC_CONTACTAUTHOR_STATICEX 1268 +#define IDC_CONTACTSUPPORT_STATICEX 1269 +#define IDS_APPNAME_STRING 5000 +#define IDS_PRIORITY0_STRING 5001 +#define IDS_PRIORITY1_STRING 5002 +#define IDS_PRIORITY2_STRING 5003 +#define IDS_PRIORITY3_STRING 5004 +#define IDS_PRIORITY4_STRING 5005 +#define IDS_PRIORITY5_STRING 5006 +#define IDS_PRIORITY6_STRING 5007 +#define IDS_FIRSTCOPY_STRING 5008 +#define IDS_NEXTCOPY_STRING 5009 +#define IDS_NOTFOUND_STRING 5010 +#define IDS_BYTE_STRING 5011 +#define IDS_KBYTE_STRING 5012 +#define IDS_MBYTE_STRING 5013 +#define IDS_GBYTE_STRING 5014 +#define IDS_TBYTE_STRING 5015 +#define IDS_PBYTE_STRING 5016 +#define IDS_LT_STRING 5017 +#define IDS_LE_STRING 5018 +#define IDS_EQ_STRING 5019 +#define IDS_GE_STRING 5020 +#define IDS_GT_STRING 5021 +#define IDS_ONECOPY_STRING 6000 +#define IDS_REGISTEROK_STRING 6001 +#define IDS_REGISTERERR_STRING 6002 +#define IDS_UNREGISTEROK_STRING 6003 +#define IDS_UNREGISTERERR_STRING 6004 +#define IDS_HELPERR_STRING 6005 +#define IDS_OTFSEARCHINGFORFILES_STRING 7000 +#define IDS_OTFMISSINGCLIPBOARDINPUT_STRING 7001 +#define IDS_OTFADDINGCLIPBOARDFILE_STRING 7002 +#define IDS_OTFADDEDFOLDER_STRING 7003 +#define IDS_OTFRECURSINGFOLDER_STRING 7004 +#define IDS_OTFADDINGKILLREQEST_STRING 7005 +#define IDS_OTFADDEDFILE_STRING 7006 +#define IDS_OTFSEARCHINGFINISHED_STRING 7007 +#define IDS_OTFDELETINGFILES_STRING 7008 +#define IDS_OTFDELETINGKILLREQUEST_STRING 7009 +#define IDS_OTFDELETINGERROR_STRING 7010 +#define IDS_OTFDELETINGFINISHED_STRING 7011 +#define IDS_OTFPRECHECKCANCELREQUEST_STRING 7012 +#define IDS_OTFOPENINGERROR_STRING 7013 +#define IDS_OTFOPENINGCANCELREQUEST_STRING 7014 +#define IDS_OTFOPENINGWAITREQUEST_STRING 7015 +#define IDS_OTFOPENINGRETRY_STRING 7016 +#define IDS_OTFDESTOPENINGERROR_STRING 7017 +#define IDS_OTFDESTOPENINGRETRY_STRING 7018 +#define IDS_OTFDESTOPENINGCANCELREQUEST_STRING 7019 +#define IDS_OTFDESTOPENINGWAITREQUEST_STRING 7020 +#define IDS_OTFMOVINGPOINTERSERROR_STRING 7021 +#define IDS_OTFRESTORINGPOINTERSERROR_STRING 7022 +#define IDS_OTFSETTINGZEROSIZEERROR_STRING 7023 +#define IDS_OTFCOPYINGKILLREQUEST_STRING 7024 +#define IDS_OTFCHANGINGBUFFERSIZE_STRING 7025 +#define IDS_OTFREADINGERROR_STRING 7026 +#define IDS_OTFWRITINGERROR_STRING 7027 +#define IDS_OTFCAUGHTEXCEPTIONCCF_STRING 7028 +#define IDS_OTFPROCESSINGFILES_STRING 7029 +#define IDS_OTFPROCESSINGFILESDATA_STRING 7030 +#define IDS_OTFPROCESSINGKILLREQUEST_STRING 7031 +#define IDS_OTFMOVEFILEERROR_STRING 7032 +#define IDS_OTFCREATEDIRECTORYERROR_STRING 7033 +#define IDS_OTFPROCESSINGFINISHED_STRING 7034 +#define IDS_OTFTHREADSTART_STRING 7035 +#define IDS_OTFWAITINGFINISHED_STRING 7036 +#define IDS_OTFWAITINGKILLREQUEST_STRING 7037 +#define IDS_OTFTHREADFINISHED_STRING 7038 +#define IDS_OTFCAUGHTEXCEPTIONMAIN_STRING 7039 +#define IDS_OTFCHECKINGSPACE_STRING 7040 +#define IDS_OTFNOTENOUGHFREESPACE_STRING 7041 +#define IDS_OTFFREESPACECANCELREQUEST_STRING 7042 +#define IDS_OTFFREESPACERETRYING_STRING 7043 +#define IDS_OTFFREESPACEIGNORE_STRING 7044 +#define IDS_OTFSHRINKERROR_STRING 7045 +#define IDS_OTFEXTMOVEFILEERROR_STRING 7046 +#define IDS_OTFMOVEFILECANCELREQUEST_STRING 7047 +#define IDS_PROGRAM_STRING 8000 +#define IDS_CLIPBOARDMONITORING_STRING 8001 +#define IDS_CLIPBOARDINTERVAL_STRING 8002 +#define IDS_AUTORUNPROGRAM_STRING 8003 +#define IDS_AUTOSHUTDOWN_STRING 8004 +#define IDS_AUTOSAVEINTERVAL_STRING 8005 +#define IDS_TEMPFOLDER_STRING 8006 +#define IDS_STATUSWINDOW_STRING 8007 +#define IDS_REFRESHSTATUSINTERVAL_STRING 8008 +#define IDS_STATUSSHOWDETAILS_STRING 8009 +#define IDS_STATUSAUTOREMOVE_STRING 8010 +#define IDS_MINIVIEW_STRING 8011 +#define IDS_SHOWFILENAMES_STRING 8012 +#define IDS_SHOWSINGLETASKS_STRING 8013 +#define IDS_MINIVIEWREFRESHINTERVAL_STRING 8014 +#define IDS_MINIVIEWSHOWAFTERSTART_STRING 8015 +#define IDS_MINIVIEWAUTOHIDE_STRING 8016 +#define IDS_PROCESSINGTHREAD_STRING 8017 +#define IDS_AUTOCOPYREST_STRING 8018 +#define IDS_SETDESTATTRIB_STRING 8019 +#define IDS_SETDESTTIME_STRING 8020 +#define IDS_PROTECTROFILES_STRING 8021 +#define IDS_LIMITOPERATIONS_STRING 8022 +#define IDS_SHOWVISUALFEEDBACK_STRING 8023 +#define IDS_USETIMEDDIALOGS_STRING 8024 +#define IDS_TIMEDDIALOGINTERVAL_STRING 8025 +#define IDS_AUTORETRYONERROR_STRING 8026 +#define IDS_AUTORETRYINTERVAL_STRING 8027 +#define IDS_DEFAULTPRIORITY_STRING 8028 +#define IDS_AUTODETECTBUFFERSIZE_STRING 8029 +#define IDS_DEFAULTBUFFERSIZE_STRING 8030 +#define IDS_DELETEAFTERFINISHED_STRING 8031 +#define IDS_CREATELOGFILES_STRING 8032 +#define IDS_SOUNDS_STRING 8033 +#define IDS_PLAYSOUNDS_STRING 8034 +#define IDS_SOUNDONERROR_STRING 8035 +#define IDS_SOUNDONFINISH_STRING 8036 +#define IDS_LANGUAGE_STRING 8037 +#define IDS_READSIZEBEFOREBLOCK_STRING 8038 +#define IDS_USENOBUFFERING_STRING 8039 +#define IDS_LARGEFILESMINSIZE_STRING 8040 +#define IDS_OPTIONSBUFFER_STRING 8041 +#define IDS_ONEDISKBUFFERSIZE_STRING 8042 +#define IDS_TWODISKSBUFFERSIZE_STRING 8043 +#define IDS_CDBUFFERSIZE_STRING 8044 +#define IDS_LANBUFFERSIZE_STRING 8045 +#define IDS_SHUTDOWNTIME_STRING 8046 +#define IDS_FORCESHUTDOWN_STRING 8047 +#define IDS_MINIVIEWSMOOTHPROGRESS_STRING 8048 +#define IDS_CFGFOLDERDIALOG_STRING 8049 +#define IDS_CFGFDEXTVIEW_STRING 8050 +#define IDS_CFGFDWIDTH_STRING 8051 +#define IDS_CFGFDHEIGHT_STRING 8052 +#define IDS_CFGFDSHORTCUTS_STRING 8053 +#define IDS_CFGFDIGNOREDIALOGS_STRING 8054 +#define IDS_CFGSHCOPY_STRING 8055 +#define IDS_CFGSHMOVE_STRING 8056 +#define IDS_CFGSHCMSPECIAL_STRING 8057 +#define IDS_CFGSHPASTE_STRING 8058 +#define IDS_CFGSHPASTESPECIAL_STRING 8059 +#define IDS_CFGSHCOPYTO_STRING 8060 +#define IDS_CFGSHMOVETO_STRING 8061 +#define IDS_CFGSHCMTOSPECIAL_STRING 8062 +#define IDS_CFGSHSHOWFREESPACE_STRING 8063 +#define IDS_CFGSHSHOWICONS_STRING 8064 +#define IDS_CFGSHOVERRIDEDRAG_STRING 8065 +#define IDS_CFGSHORTCUTS_STRING 8066 +#define IDS_CFGRECENT_STRING 8067 +#define IDS_CFGSHELL_STRING 8068 +#define IDS_CFGSCCOUNT_STRING 8069 +#define IDS_CFGRPCOUNT_STRING 8070 +#define IDS_CFGOVERRIDEDEFACTION_STRING 8071 +#define IDS_CFGPRIORITYCLASS_STRING 8072 +#define IDS_CFGDISABLEPRIORITYBOOST_STRING 8073 +#define IDS_BOOLTEXT_STRING 8074 +#define IDS_TEMPFOLDERCHOOSE_STRING 8075 +#define IDS_FEEDBACKTYPE_STRING 8076 +#define IDS_SOUNDSWAVFILTER_STRING 8077 +#define IDS_LANGUAGELIST_STRING 8078 +#define IDS_FORCESHUTDOWNVALUES_STRING 8079 +#define IDS_CFGFDSHORTCUTSSTYLES_STRING 8080 +#define IDS_CFGPRIORITYCLASSITEMS_STRING 8081 +#define IDS_CFGACTIONS_STRING 8082 +#define IDS_PLUGSFOLDER_STRING 8083 +#define IDS_PLUGSFOLDERCHOOSE_STRING 8084 +#define IDS_CFGLOGFILE_STRING 8085 +#define IDS_CFGENABLELOGGING_STRING 8086 +#define IDS_CFGLIMITATION_STRING 8087 +#define IDS_CFGMAXLIMIT_STRING 8088 +#define IDS_CFGLOGPRECISELIMITING_STRING 8089 +#define IDS_CFGTRUNCBUFFERSIZE_STRING 8090 +#define IDS_CFGHELPDIR_STRING 8091 +#define IDS_CFGHELPDIRCHOOSE_STRING 8092 +#define IDS_LANGUAGESFOLDER_STRING 8093 +#define IDS_LANGSFOLDERCHOOSE_STRING 8094 +#define IDS_MENUCOPY_STRING 9000 +#define IDS_MENUMOVE_STRING 9001 +#define IDS_MENUCOPYMOVESPECIAL_STRING 9002 +#define IDS_MENUPASTE_STRING 9003 +#define IDS_MENUPASTESPECIAL_STRING 9004 +#define IDS_MENUCOPYTO_STRING 9005 +#define IDS_MENUMOVETO_STRING 9006 +#define IDS_MENUCOPYMOVETOSPECIAL_STRING 9007 +#define IDS_MENUTIPCOPY_STRING 9008 +#define IDS_MENUTIPMOVE_STRING 9009 +#define IDS_MENUTIPCOPYMOVESPECIAL_STRING 9010 +#define IDS_MENUTIPPASTE_STRING 9011 +#define IDS_MENUTIPPASTESPECIAL_STRING 9012 +#define IDS_MENUTIPCOPYTO_STRING 9013 +#define IDS_MENUTIPMOVETO_STRING 9014 +#define IDS_MENUTIPCOPYMOVETOSPECIAL_STRING 9015 +#define IDS_BROWSE_STRING 13000 +#define IDS_BDREMOTENAME_STRING 13001 +#define IDS_BDLOCALNAME_STRING 13002 +#define IDS_BDTYPE_STRING 13003 +#define IDS_BDNETTYPE_STRING 13004 +#define IDS_BDDESCRIPTION_STRING 13005 +#define IDS_BDFREESPACE_STRING 13006 +#define IDS_BDCAPACITY_STRING 13007 +#define IDS_BDOK_STRING 13008 +#define IDS_BDCANCEL_STRING 13009 +#define IDS_BDCANNOTCREATEFOLDER_STRING 13010 +#define IDS_BDPATHDOESNTEXIST_STRING 13011 +#define IDS_BDNAME_STRING 13012 +#define IDS_BDPATH_STRING 13013 +#define IDS_BDPATH2_STRING 13014 +#define IDS_BDRIGHT_STRING 13015 +#define IDS_BDLEFT_STRING 13016 +#define IDS_BDNOSHORTCUTPATH_STRING 13017 +#define IDS_BDNEWFOLDER_STRING 13018 +#define IDS_BDLARGEICONS_STRING 13019 +#define IDS_BDSMALLICONS_STRING 13020 +#define IDS_BDLIST_STRING 13021 +#define IDS_BDREPORT_STRING 13022 +#define IDS_BDDETAILS_STRING 13023 +#define IDS_BDADDSHORTCUT_STRING 13024 +#define IDS_BDREMOVESHORTCUT_STRING 13025 +#define IDS_BDDOMAIN_STRING 13026 +#define IDS_BDSERVER_STRING 13027 +#define IDS_BDSHARE_STRING 13028 +#define IDS_BDFILE_STRING 13029 +#define IDS_BDGROUP_STRING 13030 +#define IDS_BDNETWORK_STRING 13031 +#define IDS_BDROOT_STRING 13032 +#define IDS_BDADMINSHARE_STRING 13033 +#define IDS_BDDIR_STRING 13034 +#define IDS_BDTREE_STRING 13035 +#define IDS_BDNDSCONTAINER_STRING 13036 +#define IDS_TITLECOPY_STRING 13500 +#define IDS_TITLEMOVE_STRING 13501 +#define IDS_TITLEUNKNOWNOPERATION_STRING 13502 +#define IDS_MAINBROWSETEXT_STRING 13503 +#define IDS_ABTNOTHANX_STRING 14000 +#define IDS_ABOUTVERSION_STRING 14001 +#define IDS_LANGCODE_STRING 14002 +#define IDS_LANGVER_STRING 14003 +#define IDS_BUFFERSIZEZERO_STRING 14500 +#define IDS_FILEDLGALLFILTER_STRING 15000 +#define IDS_DSTFOLDERBROWSE_STRING 15001 +#define IDS_MISSINGDATA_STRING 15002 +#define IDS_CCDCOPY_STRING 15003 +#define IDS_CCDMOVE_STRING 15004 +#define IDS_BSEDEFAULT_STRING 15005 +#define IDS_BSEONEDISK_STRING 15006 +#define IDS_BSETWODISKS_STRING 15007 +#define IDS_BSECD_STRING 15008 +#define IDS_BSELAN_STRING 15009 +#define IDS_HDRMASK_STRING 15010 +#define IDS_HDRSIZE_STRING 15011 +#define IDS_HDRDATE_STRING 15012 +#define IDS_HDRATTRIB_STRING 15013 +#define IDS_AND_STRING 15014 +#define IDS_FILTERMASKEMPTY_STRING 15015 +#define IDS_FILTERSIZE_STRING 15016 +#define IDS_FILTERDATE_STRING 15017 +#define IDS_HDREXCLUDEMASK_STRING 15018 +#define IDS_HDREXCLUDEATTRIB_STRING 15019 +#define IDS_FILTERATTRIB_STRING 15020 +#define IDS_EMPTYFILTER_STRING 15021 +#define IDS_FLTALLFILTER_STRING 15022 +#define IDS_IMPORTREPORT_STRING 15023 +#define IDS_NERPATH_STRING 16500 +#define IDS_DATECREATED_STRING 18000 +#define IDS_DATELASTWRITE_STRING 18001 +#define IDS_DATEACCESSED_STRING 18002 +#define IDS_MINIVIEWALL_STRING 18500 +#define IDS_SOURCESTRINGMISSING_STRING 20000 +#define IDS_SHORTCUTNAME_STRING 20500 +#define IDS_SHORTCUTPATH_STRING 20501 +#define IDS_SHUTDOWNERROR_STRING 21000 +#define IDS_COLUMNSTATUS_STRING 21500 +#define IDS_COLUMNSOURCE_STRING 21501 +#define IDS_COLUMNDESTINATION_STRING 21502 +#define IDS_COLUMNPROGRESS_STRING 21503 +#define IDS_EMPTYOPERATIONTEXT_STRING 21504 +#define IDS_EMPTYSOURCETEXT_STRING 21505 +#define IDS_EMPTYDESTINATIONTEXT_STRING 21506 +#define IDS_EMPTYBUFFERSIZETEXT_STRING 21507 +#define IDS_EMPTYPRIORITYTEXT_STRING 21508 +#define IDS_EMPTYERRORTEXT_STRING 21509 +#define IDS_EMPTYPROCESSEDTEXT_STRING 21510 +#define IDS_EMPTYTRANSFERTEXT_STRING 21511 +#define IDS_EMPTYTIMETEXT_STRING 21512 +#define IDS_CURRENTPASS_STRING 21513 +#define IDS_AVERAGEWORD_STRING 21514 +#define IDS_STATUSTITLE_STRING 21515 +#define IDS_REPLACEPATHSTEXT_STRING 21516 +#define IDS_TASKNOTPAUSED_STRING 21517 +#define IDS_TASKNOTSELECTED_STRING 21518 +#define IDS_NONEINPUTFILE_STRING 21519 +#define IDS_COPYWORDLESSFIVE_STRING 21520 +#define IDS_COPYWORDMOREFOUR_STRING 21521 +#define IDS_STATUS0_STRING 21522 +#define IDS_STATUS1_STRING 21523 +#define IDS_STATUS2_STRING 21524 +#define IDS_STATUS3_STRING 21525 +#define IDS_STATUS4_STRING 21526 +#define IDS_STATUS5_STRING 21527 +#define IDS_STATUS6_STRING 21528 +#define IDS_STATUS7_STRING 21529 +#define IDS_STATUS8_STRING 21530 +#define IDS_STATUS9_STRING 21531 +#define IDS_STATUS10_STRING 21532 +#define IDS_STATUS11_STRING 21533 +#define IDS_SHELLEXECUTEERROR_STRING 21534 +#define IDS_BSDEFAULT_STRING 21535 +#define IDS_BSONEDISK_STRING 21536 +#define IDS_BSTWODISKS_STRING 21537 +#define IDS_BSCD_STRING 21538 +#define IDS_BSLAN_STRING 21539 +#define IDS_CPEDELETINGERROR_STRING 21540 +#define IDS_CPEOPENINGERROR_STRING 21541 +#define IDS_CPEDESTOPENINGERROR_STRING 21542 +#define IDS_CPERESTORINGPOINTERSERROR_STRING 21543 +#define IDS_CPESETTINGZEROSIZEERROR_STRING 21544 +#define IDS_CPEREADINGERROR_STRING 21545 +#define IDS_CPEWRITINGERROR_STRING 21546 +#define IDS_CPEMOVEFILEERROR_STRING 21547 +#define IDS_CPECREATEDIRECTORYERROR_STRING 21548 +#define IDS_EMPTYASSOCFILE_STRING 21549 +#define IDS_FILTERING_STRING 21550 +#define IDS_CONFIRMCANCEL_STRING 21551 +#define ID_POPUP_SHOW_STATUS 32773 +#define ID_POPUP_TIME_CRITICAL 32774 +#define ID_POPUP_HIGHEST 32775 +#define ID_POPUP_ABOVE_NORMAL 32776 +#define ID_POPUP_NORMAL 32777 +#define ID_POPUP_BELOW_NORMAL 32778 +#define ID_POPUP_LOWEST 32779 +#define ID_POPUP_IDLE 32780 +#define ID_POPUP_CUSTOM_BUFFERSIZE 32793 +#define ID_POPUP_OPTIONS 32802 +#define ID_SHOW_MINI_VIEW 32803 +#define ID_POPUP_CUSTOM_COPY 32804 +#define ID_POPUP_REPLACE_PATHS 32805 +#define ID_POPUP_MONITORING 32806 +#define ID_POPUP_SHUTAFTERFINISHED 32807 +#define ID_POPUP_REGISTERDLL 32809 +#define ID_POPUP_UNREGISTERDLL 32810 +#define ID_POPUP_HELP 32814 +#define ID_POPUP_TEMP 32815 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 212 +#define _APS_NEXT_COMMAND_VALUE 32816 +#define _APS_NEXT_CONTROL_VALUE 1268 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif Index: Copy Handler/resource.hm =================================================================== diff -u --- Copy Handler/resource.hm (revision 0) +++ Copy Handler/resource.hm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,148 @@ +// Microsoft Developer Studio generated Help ID include file. +// Used by Copy Handler.rc +// +#define HIDCANCEL 0x80890002 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_ADDDIR_BUTTON 0x809503f3 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_ADDFILE_BUTTON 0x809503ea // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_ADDFILTER_BUTTON 0x80950401 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_ADD_BUTTON 0x80d10424 // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_ADVANCED_BUTTON 0x80830435 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_ADVANCED_CHECK 0x809503ff // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_APPLY_BUTTON 0x809004c2 // IDD_OPTIONS_DIALOG [English (U.S.)] +#define HIDC_ARCHIVE_CHECK 0x80c3048b // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_ASSOCIATEDFILES__STATIC 0x80830410 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_ATTRIBUTES_CHECK 0x80c3048a // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_AVAILABLE_STATIC 0x80ad0468 // IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG [English (U.S.)] +#define HIDC_BROWSE_BUTTON 0x80d10428 // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_BUFFERSIZES_BUTTON 0x80950400 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_BUFFERSIZES_LIST 0x809503f4 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_BUFFERSIZE_STATIC 0x80830406 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_CANCEL_ALL_BUTTON 0x80830416 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_CANCEL_BUTTON 0x808303fe // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_CDROMMULTIPLIER_COMBO 0x80890476 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_CDROMSIZE_EDIT 0x80890475 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_CHANGE_BUTTON 0x80d104a1 // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_CONTACT1LINK_STATIC 0x806404b6 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_CONTACT2LINK_STATIC 0x806404b7 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_CONTACT3LINK_STATIC 0x806404c1 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_COPY_REST_ALL_BUTTON 0x80a40452 // IDD_FEEDBACK_REPLACE_FILES_DIALOG [English (U.S.)] +#define HIDC_COPY_REST_BUTTON 0x80a4044f // IDD_FEEDBACK_REPLACE_FILES_DIALOG [English (U.S.)] +#define HIDC_COUNT_EDIT 0x8095045f // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_CREATETIME_EDIT 0x80a20443 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_DATE1TYPE_COMBO 0x80c30490 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATE1_DATETIMEPICKER 0x80c30491 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATE2TYPE_COMBO 0x80c30494 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATE2_CHECK 0x80c30493 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATE2_DATETIMEPICKER 0x80c30495 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATETYPE_COMBO 0x80c3048f // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DATE_CHECK 0x80c30489 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DEFAULTMULTIPLIER_COMBO 0x8089046d // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_DEFAULTSIZE_EDIT 0x8089046e // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_DELETE_BUTTON 0x80d10413 // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_DESTBROWSE_BUTTON 0x809503f0 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_DESTINATION_EDIT 0x80a1041b // IDD_REPLACE_PATHS_DIALOG [English (U.S.)] +#define HIDC_DESTINATION_STATIC 0x80830404 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_DESTPATH_COMBOBOXEX 0x8095049b // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_DEST_CREATETIME_EDIT 0x80a20447 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_DEST_FILENAME_EDIT 0x80a20445 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_DEST_FILESIZE_EDIT 0x80a20446 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_DEST_MODIFYTIME_EDIT 0x80a20448 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_DEVFORUMPAGELINK_STATIC 0x806404bc // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_DEVFORUMSENDLINK_STATIC 0x806404bf // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_DEVFORUMSUBSCRIBELINK_STATIC \ + 0x806404bd // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_DEVFORUMUNSUBSCRIBELINK_STATIC \ + 0x806404be // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_DIRECTORY_CHECK 0x80c30497 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_DOWN_BUTTON 0x80d004a9 // IDD_SHORTCUTEDIT_DIALOG [English (U.S.)] +#define HIDC_ERRORS_EDIT 0x8083047b // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_EXCLUDEMASK_CHECK 0x80c30499 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_FILENAME_EDIT 0x80a70440 // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDC_FILESIZE_EDIT 0x80a20441 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_FILES_LIST 0x80950429 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_FILTEREXCLUDE_COMBO 0x80c30498 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_FILTERS_CHECK 0x809503f6 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_FILTERS_LIST 0x809503f2 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_FILTER_CHECK 0x80c3047e // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_FILTER_COMBO 0x80c3047d // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_FORCEDIRECTORIES_CHECK 0x809503fc // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_GENFORUMPAGELINK_STATIC 0x806404b8 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_GENFORUMSENDLINK_STATIC 0x806404bb // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_GENFORUMSUBSCRIBELINK_STATIC \ + 0x806404b9 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_GENFORUMUNSUBSCRIBELINK_STATIC \ + 0x806404ba // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_HELP_BUTTON 0x808904e9 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_HIDDEN_CHECK 0x80c3048d // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_HOMEPAGELINK2_STATIC 0x806404b3 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_HOMEPAGELINK_STATIC 0x806404b2 // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_IGNOREFOLDERS_CHECK 0x809503f7 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_IGNORE_ALL_BUTTON 0x80a7044a // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDC_IGNORE_BUTTON 0x80a70449 // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDC_IMPORT_BUTTON 0x809504a7 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_LANMULTIPLIER_COMBO 0x80890478 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_LANSIZE_EDIT 0x80890477 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_MESSAGE_EDIT 0x80a70458 // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDC_MODIFY_TIME_EDIT 0x80a20444 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [English (U.S.)] +#define HIDC_NAME_EDIT 0x80d0049d // IDD_SHORTCUTEDIT_DIALOG [English (U.S.)] +#define HIDC_ONEDISKMULTIPLIER_COMBO 0x80890472 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_ONEDISKSIZE_EDIT 0x8089046f // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_ONLYDEFAULT_CHECK 0x80890479 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_ONLYSTRUCTURE_CHECK 0x809503f9 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_OPERATION_COMBO 0x809503f1 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_OPERATION_STATIC 0x80830405 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_OVERALL_PROGRESS_STATIC 0x8083040b // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_OVERALL_TRANSFER_STATIC 0x8083040c // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_PATHS_LIST 0x80a10436 // IDD_REPLACE_PATHS_DIALOG [English (U.S.)] +#define HIDC_PATH_COMBOBOXEX 0x80d0049e // IDD_SHORTCUTEDIT_DIALOG [English (U.S.)] +#define HIDC_PATH_EDIT 0x80d1041f // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_PAUSE_ALL_BUTTON 0x80830414 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_PAUSE_BUTTON 0x808303fa // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_PRIORITY_COMBO 0x8095042f // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_PRIORITY_STATIC 0x80830407 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_PROGRESS_LIST 0x80910419 // IDD_MINIVIEW_DIALOG [English (U.S.)] +#define HIDC_PROGRESS_STATIC 0x80830409 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_PROPERTIES_LIST 0x80900418 // IDD_OPTIONS_DIALOG [English (U.S.)] +#define HIDC_READONLY_CHECK 0x80c3048c // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_RECENT_LIST 0x80d104a6 // IDD_RECENTEDIT_DIALOG [English (U.S.)] +#define HIDC_RECOPY_ALL_BUTTON 0x80a40453 // IDD_FEEDBACK_REPLACE_FILES_DIALOG [English (U.S.)] +#define HIDC_RECOPY_BUTTON 0x80a40450 // IDD_FEEDBACK_REPLACE_FILES_DIALOG [English (U.S.)] +#define HIDC_REMOVEFILEFOLDER_BUTTON 0x809503ec // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_REMOVEFILTER_BUTTON 0x80950402 // IDD_CUSTOM_COPY_DIALOG [English (U.S.)] +#define HIDC_REMOVE_FINISHED_BUTTON 0x80830417 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_REQUIRED_STATIC 0x80ad0467 // IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG [English (U.S.)] +#define HIDC_RESTART_ALL_BUTTON 0x80830415 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_RESTART_BUTTON 0x80830412 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_RESUME_BUTTON 0x808303fd // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_RETRY_BUTTON 0x80a7044c // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDC_ROLL_UNROLL_BUTTON 0x8083040e // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_SET_BUFFERSIZE_BUTTON 0x808303f5 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_SET_PRIORITY_BUTTON 0x808303f8 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_SHORTCUT_LIST 0x80d0049c // IDD_SHORTCUTEDIT_DIALOG [English (U.S.)] +#define HIDC_SHOW_LOG_BUTTON 0x80830460 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_SIZE1MULTI_COMBO 0x80c30481 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE1_EDIT 0x80c30480 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE1_SPIN 0x80c30483 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE2MULTI_COMBO 0x80c30485 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE2_CHECK 0x80c30488 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE2_EDIT 0x80c30484 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE2_SPIN 0x80c30487 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZETYPE1_COMBO 0x80c30482 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZETYPE2_COMBO 0x80c30486 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SIZE_CHECK 0x80c3047f // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_SOURCE_EDIT 0x80a1041a // IDD_REPLACE_PATHS_DIALOG [English (U.S.)] +#define HIDC_SOURCE_STATIC 0x80830403 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_START_ALL_BUTTON 0x80830411 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_STATUS_LIST 0x808303eb // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_STICK_BUTTON 0x80830462 // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_SYSTEM_CHECK 0x80c3048e // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_THANX_EDIT 0x806404ae // IDD_ABOUTBOX [English (U.S.)] +#define HIDC_TIME1_DATETIMEPICKER 0x80c30492 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_TIME2_DATETIMEPICKER 0x80c30496 // IDD_FILTER_DIALOG [English (U.S.)] +#define HIDC_TIME_STATIC 0x8083040d // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_TRANSFER_STATIC 0x8083040a // IDD_STATUS_DIALOG [English (U.S.)] +#define HIDC_TWODISKSMULTIPLIER_COMBO 0x80890474 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_TWODISKSSIZE_EDIT 0x80890473 // IDD_BUFFERSIZE_DIALOG [English (U.S.)] +#define HIDC_UP_BUTTON 0x80d004a8 // IDD_SHORTCUTEDIT_DIALOG [English (U.S.)] +#define HIDC_WAIT_BUTTON 0x80a7044b // IDD_FEEDBACK_DSTFILE_DIALOG [English (U.S.)] +#define HIDOK 0x80640001 // IDD_ABOUTBOX [English (U.S.)] Index: Copy Handler/shortcuts.cpp =================================================================== diff -u --- Copy Handler/shortcuts.cpp (revision 0) +++ Copy Handler/shortcuts.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,48 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "shortcuts.h" + +bool CShortcut::FromString(const CString& strText) +{ + int iPos=strText.ReverseFind(_T('|')); + if (iPos != -1 && iPos < strText.GetLength()-1) + { + m_strName=strText.Left(iPos); + m_strPath=strText.Mid(iPos+1); + + return true; + } + else + return false; +} + +CShortcut::CShortcut(const CString& strText) +{ + FromString(strText); +} + +CShortcut::operator CString() +{ + if (m_strPath.IsEmpty()) + return _T(""); + else + return m_strName+_T("|")+m_strPath; +} Index: Copy Handler/shortcuts.h =================================================================== diff -u --- Copy Handler/shortcuts.h (revision 0) +++ Copy Handler/shortcuts.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,37 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __SHORTCUT_H__ +#define __SHORTCUT_H__ + +class CShortcut +{ +public: + CShortcut() { }; + CShortcut(const CString& strText); + operator CString(); + + bool FromString(const CString& strText); + +public: + CString m_strName; + CString m_strPath; +}; + +#endif \ No newline at end of file Index: Copy Handler/shortcutsdlg.h =================================================================== diff -u --- Copy Handler/shortcutsdlg.h (revision 0) +++ Copy Handler/shortcutsdlg.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,80 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __SHORTCUTSDLG_H__ +#define __SHORTCUTSDLG_H__ + +#include "afxtempl.h" +#include "shortcuts.h" +#include "charvect.h" + +///////////////////////////////////////////////////////////////////////////// +// CShortcutsDlg dialog + +class CShortcutsDlg : public CHLanguageDialog +{ +// Construction +public: + CShortcutsDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CShortcutsDlg) + enum { IDD = IDD_SHORTCUTEDIT_DIALOG }; + CComboBoxEx m_ctlPath; + CListCtrl m_ctlShortcuts; + CString m_strName; + //}}AFX_DATA + + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CShortcutsDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +public: + const char_vector *m_pcvRecent; // one way only + char_vector m_cvShortcuts; // two-way - shortcuts are being returned through this member +protected: + void UpdateComboIcon(); + void SetComboPath(LPCTSTR lpszPath); + HIMAGELIST m_himl, m_hliml; + bool m_bActualisation; + + // Generated message map functions + //{{AFX_MSG(CShortcutsDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnItemchangedShortcutList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnEditchangePathComboboxex(); + afx_msg void OnAddButton(); + afx_msg void OnChangeButton(); + afx_msg void OnDeleteButton(); + afx_msg void OnBrowseButton(); + afx_msg void OnUpButton(); + afx_msg void OnDownButton(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: Copy Handler/stdafx.cpp =================================================================== diff -u --- Copy Handler/stdafx.cpp (revision 0) +++ Copy Handler/stdafx.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,22 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" + Index: CopyHandlerShellExt/CopyHandlerShellExt.cpp =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.cpp (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,115 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +// Note: Proxy/Stub Information +// To build a separate proxy/stub DLL, +// run nmake -f CopyHandlerShellExtps.mk in the project directory. + +#include "stdafx.h" +#include "resource.h" +#include +#include "CopyHandlerShellExt.h" + +#include "CopyHandlerShellExt_i.c" +#include "MenuExt.h" +#include "DropMenuExt.h" + +CComModule _Module; + +// common memory - exactly 64kB +CSharedConfigStruct* g_pscsShared; +static HANDLE hMapObject=NULL; + +BEGIN_OBJECT_MAP(ObjectMap) +OBJECT_ENTRY(CLSID_MenuExt, CMenuExt) +OBJECT_ENTRY(CLSID_DropMenuExt, CDropMenuExt) +END_OBJECT_MAP() + +///////////////////////////////////////////////////////////////////////////// +// DLL Entry Point + +extern "C" +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + _Module.Init(ObjectMap, hInstance, &LIBID_COPYHANDLERSHELLEXTLib); + DisableThreadLibraryCalls(hInstance); + + // memory mapped file + hMapObject = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, sizeof(CSharedConfigStruct), _T("CHLMFile")); // name of map object + if (hMapObject == NULL) + return FALSE; + + // The first process to attach initializes memory. +// bool bInit = (GetLastError() != ERROR_ALREADY_EXISTS); + + // Get a pointer to the file-mapped shared memory. + g_pscsShared = (CSharedConfigStruct*)MapViewOfFile(hMapObject, FILE_MAP_WRITE, 0, 0, 0); + if (g_pscsShared == NULL) + return FALSE; + } + else if (dwReason == DLL_PROCESS_DETACH) + { + // Unmap shared memory from the process's address space. + UnmapViewOfFile((LPVOID)g_pscsShared); + + // Close the process's handle to the file-mapping object. + CloseHandle(hMapObject); + + _Module.Term(); + } + return TRUE; // ok +} + +///////////////////////////////////////////////////////////////////////////// +// Used to determine whether the DLL can be unloaded by OLE + +STDAPI DllCanUnloadNow(void) +{ + return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; +} + +///////////////////////////////////////////////////////////////////////////// +// Returns a class factory to create an object of the requested type + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + return _Module.GetClassObject(rclsid, riid, ppv); +} + +///////////////////////////////////////////////////////////////////////////// +// DllRegisterServer - Adds entries to the system registry + +STDAPI DllRegisterServer(void) +{ + // registers object, typelib and all interfaces in typelib + return _Module.RegisterServer(TRUE); +} + +///////////////////////////////////////////////////////////////////////////// +// DllUnregisterServer - Removes entries from the system registry + +STDAPI DllUnregisterServer(void) +{ + return _Module.UnregisterServer(TRUE); +} + + Index: CopyHandlerShellExt/CopyHandlerShellExt.def =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.def (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.def (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,9 @@ +; CopyHandlerShellExt.def : Declares the module parameters. + +LIBRARY "chext.DLL" + +EXPORTS + DllCanUnloadNow @1 PRIVATE + DllGetClassObject @2 PRIVATE + DllRegisterServer @3 PRIVATE + DllUnregisterServer @4 PRIVATE Index: CopyHandlerShellExt/CopyHandlerShellExt.dsp =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.dsp (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.dsp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,226 @@ +# Microsoft Developer Studio Project File - Name="CopyHandlerShellExt" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=CopyHandlerShellExt - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "CopyHandlerShellExt.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "CopyHandlerShellExt.mak" CFG="CopyHandlerShellExt - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "CopyHandlerShellExt - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "CopyHandlerShellExt - Win32 Release MinDependency" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "CopyHandlerShellExt - Win32 Debug" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x415 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib shell32.lib gdi32.lib comctl32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"../BIN/Debug/chext.dll" /pdbtype:sept +# SUBTRACT LINK32 /nodefaultlib +# Begin Custom Build - Performing registration +OutDir=.\Debug +TargetPath=\PROJECTS\c++\working\Copy Handler\BIN\Debug\chext.dll +InputPath=\PROJECTS\c++\working\Copy Handler\BIN\Debug\chext.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + start regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + +# End Custom Build +# Begin Special Build Tool +WkspDir=. +SOURCE="$(InputPath)" +PostBuild_Cmds="BuildManager" "Debug builds" "$(WkspDir)\chext_count.txt" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "CopyHandlerShellExt - Win32 Release MinDependency" + +# PROP BASE Use_MFC 2 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseMinDependency" +# PROP BASE Intermediate_Dir "ReleaseMinDependency" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseMinDependency" +# PROP Intermediate_Dir "ReleaseMinDependency" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /G5 /MT /W4 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x415 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib shell32.lib gdi32.lib comctl32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"../BIN/Release/chext.dll" +# SUBTRACT LINK32 /debug /nodefaultlib +# Begin Custom Build - Performing registration +OutDir=.\ReleaseMinDependency +TargetPath=\PROJECTS\c++\working\Copy Handler\BIN\Release\chext.dll +InputPath=\PROJECTS\c++\working\Copy Handler\BIN\Release\chext.dll +SOURCE="$(InputPath)" + +"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + regsvr32 /s /c "$(TargetPath)" + echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg" + +# End Custom Build +# Begin Special Build Tool +WkspDir=. +TargetPath=\PROJECTS\c++\working\Copy Handler\BIN\Release\chext.dll +SOURCE="$(InputPath)" +PostBuild_Cmds="BuildManager" "Release builds" "$(WkspDir)\chext_count.txt" upx.exe -9 -v "$(TargetPath)" +# End Special Build Tool + +!ENDIF + +# Begin Target + +# Name "CopyHandlerShellExt - Win32 Debug" +# Name "CopyHandlerShellExt - Win32 Release MinDependency" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\clipboard.cpp +# End Source File +# Begin Source File + +SOURCE=.\CopyHandlerShellExt.cpp +# End Source File +# Begin Source File + +SOURCE=.\CopyHandlerShellExt.def +# End Source File +# Begin Source File + +SOURCE=.\CopyHandlerShellExt.idl +# ADD MTL /tlb ".\CopyHandlerShellExt.tlb" /h "CopyHandlerShellExt.h" /iid "CopyHandlerShellExt_i.c" /Oicf +# End Source File +# Begin Source File + +SOURCE=.\CopyHandlerShellExt.rc +# End Source File +# Begin Source File + +SOURCE=.\DropMenuExt.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\FileSupport.cpp +# End Source File +# Begin Source File + +SOURCE=.\MenuExt.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\StringHelpers.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\clipboard.h +# End Source File +# Begin Source File + +SOURCE=.\DropMenuExt.h +# End Source File +# Begin Source File + +SOURCE=..\Common\FileSupport.h +# End Source File +# Begin Source File + +SOURCE=.\IContextMenuImpl.h +# End Source File +# Begin Source File + +SOURCE=..\Common\ipcstructs.h +# End Source File +# Begin Source File + +SOURCE=.\IShellExtInitImpl.h +# End Source File +# Begin Source File + +SOURCE=.\MenuExt.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=.\StringHelpers.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\DropMenuExt.rgs +# End Source File +# Begin Source File + +SOURCE=.\MenuExt.rgs +# End Source File +# End Group +# End Target +# End Project Index: CopyHandlerShellExt/CopyHandlerShellExt.h =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.h (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,338 @@ +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Sun Oct 10 12:09:27 2004 + */ +/* Compiler settings for F:\projects\c++\working\Copy Handler\CopyHandlerShellExt\CopyHandlerShellExt.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 440 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __CopyHandlerShellExt_h__ +#define __CopyHandlerShellExt_h__ + +#ifdef __cplusplus +extern "C"{ +#endif + +/* Forward Declarations */ + +#ifndef __IMenuExt_FWD_DEFINED__ +#define __IMenuExt_FWD_DEFINED__ +typedef interface IMenuExt IMenuExt; +#endif /* __IMenuExt_FWD_DEFINED__ */ + + +#ifndef __IDropMenuExt_FWD_DEFINED__ +#define __IDropMenuExt_FWD_DEFINED__ +typedef interface IDropMenuExt IDropMenuExt; +#endif /* __IDropMenuExt_FWD_DEFINED__ */ + + +#ifndef __MenuExt_FWD_DEFINED__ +#define __MenuExt_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class MenuExt MenuExt; +#else +typedef struct MenuExt MenuExt; +#endif /* __cplusplus */ + +#endif /* __MenuExt_FWD_DEFINED__ */ + + +#ifndef __DropMenuExt_FWD_DEFINED__ +#define __DropMenuExt_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class DropMenuExt DropMenuExt; +#else +typedef struct DropMenuExt DropMenuExt; +#endif /* __cplusplus */ + +#endif /* __DropMenuExt_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void __RPC_FAR * ); + +#ifndef __IMenuExt_INTERFACE_DEFINED__ +#define __IMenuExt_INTERFACE_DEFINED__ + +/* interface IMenuExt */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IMenuExt; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("413AA618-E769-4E6E-A610-7BDC8A189FB2") + IMenuExt : public IDispatch + { + public: + }; + +#else /* C style interface */ + + typedef struct IMenuExtVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + IMenuExt __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + IMenuExt __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + IMenuExt __RPC_FAR * This); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( + IMenuExt __RPC_FAR * This, + /* [out] */ UINT __RPC_FAR *pctinfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( + IMenuExt __RPC_FAR * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( + IMenuExt __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( + IMenuExt __RPC_FAR * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, + /* [out] */ VARIANT __RPC_FAR *pVarResult, + /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, + /* [out] */ UINT __RPC_FAR *puArgErr); + + END_INTERFACE + } IMenuExtVtbl; + + interface IMenuExt + { + CONST_VTBL struct IMenuExtVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IMenuExt_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IMenuExt_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IMenuExt_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IMenuExt_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IMenuExt_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IMenuExt_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IMenuExt_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IMenuExt_INTERFACE_DEFINED__ */ + + +#ifndef __IDropMenuExt_INTERFACE_DEFINED__ +#define __IDropMenuExt_INTERFACE_DEFINED__ + +/* interface IDropMenuExt */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_IDropMenuExt; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4AEAD637-8A55-47B9-AA1A-DACEA3DE9B71") + IDropMenuExt : public IDispatch + { + public: + }; + +#else /* C style interface */ + + typedef struct IDropMenuExtVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )( + IDropMenuExt __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )( + IDropMenuExt __RPC_FAR * This); + + ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )( + IDropMenuExt __RPC_FAR * This); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfoCount )( + IDropMenuExt __RPC_FAR * This, + /* [out] */ UINT __RPC_FAR *pctinfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetTypeInfo )( + IDropMenuExt __RPC_FAR * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo); + + HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetIDsOfNames )( + IDropMenuExt __RPC_FAR * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID __RPC_FAR *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Invoke )( + IDropMenuExt __RPC_FAR * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams, + /* [out] */ VARIANT __RPC_FAR *pVarResult, + /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo, + /* [out] */ UINT __RPC_FAR *puArgErr); + + END_INTERFACE + } IDropMenuExtVtbl; + + interface IDropMenuExt + { + CONST_VTBL struct IDropMenuExtVtbl __RPC_FAR *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define IDropMenuExt_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define IDropMenuExt_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define IDropMenuExt_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define IDropMenuExt_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define IDropMenuExt_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define IDropMenuExt_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define IDropMenuExt_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __IDropMenuExt_INTERFACE_DEFINED__ */ + + + +#ifndef __COPYHANDLERSHELLEXTLib_LIBRARY_DEFINED__ +#define __COPYHANDLERSHELLEXTLib_LIBRARY_DEFINED__ + +/* library COPYHANDLERSHELLEXTLib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_COPYHANDLERSHELLEXTLib; + +EXTERN_C const CLSID CLSID_MenuExt; + +#ifdef __cplusplus + +class DECLSPEC_UUID("E7A4C2DA-F3AF-4145-AC19-E3B215306A54") +MenuExt; +#endif + +EXTERN_C const CLSID CLSID_DropMenuExt; + +#ifdef __cplusplus + +class DECLSPEC_UUID("B46F8244-86E6-43CF-B8AB-8C3A89928A48") +DropMenuExt; +#endif +#endif /* __COPYHANDLERSHELLEXTLib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif Index: CopyHandlerShellExt/CopyHandlerShellExt.idl =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.idl (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.idl (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,65 @@ +// CopyHandlerShellExt.idl : IDL source for CopyHandlerShellExt.dll +// + +// This file will be processed by the MIDL tool to +// produce the type library (CopyHandlerShellExt.tlb) and marshalling code. + +import "oaidl.idl"; +import "ocidl.idl"; + [ + object, + uuid(413AA618-E769-4E6E-A610-7BDC8A189FB2), + dual, + helpstring("IMenuExt Interface"), + pointer_default(unique) + ] + interface IMenuExt : IDispatch + { +// [id(1), helpstring("method QueryContextMenu")] HRESULT QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); +// [id(1), helpstring("method GetCommandString")] HRESULT GetCommandString(UINT idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax); +// [id(2), helpstring("method InvokeCommand")] HRESULT InvokeCommand(LPCMINVOKECOMMANDINFO lpici); +// [id(1), helpstring("method Initialize")] HRESULT Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID); +// [id(1), helpstring("method Initialize")] HRESULT Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID); + }; + [ + object, + uuid(4AEAD637-8A55-47B9-AA1A-DACEA3DE9B71), + dual, + helpstring("IDropMenuExt Interface"), + pointer_default(unique) + ] + interface IDropMenuExt : IDispatch + { +// [id(1), helpstring("method QueryContextMenu")] HRESULT QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); +// [id(1), helpstring("method GetCommandString")] HRESULT GetCommandString(UINT idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax); +// [id(1), helpstring("method Initialize")] HRESULT Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID); +// [id(1), helpstring("method InvokeCommand")] HRESULT InvokeCommand(LPCMINVOKECOMMANDINFO lpici); + }; + +[ + uuid(68FAFC14-8EB8-4DA1-90EB-6B3D22010505), + version(1.0), + helpstring("CopyHandlerShellExt 1.0 Type Library") +] +library COPYHANDLERSHELLEXTLib +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + [ + uuid(E7A4C2DA-F3AF-4145-AC19-E3B215306A54), + helpstring("MenuExt Class") + ] + coclass MenuExt + { + [default] interface IMenuExt; + }; + [ + uuid(B46F8244-86E6-43CF-B8AB-8C3A89928A48), + helpstring("DropMenuExt Class") + ] + coclass DropMenuExt + { + [default] interface IDropMenuExt; + }; +}; Index: CopyHandlerShellExt/CopyHandlerShellExt.rc =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt.rc (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt.rc (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,118 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Polish resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PLK) +#ifdef _WIN32 +LANGUAGE LANG_POLISH, SUBLANG_DEFAULT +#pragma code_page(1250) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "1 TYPELIB ""CopyHandlerShellExt.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,28,19,182 + PRODUCTVERSION 1,28,19,182 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x29L +#else + FILEFLAGS 0x28L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "Copy handler Shell Extension\0" + VALUE "CompanyName", "\0" + VALUE "FileDescription", "CopyHandlerShellExt Module version\0" + VALUE "FileVersion", "1.28.19.182\0" + VALUE "InternalName", "CopyHandlerShellExt\0" + VALUE "LegalCopyright", "Copyright 2001-2004 Ixen Gerthannes\0" + VALUE "LegalTrademarks", " \0" + VALUE "OLESelfRegister", " \0" + VALUE "OriginalFilename", "CopyHandlerShellExt.DLL\0" + VALUE "PrivateBuild", " \0" + VALUE "ProductName", "CopyHandlerShellExt Shell Extension Library version\0" + VALUE "ProductVersion", "1.28.19.182\0" + VALUE "SpecialBuild", " \0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_MENUEXT REGISTRY DISCARDABLE "MenuExt.rgs" +IDR_DROPMENUEXT REGISTRY DISCARDABLE "DropMenuExt.rgs" +#endif // Polish resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "CopyHandlerShellExt.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + Index: CopyHandlerShellExt/CopyHandlerShellExt.tlb =================================================================== diff -u Binary files differ Index: CopyHandlerShellExt/CopyHandlerShellExt_i.c =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt_i.c (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt_i.c (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,56 @@ +/* this file contains the actual definitions of */ +/* the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Sun Oct 10 12:09:27 2004 + */ +/* Compiler settings for F:\projects\c++\working\Copy Handler\CopyHandlerShellExt\CopyHandlerShellExt.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) +#ifdef __cplusplus +extern "C"{ +#endif + + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +const IID IID_IMenuExt = {0x413AA618,0xE769,0x4E6E,{0xA6,0x10,0x7B,0xDC,0x8A,0x18,0x9F,0xB2}}; + + +const IID IID_IDropMenuExt = {0x4AEAD637,0x8A55,0x47B9,{0xAA,0x1A,0xDA,0xCE,0xA3,0xDE,0x9B,0x71}}; + + +const IID LIBID_COPYHANDLERSHELLEXTLib = {0x68FAFC14,0x8EB8,0x4DA1,{0x90,0xEB,0x6B,0x3D,0x22,0x01,0x05,0x05}}; + + +const CLSID CLSID_MenuExt = {0xE7A4C2DA,0xF3AF,0x4145,{0xAC,0x19,0xE3,0xB2,0x15,0x30,0x6A,0x54}}; + + +const CLSID CLSID_DropMenuExt = {0xB46F8244,0x86E6,0x43CF,{0xB8,0xAB,0x8C,0x3A,0x89,0x92,0x8A,0x48}}; + + +#ifdef __cplusplus +} +#endif + Index: CopyHandlerShellExt/CopyHandlerShellExt_p.c =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExt_p.c (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExt_p.c (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,248 @@ +/* this ALWAYS GENERATED file contains the proxy stub code */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Sun Oct 10 12:09:27 2004 + */ +/* Compiler settings for F:\projects\c++\working\Copy Handler\CopyHandlerShellExt\CopyHandlerShellExt.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + +#define USE_STUBLESS_PROXY + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REDQ_RPCPROXY_H_VERSION__ +#define __REQUIRED_RPCPROXY_H_VERSION__ 440 +#endif + + +#include "rpcproxy.h" +#ifndef __RPCPROXY_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCPROXY_H_VERSION__ + + +#include "CopyHandlerShellExt.h" + +#define TYPE_FORMAT_STRING_SIZE 3 +#define PROC_FORMAT_STRING_SIZE 1 + +typedef struct _MIDL_TYPE_FORMAT_STRING + { + short Pad; + unsigned char Format[ TYPE_FORMAT_STRING_SIZE ]; + } MIDL_TYPE_FORMAT_STRING; + +typedef struct _MIDL_PROC_FORMAT_STRING + { + short Pad; + unsigned char Format[ PROC_FORMAT_STRING_SIZE ]; + } MIDL_PROC_FORMAT_STRING; + + +extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString; +extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString; + + +/* Object interface: IUnknown, ver. 0.0, + GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: IDispatch, ver. 0.0, + GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */ + + +/* Object interface: IMenuExt, ver. 0.0, + GUID={0x413AA618,0xE769,0x4E6E,{0xA6,0x10,0x7B,0xDC,0x8A,0x18,0x9F,0xB2}} */ + + +extern const MIDL_STUB_DESC Object_StubDesc; + + +#pragma code_seg(".orpc") +CINTERFACE_PROXY_VTABLE(7) _IMenuExtProxyVtbl = +{ + 0, + &IID_IMenuExt, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ , + 0 /* (void *)-1 /* IDispatch::GetTypeInfo */ , + 0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ +}; + + +static const PRPC_STUB_FUNCTION IMenuExt_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION +}; + +CInterfaceStubVtbl _IMenuExtStubVtbl = +{ + &IID_IMenuExt, + 0, + 7, + &IMenuExt_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + + +/* Object interface: IDropMenuExt, ver. 0.0, + GUID={0x4AEAD637,0x8A55,0x47B9,{0xAA,0x1A,0xDA,0xCE,0xA3,0xDE,0x9B,0x71}} */ + + +extern const MIDL_STUB_DESC Object_StubDesc; + + +#pragma code_seg(".orpc") + +static const MIDL_STUB_DESC Object_StubDesc = + { + 0, + NdrOleAllocate, + NdrOleFree, + 0, + 0, + 0, + 0, + 0, + __MIDL_TypeFormatString.Format, + 1, /* -error bounds_check flag */ + 0x20000, /* Ndr library version */ + 0, + 0x50100a4, /* MIDL Version 5.1.164 */ + 0, + 0, + 0, /* notify & notify_flag routine table */ + 1, /* Flags */ + 0, /* Reserved3 */ + 0, /* Reserved4 */ + 0 /* Reserved5 */ + }; + +CINTERFACE_PROXY_VTABLE(7) _IDropMenuExtProxyVtbl = +{ + 0, + &IID_IDropMenuExt, + IUnknown_QueryInterface_Proxy, + IUnknown_AddRef_Proxy, + IUnknown_Release_Proxy , + 0 /* (void *)-1 /* IDispatch::GetTypeInfoCount */ , + 0 /* (void *)-1 /* IDispatch::GetTypeInfo */ , + 0 /* (void *)-1 /* IDispatch::GetIDsOfNames */ , + 0 /* IDispatch_Invoke_Proxy */ +}; + + +static const PRPC_STUB_FUNCTION IDropMenuExt_table[] = +{ + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION, + STUB_FORWARDING_FUNCTION +}; + +CInterfaceStubVtbl _IDropMenuExtStubVtbl = +{ + &IID_IDropMenuExt, + 0, + 7, + &IDropMenuExt_table[-3], + CStdStubBuffer_DELEGATING_METHODS +}; + +#pragma data_seg(".rdata") + +#if !defined(__RPC_WIN32__) +#error Invalid build platform for this stub. +#endif + +#if !(TARGET_IS_NT40_OR_LATER) +#error You need a Windows NT 4.0 or later to run this stub because it uses these features: +#error -Oif or -Oicf, more than 32 methods in the interface. +#error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems. +#error This app will die there with the RPC_X_WRONG_STUB_VERSION error. +#endif + + +static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString = + { + 0, + { + + 0x0 + } + }; + +static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString = + { + 0, + { + NdrFcShort( 0x0 ), /* 0 */ + + 0x0 + } + }; + +const CInterfaceProxyVtbl * _CopyHandlerShellExt_ProxyVtblList[] = +{ + ( CInterfaceProxyVtbl *) &_IMenuExtProxyVtbl, + ( CInterfaceProxyVtbl *) &_IDropMenuExtProxyVtbl, + 0 +}; + +const CInterfaceStubVtbl * _CopyHandlerShellExt_StubVtblList[] = +{ + ( CInterfaceStubVtbl *) &_IMenuExtStubVtbl, + ( CInterfaceStubVtbl *) &_IDropMenuExtStubVtbl, + 0 +}; + +PCInterfaceName const _CopyHandlerShellExt_InterfaceNamesList[] = +{ + "IMenuExt", + "IDropMenuExt", + 0 +}; + +const IID * _CopyHandlerShellExt_BaseIIDList[] = +{ + &IID_IDispatch, + &IID_IDispatch, + 0 +}; + + +#define _CopyHandlerShellExt_CHECK_IID(n) IID_GENERIC_CHECK_IID( _CopyHandlerShellExt, pIID, n) + +int __stdcall _CopyHandlerShellExt_IID_Lookup( const IID * pIID, int * pIndex ) +{ + IID_BS_LOOKUP_SETUP + + IID_BS_LOOKUP_INITIAL_TEST( _CopyHandlerShellExt, 2, 1 ) + IID_BS_LOOKUP_RETURN_RESULT( _CopyHandlerShellExt, 2, *pIndex ) + +} + +const ExtendedProxyFileInfo CopyHandlerShellExt_ProxyFileInfo = +{ + (PCInterfaceProxyVtblList *) & _CopyHandlerShellExt_ProxyVtblList, + (PCInterfaceStubVtblList *) & _CopyHandlerShellExt_StubVtblList, + (const PCInterfaceName * ) & _CopyHandlerShellExt_InterfaceNamesList, + (const IID ** ) & _CopyHandlerShellExt_BaseIIDList, + & _CopyHandlerShellExt_IID_Lookup, + 2, + 2, + 0, /* table of [async_uuid] interfaces */ + 0, /* Filler1 */ + 0, /* Filler2 */ + 0 /* Filler3 */ +}; Index: CopyHandlerShellExt/CopyHandlerShellExtps.def =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExtps.def (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExtps.def (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,11 @@ + +LIBRARY "CopyHandlerShellExtPS" + +DESCRIPTION 'Proxy/Stub DLL' + +EXPORTS + DllGetClassObject @1 PRIVATE + DllCanUnloadNow @2 PRIVATE + GetProxyDllInfo @3 PRIVATE + DllRegisterServer @4 PRIVATE + DllUnregisterServer @5 PRIVATE Index: CopyHandlerShellExt/CopyHandlerShellExtps.mk =================================================================== diff -u --- CopyHandlerShellExt/CopyHandlerShellExtps.mk (revision 0) +++ CopyHandlerShellExt/CopyHandlerShellExtps.mk (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,16 @@ + +CopyHandlerShellExtps.dll: dlldata.obj CopyHandlerShellExt_p.obj CopyHandlerShellExt_i.obj + link /dll /out:CopyHandlerShellExtps.dll /def:CopyHandlerShellExtps.def /entry:DllMain dlldata.obj CopyHandlerShellExt_p.obj CopyHandlerShellExt_i.obj \ + kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib \ + +.c.obj: + cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL \ + $< + +clean: + @del CopyHandlerShellExtps.dll + @del CopyHandlerShellExtps.lib + @del CopyHandlerShellExtps.exp + @del dlldata.obj + @del CopyHandlerShellExt_p.obj + @del CopyHandlerShellExt_i.obj Index: CopyHandlerShellExt/DropMenuExt.cpp =================================================================== diff -u --- CopyHandlerShellExt/DropMenuExt.cpp (revision 0) +++ CopyHandlerShellExt/DropMenuExt.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,324 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "CopyHandlerShellExt.h" +#include "DropMenuExt.h" +#include "clipboard.h" +///////////////////////////////////////////////////////////////////////////// +// CDropMenuExt + +extern CSharedConfigStruct* g_pscsShared; + +#define DE_COPY 0 +#define DE_MOVE 1 +#define DE_SPECIAL 2 +#define DE_AUTO 3 + +STDMETHODIMP CDropMenuExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT /*idCmdLast*/, UINT /*uFlags*/) +{ + // find CH's window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (hWnd) + { + // get state of keys + bool bShift=(GetKeyState(VK_SHIFT) & 0x80) != 0; + bool bCtrl=(GetKeyState(VK_CONTROL) & 0x80) != 0; + bool bAlt=(GetKeyState(VK_MENU) & 0x80) != 0; + +/* OTF2("CDropMenuExt::QueryContextMenu - uFlags=%lu (", uFlags); + if (uFlags & CMF_CANRENAME) + OTF2("CMF_CANRENAME "); + if (uFlags & CMF_DEFAULTONLY) + OTF2("CMF_DEFAULTONLY "); + if (uFlags & CMF_EXPLORE) + OTF2("CMF_EXPLORE "); + if (uFlags & CMF_EXTENDEDVERBS) + OTF2("CMF_EXTENDEDVERBS "); + if (uFlags & CMF_INCLUDESTATIC) + OTF2("CMF_INCLUDESTATIC "); + if (uFlags & CMF_NODEFAULT) + OTF2("CMF_NODEFAULT "); + if (uFlags & CMF_NORMAL) + OTF2("CMF_NORMAL "); + if (uFlags & CMF_NOVERBS) + OTF2("CMF_NOVERBS "); + if (uFlags & CMF_VERBSONLY) + OTF2("CMF_VERBSONLY "); + OTF2(")\r\n"); + OTF2("Keys State: Shift:%u, ctrl:%u, alt:%u\r\n", bShift, bCtrl, bAlt); +*/ + // got a config + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + int iCommandCount=0; + + if (g_pscsShared->uiFlags & DD_COPY_FLAG) + { + ::InsertMenu(hmenu, indexMenu+iCommandCount, MF_BYPOSITION | MF_STRING, idCmdFirst+0, pCommand[0].szCommand); + if (g_pscsShared->bOverrideDefault) + ::SetMenuDefaultItem(hmenu, idCmdFirst+0, FALSE); + iCommandCount++; + } + + if (g_pscsShared->uiFlags & DD_MOVE_FLAG) + { + ::InsertMenu(hmenu, indexMenu+iCommandCount, MF_BYPOSITION | MF_STRING, idCmdFirst+1, pCommand[1].szCommand); + if (g_pscsShared->bOverrideDefault && (bShift || (m_uiDropEffect == DE_MOVE && (m_bExplorer || !bCtrl))) ) + ::SetMenuDefaultItem(hmenu, idCmdFirst+1, FALSE); + iCommandCount++; + } + + if (g_pscsShared->uiFlags & DD_COPYMOVESPECIAL_FLAG) + { + ::InsertMenu(hmenu, indexMenu+iCommandCount, MF_BYPOSITION | MF_STRING, idCmdFirst+2, pCommand[2].szCommand); + if (g_pscsShared->bOverrideDefault && (bAlt || (bCtrl && bShift) || m_uiDropEffect == DE_SPECIAL) && !(m_uiDropEffect == DE_MOVE)) + ::SetMenuDefaultItem(hmenu, idCmdFirst+2, FALSE); + iCommandCount++; + } + + if (iCommandCount) + { + ::InsertMenu(hmenu, indexMenu+iCommandCount, MF_BYPOSITION | MF_SEPARATOR, idCmdFirst+3, NULL); + iCommandCount++; + } + + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 4); + } + else + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0); +} + +STDMETHODIMP CDropMenuExt::GetCommandString(UINT idCmd, UINT uFlags, UINT* /*pwReserved*/, LPSTR pszName, UINT cchMax) +{ + if (uFlags == GCS_HELPTEXTW) + { + USES_CONVERSION; + + // find CH's window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (hWnd) + { + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + + switch (idCmd) + { + case 0: + case 1: + case 2: + wcsncpy(reinterpret_cast(pszName), A2W(pCommand[idCmd].szDesc), cchMax); + break; + default: + wcsncpy(reinterpret_cast(pszName), L"", cchMax); + break; + } + } + else + wcsncpy(reinterpret_cast(pszName), L"", cchMax); + } + if (uFlags == GCS_HELPTEXTA) + { + // find CH's window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + + if (hWnd) + { + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + + switch (idCmd) + { + case 0: + case 1: + case 2: + strncpy(pszName, pCommand[idCmd].szDesc, cchMax); + break; + default: + strncpy(pszName, "", cchMax); + break; + } + } + else + strncpy(pszName, "", cchMax); + } + + return S_OK; +} + +STDMETHODIMP CDropMenuExt::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/) +{ +// OTF2("Initialize cdropmenuext\r\n"); + // find window + HWND hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (hWnd == NULL) + return E_FAIL; + + // gets the config from CH + ::SendMessage(hWnd, WM_GETCONFIG, GC_DRAGDROP, 0); + +// OTF2("========================================================\r\n"); +// OTF2("Initialize drag&drop context menu handler pidlFolder=%lu, lpdobj=%lu\r\n", pidlFolder, lpdobj); + + // get dest folder + m_szDstPath[0]=_T('\0'); + if (!SHGetPathFromIDList(pidlFolder, m_szDstPath)) + return E_FAIL; + + // get data from IDataObject - files to copy/move + if (lpdobj) + { +// ReportAvailableFormats(lpdobj); + // file list + STGMEDIUM medium; + FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + + HRESULT hr = lpdobj->GetData(&fe, &medium); + if (FAILED(hr)) + return E_FAIL; + + GetDataFromClipboard(static_cast(medium.hGlobal), m_szDstPath, &m_bBuffer.m_pszFiles, &m_bBuffer.m_iDataSize); + + // set std text + switch (g_pscsShared->uiDefaultAction) + { + case 1: + // move action + m_uiDropEffect=DE_MOVE; + break; + case 2: + // special operation + m_uiDropEffect=DE_SPECIAL; + break; + case 3: + { + // autodetecting - copy or move - check the last path + UINT uiCount=DragQueryFile((HDROP)medium.hGlobal, 0xffffffff, NULL, 0); + TCHAR szPath[_MAX_PATH]; + if (DragQueryFile((HDROP)medium.hGlobal, uiCount-1, szPath, _MAX_PATH)) + { + if (_tcsncmp(szPath, _T("\\\\"), 2) == 0) + { + TCHAR* pFnd=_tcsstr(szPath+2, _T("\\")); + + if (pFnd) + { + int iCount; + // find another + TCHAR *pSecond=_tcsstr(pFnd+1, _T("\\")); + if (pSecond) + { + iCount=pSecond-szPath; +// OTF2("Counted: %lu\r\n", iCount); + } + else + iCount=_tcslen(szPath); + + // found - compare +// OTF2("Compare %s and %s\r\n", szPath, m_szDstPath); + if (_tcsnicmp(szPath, m_szDstPath, iCount) == 0) + { +// OTF2("OP: MOVE\r\n"); + m_uiDropEffect=DE_MOVE; + } + else + { +// OTF2("OP: COPY\r\n"); + m_uiDropEffect=DE_COPY; + } + } + else + m_uiDropEffect=DE_COPY; + + } + else + { + // local path - check drive letter + if (m_szDstPath[0] == szPath[0]) + m_uiDropEffect=DE_MOVE; + else + m_uiDropEffect=DE_COPY; + } + } + else + m_uiDropEffect=DE_COPY; + } + break; + + default: + m_uiDropEffect=DE_COPY; // std copying + break; + } + + ReleaseStgMedium(&medium); + + // get operation type + UINT cf=RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT); + fe.cfFormat=(unsigned short)cf; + + // if explorer knows better - change effect + m_bExplorer=false; + hr=lpdobj->GetData(&fe, &medium); + if (SUCCEEDED(hr)) + { + // specify operation + LPVOID lpv=GlobalLock(medium.hGlobal); + if (lpv) + { + UINT uiDrop=*((DWORD*)lpv); + if (uiDrop & DROPEFFECT_MOVE) + m_uiDropEffect=DE_MOVE; + else + m_uiDropEffect=DE_COPY; + m_bExplorer=true; + +// OTF2("Detected operation %lu\r\n", m_uiDropEffect); + GlobalUnlock(medium.hGlobal); + } + + ReleaseStgMedium(&medium); + } + } + + return S_OK; +} + +STDMETHODIMP CDropMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) +{ + // find window + HWND hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (hWnd == NULL) + return E_FAIL; + + // commands + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + + // IPC struct + COPYDATASTRUCT cds; + cds.dwData=pCommand[LOWORD(lpici->lpVerb)].uiCommandID; // based on command's number (0-copy, 1-move, 2-special (copy), 3-special (move)) + cds.cbData=m_bBuffer.m_iDataSize; + cds.lpData=m_bBuffer.m_pszFiles; + + // send a message to ch + ::SendMessage(hWnd, WM_COPYDATA, reinterpret_cast(lpici->hwnd), reinterpret_cast(&cds)); + + m_bBuffer.Destroy(); + + return S_OK; +} \ No newline at end of file Index: CopyHandlerShellExt/DropMenuExt.h =================================================================== diff -u --- CopyHandlerShellExt/DropMenuExt.h (revision 0) +++ CopyHandlerShellExt/DropMenuExt.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,82 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __DROPMENUEXT_H_ +#define __DROPMENUEXT_H_ + +#include "resource.h" // main symbols +#include "IShellExtInitImpl.h" +#include "IContextMenuImpl.h" +#include "comdef.h" +#include "..\Common\ipcstructs.h" + +///////////////////////////////////////////////////////////////////////////// +// CDropMenuExt +class ATL_NO_VTABLE CDropMenuExt : + public CComObjectRootEx, + public CComCoClass, + public IObjectWithSiteImpl, + public IDispatchImpl, + public IShellExtInitImpl, + public IContextMenuImpl +{ +public: + CDropMenuExt() + { + } +public: + class CBuffer + { + public: + CBuffer() { m_pszFiles=NULL; m_iDataSize=0; }; + void Destroy() { delete [] m_pszFiles; m_pszFiles=NULL; m_iDataSize=0; }; + ~CBuffer() { Destroy(); }; + + public: + TCHAR *m_pszFiles; + UINT m_iDataSize; + } m_bBuffer; + + TCHAR m_szDstPath[_MAX_PATH]; + UINT m_uiDropEffect; + bool m_bExplorer; // if the operation has been retrieved from explorer or from the program + +DECLARE_REGISTRY_RESOURCEID(IDR_DROPMENUEXT) +DECLARE_NOT_AGGREGATABLE(CDropMenuExt) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CDropMenuExt) + COM_INTERFACE_ENTRY(IDropMenuExt) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IShellExtInit) + COM_INTERFACE_ENTRY(IContextMenu) + COM_INTERFACE_ENTRY(IObjectWithSite) +END_COM_MAP() + +// IDropMenuExt +public: + STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici); + STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/); + STDMETHOD(GetCommandString)(UINT idCmd, UINT uFlags, UINT* /*pwReserved*/, LPSTR pszName, UINT cchMax); + STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT /*idCmdLast*/, UINT uFlags); +}; + +#endif //__DROPMENUEXT_H_ Index: CopyHandlerShellExt/DropMenuExt.htm =================================================================== diff -u --- CopyHandlerShellExt/DropMenuExt.htm (revision 0) +++ CopyHandlerShellExt/DropMenuExt.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,8 @@ + + +ATL 3.0 test page for object DropMenuExt + + + + + \ No newline at end of file Index: CopyHandlerShellExt/DropMenuExt.rgs =================================================================== diff -u --- CopyHandlerShellExt/DropMenuExt.rgs (revision 0) +++ CopyHandlerShellExt/DropMenuExt.rgs (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,63 @@ +HKCR +{ + CopyHandlerShellExt.DropMenuExt.1 = s 'DropMenuExt Class' + { + CLSID = s '{B46F8244-86E6-43CF-B8AB-8C3A89928A48}' + } + CopyHandlerShellExt.DropMenuExt = s 'DropMenuExt Class' + { + CLSID = s '{B46F8244-86E6-43CF-B8AB-8C3A89928A48}' + CurVer = s 'CopyHandlerShellExt.DropMenuExt.1' + } + NoRemove CLSID + { + ForceRemove {B46F8244-86E6-43CF-B8AB-8C3A89928A48} = s 'DropMenuExt Class' + { + ProgID = s 'CopyHandlerShellExt.DropMenuExt.1' + VersionIndependentProgID = s 'CopyHandlerShellExt.DropMenuExt' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + 'TypeLib' = s '{68FAFC14-8EB8-4DA1-90EB-6B3D22010505}' + ForceRemove shellex + { + ForceRemove MayChangeDefaultMenu + } + } + } + + NoRemove Directory + { + NoRemove Shellex + { + NoRemove DragDropHandlers + { + CopyHandlerShellExt = s '{B46F8244-86E6-43CF-B8AB-8C3A89928A48}' + } + } + } + + NoRemove Drive + { + NoRemove Shellex + { + NoRemove DragDropHandlers + { + CopyHandlerShellExt = s '{B46F8244-86E6-43CF-B8AB-8C3A89928A48}' + } + } + } + + NoRemove Folder + { + NoRemove Shellex + { + NoRemove DragDropHandlers + { + CopyHandlerShellExt = s '{B46F8244-86E6-43CF-B8AB-8C3A89928A48}' + } + } + } +} Index: CopyHandlerShellExt/IContextMenuImpl.h =================================================================== diff -u --- CopyHandlerShellExt/IContextMenuImpl.h (revision 0) +++ CopyHandlerShellExt/IContextMenuImpl.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,68 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __ICONTEXTMENUIMPL_H__ +#define __ICONTEXTMENUIMPL_H__ + +// IContextMenuImpl.h +// +////////////////////////////////////////////////////////////////////// +#include +#include + + +class ATL_NO_VTABLE IContextMenuImpl : public IContextMenu3 +{ +public: + + // IUnknown + // + STDMETHOD(QueryInterface)(REFIID riid, void** ppvObject) = 0; + _ATL_DEBUG_ADDREF_RELEASE_IMPL( IContextMenuImpl ) + + + // IContextMenu + // + STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT) + { + return S_FALSE; + } + + STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO) + { + return S_FALSE; + } + + STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT , UINT, UINT) + { + return S_FALSE; + } + + STDMETHOD(HandleMenuMsg)(UINT, WPARAM, LPARAM) + { + return S_FALSE; + } + + STDMETHOD(HandleMenuMsg2)(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, LRESULT* /*plResult*/) + { + return S_FALSE; + } +}; + +#endif \ No newline at end of file Index: CopyHandlerShellExt/IShellExtInitImpl.h =================================================================== diff -u --- CopyHandlerShellExt/IShellExtInitImpl.h (revision 0) +++ CopyHandlerShellExt/IShellExtInitImpl.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,49 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __ISHELLEXTINITIMPL_H__ +#define __ISHELLEXTINITIMPL_H__ + +// IShellExtInitImpl.h +// +////////////////////////////////////////////////////////////////////// +#include +#include + + +class ATL_NO_VTABLE IShellExtInitImpl : public IShellExtInit +{ +public: + + // IUnknown + // + STDMETHOD(QueryInterface)(REFIID riid, void** ppvObject) = 0; + _ATL_DEBUG_ADDREF_RELEASE_IMPL( IShellExtInitImpl ) + + + // IShellExtInit + // + STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY) + { + return S_FALSE; + }; + +}; + +#endif \ No newline at end of file Index: CopyHandlerShellExt/MenuExt.cpp =================================================================== diff -u --- CopyHandlerShellExt/MenuExt.cpp (revision 0) +++ CopyHandlerShellExt/MenuExt.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,608 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "CopyHandlerShellExt.h" +#include "MenuExt.h" +#include "clipboard.h" +#include "..\Common\ipcstructs.h" +#include "..\Common\FileSupport.h" +#include "stdio.h" +#include "memory.h" +#include "StringHelpers.h" + +extern CSharedConfigStruct* g_pscsShared; + +// globals +void CutAmpersands(LPTSTR lpszString) +{ + int iOffset=0; + int iLength=_tcslen(lpszString); + for (int j=0;jitemID-m_uiFirstID-5)%g_pscsShared->iShortcutsCount; + _SHORTCUT* pShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + + // measure the text + HWND hDesktop=GetDesktopWindow(); + HDC hDC=GetDC(hDesktop); + + // get menu logfont + NONCLIENTMETRICS ncm; + ncm.cbSize=sizeof(NONCLIENTMETRICS); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0); + + HFONT hFont=CreateFontIndirect(&ncm.lfMenuFont); + HFONT hOldFont=(HFONT)SelectObject(hDC, hFont); + + // calc text size + SIZE size; + GetTextExtentPoint32(hDC, pShortcuts[iShortcutIndex].szName, _tcslen(pShortcuts[iShortcutIndex].szName), &size); + + // restore old settings + SelectObject(hDC, hOldFont); + ReleaseDC(hDesktop, hDC); + + // set + lpmis->itemWidth=size.cx+GetSystemMetrics(SM_CXMENUCHECK)+2*GetSystemMetrics(SM_CXSMICON); + lpmis->itemHeight = __max(size.cy+3, GetSystemMetrics(SM_CYMENU)+3); + + break; + } + } + + return S_OK; +} + +void CMenuExt::DrawMenuItem(LPDRAWITEMSTRUCT lpdis) +{ + // check if menu + if (lpdis->CtlType != ODT_MENU) + return; + + // margins and other stuff + const int iSmallIconWidth=GetSystemMetrics(SM_CXSMICON); + const int iSmallIconHeight=GetSystemMetrics(SM_CYSMICON); + const int iLeftMargin=GetSystemMetrics(SM_CXMENUCHECK)/2; + const int iRightMargin=GetSystemMetrics(SM_CXMENUCHECK)-iLeftMargin; + + int iShortcutIndex=(lpdis->itemID-m_uiFirstID-5)%g_pscsShared->iShortcutsCount; + _SHORTCUT* pShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + + // text color + HBRUSH hbr; + if (lpdis->itemState & ODS_SELECTED) + { + SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT)); + hbr=CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); + } + else + { + SetTextColor(lpdis->hDC, GetSysColor(COLOR_MENUTEXT)); + SetBkColor(lpdis->hDC, GetSysColor(COLOR_MENU)); + hbr=CreateSolidBrush(GetSysColor(COLOR_MENU)); + } + + // draw background + RECT rcSelect=lpdis->rcItem; + rcSelect.top++; + rcSelect.bottom--; + + FillRect(lpdis->hDC, &rcSelect, hbr); + DeleteObject(hbr); + + // get img list + SHFILEINFO sfi; + HIMAGELIST himl=(HIMAGELIST)SHGetFileInfo(pShortcuts[iShortcutIndex].szPath, FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_ICON | SHGFI_SYSICONINDEX); + ImageList_Draw(himl, sfi.iIcon, lpdis->hDC, lpdis->rcItem.left+iLeftMargin, + lpdis->rcItem.top+(lpdis->rcItem.bottom-lpdis->rcItem.top+1-iSmallIconHeight)/2, ILD_TRANSPARENT); + + RECT rcText; + rcText.left=iLeftMargin+iSmallIconWidth+iRightMargin; + rcText.top=lpdis->rcItem.top; + rcText.right=lpdis->rcItem.right; + rcText.bottom=lpdis->rcItem.bottom; + +// OTF("Drawing text: %s\r\n", pShortcuts[iShortcutIndex].szName); + DrawText(lpdis->hDC, pShortcuts[iShortcutIndex].szName, -1, &rcText, DT_LEFT | DT_SINGLELINE | DT_VCENTER); +} + +STDMETHODIMP CMenuExt::QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT /*idCmdLast*/, UINT /*uFlags*/) +{ + // find ch window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (!hWnd) + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0); + +/* OTF("CMenuExt::QueryContextMenu - idCmdFirst=%lu, uFlags=%lu (", idCmdFirst, uFlags); + if (uFlags & CMF_CANRENAME) + OTF("CMF_CANRENAME "); + if (uFlags & CMF_DEFAULTONLY) + OTF("CMF_DEFAULTONLY "); + if (uFlags & CMF_EXPLORE) + OTF("CMF_EXPLORE "); + if (uFlags & CMF_EXTENDEDVERBS) + OTF("CMF_EXTENDEDVERBS "); + if (uFlags & CMF_INCLUDESTATIC) + OTF("CMF_INCLUDESTATIC "); + if (uFlags & CMF_NODEFAULT) + OTF("CMF_NODEFAULT "); + if (uFlags & CMF_NORMAL) + OTF("CMF_NORMAL "); + if (uFlags & CMF_NOVERBS) + OTF("CMF_NOVERBS "); + if (uFlags & CMF_VERBSONLY) + OTF("CMF_VERBSONLY "); + OTF(")\r\n"); +*/ + // remember ID of the first command + m_uiFirstID=idCmdFirst; + + // current commands count in menu + TCHAR szText[_MAX_PATH]; + int iCount=::GetMenuItemCount(hmenu); + + MENUITEMINFO mii; + mii.cbSize=sizeof(mii); + mii.fMask=MIIM_TYPE; + mii.dwTypeData=szText; + mii.cch=_MAX_PATH; + + // find a place where the commands should be inserted + for (int i=0;iszData; + + // data about commands + int iCommandCount=0; + + if (!m_bGroupFiles) + { + // paste + if (g_pscsShared->uiFlags & EC_PASTE_FLAG) + { + ::InsertMenu(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING | (IsClipboardFormatAvailable(CF_HDROP) ? MF_ENABLED : MF_GRAYED), + idCmdFirst+0, pCommand[0].szCommand); + iCommandCount++; + } + + if (g_pscsShared->uiFlags & EC_PASTESPECIAL_FLAG) + { + ::InsertMenu(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING | (IsClipboardFormatAvailable(CF_HDROP) ? MF_ENABLED : MF_GRAYED), + idCmdFirst+1, pCommand[1].szCommand); + iCommandCount++; + } + } + +// OTF("After group files\r\n"); + + if (!m_bBackground) + { + CreateShortcutsMenu(idCmdFirst+5, g_pscsShared->bShowShortcutIcons); +// OTF("after creating shortcuts menu\r\n"); + + // copy to > + if (g_pscsShared->uiFlags & EC_COPYTO_FLAG) + { + MENUITEMINFO mii; + mii.cbSize=sizeof(MENUITEMINFO); + mii.fMask=MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE; + mii.fType=MFT_STRING; + mii.fState=(g_pscsShared->iShortcutsCount > 0) ? MFS_ENABLED : MFS_GRAYED; + mii.wID=idCmdFirst+2; + mii.hSubMenu=m_mMenus.hShortcuts[0]; + mii.dwTypeData=pCommand[2].szCommand; + mii.cch=_tcslen(pCommand[2].szCommand); + + ::InsertMenuItem(hmenu, indexMenu++, TRUE, &mii); +// ::InsertMenu(hmenu, indexMenu++, MF_BYPOSITION | MF_POPUP | MF_STRING | ((g_pscsShared->iShortcutsCount > 0) ? MF_ENABLED : MF_GRAYED), +// (UINT)m_mMenus.hShortcuts[0], pCommand[2].szCommand); + iCommandCount++; +// OTF("added menu item\r\n"); + } + + // move to > + if (g_pscsShared->uiFlags & EC_MOVETO_FLAG) + { + MENUITEMINFO mii; + mii.cbSize=sizeof(MENUITEMINFO); + mii.fMask=MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE; + mii.fType=MFT_STRING; + mii.fState=(g_pscsShared->iShortcutsCount > 0) ? MFS_ENABLED : MFS_GRAYED; + mii.wID=idCmdFirst+3; + mii.hSubMenu=m_mMenus.hShortcuts[1]; + mii.dwTypeData=pCommand[3].szCommand; + mii.cch=_tcslen(pCommand[3].szCommand); + + ::InsertMenuItem(hmenu, indexMenu++, TRUE, &mii); +// ::InsertMenu(hmenu, indexMenu++, MF_BYPOSITION | MF_POPUP | MF_STRING | ((g_pscsShared->iShortcutsCount > 0) ? MF_ENABLED : MF_GRAYED), +// (UINT)m_mMenus.hShortcuts[1], pCommand[3].szCommand); + iCommandCount++; + } + + // copy/move to special... > + if (g_pscsShared->uiFlags & EC_COPYMOVETOSPECIAL_FLAG) + { + MENUITEMINFO mii; + mii.cbSize=sizeof(MENUITEMINFO); + mii.fMask=MIIM_ID | MIIM_STATE | MIIM_SUBMENU | MIIM_TYPE; + mii.fType=MFT_STRING; + mii.fState=(g_pscsShared->iShortcutsCount > 0) ? MFS_ENABLED : MFS_GRAYED; + mii.wID=idCmdFirst+4; + mii.hSubMenu=m_mMenus.hShortcuts[2]; + mii.dwTypeData=pCommand[4].szCommand; + mii.cch=_tcslen(pCommand[4].szCommand); + + ::InsertMenuItem(hmenu, indexMenu++, TRUE, &mii); +// ::InsertMenu(hmenu, indexMenu++, MF_BYPOSITION | MF_POPUP | MF_STRING | ((g_pscsShared->iShortcutsCount > 0) ? MF_ENABLED : MF_GRAYED), +// (UINT)m_mMenus.hShortcuts[2], pCommand[4].szCommand); + iCommandCount++; + } + } + +// OTF("before return\r\n"); + return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, g_pscsShared->iCommandCount+(m_bBackground ? 0 : 3*g_pscsShared->iShortcutsCount)); +} + +void CMenuExt::CreateShortcutsMenu(UINT uiIDBase, bool bOwnerDrawn) +{ +// OTF("CreateShortcutsMenu\r\n"); + + // tw�rz puste menu + m_mMenus.hShortcuts[0]=CreatePopupMenu(); + m_mMenus.hShortcuts[1]=CreatePopupMenu(); + m_mMenus.hShortcuts[2]=CreatePopupMenu(); + + // fill with shortcuts + _SHORTCUT* pShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + TCHAR szText[256], szSize[32]; + __int64 iiFree; + + for (int i=0;iiShortcutsCount;i++) + { + // modify text + if (g_pscsShared->bShowFreeSpace && GetDynamicFreeSpace(pShortcuts[i].szPath, &iiFree, NULL)) + { + _stprintf(szText, _T("%s (%s)"), pShortcuts[i].szName, GetSizeString(iiFree, szSize)); + _tcsncpy(pShortcuts[i].szName, szText, 127); +// OTF("Text to display=%s\r\n", pShortcuts[i].szName); + pShortcuts[i].szName[127]=_T('\0'); + } + + // add to all menus + for (int j=0;j<3;j++) + ::InsertMenu(m_mMenus.hShortcuts[j], i, MF_BYPOSITION | MF_ENABLED | (bOwnerDrawn ? MF_OWNERDRAW : 0), uiIDBase+i+j*g_pscsShared->iShortcutsCount, (bOwnerDrawn ? NULL : pShortcuts[i].szName)); + } +} + +STDMETHODIMP CMenuExt::GetCommandString(UINT idCmd, UINT uFlags, UINT* /*pwReserved*/, LPSTR pszName, UINT cchMax) +{ + if (uFlags == GCS_HELPTEXTW) + { + USES_CONVERSION; + // find window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (!hWnd) + wcscpy(reinterpret_cast(pszName), L""); + + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + + switch (idCmd) + { + case 0: + case 1: + case 2: + case 3: + case 4: + wcsncpy(reinterpret_cast(pszName), A2W(pCommand[idCmd].szDesc), cchMax); + break; + default: + _SHORTCUT* pShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + if ((int)(idCmd-5) < g_pscsShared->iShortcutsCount*3) + wcsncpy(reinterpret_cast(pszName), A2W(pShortcuts[(idCmd-5)%g_pscsShared->iShortcutsCount].szPath), cchMax); + else + wcsncpy(reinterpret_cast(pszName), L"", cchMax); + } + } + if (uFlags == GCS_HELPTEXTA) + { + // find window + HWND hWnd; + hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + + if (!hWnd) + strcpy(pszName, ""); + + _COMMAND* pCommand=(_COMMAND*)g_pscsShared->szData; + + switch (idCmd) + { + case 0: + case 1: + case 2: + case 3: + case 4: + strncpy(pszName, pCommand[idCmd].szDesc, cchMax); + break; + default: // rest of commands + _SHORTCUT* pShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + if ((int)(idCmd-5) < g_pscsShared->iShortcutsCount*3) + strncpy(pszName, pShortcuts[(idCmd-5)%g_pscsShared->iShortcutsCount].szPath, cchMax); + else + strncpy(pszName, "", cchMax); + } + } + + return S_OK; +} + + +STDMETHODIMP CMenuExt::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/) +{ + // find ch window + HWND hWnd=::FindWindow(_T("Copy Handler Wnd Class"), _T("Copy handler")); + if (hWnd == NULL) + return E_FAIL; + + // get cfg from ch + ::SendMessage(hWnd, WM_GETCONFIG, GC_EXPLORER, 0); + + // read dest folder + m_szDstPath[0]=_T('\0'); + + // TEMP +// OTF("****************************************************************\r\n"); +// OTF("CMenuExt::Initialize: pidlFolder=%lu, lpdobj=%lu\r\n", pidlFolder, lpdobj); + + // get data from IDataObject - files to copy/move + bool bPathFound=false; + m_bGroupFiles=false; + if (lpdobj) + { + STGMEDIUM medium; + FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL}; + + HRESULT hr = lpdobj->GetData(&fe, &medium); + if (FAILED(hr)) + return E_FAIL; + + // copy all filenames to a table + GetDataFromClipboard(static_cast(medium.hGlobal), NULL, &m_bBuffer.m_pszFiles, &m_bBuffer.m_iDataSize); + + // find the first non-empty entry + UINT fileCount = DragQueryFile((HDROP)medium.hGlobal, 0xFFFFFFFF, NULL, 0); + TCHAR szPath[_MAX_PATH]; + UINT uiRes; + for (UINT i=0;iszData; + +// OTF("Invoke Command\r\n"); + // command type + switch (LOWORD(lpici->lpVerb)) + { + // paste & paste special + case 0: + case 1: + { + // search for data in a clipboard + if (IsClipboardFormatAvailable(CF_HDROP)) + { + bool bMove=false; // 0-copy, 1-move + + // get data + OpenClipboard(lpici->hwnd); + HANDLE handle=GetClipboardData(CF_HDROP); + char *pchBuffer=NULL; + UINT uiSize; + + GetDataFromClipboard(static_cast(handle), m_szDstPath, &pchBuffer, &uiSize); + + // register clipboard format nad if exists in it + UINT nFormat=RegisterClipboardFormat(_T("Preferred DropEffect")); + if (IsClipboardFormatAvailable(nFormat)) + { + HANDLE handle=GetClipboardData(nFormat); + LPVOID addr=GlobalLock(handle); + + DWORD dwData=((DWORD*)addr)[0]; + if (dwData & DROPEFFECT_MOVE) + bMove=true; + + GlobalUnlock(handle); + } + + CloseClipboard(); + + // fill struct + COPYDATASTRUCT cds; + cds.dwData=(((DWORD)bMove) << 31) | pCommand[LOWORD(lpici->lpVerb)].uiCommandID; + cds.lpData=pchBuffer; + cds.cbData=uiSize; + + // send a message + ::SendMessage(hWnd, WM_COPYDATA, reinterpret_cast(lpici->hwnd), reinterpret_cast(&cds)); + + // delete buffer + delete [] pchBuffer; + } + } + break; + +// case 2: +// case 3: +// case 4: + default: + { + // out of range - may be a shortcut + if (LOWORD(lpici->lpVerb) < g_pscsShared->iCommandCount+(m_bBackground ? 0 : 3*g_pscsShared->iShortcutsCount)) + { + // addr of a table with shortcuts + _SHORTCUT* stShortcuts=(_SHORTCUT*)(g_pscsShared->szData+g_pscsShared->iCommandCount*sizeof(_COMMAND)); + + // find command for which this command is generated + int iCommandIndex=(int)(((LOWORD(lpici->lpVerb)-5) / g_pscsShared->iShortcutsCount))+2; // command index + int iShortcutIndex=((LOWORD(lpici->lpVerb)-5) % g_pscsShared->iShortcutsCount); // shortcut index + + // buffer for data + UINT uiSize=_tcslen(stShortcuts[iShortcutIndex].szPath)+1+m_bBuffer.m_iDataSize; + TCHAR *pszBuffer=new TCHAR[uiSize]; + _tcscpy(pszBuffer, stShortcuts[iShortcutIndex].szPath); // �cie�ka docelowa + + // buffer with files + memcpy(pszBuffer+_tcslen(stShortcuts[iShortcutIndex].szPath)+1, m_bBuffer.m_pszFiles, m_bBuffer.m_iDataSize*sizeof(TCHAR)); + + // fill struct + COPYDATASTRUCT cds; + cds.dwData=pCommand[iCommandIndex].uiCommandID; + cds.lpData=pszBuffer; + cds.cbData=uiSize; + + // send message + ::SendMessage(hWnd, WM_COPYDATA, reinterpret_cast(lpici->hwnd), reinterpret_cast(&cds)); + + // delete bufor + delete [] pszBuffer; + m_bBuffer.Destroy(); + } + else + return E_FAIL; + } + break; + } + + return S_OK; +} Index: CopyHandlerShellExt/MenuExt.h =================================================================== diff -u --- CopyHandlerShellExt/MenuExt.h (revision 0) +++ CopyHandlerShellExt/MenuExt.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,111 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __MENUEXT_H_ +#define __MENUEXT_H_ + +#include "resource.h" // main symbols +#include "comdef.h" + +#include "IShellExtInitImpl.h" +#include "IContextMenuImpl.h" + +/////// +// globals +void CutAmpersands(LPTSTR lpszString); + +///////////////////////////////////////////////////////////////////////////// +// CMenuExt +class ATL_NO_VTABLE CMenuExt : + public CComObjectRootEx, + public CComCoClass, + public IObjectWithSiteImpl, + public IDispatchImpl, + public IShellExtInitImpl, + public IContextMenuImpl +{ +public: + CMenuExt() + { + } +public: + // class for making sure memory is freed + class CBuffer + { + public: + CBuffer() { m_pszFiles=NULL; m_iDataSize=0; }; + void Destroy() { delete [] m_pszFiles; m_pszFiles=NULL; m_iDataSize=0; }; + ~CBuffer() { Destroy(); }; + + public: + TCHAR *m_pszFiles; + UINT m_iDataSize; + } m_bBuffer; + + TCHAR m_szDstPath[_MAX_PATH]; + + // for making sure DestroyMenu would be called + class CSubMenus + { + public: + CSubMenus() { hShortcuts[0]=NULL; hShortcuts[1]=NULL; hShortcuts[2]=NULL; }; + void Destroy() { for (int i=0;i<3;i++) { if (hShortcuts[i] != NULL) DestroyMenu(hShortcuts[i]); } }; + ~CSubMenus() { Destroy(); }; + + public: + HMENU hShortcuts[3]; + } m_mMenus; + + bool m_bBackground; // folder or folder background + bool m_bGroupFiles; // if the group of files have a files in it + + UINT m_uiFirstID; // first menu ID + bool m_bShown; // have the menu been already shown ?czy pokazano ju� menu + +DECLARE_REGISTRY_RESOURCEID(IDR_MENUEXT) +DECLARE_NOT_AGGREGATABLE(CMenuExt) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CMenuExt) + COM_INTERFACE_ENTRY(IMenuExt) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(IShellExtInit) + COM_INTERFACE_ENTRY(IContextMenu) + COM_INTERFACE_ENTRY(IContextMenu2) + COM_INTERFACE_ENTRY(IContextMenu3) + COM_INTERFACE_ENTRY(IObjectWithSite) +END_COM_MAP() + +// IMenuExt +public: + STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY /*hkeyProgID*/); + STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici); + STDMETHOD(GetCommandString)(UINT idCmd, UINT uFlags, UINT* /*pwReserved*/, LPSTR pszName, UINT cchMax); + STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT /*idCmdLast*/, UINT /*uFlags*/); + STDMETHOD(HandleMenuMsg)(UINT uMsg, WPARAM wParam, LPARAM lParam); + STDMETHOD(HandleMenuMsg2)(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult); + +protected: + void DrawMenuItem(LPDRAWITEMSTRUCT lpdis); + void CreateShortcutsMenu(UINT uiIDBase, bool bOwnerDrawn); +}; + +#endif //__MENUEXT_H_ Index: CopyHandlerShellExt/MenuExt.htm =================================================================== diff -u --- CopyHandlerShellExt/MenuExt.htm (revision 0) +++ CopyHandlerShellExt/MenuExt.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,8 @@ + + +ATL 3.0 test page for object MenuExt + + + + + \ No newline at end of file Index: CopyHandlerShellExt/MenuExt.rgs =================================================================== diff -u --- CopyHandlerShellExt/MenuExt.rgs (revision 0) +++ CopyHandlerShellExt/MenuExt.rgs (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,74 @@ +HKCR +{ + CopyHandlerShellExt.MenuExt.1 = s 'MenuExt Class' + { + CLSID = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + } + CopyHandlerShellExt.MenuExt = s 'MenuExt Class' + { + CLSID = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + CurVer = s 'CopyHandlerShellExt.MenuExt.1' + } + NoRemove CLSID + { + ForceRemove {E7A4C2DA-F3AF-4145-AC19-E3B215306A54} = s 'MenuExt Class' + { + ProgID = s 'CopyHandlerShellExt.MenuExt.1' + VersionIndependentProgID = s 'CopyHandlerShellExt.MenuExt' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + 'TypeLib' = s '{68FAFC14-8EB8-4DA1-90EB-6B3D22010505}' + } + } + + NoRemove Directory + { + NoRemove Shellex + { + NoRemove ContextMenuHandlers + { + CopyHandlerShellExt = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + } + } + } + + NoRemove Directory + { + NoRemove Background + { + NoRemove Shellex + { + NoRemove ContextMenuHandlers + { + CopyHandlerShellExt = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + } + } + } + } + + NoRemove Folder + { + NoRemove Shellex + { + NoRemove ContextMenuHandlers + { + CopyHandlerShellExt = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + } + } + } + + NoRemove * + { + NoRemove Shellex + { + NoRemove ContextMenuHandlers + { + CopyHandlerShellExt = s '{E7A4C2DA-F3AF-4145-AC19-E3B215306A54}' + } + } + } + +} Index: CopyHandlerShellExt/StdAfx.cpp =================================================================== diff -u --- CopyHandlerShellExt/StdAfx.cpp (revision 0) +++ CopyHandlerShellExt/StdAfx.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,28 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include +#include +#endif + +#include Index: CopyHandlerShellExt/StdAfx.h =================================================================== diff -u --- CopyHandlerShellExt/StdAfx.h (revision 0) +++ CopyHandlerShellExt/StdAfx.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#ifndef __STDAFX_H__ +#define __STDAFX_H__ + +#define STRICT +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0400 +#endif +#define _ATL_APARTMENT_THREADED + +// include for MFC Support +//#include +//#include + +#include +//You may derive a class from CComModule and use it if you want to override +//something, but do not change the name of _Module +extern CComModule _Module; +#include + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif Index: CopyHandlerShellExt/StringHelpers.cpp =================================================================== diff -u --- CopyHandlerShellExt/StringHelpers.cpp (revision 0) +++ CopyHandlerShellExt/StringHelpers.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,39 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "StringHelpers.h" +#include "stdio.h" + +LPTSTR GetSizeString(double dData, LPTSTR pszBuffer) +{ + if (dData < 0.0) + dData=0.0; + + if (dData < 1200.0) + _stprintf(pszBuffer, _T("%.2f %s"), dData, g_pscsShared->szSizes[0]); + else if (dData < 1228800.0) + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1024.0, g_pscsShared->szSizes[1]); + else if (dData < 1258291200.0) + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1048576.0, g_pscsShared->szSizes[2]); + else + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(dData)/1073741824.0, g_pscsShared->szSizes[3]); + + return pszBuffer; +} Index: CopyHandlerShellExt/StringHelpers.h =================================================================== diff -u --- CopyHandlerShellExt/StringHelpers.h (revision 0) +++ CopyHandlerShellExt/StringHelpers.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,56 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __STRINGHELPERS_H__ +#define __STRINGHELPERS_H__ + +#include "..\common\ipcstructs.h" + +extern CSharedConfigStruct* g_pscsShared; + +LPTSTR GetSizeString(double dData, LPTSTR pszBuffer); + +template LPTSTR GetSizeString(T tData, LPTSTR pszBuffer, bool bStrict=false) +{ + if (tData < 0) + tData=0; + + if (tData >= 1258291200 && (!bStrict || (tData % 1073741824) == 0)) + { + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(tData)/1073741824.0, g_pscsShared->szSizes[3]); + return pszBuffer; + } + else if (tData >= 1228800 && (!bStrict || (tData % 1048576) == 0)) + { + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(tData)/1048576.0, g_pscsShared->szSizes[2]); + return pszBuffer; + } + else if (tData >= 1200 && (!bStrict || (tData % 1024) == 0)) + { + _stprintf(pszBuffer, _T("%.2f %s"), static_cast(tData)/1024.0, g_pscsShared->szSizes[1]); + return pszBuffer; + } + else + { + _stprintf(pszBuffer, _T("%d %s"), tData, g_pscsShared->szSizes[0]); + return pszBuffer; + } +} + +#endif Index: CopyHandlerShellExt/clipboard.cpp =================================================================== diff -u --- CopyHandlerShellExt/clipboard.cpp (revision 0) +++ CopyHandlerShellExt/clipboard.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,53 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "clipboard.h" + +void GetDataFromClipboard(HDROP hdrop, LPCTSTR pszDstPath, LPTSTR *pszBuffer, UINT* pSize) +{ + // get clipboard data + UINT uiBufferSize=(pszDstPath == NULL) ? 0 : _tcslen(pszDstPath)+1; + UINT uiFilesCount=DragQueryFile(hdrop, 0xffffffff, NULL, 0); + + // count size + for (UINT i=0;i + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN_PROXY_FILE( CopyHandlerShellExt ) + + +PROXYFILE_LIST_START +/* Start of list */ + REFERENCE_PROXY_FILE( CopyHandlerShellExt ), +/* End of list */ +PROXYFILE_LIST_END + + +DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID ) + +#ifdef __cplusplus +} /*extern "C" */ +#endif + +/* end of generated dlldata file */ Index: CopyHandlerShellExt/resource.h =================================================================== diff -u --- CopyHandlerShellExt/resource.h (revision 0) +++ CopyHandlerShellExt/resource.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by CopyHandlerShellExt.rc +// +#define IDS_COPYBYCH_STRING 1 +#define IDS_MOVEBYCH_STRING 2 +#define IDS_SPECIALCOPYMOVE_STRING 3 +#define IDS_COPYBYCHDESC_STRING 4 +#define IDS_MOVEBYCHDESC_STRING 5 +#define IDS_COPYMOVESPECIALDESC_STRING 6 +#define IDS_PASTEBYCH_STRING 7 +#define IDS_PASTEBYCHSPECIAL_STRING 8 +#define IDS_PASTEBYCHDESC_STRING 9 +#define IDS_PASTEBYCHSPECDESC_STRING 10 +#define IDR_MENUEXT 102 +#define IDR_DROPMENUEXT 103 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 104 +#endif +#endif Index: License.txt =================================================================== diff -u --- License.txt (revision 0) +++ License.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Index: bin/Release/License.txt =================================================================== diff -u --- bin/Release/License.txt (revision 0) +++ bin/Release/License.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Index: bin/Release/ch.ini =================================================================== diff -u --- bin/Release/ch.ini (revision 0) +++ bin/Release/ch.ini (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,94 @@ + +[Config] +Current configuration name=Default + + +[Program] +Enabled clipboard monitoring=0 +Monitor scan interval=1000 +Reload after restart=0 +Shutdown system after finished=0 +Time before shutdown=10000 +Force shutdown=0 +Autosave interval=30000 +Process priority class=32 +Autosave directory=\ +Plugins directory=\Plugins\ +Help directory=\..\..\other\Help\ +Language=\..\..\other\Langs\English.lng +Languages directory=\..\..\other\Langs\ + +[Status dialog] +Status refresh interval=1000 +Show details=1 +Auto remove finished=0 + +[Folder dialog] +Dialog width=-1 +Dialog height=-1 +Shortcut list style=1 +Extended view=1 +Ignore shell dialogs=0 + +[Mini view] +Show filenames=1 +Show single tasks=1 +Miniview refresh interval=200 +Autoshow when run=1 +Autohide when empty=1 +Use smooth progress=1 + +[Copying/moving] +Use auto-complete files=1 +Always set destination attributes=1 +Always set destination time=1 +Protect read-only files=0 +Limit max operations=1 +Read tasks size before blocking=1 +Show visual feedback=2 +Use timed feedback dialogs=0 +Feedback time=60000 +Auto retry on error=1 +Auto retry interval=10000 +Default priority=0 +Disable priority boost=0 +Delete files after finished=1 +Create log file=1 + +[Shell] +Show 'Copy' command=1 +Show 'Move' command=1 +Show 'Copy/move special' command=1 +Show 'Paste' command=1 +Show 'Paste special' command=1 +Show 'Copy to' command=1 +Show 'Move to' command=1 +Show 'Copy to/Move to special' command=1 +Show free space along with shortcut=1 +Show shell icons in shortcuts menu=0 +Use drag&drop default menu item override=1 +Default action when dragging=3 + +[Buffer] +Use only default buffer=0 +Default buffer size=2097152 +One physical disk buffer size=4194304 +Two different hard disks buffer size=524288 +CD buffer size=262144 +LAN buffer size=131072 +Use no buffering for large files=1 +Large files lower boundary limit=2097152 + +[Sounds] +Play sounds=1 +Error sound path=\media\chord.wav +Finished sound path=\media\ding.wav + +[Log file] +Path to main log file=\ch.log +Enable logging=1 +Enable log size limitation=1 +Max log size limit=65535 +Precise log size limiting=0 +Truncation buffer size=65535 + Index: ch_count.txt =================================================================== diff -u --- ch_count.txt (revision 0) +++ ch_count.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,3 @@ +Debug builds: 943 +Release builds: 131 +All builds: 1074 Index: chext_count.txt =================================================================== diff -u --- chext_count.txt (revision 0) +++ chext_count.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,3 @@ +Debug builds: 58 +Release builds: 130 +All builds: 188 Index: modules/App Framework/AppHelper.cpp =================================================================== diff -u --- modules/App Framework/AppHelper.cpp (revision 0) +++ modules/App Framework/AppHelper.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,281 @@ +#include "stdafx.h" +#include "AppHelper.h" +#include "shlobj.h" + +CAppHelper::CAppHelper() +{ + // read program paths + RetrievePaths(); + + // retrieve VERSION-based info + RetrieveAppInfo(); + + // single-instance protection + m_bFirstInstance=true; + m_hMutex=NULL; + + // name of the protection mutex + m_pszMutexName=new TCHAR[_tcslen(m_pszAppName)+sizeof(_T("__ instance"))/sizeof(TCHAR)+1]; + _stprintf(m_pszMutexName, _T("_%s_ instance"), m_pszAppName); + _tcslwr(m_pszMutexName+2); // first letter of appname has to be of predefined case +} + +CAppHelper::~CAppHelper() +{ + if (m_hMutex) + ReleaseMutex(m_hMutex); + + delete [] m_pszProgramPath; + delete [] m_pszProgramName; + delete [] m_pszAppName; + delete [] m_pszAppNameVer; + delete [] m_pszAppVersion; + delete [] m_pszMutexName; +} + +// inits mutex app protection +void CAppHelper::InitProtection() +{ + m_hMutex=CreateMutex(NULL, TRUE, m_pszMutexName); + m_bFirstInstance=(m_hMutex != NULL && GetLastError() != ERROR_ALREADY_EXISTS); +} + +// retrieves application path +void CAppHelper::RetrievePaths() +{ + // try to find '\\' in path to see if this is only exe name or fully qualified path + TCHAR* pszName=_tcsrchr(__argv[0], _T('\\')); + if (pszName != NULL) + { + // copy name + m_pszProgramName=new TCHAR[_tcslen(pszName+1)+1]; + _tcscpy(m_pszProgramName, pszName+1); + + // path + UINT uiSize=(UINT)(pszName-__argv[0]); + m_pszProgramPath=new TCHAR[uiSize+1]; + _tcsncpy(m_pszProgramPath, __argv[0], uiSize); + m_pszProgramPath[uiSize]=_T('\0'); + } + else + { + // copy name + m_pszProgramName=new TCHAR[_tcslen(__argv[0])+1]; + _tcscpy(m_pszProgramName, __argv[0]); + + // path + TCHAR szPath[_MAX_PATH]; + UINT uiSize=GetCurrentDirectory(_MAX_PATH, szPath); + _tcscat(szPath, _T("\\")); + m_pszProgramPath=new TCHAR[uiSize+2]; + _tcsncpy(m_pszProgramPath, szPath, uiSize+2); + } +} + +void CAppHelper::RetrieveAppInfo() +{ + if (m_pszAppName) + { + delete [] m_pszAppName; + m_pszAppName=NULL; + } + if (m_pszAppNameVer) + { + delete [] m_pszAppNameVer; + m_pszAppNameVer=NULL; + } + if (m_pszAppVersion) + { + delete [] m_pszAppVersion; + m_pszAppVersion=NULL; + } + + TCHAR *pszPath=new TCHAR[_tcslen(m_pszProgramPath)+_tcslen(m_pszProgramName)+2]; + _tcscpy(pszPath, m_pszProgramPath); + _tcscat(pszPath, _T("\\")); + _tcscat(pszPath, m_pszProgramName); + + DWORD dwHandle; + DWORD dwSize=GetFileVersionInfoSize(pszPath, &dwHandle); + if (dwSize) + { + BYTE *pbyBuffer=new BYTE[dwSize]; + if (GetFileVersionInfo(pszPath, 0, dwSize, pbyBuffer)) + { + TCHAR* pszProp; + UINT uiLen; + // product name with short version number + if (VerQueryValue(pbyBuffer, _T("\\StringFileInfo\\040904b0\\ProductName"), (LPVOID*)&pszProp, &uiLen)) + { + m_pszAppNameVer=new TCHAR[uiLen]; + _tcscpy(m_pszAppNameVer, pszProp); + } + + // product long version + if (VerQueryValue(pbyBuffer, _T("\\StringFileInfo\\040904b0\\ProductVersion"), (LPVOID*)&pszProp, &uiLen)) + { + m_pszAppVersion=new TCHAR[uiLen]; + _tcscpy(m_pszAppVersion, pszProp); + } + + // product name without version number + if (VerQueryValue(pbyBuffer, _T("\\StringFileInfo\\040904b0\\InternalName"), (LPVOID*)&pszProp, &uiLen)) + { + m_pszAppName=new TCHAR[uiLen]; + _tcscpy(m_pszAppName, pszProp); + } + } + + delete [] pbyBuffer; + } + delete [] pszPath; + + if (m_pszAppNameVer == NULL) + { + m_pszAppNameVer=new TCHAR[sizeof(_T("Unknown App 1.0"))/sizeof(TCHAR)]; + _tcscpy(m_pszAppNameVer, _T("Unknown App 1.0")); + } + if (m_pszAppVersion == NULL) + { + m_pszAppVersion=new TCHAR[sizeof(_T("1.0.0.0"))/sizeof(TCHAR)]; + _tcscpy(m_pszAppVersion, _T("1.0.0.0")); + } + if (m_pszAppName == NULL) + { + m_pszAppName=new TCHAR[sizeof(_T("Unknown App"))/sizeof(TCHAR)]; + _tcscpy(m_pszAppName, _T("Unknown App")); + } +} + +// internal func - safe getting special folder locations +UINT CAppHelper::GetFolderLocation(int iFolder, PTSTR pszBuffer) +{ + LPITEMIDLIST piid; + HRESULT h=SHGetSpecialFolderLocation(NULL, iFolder, &piid); + if (!SUCCEEDED(h)) + return false; + + // get path + BOOL bRes=SHGetPathFromIDList(piid, pszBuffer); + + // free piid + LPMALLOC lpm; + if (!SUCCEEDED(SHGetMalloc(&lpm))) + return 0; + + lpm->Free((void*)piid); + lpm->Release(); + + // check for error + if (!bRes) + return 0; + + // strip the last '\\' + UINT uiLen=(UINT)_tcslen(pszBuffer); + if (pszBuffer[uiLen-1] == _T('\\')) + { + pszBuffer[uiLen-1]=_T('\0'); + return uiLen-1; + } + else + return uiLen; +} + +// expands given path +PTSTR CAppHelper::ExpandPath(PTSTR pszString) +{ + // check if there is need to perform all these checkings + if (pszString[0] != _T('<')) + return pszString; + + TCHAR szStr[_MAX_PATH]; + szStr[0]=_T('\0'); + + // search for string to replace + // _T(""), _T(""), _T(""), _T(""), _T(""), + // _T(""), _T("") + if (_tcsnicmp(pszString, _T(""), 9) == 0) + { + // get windows path + _tcscpy(szStr, m_pszProgramPath); + _tcscat(szStr, pszString+9); + } + else if (_tcsnicmp(pszString, _T(""), 9) == 0) + { + // get windows path + UINT uiSize=GetWindowsDirectory(szStr, _MAX_PATH); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+9); + } + else if (_tcsnicmp(pszString, _T(""), 6) == 0) // temp dir + { + // get windows path + UINT uiSize=GetTempPath(_MAX_PATH, szStr); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+6); + } + else if (_tcsnicmp(pszString, _T(""), 8) == 0) // system + { + // get windows path + UINT uiSize=GetSystemDirectory(szStr, _MAX_PATH); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+8); + } + else if (_tcsnicmp(pszString, _T(""), 9) == 0) // app data + { + // get windows path + UINT uiSize=GetFolderLocation(CSIDL_APPDATA, szStr); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+9); + } + else if (_tcsnicmp(pszString, _T(""), 9) == 0) // desktop + { + // get windows path + UINT uiSize=GetFolderLocation(CSIDL_DESKTOPDIRECTORY, szStr); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+9); + } + else if (_tcsnicmp(pszString, _T(""), 10) == 0) // personal... + { + // get windows path + UINT uiSize=GetFolderLocation(CSIDL_PERSONAL, szStr); + if (szStr[uiSize-1] == _T('\\')) + szStr[uiSize-1]=_T('\0'); + _tcscat(szStr, pszString+10); + } + + // copy to src string + if (szStr[0] != _T('\0')) + _tcscpy(pszString, szStr); + + return pszString; +} + +void CAppHelper::SetAutorun(bool bState) +{ + // storing key in registry + HKEY hkeyRun; + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_ALL_ACCESS, &hkeyRun) != ERROR_SUCCESS) + return; + + if (bState) + { + TCHAR *pszPath=new TCHAR[_tcslen(m_pszProgramPath)+_tcslen(m_pszProgramName)+2]; + _tcscpy(pszPath, m_pszProgramPath); + _tcscat(pszPath, _T("\\")); + _tcscat(pszPath, m_pszProgramName); + + RegSetValueEx(hkeyRun, m_pszAppName, 0, REG_SZ, (BYTE*)pszPath, (DWORD)(_tcslen(pszPath)+1)*sizeof(TCHAR)); + + delete [] pszPath; + } + else + RegDeleteValue(hkeyRun, m_pszAppName); + + RegCloseKey(hkeyRun); +} Index: modules/App Framework/AppHelper.h =================================================================== diff -u --- modules/App Framework/AppHelper.h (revision 0) +++ modules/App Framework/AppHelper.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,42 @@ +#ifndef __APPHELPER_H__ +#define __APPHELPER_H__ + +class CAppHelper +{ +public: + CAppHelper(); + ~CAppHelper(); + + void SetAutorun(bool bState); // changes state of "run with system" option + PTSTR ExpandPath(PTSTR pszString); // expands path string - ie. into c:\windows + + bool IsFirstInstance() const { return m_bFirstInstance; }; + + PCTSTR GetAppName() const { return m_pszAppName; }; + PCTSTR GetAppNameVer() const { return m_pszAppNameVer; }; + PCTSTR GetAppVersion() const { return m_pszAppVersion; }; + + PCTSTR GetProgramPath() const { return m_pszProgramPath; }; + PCTSTR GetProgramName() const { return m_pszProgramName; }; + +protected: + void InitProtection(); // optional call - protects from running multiple instance + void RetrievePaths(); // reads program's path and name + void RetrieveAppInfo(); // reads app name and version from VERSION resource + UINT GetFolderLocation(int iFolder, PTSTR pszBuffer); + +protected: + HANDLE m_hMutex; + bool m_bFirstInstance; // tells if it is first instance(true) or second(or third, ...) + TCHAR *m_pszMutexName; // name of the protection mutex + + // program placement + TCHAR* m_pszProgramPath; // path from which this program was run + TCHAR* m_pszProgramName; // name of this program (ie. CH.exe) + + TCHAR* m_pszAppName; // app-name string of this app + TCHAR* m_pszAppNameVer; // extended app-name-with small version + TCHAR* m_pszAppVersion; // app-version string of this app (VERSION based) +}; + +#endif \ No newline at end of file Index: modules/App Framework/ConfigManager.cpp =================================================================== diff -u --- modules/App Framework/ConfigManager.cpp (revision 0) +++ modules/App Framework/ConfigManager.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,802 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "ConfigManager.h" +#ifndef DISABLE_CRYPT +#include "crypt.h" +#include "conv.h" +#endif + +#define CFG_PROFILE _T("Common") +#define CFG_SECTION _T("Config") +#define CFG_KEY _T("Current configuration name") +#define CFG_DEFAULTSECTION _T("Default") + +#define CFG_MAXCOMPOUND 500 /* max count of items in a compound property */ + +/////////////////////////////////////////////////////////////// +// Opens configuration file. +// This function should be called only once - isn't thread safe +// Doesn't throw any file exception. If physical file couldn't +// be opened - this class does not require it. Could work +// without saving options to file, or with read-only files. +// pszFilename [in] - path to the configuration file +/////////////////////////////////////////////////////////////// +void CConfigManager::Open(LPCTSTR pszFilename) +{ + // load text file, and process it in ini file + try + { + ((CIniFile*)this)->Open(pszFilename, NULL, false); + } + catch(CFileExceptionEx* e) + { + // report error + TCHAR szData[1024]; + szData[1023]=_T('\0'); + _sntprintf(szData, 1023, _T("[Config Manager]: Couldn't open file %s to read initial data;\r\n\tReason: %s."), pszFilename, e->m_pszReason); + Report(szData); + + delete e; // get rid of this exception (file works doesn't work) + + // file couldn't be loaded... - create default section + m_pszCurrentConfig=new TCHAR[8]; + _tcscpy(m_pszCurrentConfig, CFG_DEFAULTSECTION); + SetString(CFG_PROFILE, CFG_SECTION, CFG_KEY, m_pszCurrentConfig); + return; + } + + // now - read current config name from cfg + if (!GetStr(CFG_PROFILE, CFG_SECTION, CFG_KEY, m_szBuffer, _T(""))) + { + // current config not found - the first found would be current + vector<_PROFILE*>::const_iterator it=m_vConfigProfiles.begin(); + + while (it != m_vConfigProfiles.end()) + { + // check if element 0 isn't + if (_tcsicmp((*it)->pszProfileName, CFG_PROFILE) != 0) + { + // set current cfg to the found one + m_pszCurrentConfig=new TCHAR[_tcslen((*it)->pszProfileName)+1]; + _tcscpy(m_pszCurrentConfig, (*it)->pszProfileName); + + // save current selection + SetString(CFG_PROFILE, CFG_SECTION, CFG_KEY, m_pszCurrentConfig); + break; // we've found what was needed - stop processing + } + it++; + } + + // if not found - create default + if (m_pszCurrentConfig == NULL) + { + m_pszCurrentConfig=new TCHAR[8]; + _tcscpy(m_pszCurrentConfig, CFG_DEFAULTSECTION); + SetString(CFG_PROFILE, CFG_SECTION, CFG_KEY, m_pszCurrentConfig); + } + } + else + { + // section found - copy it + m_pszCurrentConfig=new TCHAR[_tcslen(m_szBuffer)+1]; + _tcscpy(m_pszCurrentConfig, m_szBuffer); + } +} + +/////////////////////////////////////////////////////////////// +// Tries to save settings to the configuration file. If +// couldn't be saved - function reports it through Report func +// and doesn't save data to file (this allows to use read-only +// attribute on config file). +/////////////////////////////////////////////////////////////// +void CConfigManager::Save() +{ + EnterCriticalSection(&m_cs); + // copy data into ini file object + vector<_CFGENTRY*>::const_iterator it=m_vCfgData.begin(); + while (it != m_vCfgData.end()) + WriteProperty(*it++); + + // save file + try + { + ((CIniFile*)this)->Save(); + } + catch(CFileExceptionEx* e) + { + TCHAR szData[1024]; + e->GetInfo(_T("[Config Manager]: Couldn't save configuration file."), szData, 1024); + Report(szData); + delete e; + + LeaveCriticalSection(&m_cs); + return; + } + catch(...) + { + LeaveCriticalSection(&m_cs); + throw; + } + + LeaveCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Closes this configuration file (saves data before closing). +// If couldn't be saved/closed - it reports the fact and allows +// to continue (allows usage of read-only files). +/////////////////////////////////////////////////////////////// +void CConfigManager::Close() +{ + // store all data into .ini object + EnterCriticalSection(&m_cs); + vector<_CFGENTRY*>::const_iterator it=m_vCfgData.begin(); + while (it != m_vCfgData.end()) + { + WriteProperty(*it); + FreeEntry(*it++); + } + + // free all + m_vCfgData.clear(); + + // free current config name + delete [] m_pszCurrentConfig; + m_pszCurrentConfig=NULL; + + // destroy base... + try + { + ((CIniFile*)this)->Close(); // storing data, closing file in a base class + } + catch(CFileExceptionEx* e) + { + TCHAR szData[1024]; + e->GetInfo(_T("[Config Manager]: Couldn't properly save/close file."), szData, 1024); + Report(szData); + + delete e; + + LeaveCriticalSection(&m_cs); + return; + } + catch(...) + { + LeaveCriticalSection(&m_cs); + throw; + } + + LeaveCriticalSection(&m_cs); +} + +#ifndef DISABLE_CRYPT +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CConfigManager::SetPassword(PCTSTR pszPass) +{ + // gen new 256b password + TCHAR szNewPass[64+1], szLine[8192]; + StringToKey256(pszPass, szNewPass); + + // recrypt the old data if needed + if (m_pszPassword) + { + // if there already was a password + for (vector<_CFGENTRY*>::iterator it=m_vCfgData.begin();it!=m_vCfgData.end();it++) + { + // reencrypt every encrypted item + if ((*it)->dwFlags & RF_ENCRYPTED && (*it)->cType == PT_STRING) + { + // decrypt the old data + if (AES256DecipherString((*it)->val.pszValue, m_pszPassword, szLine) < 0) + continue; + + // encrypt to the new one + if (AES256CipherString(szLine, szNewPass, szLine) < 0) + continue; + + // store the new value + delete [] (*it)->val.pszValue; + (*it)->val.pszValue=new TCHAR[_tcslen(szLine)+1]; + _tcscpy((*it)->val.pszValue, szLine); + (*it)->bModified=true; // set the modified flag + } + } + + delete [] m_pszPassword; // delete old password + } + m_pszPassword=new TCHAR[64+1]; + _tcscpy(m_pszPassword, szNewPass); +} + +#endif +/////////////////////////////////////////////////////////////// +// Registers some property given filled _CFGENTRY struct. +// pEntry [in] - specifies all possible information about the +// attribute being registered. +// Ret Value [out] - ID of registered property. It must be +// used when accessing this property. +/////////////////////////////////////////////////////////////// +UINT CConfigManager::RegisterProperty(_CFGENTRY* pEntry) +{ + _ASSERT(pEntry != NULL); + + EnterCriticalSection(&m_cs); + ReadProperty(pEntry); + m_vCfgData.push_back(pEntry); + UINT uiRet=(UINT)(m_vCfgData.size()-1); + LeaveCriticalSection(&m_cs); + return uiRet; +} + +/////////////////////////////////////////////////////////////// +// Registers int64 property. +// pszSection [in] - section in which resides given property +// pszKey [in] - key in which resides given property +// llDefault [in] - default value of this property (used if the +// config file doesn't contain it) +// cDetailLevel [in] - specifies "level" of this property. It +// could be simple property (for all users) or +// something that only some paranoics will use. +// Ret Value [out] - ID of registered property. It must be +// used when accessing this property. +/////////////////////////////////////////////////////////////// +UINT CConfigManager::RegisterInt64Property(LPCTSTR pszSection, LPCTSTR pszKey, __int64 llDefault, char cDetailLevel) +{ + // create config entry + _CFGENTRY* pcfg=new _CFGENTRY; + pcfg->pszSection=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(pcfg->pszSection, pszSection); + pcfg->pszKey=new TCHAR[_tcslen(pszKey)+1]; + _tcscpy(pcfg->pszKey, pszKey); + pcfg->cType=PT_INT64; + pcfg->def.llValue=llDefault; + pcfg->bModified=false; + pcfg->cDetailLevel=cDetailLevel; + pcfg->dwFlags=RF_NONE; + + // register + return RegisterProperty(pcfg); +} + +/////////////////////////////////////////////////////////////// +// Registers int property. +// pszSection [in] - section in which resides given property +// pszKey [in] - key in which resides given property +// iDefault [in] - default value of this property (used if the +// config file doesn't contain it) +// cDetailLevel [in] - specifies "level" of this property. It +// could be simple property (for all users) or +// something that only some paranoics will use. +// Ret Value [out] - ID of registered property. It must be +// used when accessing this property. +/////////////////////////////////////////////////////////////// +UINT CConfigManager::RegisterIntProperty(LPCTSTR pszSection, LPCTSTR pszKey, int iDefault, char cDetailLevel) +{ + // create config entry + _CFGENTRY* pcfg=new _CFGENTRY; + pcfg->pszSection=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(pcfg->pszSection, pszSection); + pcfg->pszKey=new TCHAR[_tcslen(pszKey)+1]; + _tcscpy(pcfg->pszKey, pszKey); + pcfg->cType=PT_INT; + pcfg->def.iValue=iDefault; + pcfg->bModified=false; + pcfg->cDetailLevel=cDetailLevel; + pcfg->dwFlags=RF_NONE; + + // register + return RegisterProperty(pcfg); +} + +/////////////////////////////////////////////////////////////// +// Registers bool property. +// pszSection [in] - section in which resides given property +// pszKey [in] - key in which resides given property +// bDefault [in] - default value of this property (used if the +// config file doesn't contain it) +// cDetailLevel [in] - specifies "level" of this property. It +// could be simple property (for all users) or +// something that only some paranoics will use. +// Ret Value [out] - ID of registered property. It must be +// used when accessing this property. +/////////////////////////////////////////////////////////////// +UINT CConfigManager::RegisterBoolProperty(LPCTSTR pszSection, LPCTSTR pszKey, bool bDefault, char cDetailLevel) +{ + // create config entry + _CFGENTRY* pcfg=new _CFGENTRY; + pcfg->pszSection=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(pcfg->pszSection, pszSection); + pcfg->pszKey=new TCHAR[_tcslen(pszKey)+1]; + _tcscpy(pcfg->pszKey, pszKey); + pcfg->cType=PT_BOOL; + pcfg->def.bValue=bDefault; + pcfg->bModified=false; + pcfg->cDetailLevel=cDetailLevel; + pcfg->dwFlags=RF_NONE; + + // register + return RegisterProperty(pcfg); +} + +/////////////////////////////////////////////////////////////// +// Registers string property. +// pszSection [in] - section in which resides given property +// pszKey [in] - key in which resides given property +// pszDefault [in] - default value of this property (used if +// the config file doesn't contain it) +// cDetailLevel [in] - specifies "level" of this property. It +// could be simple property (for all users) or +// something that only some paranoics will use. +// Ret Value [out] - ID of registered property. It must be +// used when accessing this property. +/////////////////////////////////////////////////////////////// +UINT CConfigManager::RegisterStringProperty(LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszDefault, DWORD dwFlags, char cDetailLevel) +{ + // create config entry + _CFGENTRY* pcfg=new _CFGENTRY; + pcfg->pszSection=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(pcfg->pszSection, pszSection); + pcfg->pszKey=new TCHAR[_tcslen(pszKey)+1]; + _tcscpy(pcfg->pszKey, pszKey); + pcfg->cType=PT_STRING; + pcfg->def.pszValue=new TCHAR[_tcslen(pszDefault)+1]; + _tcscpy(pcfg->def.pszValue, pszDefault); + pcfg->bModified=false; + pcfg->cDetailLevel=cDetailLevel; + pcfg->dwFlags=dwFlags; + + // register + return RegisterProperty(pcfg); +} + +UINT CConfigManager::RegisterStringArrayProperty(LPCTSTR pszSection, char cDetailLevel) +{ + _CFGENTRY* pcfg=new _CFGENTRY; + pcfg->pszSection=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(pcfg->pszSection, pszSection); + pcfg->pszKey=NULL; + pcfg->cType=PT_ASTRING; + pcfg->bModified=false; + pcfg->cDetailLevel=cDetailLevel; + pcfg->val.pvszValue=new char_vector; + pcfg->dwFlags=RF_NONE; + + return RegisterProperty(pcfg); +} + +/////////////////////////////////////////////////////////////// +// Returns value of int property given property ID +// uiPropID [in] - property ID (returned by RegisterProperty..) +// Ret Value [out] - value of this property (either from file +// or the default one specified at registration) +/////////////////////////////////////////////////////////////// +int CConfigManager::GetIntValue(UINT uiPropID) +{ + EnterCriticalSection(&m_cs); + int iRet=m_vCfgData.at(uiPropID)->val.iValue; + LeaveCriticalSection(&m_cs); + return iRet; +} + +/////////////////////////////////////////////////////////////// +// Sets value of a given property (by it's ID) +// uiPropID [in] - property ID (returned by RegisterProperty..) +// iValue [in] - the new value of this property +/////////////////////////////////////////////////////////////// +void CConfigManager::SetIntValue(UINT uiPropID, int iValue) +{ + EnterCriticalSection(&m_cs); + m_vCfgData.at(uiPropID)->val.iValue=iValue; + m_vCfgData.at(uiPropID)->bModified=true; + LeaveCriticalSection(&m_cs); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROPERTYCHANGE, uiPropID); +} + +/////////////////////////////////////////////////////////////// +// Returns value of int64 property given property ID +// uiPropID [in] - property ID (returned by RegisterProperty..) +// Ret Value [out] - value of this property (either from file +// or the default one specified at registration) +/////////////////////////////////////////////////////////////// +__int64 CConfigManager::GetInt64Value(UINT uiPropID) +{ + EnterCriticalSection(&m_cs); + __int64 llRet=m_vCfgData.at(uiPropID)->val.llValue; + LeaveCriticalSection(&m_cs); + return llRet; +} + +/////////////////////////////////////////////////////////////// +// Sets value of a given property (by it's ID) +// uiPropID [in] - property ID (returned by RegisterProperty..) +// llValue [in] - the new value of this property +/////////////////////////////////////////////////////////////// +void CConfigManager::SetInt64Value(UINT uiPropID, __int64 llValue) +{ + EnterCriticalSection(&m_cs); + m_vCfgData.at(uiPropID)->val.llValue=llValue; + m_vCfgData.at(uiPropID)->bModified=true; + LeaveCriticalSection(&m_cs); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROPERTYCHANGE, uiPropID); +} + +/////////////////////////////////////////////////////////////// +// Returns value of bool property given property ID +// uiPropID [in] - property ID (returned by RegisterProperty..) +// Ret Value [out] - value of this property (either from file +// or the default one specified at registration) +/////////////////////////////////////////////////////////////// +bool CConfigManager::GetBoolValue(UINT uiPropID) +{ + EnterCriticalSection(&m_cs); + bool bRet=m_vCfgData.at(uiPropID)->val.bValue; + LeaveCriticalSection(&m_cs); + return bRet; +} + +/////////////////////////////////////////////////////////////// +// Sets value of a given property (by it's ID) +// uiPropID [in] - property ID (returned by RegisterProperty..) +// bValue [in] - the new value of this property +/////////////////////////////////////////////////////////////// +void CConfigManager::SetBoolValue(UINT uiPropID, bool bValue) +{ + EnterCriticalSection(&m_cs); + m_vCfgData.at(uiPropID)->val.bValue=bValue; + m_vCfgData.at(uiPropID)->bModified=true; + LeaveCriticalSection(&m_cs); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROPERTYCHANGE, uiPropID); +} + +/////////////////////////////////////////////////////////////// +// Returns value of string property given property ID +// uiPropID [in] - property ID (returned by RegisterProperty..) +// Ret Value [out] - value of this property (either from file +// or the default one specified at registration) +/////////////////////////////////////////////////////////////// +PCTSTR CConfigManager::GetStringValue(UINT uiPropID, PTSTR pszBuffer, int iSize) +{ + EnterCriticalSection(&m_cs); + +#ifndef DISABLE_CRYPT + if (m_vCfgData.at(uiPropID)->dwFlags & RF_ENCRYPTED) + { + // make sure password has been set already + _ASSERT(m_pszPassword); + + TCHAR szLine[8192]; + if (AES256DecipherString(m_vCfgData.at(uiPropID)->val.pszValue, m_pszPassword, szLine) <= 0) + { + // return + _tcscpy(pszBuffer, _T("")); + LeaveCriticalSection(&m_cs); + return pszBuffer; + } + + // copy the decrypted data + _tcsncpy(pszBuffer, szLine, iSize); + pszBuffer[iSize-1]=_T('\0'); + } + else +#endif + _tcsncpy(pszBuffer, m_vCfgData.at(uiPropID)->val.pszValue, iSize); + + if (m_vCfgData.at(uiPropID)->dwFlags & RF_PATH) + { + if (pszBuffer[_tcslen(pszBuffer)-1] != _T('\\')) + _tcscat(pszBuffer, _T("\\")); + } + + LeaveCriticalSection(&m_cs); + + return pszBuffer; +} + +/////////////////////////////////////////////////////////////// +// Sets value of a given property (by it's ID) +// uiPropID [in] - property ID (returned by RegisterProperty..) +// pszValue [in] - the new value of this property +/////////////////////////////////////////////////////////////// +void CConfigManager::SetStringValue(UINT uiPropID, LPCTSTR pszValue) +{ + EnterCriticalSection(&m_cs); +#ifndef DISABLE_CRYPT + // encrypt the data before setting the property text + if (m_vCfgData.at(uiPropID)->dwFlags & RF_ENCRYPTED) + { + // make sure password has been set already + _ASSERT(m_pszPassword); + + TCHAR szLine[8192]; + if (AES256CipherString(pszValue, m_pszPassword, szLine) < 0) + { + _ASSERT(false); + TRACE("Cannot cipher string - what to do ????\n"); + } + + // store encrypted value + delete [] m_vCfgData.at(uiPropID)->val.pszValue; // delete old value + m_vCfgData.at(uiPropID)->val.pszValue=new TCHAR[_tcslen(szLine)+1]; // create space for new + _tcscpy(m_vCfgData.at(uiPropID)->val.pszValue, szLine); // copy the new one + m_vCfgData.at(uiPropID)->bModified=true; // modified state + } + else + { +#endif + delete [] m_vCfgData.at(uiPropID)->val.pszValue; // delete old value + m_vCfgData.at(uiPropID)->val.pszValue=new TCHAR[_tcslen(pszValue)+1]; // create space for new + _tcscpy(m_vCfgData.at(uiPropID)->val.pszValue, pszValue); // copy the new one + m_vCfgData.at(uiPropID)->bModified=true; // modified state +#ifndef DISABLE_CRYPT + } +#endif + LeaveCriticalSection(&m_cs); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROPERTYCHANGE, uiPropID); +} + +void CConfigManager::GetStringArrayValue(UINT uiPropID, char_vector* pcVector) +{ + EnterCriticalSection(&m_cs); + _CFGENTRY* pentry=m_vCfgData.at(uiPropID); + pcVector->assign(pentry->val.pvszValue->begin(), pentry->val.pvszValue->end(), true, true); + LeaveCriticalSection(&m_cs); +} + +void CConfigManager::SetStringArrayValue(UINT uiPropID, char_vector* pcVector) +{ + EnterCriticalSection(&m_cs); + _CFGENTRY* pentry=m_vCfgData.at(uiPropID); + pentry->val.pvszValue->assign(pcVector->begin(), pcVector->end(), true, true); + LeaveCriticalSection(&m_cs); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROPERTYCHANGE, uiPropID); +} + +/////////////////////////////////////////////////////////////// +// Selects new profile +// pszCfgName [in] - new profile name +/////////////////////////////////////////////////////////////// +void CConfigManager::SelectProfile(LPCTSTR pszCfgName) +{ + // store config into ini file + vector<_CFGENTRY*>::const_iterator it=m_vCfgData.begin(); + while (it != m_vCfgData.end()) + WriteProperty(*it++); + + // change config + delete [] m_pszCurrentConfig; + m_pszCurrentConfig=new TCHAR[_tcslen(pszCfgName)+1]; + _tcscpy(m_pszCurrentConfig, pszCfgName); + + // read data from ini file + it=m_vCfgData.begin(); + while (it != m_vCfgData.end()) + ReadProperty(*it++); + + // set data in ini file + SetString(CFG_PROFILE, CFG_SECTION, CFG_KEY, pszCfgName); + + if (m_pfnCallback) + (*m_pfnCallback)(0, WM_CFGNOTIFY, CNFT_PROFILECHANGE, (LPARAM)pszCfgName); +} + +/////////////////////////////////////////////////////////////// +// (Internal) Frees one of the profile entries +// pEntry [in] - address of profile entry +/////////////////////////////////////////////////////////////// +void CConfigManager::FreeEntry(_CFGENTRY* pEntry) +{ + // free section and key + delete [] pEntry->pszSection; + delete [] pEntry->pszKey; + + // if this is a string property - free it + switch(pEntry->cType) + { + case PT_STRING: + delete [] pEntry->def.pszValue; + delete [] pEntry->val.pszValue; + break; + case PT_ASTRING: + { + pEntry->val.pvszValue->clear(true); + delete pEntry->val.pvszValue; + break; + } + } + + // last - delete object itself + delete pEntry; +} + +/////////////////////////////////////////////////////////////// +// Reads value of a given property entry from .ini file +// pEntry [in] - filled property entry structure +/////////////////////////////////////////////////////////////// +void CConfigManager::ReadProperty(_CFGENTRY* pEntry) +{ + // process each attribute + switch (pEntry->cType) + { + case PT_INT64: + { + pEntry->val.llValue=GetInt64(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->def.llValue, m_szBuffer); + break; + } + case PT_STRING: + { + GetString(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, m_szBuffer, pEntry->def.pszValue); + pEntry->val.pszValue=new TCHAR[_tcslen(m_szBuffer)+1]; + _tcscpy(pEntry->val.pszValue, m_szBuffer); + break; + } + case PT_BOOL: + { + pEntry->val.bValue=GetBool(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->def.bValue, m_szBuffer); + break; + } + case PT_INT: + { + pEntry->val.iValue=GetInt(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->def.iValue, m_szBuffer); + break; + } + case PT_ASTRING: + { + TCHAR szNum[8]; + for (int i=0;ipszSection, szNum, m_szBuffer, _T(""))) + pEntry->val.pvszValue->push_back(m_szBuffer, true); + else + break; + } + + break; + } + default: + _ASSERT(false); // unknown property type + } + + // set modified if this wasn't read from a file + pEntry->bModified=m_bDefault; // if this is a default value - store it when needed +} + +/////////////////////////////////////////////////////////////// +// Writes property to the .ini file +// pEntry [in] - filled property entry struct +/////////////////////////////////////////////////////////////// +void CConfigManager::WriteProperty(_CFGENTRY* pEntry) +{ + if (pEntry->bModified) + { + switch (pEntry->cType) + { + case PT_INT64: + { + SetInt64(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->val.llValue); + pEntry->bModified=false; + break; + } + case PT_STRING: + { + SetString(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->val.pszValue); + pEntry->bModified=false; + break; + } + case PT_BOOL: + { + SetBool(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->val.bValue); + pEntry->bModified=false; + break; + } + case PT_INT: + { + SetInt(m_pszCurrentConfig, pEntry->pszSection, pEntry->pszKey, pEntry->val.iValue); + pEntry->bModified=false; + break; + } + case PT_ASTRING: + { + TCHAR szNum[8]; + for (int i=0;ival.pvszValue->size()) + { + // add string + SetString(m_pszCurrentConfig, pEntry->pszSection, szNum, pEntry->val.pvszValue->at(i)); + } + else + { + // remove string + RemoveKey(m_pszCurrentConfig, pEntry->pszSection, szNum, true); + break; + } + } + pEntry->bModified=false; + + break; + } + } + } +} + +LRESULT CConfigManager::MsgRouter(UINT uiMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uiMsg) + { + case CCMI_REGISTERPROPERTY: + return (LRESULT)RegisterProperty((_CFGENTRY*)lParam); + case CCMI_GETINTVALUE: + return (LRESULT)GetIntValue((UINT)wParam); + case CCMI_SETINTVALUE: + SetIntValue((UINT)wParam, (int)lParam); + return (LRESULT)0; + case CCMI_GETINT64VALUE: + { + if (lParam) + { + *((__int64*)lParam)=GetInt64Value((UINT)wParam); + return (LRESULT)0; + } + else + return (LRESULT)1; + } + case CCMI_SETINT64VALUE: + { + if (lParam) + { + SetInt64Value((UINT)wParam, *((__int64*)lParam)); + return (LRESULT)0; + } + else + return (LRESULT)1; + } + case CCMI_GETBOOLVALUE: + return (LRESULT)GetBoolValue((UINT)wParam); + case CCMI_SETBOOLVALUE: + SetBoolValue((UINT)wParam, lParam != 0); + return (LRESULT)0; + case CCMI_GETSTRINGVALUE: + GetStringValue((UINT)wParam, (LPTSTR)lParam, 1024); + return (LRESULT)0; + case CCMI_SETSTRINGVALUE: + SetStringValue((UINT)wParam, (LPCTSTR)lParam); + return (LRESULT)0; + case CCMI_SELECTPROFILE: + SelectProfile((LPCTSTR)lParam); + return (LRESULT)0; + } + return (LRESULT)1; +} Index: modules/App Framework/ConfigManager.h =================================================================== diff -u --- modules/App Framework/ConfigManager.h (revision 0) +++ modules/App Framework/ConfigManager.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,186 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + File: ConfigManager.h + Version: 1.0 + Author: Ixen Gerthannes (ixen@interia.pl) + File description: + Contains structs/classes for handling configuration + settings in application. + Classes: + CConfigManager + - support access to properties by it's ID + - supports registering additional properties when + the program works. + - supports multiple levels of property detail + - special meaning - ; [Config]; + "Current configuration name=xxx" - specifies + current active profile (the one that will be used + as a source for getting data for properties). + Structures: + _CFGENTRY - contain information about one property. +*************************************************************************/ + +#ifndef __CONFIG_MANAGER_H__ +#define __CONFIG_MANAGER_H__ + +#include "IniFile.h" +#include "charvect.h" +#include "af_defs.h" + +using namespace std; + +// property types in CConfigEntry +#define PT_INT64 0 +#define PT_STRING 1 +#define PT_BOOL 2 +#define PT_INT 3 +#define PT_ASTRING 4 /* array of strings */ + +// flags when registering +#define RF_NONE 0x00 +#define RF_PATH 0x01 + +#ifndef DISABLE_CRYPT +#define RF_ENCRYPTED 0x02 +#endif + +// property detail level +// general properties - for everyone +#define PDL_GENERAL 0 +// advanced properties - for advanced users +#define PDL_ADVANCED 1 +// paranoid type - for only a few individuals who want to configure everything +#define PDL_PARANOID 2 + +// types of notifications (going out) +// CNFT_PROFILECHANGE - this notification is sent when something changes the current configuration profile +// LPARAM - address of new profile string +#define CNFT_PROFILECHANGE 0x0001 +// CNFT_PROPERTYCHANGE - tells about changing value of a property +// LPARAM - (UINT) property ID +#define CNFT_PROPERTYCHANGE 0x0002 + +// messages that goes into this class +#define CCMI_REGISTERPROPERTY 0x0001 +#define CCMI_GETINTVALUE 0x0002 +#define CCMI_SETINTVALUE 0x0003 +#define CCMI_GETINT64VALUE 0x0004 +#define CCMI_SETINT64VALUE 0x0005 +#define CCMI_GETBOOLVALUE 0x0006 +#define CCMI_SETBOOLVALUE 0x0007 +#define CCMI_GETSTRINGVALUE 0x0008 +#define CCMI_SETSTRINGVALUE 0x0009 +#define CCMI_SELECTPROFILE 0x000a + + +// defines one of the attributes +struct _CFGENTRY +{ + TCHAR* pszSection; // section name + TCHAR* pszKey; // key name + char cDetailLevel; // detail level of this property (GENERAL (for everyone), ADVANCED (for advanced users), PARANOID) + bool bModified; // if property is in modified state (it wasn't saved from last change) + char cType; // type of property + DWORD dwFlags; // if set and property is string then we need to append '\\' at the end + union DATA + { + __int64 llValue; // __int64 value type + TCHAR* pszValue; // string value type + int iValue; // int value type + bool bValue; // bool value type + char_vector* pvszValue; // compound string table + } val, def; +}; + + +class CConfigManager : public CIniFile +{ +public: + CConfigManager() : CIniFile() { m_pszCurrentConfig=NULL; m_pfnCallback=NULL; +#ifndef DISABLE_CRYPT + m_pszPassword=NULL; +#endif + InitializeCriticalSection(&m_cs); }; + ~CConfigManager() { Close(); +#ifndef DISABLE_CRYPT + delete [] m_pszPassword; +#endif + DeleteCriticalSection(&m_cs); }; + + void SetCallback(PFNNOTIFYCALLBACK pfn) { m_pfnCallback=pfn; }; + + LRESULT MsgRouter(UINT uiMsg, WPARAM wParam, LPARAM lParam); + + // open/close funcs + void Open(LPCTSTR pszFilename); // reads all registered attributes from file + void Save(); // saves data to file + void Close(); // destroys everything + +#ifndef DISABLE_CRYPT + // encryption options + void SetPassword(PCTSTR pszPass); // sets the encrypt/decrypt password +#endif + + // properties registration funcs + UINT RegisterProperty(_CFGENTRY* pEntry); // just adds pointer to a vector + UINT RegisterInt64Property(LPCTSTR pszSection, LPCTSTR pszKey, __int64 llDefault, char cDetailLevel=PDL_GENERAL); + UINT RegisterIntProperty(LPCTSTR pszSection, LPCTSTR pszKey, int iDefault, char cDetailLevel=PDL_GENERAL); + UINT RegisterBoolProperty(LPCTSTR pszSection, LPCTSTR pszKey, bool bDefault, char cDetailLevel=PDL_GENERAL); + UINT RegisterStringProperty(LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszDefault, DWORD dwFlags=RF_NONE, char cDetailLevel=PDL_GENERAL); + UINT RegisterStringArrayProperty(LPCTSTR pszSection, char cDetailLevel=PDL_GENERAL); + + // property get/set funcs + int GetIntValue(UINT uiPropID); + void SetIntValue(UINT uiPropID, int iValue); + __int64 GetInt64Value(UINT uiPropID); + void SetInt64Value(UINT uiPropID, __int64 llValue); + bool GetBoolValue(UINT uiPropID); + void SetBoolValue(UINT uiPropID, bool bValue); + PCTSTR GetStringValue(UINT uiPropID, PTSTR pszBuffer, int iSize); + void SetStringValue(UINT uiPropID, LPCTSTR pszValue); + void GetStringArrayValue(UINT uiPropID, char_vector* pcVector); + void SetStringArrayValue(UINT uiPropID, char_vector* pcVector); + + // config profiles management + void SelectProfile(LPCTSTR pszCfgName); + +protected: + void ReadProperty(_CFGENTRY* pEntry); // reads value from ini file... + void WriteProperty(_CFGENTRY* pEntry); // store value to ini file + void FreeEntry(_CFGENTRY* pEntry); // frees entry with data + + void Report(LPCTSTR /*pszReportString*/) { /* currently nothing */ }; // reports errors and others + +protected: + TCHAR* m_pszCurrentConfig; // name of current config + vector<_CFGENTRY*> m_vCfgData; // config data - all attributes + TCHAR m_szBuffer[1024]; // internal buffer + +#ifndef DISABLE_CRYPT + // passwd + TCHAR* m_pszPassword; // password for the encrypted properties +#endif + + PFNNOTIFYCALLBACK m_pfnCallback; // callback func for reporting some data + CRITICAL_SECTION m_cs; +}; + +#endif \ No newline at end of file Index: modules/App Framework/ExceptionEx.h =================================================================== diff -u --- modules/App Framework/ExceptionEx.h (revision 0) +++ modules/App Framework/ExceptionEx.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,212 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + File: Exception.h + Version: 1.0 + Author: Ixen Gerthannes (ixen@interia.pl) + File description: + Contain CException class - a base for any other exception + types. + Classes: + CException + - provides basic exception functionality. + - when used with MFC class name is CExceptionEx (it's + not based on MFC CException!). +*************************************************************************/ +#ifndef __EXCEPTION_H__ +#define __EXCEPTION_H__ + +#include "stdio.h" + +#define THROW_EXCEPTIONEX(str_reason, app_code, last_error) throw new CExceptionEx(__FILE__, __LINE__, __FUNCTION__, str_reason, app_code, last_error) + +// not too specific - use specialised classes based on this one (this also could be used) +class CExceptionEx +{ +protected: + enum PropType { dtString, dtPtrToString, dtDword, dtSysError }; + + struct __EXCPROPINFO + { + TCHAR szName[64]; // name of the property (ie."Source file") + PropType eType; // type of the property (string, dword, bool, ...) + void* pData; // pointer to the value of the property + }; + +public: + CExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, PCTSTR pszReason, DWORD dwReason, DWORD dwLastError=0) + { + // init the object with a given values + _tcsncpy(m_szSourceFile, pszSrcFile, _MAX_PATH); + m_szSourceFile[_MAX_PATH-1]=_T('\0'); + m_dwSourceLine=dwLine; + _tcsncpy(m_szFunction, pszFunc, _MAX_PATH); + m_szFunction[_MAX_PATH-1]=_T('\0'); + SetReason(pszReason); + m_dwReason=dwReason; + m_dwError=dwLastError; + }; + CExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, TCHAR* pszReason, DWORD dwReason, DWORD dwLastError=0) + { + _tcsncpy(m_szSourceFile, pszSrcFile, _MAX_PATH); + m_szSourceFile[_MAX_PATH-1]=_T('\0'); + m_dwSourceLine=dwLine; + _tcsncpy(m_szFunction, pszFunc, _MAX_PATH); + m_szFunction[_MAX_PATH-1]=_T('\0'); + m_pszReason=pszReason; + m_dwReason=dwReason; + m_dwError=dwLastError; + }; + + virtual ~CExceptionEx() { delete [] m_pszReason; }; + + virtual int RegisterInfo(__EXCPROPINFO* pInfo) + { + // if the pInfo is null - return count of a needed props + if (pInfo == NULL) + return 6; // +baseClass::RegisterInfo + + // call base class RegisterInfo + + // function has to register the info to be displayed (called from within GetInfo) + RegisterProp(pInfo+0, _T("Source file"), PropType::dtString, &m_szSourceFile); + RegisterProp(pInfo+1, _T("Line"), PropType::dtDword, &m_dwSourceLine); + RegisterProp(pInfo+2, _T("Function"), PropType::dtString, &m_szFunction); + RegisterProp(pInfo+3, _T("Reason"), PropType::dtPtrToString, &m_pszReason); + RegisterProp(pInfo+4, _T("App error"), PropType::dtDword, &m_dwReason); + RegisterProp(pInfo+5, _T("System error"), PropType::dtSysError, &m_dwError); + + return 6; + }; + +public: + // helpers + static TCHAR* FormatReason(PCTSTR pszReason, ...) + { + TCHAR szBuf[1024]; + va_list marker; + va_start(marker, pszReason); + _vstprintf(szBuf, pszReason, marker); + va_end(marker); + TCHAR *pszData=new TCHAR[_tcslen(szBuf)+1]; + _tcscpy(pszData, szBuf); + return pszData; + }; + + // formats max info about this exception + virtual TCHAR* GetInfo(LPCTSTR pszDesc, TCHAR* pszStr, DWORD dwMaxLen) + { + // get the properties + int iCount=RegisterInfo(NULL); + __EXCPROPINFO *pepi=new __EXCPROPINFO[iCount]; + RegisterInfo(pepi); // register all the properties + + // add the desc to the out + if (pszDesc) + { + _tcsncpy(pszStr, pszDesc, dwMaxLen-1); + pszStr[dwMaxLen-1]=_T('\0'); + } + else + pszStr[0]=_T('\0'); + + size_t tIndex=_tcslen(pszStr); + + // format the info accordingly + TCHAR szData[1024]; + for (int i=0;iszName, pszName, 63); + pInfo->szName[63]=_T('\0'); + pInfo->eType=type; + pInfo->pData=pData; + }; + +public: + // exception information + TCHAR m_szSourceFile[_MAX_PATH]; // source file from where the exception is being thrown + DWORD m_dwSourceLine; // line in the source file from where exception has been thrown + TCHAR m_szFunction[_MAX_PATH]; // name of the function in which the exception occured + TCHAR *m_pszReason; // description of this error (in english - internal error code - description - human readable) + DWORD m_dwReason; // numerical value that states app-level error number + DWORD m_dwError; // in most cases GetLastError() when it has any sense +}; + +#endif \ No newline at end of file Index: modules/App Framework/FileEx.cpp =================================================================== diff -u --- modules/App Framework/FileEx.cpp (revision 0) +++ modules/App Framework/FileEx.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,913 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "FileEx.h" +#include "crc32.h" +#ifndef DISABLE_CRYPT +#include "crypt.h" +#endif + +#pragma warning( disable : 4127 ) + +// serialization buffer add on every reallocation +#define SERIALBUFFER_DELTA 4096UL + +/////////////////////////////////////////////////////////////// +// Opens file +// pszFilename [in] - name of the file to open +// dwAccess [in] - type of access to this file (R, W, RW, APPEND) +// dwBufferSize [in] - size of internal buffer when using buffered +// operations. +/////////////////////////////////////////////////////////////// +void CFileEx::Open(PCTSTR pszFilename, DWORD dwAccess, DWORD dwBufferSize) +{ + // check if this object is ready to open a file + if (m_hFile) + Close(); + + HANDLE hFile=NULL; + switch (dwAccess & FA_OPERATION) + { + case FA_READ: + hFile=CreateFile(pszFilename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + break; + case FA_WRITE: + hFile=CreateFile(pszFilename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + break; + case FA_RW: + case FA_APPEND: + hFile=CreateFile(pszFilename, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + break; + default: + _ASSERT(false); // unknown File access value + } + + // check if operation succeeded + if (hFile == INVALID_HANDLE_VALUE) + THROW_FILEEXCEPTIONEX(_T("Cannot open the specified file (CreateFile failed)."), pszFilename, FERR_OPEN, GetLastError()); + else + { + // store hFile + m_hFile=hFile; + + // remember path of this file + m_pszFilename=new TCHAR[_tcslen(pszFilename)+1]; + _tcscpy(m_pszFilename, pszFilename); + + // remember the mode + m_dwMode=dwAccess; + + // is this buffered ? + SetBuffering((dwAccess & 0x8000) != 0, dwBufferSize); + } + + // if this is the "FA_APPEND" access mode - seek to end + if ((dwAccess & FA_OPERATION) == FA_APPEND) + InternalSeek(0, FILE_END); +} + +/////////////////////////////////////////////////////////////// +// Closes the file (could be used on non-opened files +/////////////////////////////////////////////////////////////// +void CFileEx::Close() +{ + // only if the file has been opened + if (m_hFile) + { + // flush all data + Flush(); + + // close da file + if (!CloseHandle(m_hFile)) + { + // error closing + THROW_FILEEXCEPTIONEX(_T("Cannot close the handle associated with a file (CloseHandle failed)."), m_pszFilename, FERR_CLOSE, GetLastError()); + } + else + m_hFile=NULL; + + // free strings and other data + delete [] m_pszFilename; + m_pszFilename=NULL; + delete [] m_pbyBuffer; + m_pbyBuffer=NULL; + } +} + +/////////////////////////////////////////////////////////////// +// Flushes internal buffers when using buffered operations +// may be used in non-buffered mode and for not opened files +// sets file pointer to the place resulting from position +// in internal buffer +/////////////////////////////////////////////////////////////// +void CFileEx::Flush() +{ + if (m_hFile && m_bBuffered && m_dwDataCount > 0) + { + if (m_bLastOperation) + { + // last operation - storing data + WritePacket(); + } + else + { + // last - reading data + // set file pointer to position current-(m_dwDataCount-m_dwCurrentPos) + InternalSeek(-(long)(m_dwDataCount-m_dwCurrentPos), FILE_CURRENT); + m_dwCurrentPos=0; + m_dwDataCount=0; + } + } +} + +/////////////////////////////////////////////////////////////// +// Reads some data from file (buffered or not) +// pBuffer [in/out] - buffer for data +// dwSize [in] - size of data to read +// Ret Value [out] - count of bytes read (could differ from +// dwSize) +/////////////////////////////////////////////////////////////// +DWORD CFileEx::ReadBuffer(void* pBuffer, DWORD dwSize) +{ + _ASSERT(m_hFile); // forgot to open the file ? + + // flush if needed + if (m_bLastOperation) + { + Flush(); + m_bLastOperation=false; + } + + if (!m_bBuffered) + { + // unbuffered operation (read what is needed) + DWORD dwRD=0; + if (!ReadFile(m_hFile, pBuffer, dwSize, &dwRD, NULL)) + THROW_FILEEXCEPTIONEX(_T("Cannot read data from file (ReadFile failed)."), m_pszFilename, FERR_READ, GetLastError()); + + return dwRD; // if 0 - eof (not treated as exception) + } + else + { + // reads must be done by packets + DWORD dwCurrPos=0; // position in external buffer + while (dwCurrPos 0); // couldn't use 0-sized internal buffer + + // flush + Flush(); + + // delete old buffer + if (m_bBuffered && (!bEnable || dwSize != m_dwBufferSize)) + { + delete [] m_pbyBuffer; + m_pbyBuffer=NULL; + } + + // alloc new buffer if needed + if (bEnable && (!m_bBuffered || dwSize != m_dwBufferSize)) + m_pbyBuffer=new BYTE[dwSize]; + + m_bBuffered=bEnable; + m_dwBufferSize=dwSize; +} + +/////////////////////////////////////////////////////////////// +// Changes current mode to unbuffered. If already unbuffered +// function returns doing nothing +/////////////////////////////////////////////////////////////// +void CFileEx::SwitchToUnbuffered() +{ + if (!m_bBuffered) + return; // it's already unbuffered - leave it as is + else + { + m_bRememberedState=true; // mark that we change state to a different one + SetBuffering(false, m_dwBufferSize); // do no change internal buffer size + } +} + +/////////////////////////////////////////////////////////////// +// Changes current mode to buffered. If already buffered +// function returns doing nothing +/////////////////////////////////////////////////////////////// +void CFileEx::SwitchToBuffered() +{ + if (m_bBuffered) + return; // already buffered + else + { + m_bRememberedState=true; + SetBuffering(true, m_dwBufferSize); + } +} + +/////////////////////////////////////////////////////////////// +// Function restores (un)buffered state previously remembered +// with SwitchToXXX. If SwitchToXXX doesn't change the state +// - this function also doesn't. +/////////////////////////////////////////////////////////////// +void CFileEx::RestoreState() +{ + // restore state only if changed + if (m_bRememberedState) + { + SetBuffering(!m_bBuffered, m_dwBufferSize); + m_bRememberedState=false; + } +} + +/////////////////////////////////////////////////////////////// +// (Internal) Reads next packet of data from file (when using +// buffered operations it cause next data of size of internal +// buffer to be read from file +// Ret Value [out] - Count of data that was read +/////////////////////////////////////////////////////////////// +DWORD CFileEx::ReadPacket() +{ + _ASSERT(m_hFile); + + // read data + DWORD dwRD=0; + if (!ReadFile(m_hFile, m_pbyBuffer, m_dwBufferSize, &dwRD, NULL)) + THROW_FILEEXCEPTIONEX(_T("Cannot read data from a file (ReadFile failed)."), m_pszFilename, FERR_READ, GetLastError()); + + // reset internal members + m_dwDataCount=dwRD; + m_dwCurrentPos=0; + + return dwRD; +} + +/////////////////////////////////////////////////////////////// +// (Internal) Function writes all data from internal buffer to +// a file. +// Ret Value [out] - count of bytes written +/////////////////////////////////////////////////////////////// +DWORD CFileEx::WritePacket() +{ + _ASSERT(m_hFile); + + DWORD dwWR=0; + if (!WriteFile(m_hFile, m_pbyBuffer, m_dwDataCount, &dwWR, NULL)) + THROW_FILEEXCEPTIONEX(_T("Cannot write data to a file (WriteFile failed)."), m_pszFilename, FERR_WRITE, GetLastError()); + + // reset internal members + m_dwDataCount=0; + m_dwCurrentPos=0; + + return dwWR; +} + +#ifndef DISABLE_CRYPT +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::SetPassword(PCTSTR pszPass) +{ + // delete the old password + if (m_pszPassword) + delete [] m_pszPassword; // delete old password + + // generate the SHA256 from this password + m_pszPassword=new TCHAR[64+1]; + StringToKey256(pszPass, m_pszPassword); +} + +#endif + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::BeginDataBlock(DWORD dwFlags) +{ + // do not call begin data block within another data block + _ASSERT(!m_bSerializing && m_pbySerialBuffer == NULL); + + // alloc the new buffer and insert there a header (a few bytes) + m_pbySerialBuffer=new BYTE[SERIALBUFFER_DELTA]; + m_dwSerialBufferSize=SERIALBUFFER_DELTA; + + // determine action from read or write flag + bool bWrite=false; + switch(m_dwMode & FA_OPERATION) + { + case FA_READ: + bWrite=false; + break; + case FA_WRITE: + bWrite=true; + break; + case FA_RW: + case FA_APPEND: + _ASSERT(FALSE); // cannot use serialization with files opened in rw mode + break; + } + + // action + if (bWrite) + { + // reserve some space for a header + m_dwSerialBufferPos=sizeof(SERIALIZEINFOHEADER); + } + else + { + // we need to read the block from a file + if (ReadBuffer(m_pbySerialBuffer, sizeof(SERIALIZEINFOHEADER)) != sizeof(SERIALIZEINFOHEADER)) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("Cannot read the specified amount of data from a file (reading serialization header)."), m_pszFilename, FERR_SERIALIZE, GetLastError()); + } + + // move forward + m_dwSerialBufferPos=sizeof(SERIALIZEINFOHEADER); + + // determine the size of the remaining data in file + SERIALIZEINFOHEADER* psih=(SERIALIZEINFOHEADER*)m_pbySerialBuffer; + DWORD dwSize=psih->dwToRead-sizeof(SERIALIZEINFOHEADER); + + // check the header crc + DWORD dwhc=CRC32(m_pbySerialBuffer, sizeof(SERIALIZEINFOHEADER)-sizeof(DWORD)); + if (dwhc != psih->dwHeaderCRC32) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("Block corrupted. Header CRC check failed."), m_pszFilename, FERR_SERIALIZE, 0); + } + + // resize the buffer + ResizeSerialBuffer(psih->dwToRead); + + // refresh the psih + psih=(SERIALIZEINFOHEADER*)m_pbySerialBuffer; + + // read the remaining data + if (ReadBuffer(m_pbySerialBuffer+m_dwSerialBufferPos, dwSize) != dwSize) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("Cannot read specified amount of data from file (reading the after-header data)."), m_pszFilename, FERR_SERIALIZE, GetLastError()); + } + +#ifndef DISABLE_CRYPT + // decrypt the data + if (dwFlags & BF_ENCRYPTED) + { + if (AES256Decrypt(m_pbySerialBuffer+m_dwSerialBufferPos, dwSize, m_pszPassword, m_pbySerialBuffer+m_dwSerialBufferPos) < 0) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("Cannot decrypt the data read from the serialization file."), m_pszFilename, FERR_CRYPT, 0); + } + } +#endif + // NOTE: do not update the position - we need ptr at the beginning of data + + // now we are almost ready to retrieve data - only the crc check for the data + DWORD dwCRC=CRC32(m_pbySerialBuffer+sizeof(SERIALIZEINFOHEADER), psih->dwDataSize-sizeof(SERIALIZEINFOHEADER)); + if (psih->dwCRC32 != dwCRC) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("CRC check of the data read from file failed."), m_pszFilename, FERR_SERIALIZE, GetLastError()); + } + } + + // make a mark + m_dwDataBlockFlags=dwFlags; + m_bSerializing=true; +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::EndDataBlock() +{ + // make sure everything is ok + _ASSERT(m_bSerializing && m_pbySerialBuffer != NULL); + + // type of operation + bool bWrite=false; + switch(m_dwMode & FA_OPERATION) + { + case FA_READ: + bWrite=false; + break; + case FA_WRITE: + bWrite=true; + break; + case FA_RW: + case FA_APPEND: + _ASSERT(FALSE); // cannot use serialization with files opened in rw mode + break; + } + + // when writing - make a header, ...; when reading - do nothing important + if (bWrite) + { + // check if there is any data + if (m_dwSerialBufferPos == sizeof(SERIALIZEINFOHEADER)) + return; // no data has been serialized + + // fill the header (real data information) + SERIALIZEINFOHEADER *psih=(SERIALIZEINFOHEADER*)m_pbySerialBuffer; + psih->dwDataSize=m_dwSerialBufferPos; + psih->dwCRC32=CRC32(m_pbySerialBuffer+sizeof(SERIALIZEINFOHEADER), m_dwSerialBufferPos-sizeof(SERIALIZEINFOHEADER)); + +#ifndef DISABLE_CRYPT + // we could encrypt the data here if needed + if (m_dwDataBlockFlags & BF_ENCRYPTED) + { + int iRes=AES256Crypt(m_pbySerialBuffer+sizeof(SERIALIZEINFOHEADER), m_dwSerialBufferPos-sizeof(SERIALIZEINFOHEADER), m_pszPassword, m_pbySerialBuffer+sizeof(SERIALIZEINFOHEADER)); + if (iRes < 0) + { + ClearSerialization(); + THROW_FILEEXCEPTIONEX(_T("Cannot encrypt the data to store."), m_pszFilename, FERR_CRYPT, 0); + } + + // fill the header + psih->dwToRead=iRes+sizeof(SERIALIZEINFOHEADER); + } + else + { +#endif + // the rest of header + psih->dwToRead=m_dwSerialBufferPos; +#ifndef DISABLE_CRYPT + } +#endif + + // calc the header crc + psih->dwHeaderCRC32=CRC32(m_pbySerialBuffer, sizeof(SERIALIZEINFOHEADER)-sizeof(DWORD)); + + // write the buffer + WriteBuffer(m_pbySerialBuffer, psih->dwToRead); + } + + // remove all the traces of serializing + ClearSerialization(); +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::SWrite(void* pData, DWORD dwSize) +{ + InternalAppendSerialBuffer(pData, dwSize); +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::SRead(void* pData, DWORD dwSize) +{ + InternalReadSerialBuffer(pData, dwSize); +} + +#ifdef _MFC_VER + +CFileEx& CFileEx::operator<<(CString strData) +{ + DWORD dwLen=strData.GetLength(); + SWrite(&dwLen, sizeof(DWORD)); + SWrite(strData.GetBuffer(1), dwLen); + strData.ReleaseBuffer(); + return *this; +} + +CFileEx& CFileEx::operator>>(CString& strData) +{ + DWORD dwLen; + SRead(&dwLen, sizeof(DWORD)); + PTSTR pszData=strData.GetBuffer(dwLen+1); + try + { + SRead(pszData, dwLen); + } + catch(...) + { + pszData[dwLen]=_T('\0'); + strData.ReleaseBuffer(); + throw; + } + + pszData[dwLen]=_T('\0'); + strData.ReleaseBuffer(); + return *this; +} + +#endif + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::ClearSerialization() +{ + // remove all the traces of serializing + delete [] m_pbySerialBuffer; + m_pbySerialBuffer=NULL; + m_dwSerialBufferSize=0; + m_dwSerialBufferPos=0; + m_bSerializing=false; +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::InternalReadSerialBuffer(void* pData, DWORD dwLen) +{ + // check if we are reading + _ASSERT((m_dwMode & FA_OPERATION) == FA_READ); + + // check the ranges + if (m_dwSerialBufferPos+dwLen > m_dwSerialBufferSize) + { + // throw an exception - read beyond the data range in a given object + THROW_FILEEXCEPTIONEX(_T("Trying to read the serialization data beyond the range."), m_pszFilename, FERR_MEMORY, GetLastError()); + } + + // read the data + memcpy(pData, m_pbySerialBuffer+m_dwSerialBufferPos, dwLen); + m_dwSerialBufferPos+=dwLen; +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::InternalAppendSerialBuffer(void* pData, DWORD dwCount) +{ + // check if we are writing + _ASSERT((m_dwMode & FA_OPERATION) == FA_WRITE); + + // check serial buffer size (if there is enough room for the data) + if (m_dwSerialBufferPos+dwCount > m_dwSerialBufferSize) + { + // we need a buffer reallocation + DWORD dwDelta=((dwCount/SERIALBUFFER_DELTA)+1)*SERIALBUFFER_DELTA; + + // alloc the new buffer + ResizeSerialBuffer(m_dwSerialBufferSize+dwDelta); + } + + // real storage of the data + if (dwCount > 0) + { + memcpy(m_pbySerialBuffer+m_dwSerialBufferPos, pData, dwCount); + m_dwSerialBufferPos+=dwCount; + } +} + +/////////////////////////////////////////////////////////////// +// +/////////////////////////////////////////////////////////////// +void CFileEx::ResizeSerialBuffer(DWORD dwNewLen) +{ + // alloc the new buffer + BYTE* pbyNewBuffer=new BYTE[dwNewLen]; + + // copy the old data into the new one + DWORD dwCount=min(m_dwSerialBufferPos, dwNewLen); + if (m_dwSerialBufferPos > 0) + memcpy(pbyNewBuffer, m_pbySerialBuffer, dwCount); + + // delete the old buffer + delete [] m_pbySerialBuffer; + + // set the new buffer inplace and update the internal size + m_pbySerialBuffer=pbyNewBuffer; + m_dwSerialBufferSize=dwNewLen; +} + +/////////////////////////////////////////////////////////////// +// (Internal) Functions reads line of text from text file +// Only for buffered operation +// pszStr [out] - string that was read from file +// dwMaxLen [in] - size of the string buffer +/////////////////////////////////////////////////////////////// +bool CFileEx::InternalReadString(TCHAR* pszStr, DWORD dwMaxLen) +{ + _ASSERT(m_hFile != NULL); // file wasn't opened - error opening or you've forgotten to do so ? + + // last time was writing - free buffer + if (m_bLastOperation) + { + Flush(); + m_bLastOperation=false; + } + + // zero all the string + memset(pszStr, 0, dwMaxLen*sizeof(TCHAR)); + + // additional vars + DWORD dwStrPos=0; // current pos in external buffer + bool bSecondPass=false; // if there is need to check data for 0x0a char + + // copy each char into pszString + while(true) + { + // if buffer is empty - fill it + if (m_dwDataCount == 0 || m_dwCurrentPos == m_dwDataCount) + { + if (ReadPacket() == 0) + return _tcslen(pszStr) != 0; + } + + // skipping 0x0a in second pass + if (bSecondPass) + { + if (m_pbyBuffer[m_dwCurrentPos] == 0x0a) + m_dwCurrentPos++; + return true; + } + + // now process chars + while (m_dwCurrentPos < m_dwDataCount) + { + if (m_pbyBuffer[m_dwCurrentPos] == 0x0d) + { + bSecondPass=true; + m_dwCurrentPos++; + break; + } + else if (m_pbyBuffer[m_dwCurrentPos] == 0x0a) + { + m_dwCurrentPos++; + return true; + } + else + { + if (dwStrPos < dwMaxLen-1) + pszStr[dwStrPos++]=m_pbyBuffer[m_dwCurrentPos]; + m_dwCurrentPos++; + } + } + } + + return false; +} + +/////////////////////////////////////////////////////////////// +// (Internal) Sets file pointer in a file +// llOffset [in] - position to move to +// uiFrom [in] - type of moving (see Platform SDK on +// SetFilePointer) +/////////////////////////////////////////////////////////////// +LONGLONG CFileEx::InternalSeek(LONGLONG llOffset, UINT uiFrom) +{ + LARGE_INTEGER li; + li.QuadPart = llOffset; + li.LowPart = SetFilePointer (m_hFile, li.LowPart, &li.HighPart, uiFrom); + + if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) + { + // error seeking - throw an exception + THROW_FILEEXCEPTIONEX(_T("Seek error."), m_pszFilename, FERR_SEEK, GetLastError()); + } + + return li.QuadPart; +} Index: modules/App Framework/FileEx.h =================================================================== diff -u --- modules/App Framework/FileEx.h (revision 0) +++ modules/App Framework/FileEx.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,249 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + File: File.h + Version: 1.0 + Author: Ixen Gerthannes (ixen@interia.pl) + File description: + Contain class that handle buffered and unbuffered access to + file. Primarily designed to work without mfc. Possible use + with ms foundation classes. + Classes: + CFileException (based on CException) + - exception class designed for usage with class CFile + (not MFC based). + - when used with MFC class name is CFileExException + CFile + - handles file-based operations (buffered and + unbuffered): + - reading/writing of data buffers + - reading/writing of text lines (for text files) + - reading/writing values of internal types (int, + ...) + - when used with MFC class name is CFileEx +*************************************************************************/ +#ifndef __FILE_H__ +#define __FILE_H__ + +#pragma warning (disable : 4786) + +#include "ExceptionEx.h" + +#ifndef __FUNCTION__ + #define __FUNCTION__ "" +#endif + +#define THROW_FILEEXCEPTIONEX(str_reason, filename, app_code, last_error) throw new CFileExceptionEx(__FILE__, __LINE__, __FUNCTION__, str_reason, filename, app_code, last_error) + +// File exception errors +#define FERR_UNKNOWN 0 +#define FERR_OPEN 1 +#define FERR_CLOSE 2 +#define FERR_READ 3 +#define FERR_WRITE 4 +#define FERR_SEEK 5 +#define FERR_EOF 6 /* eof encountered - currently unused*/ +#define FERR_SETEOF 7 /* error while setting an eof in file */ +#define FERR_GETSIZE 8 /* error getting file size */ +#define FERR_SERIALIZE 9 /* serialization error */ +#define FERR_MEMORY 10 /* trying to read the data beyond the index */ +#define FERR_CRYPT 11 /* encryption/decryption error */ + +class CFileExceptionEx : public CExceptionEx +{ +public: + CFileExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, PCTSTR pszReason, PCTSTR pszFilename, DWORD dwReason=FERR_UNKNOWN, DWORD dwLastError=0) : CExceptionEx(pszSrcFile, dwLine, pszFunc, pszReason, dwReason, dwLastError) { SetFilename(pszFilename); }; + CFileExceptionEx(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, TCHAR* pszReason, PCTSTR pszFilename, DWORD dwReason=FERR_UNKNOWN, DWORD dwLastError=0) : CExceptionEx(pszSrcFile, dwLine, pszFunc, pszReason, dwReason, dwLastError) { SetFilename(pszFilename); }; + virtual ~CFileExceptionEx() { delete [] m_pszFilename; }; + + virtual int RegisterInfo(__EXCPROPINFO* pInfo) + { + // if the pInfo is null - return count of a needed props + if (pInfo == NULL) + return 1+CExceptionEx::RegisterInfo(NULL); + + // call base class RegisterInfo + size_t tIndex=CExceptionEx::RegisterInfo(pInfo); + + // function has to register the info to be displayed (called from within GetInfo) + RegisterProp(pInfo+tIndex+0, _T("Filename"), PropType::dtPtrToString, &m_pszFilename); + + return 1; + }; + +protected: + void SetFilename(PCTSTR pszFilename) { if (pszFilename) { m_pszFilename=new TCHAR[_tcslen(pszFilename)+1]; _tcscpy(m_pszFilename, pszFilename); } else m_pszFilename=NULL; }; + +public: + TCHAR* m_pszFilename; +}; + +// header information for serialziation block +struct SERIALIZEINFOHEADER +{ + // main header + DWORD dwDataSize; // size of the meaningful data (with the header size) + DWORD dwToRead; // count of data to read at once (may be greater than dwDataSize) + DWORD dwCRC32; // crc32 of the data (only the data part) + + // helper + DWORD dwHeaderCRC32; // the above's header crc +}; + +// file access modes +#define FA_OPERATION 0x7fff +#define FA_READ 0 +#define FA_WRITE 1 +#define FA_RW 2 +#define FA_APPEND 3 /* second rw access but with seek to end */ + +// additional mode mods +#define FA_BUFFERED 0x8000 /* if this is buffered */ + +// begin data block flags +#define BF_NONE 0x00 +#define BF_ENCRYPTED 0x01 + +// currently CSerializer will be the same as CFileEx (later it may change) +#define CSerializer CFileEx + +// real file class +class CFileEx +{ +public: + // construction/destruction + CFileEx() { m_hFile=NULL; m_pszFilename=NULL; m_dwMode=0; + m_dwBufferSize=0; m_pbyBuffer=NULL; m_dwCurrentPos=0; + m_dwDataCount=0; m_bBuffered=false; m_bLastOperation=false; m_bRememberedState=false; + m_pbySerialBuffer=NULL; m_dwSerialBufferSize=NULL; m_dwSerialBufferPos=0; m_bSerializing=0; +#ifndef DISABLE_CRYPT + m_pszPassword=NULL; +#endif + }; + ~CFileEx() { Close(); +#ifndef DISABLE_CRYPT + delete [] m_pszPassword; +#endif + }; + + // opening/closing file + void Open(PCTSTR pszFilename, DWORD dwAccess, DWORD dwBufferSize=4096); + void Close(); + + // flushing (flushes all the internal's buffer data to the external file) + void Flush(); + + // reads or writes the data from/to a file (uses buffering for this if enabled) + DWORD ReadBuffer(void* pBuffer, DWORD dwSize); + DWORD WriteBuffer(void* pBuffer, DWORD dwSize); + + // handling the lines of text in a file (autodetecting the windows/unix style of line ending) + bool ReadLine(TCHAR* pszStr, DWORD dwMaxLen); + void WriteLine(TCHAR* pszString); + + // position related functions + void Seek(LONGLONG llOffset, UINT uiFrom); // seeks in a file - flushes buffers before + LONGLONG GetPos(); // returns the current position of a file pointer (corrected by a pos in the internal buffer) + + // size related functions + void SetEndOfFile(); // sets the end of file in the current file pointer place + LONGLONG GetSize(); // retrieves the size of this file + + // buffered/unbuffered state managing + void SetBuffering(bool bEnable=true, DWORD dwSize=4096); // on-the-fly changing operation types + bool IsBuffered() { return m_bBuffered; }; + DWORD GetBufferSize() { return m_dwBufferSize; }; + + void SwitchToUnbuffered(); // remembers current state and changes to unbuffered + void SwitchToBuffered(); // remembers current state and changes to buffered + void RestoreState(); // restores (un)buffered last state + + // serialization (block operation) + void BeginDataBlock(DWORD dwFlags=BF_NONE); + void EndDataBlock(); + +#ifndef DISABLE_CRYPT + void SetPassword(PCTSTR pszPass); +#endif + // serialization stuff + void SWrite(void* pData, DWORD dwSize); + void SRead(void* pData, DWORD dwSize); + + bool IsStoring() { return (m_dwMode & FA_OPERATION) == FA_WRITE; }; + bool IsLoading() { return (m_dwMode & FA_OPERATION) == FA_READ; }; + + // storing data + template CFileEx& operator<<(T tData) { SWrite(&tData, sizeof(T)); return *this; }; + +#ifdef _MFC_VER + CFileEx& operator<<(CString strData); +#endif + + // reading data + template CFileEx& operator>>(T& tData) { SRead(&tData, sizeof(T)); return *this; }; + +#ifdef _MFC_VER + CFileEx& operator>>(CString& strData); +#endif + +protected: + // serialization related internal functions + void InternalAppendSerialBuffer(void* pData, DWORD dwCount); + void ResizeSerialBuffer(DWORD dwNewLen); + void InternalReadSerialBuffer(void* pData, DWORD dwLen); + void ClearSerialization(); + + // file-buffering related operations + DWORD ReadPacket(); // reads next packet of data - for buffered operations + DWORD WritePacket(); // writes next packet of data - buffered only + + bool InternalReadString(TCHAR* pszStr, DWORD dwMaxLen); + LONGLONG InternalSeek(LONGLONG llOffset, UINT uiFrom); // real seek-w/o any flushing + +protected: + HANDLE m_hFile; // handle to file + TCHAR* m_pszFilename; // path to this file + DWORD m_dwMode; // mode in which this file has been opened + + bool m_bLastOperation; // false=>READ, true=>WRITE + + // read/write buffering + bool m_bBuffered; // is this file additionally buffered ? + DWORD m_dwBufferSize; // specifies internal buffer size + BYTE* m_pbyBuffer; // internal buffer address + DWORD m_dwCurrentPos; // current position in above buffer + DWORD m_dwDataCount; // count of data in buffer (counting from beginning) + + // serialization stuff + bool m_bSerializing; // are we currently serializing (between BeginDataBlock and EndDataBlock) ? + BYTE* m_pbySerialBuffer; // buffer used for serialization + DWORD m_dwSerialBufferSize; // current size of the serialization buffer + DWORD m_dwSerialBufferPos; // current position in the serialization buffer + DWORD m_dwDataBlockFlags; // flags used in begin data block + +#ifndef DISABLE_CRYPT + // encryption related + TCHAR *m_pszPassword; +#endif + // state + bool m_bRememberedState; // was state remembered (it means also that last state was different) ? +}; + +#endif Index: modules/App Framework/IniFile.cpp =================================================================== diff -u --- modules/App Framework/IniFile.cpp (revision 0) +++ modules/App Framework/IniFile.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,813 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "IniFile.h" + +#define MAX_LINE 8192 + +/////////////////////////////////////////////////////////////// +// Opens .ini file, reads all lines from it and keep in memory +// pszFilename [in] - path to .ini file +// pszOneSection [in] - ptr to a string with section's name +// which we want to read +/////////////////////////////////////////////////////////////// +void CIniFile::Open(LPCTSTR pszFilename, PCTSTR pszOneSection, bool bEscapeConversion) +{ + // remember file name + m_pszFilename=new TCHAR[_tcslen(pszFilename)+1]; + _tcscpy(m_pszFilename, pszFilename); + + // count the length of a section member + size_t tSectionLen=(size_t)-1; + if (pszOneSection) + tSectionLen=_tcslen(pszOneSection); + + // open file + CFileEx file; + file.Open(pszFilename, FA_READ | FA_BUFFERED); // may throw an exception + + // read all lines from file and process it + TCHAR szLine[MAX_LINE]; + size_t ulLen; + + // config object - zero members + _PROFILE* pcfg=NULL; // current config object + _SECTION* psect=NULL; // current section + _ENTRY* pentry=NULL; // current entry + TCHAR* pszSeparator; // used for separating keys from values + + while(file.ReadLine(szLine, MAX_LINE)) + { + // process + ulLen=_tcslen(szLine); // length of read string + + if (ulLen == 0 || szLine[0] == '#') + continue; + + // if it's config-selector <...> + if (ulLen > 1 && szLine[0] == _T('<') && szLine[ulLen-1] == _T('>')) + { + // config-selector + // create new profile + pcfg=new _PROFILE; + pcfg->pszProfileName=new TCHAR[ulLen-1]; + _tcsncpy(pcfg->pszProfileName, szLine+1, ulLen-2); + pcfg->pszProfileName[ulLen-2]=_T('\0'); + m_vConfigProfiles.push_back(pcfg); + } + else if (ulLen > 1 && szLine[0] == _T('[') && szLine[ulLen-1] == _T(']')) + { + if (pszOneSection && psect != NULL) // break if the needed section has been read already + break; + + if (!pszOneSection || (ulLen-2 == tSectionLen && _tcsncmp(pszOneSection, szLine+1, ulLen-2) == 0)) + { + // section-selector + if (pcfg == NULL) + { + // encountered section without config-selector - create default one + pcfg=new _PROFILE; + pcfg->pszProfileName=new TCHAR[4]; + _tcscpy(pcfg->pszProfileName, _T("000")); + m_vConfigProfiles.push_back(pcfg); + } + + // new section + psect=new _SECTION; + psect->pszSectionName=new TCHAR[ulLen-1]; + _tcsncpy(psect->pszSectionName, szLine+1, ulLen-2); + psect->pszSectionName[ulLen-2]=_T('\0'); + pcfg->vSections.push_back(psect); + } + } + else + { + if (!pszOneSection || psect != NULL) + { + // normal line (not empty) + if (pcfg == NULL) + { + // config-selector doesn't exist - create default + pcfg=new _PROFILE; + pcfg->pszProfileName=new TCHAR[4]; + _tcscpy(pcfg->pszProfileName, _T("000")); + m_vConfigProfiles.push_back(pcfg); + } + + if (psect == NULL) + { + // section doesn't exist -create default + psect=new _SECTION; + psect->pszSectionName=new TCHAR[4]; + _tcscpy(psect->pszSectionName, _T("000")); + pcfg->vSections.push_back(psect); + } + + // analyze string and copy data + pentry=new _ENTRY; + pszSeparator=_tcschr(szLine, _T('=')); + if (pszSeparator != NULL) + { + pszSeparator[0]=_T('\0'); + pszSeparator++; + + pentry->pszKey=new TCHAR[_tcslen(szLine)+1]; + _tcscpy(pentry->pszKey, szLine); + + // now the value - correct the ansi escape sequences if needed + if (bEscapeConversion) + { +// int iLen=_tcslen(pszSeparator); + UnescapeString(pszSeparator); + } + pentry->pszValue=new TCHAR[_tcslen(pszSeparator)+1]; + _tcscpy(pentry->pszValue, pszSeparator); + } + else + { + // no '=' sign in the line + pentry->pszKey=NULL; + if (bEscapeConversion) + UnescapeString(szLine); + pentry->pszValue=new TCHAR[_tcslen(szLine)+1]; + _tcscpy(pentry->pszValue, szLine); + } + + psect->vEntries.push_back(pentry); + } + } + } + + file.Close(); +} + +void CIniFile::UnescapeString(PTSTR pszData) +{ + PTSTR pszOut=pszData; + while (*pszData != 0) + { + if (*pszData == _T('\\')) + { + pszData++; + switch(*pszData++) + { + case _T('t'): + *pszOut++=_T('\t'); + break; + case _T('r'): + *pszOut++=_T('\r'); + break; + case _T('n'): + *pszOut++=_T('\n'); + break; + default: + *pszOut++=_T('\\'); + } + } + else + *pszOut++=*pszData++; + } + *pszOut=_T('\0'); +} + +/////////////////////////////////////////////////////////////// +// Saves data from memory to an .ini file +/////////////////////////////////////////////////////////////// +void CIniFile::Save() +{ + // if saving data is needed + if (!m_bModified) + return; + + _ASSERT(m_pszFilename); // is there a filename + + // open file for writing + CFileEx file; + file.Open(m_pszFilename, FA_WRITE | FA_BUFFERED); // may throw an exception + + // enumerate through all data and store it to the file + TCHAR szLine[MAX_LINE]; + int iLen; + vector<_PROFILE*>::const_iterator cit=m_vConfigProfiles.begin(); + vector<_SECTION*>::const_iterator sit; + vector<_ENTRY*>::const_iterator eit; + while (cit != m_vConfigProfiles.end()) + { + // store profile name + iLen=_stprintf(szLine, _T("<%s>"), (*cit)->pszProfileName); + file.WriteLine(szLine); + + // enumerate through sections + sit=(*cit)->vSections.begin(); + while (sit != (*cit)->vSections.end()) + { + // write section name + iLen=_stprintf(szLine, _T("[%s]"), (*sit)->pszSectionName); + file.WriteLine(szLine); + + // enumerate through attributes + eit=(*sit)->vEntries.begin(); + while(eit != (*sit)->vEntries.end()) + { + // store data + iLen=_stprintf(szLine, _T("%s=%s"), (*eit)->pszKey, (*eit)->pszValue); + file.WriteLine(szLine); + + // analyze next element + eit++; + } + + // cosmetics + file.WriteLine(_T("")); + + // analyze next section + sit++; + } + + // analyze next profile + cit++; + } + + // close file + file.Close(); + + m_bModified=false; +} + +/////////////////////////////////////////////////////////////// +// Closes the .ini file. Causes data from memory to be saved, +// and frees all the memory. +/////////////////////////////////////////////////////////////// +void CIniFile::Close() +{ + // save file and free all data (doesn't matter if save succeeded) + try + { + Save(); + } + catch(...) + { + FreeData(); + throw; + } + FreeData(); +} + +/////////////////////////////////////////////////////////////// +// Gets a string from .ini file (more precisely from the data +// from memory). +// pszConfig [in] - profile name +// pszSection [in] - section name +// pszKey [in] - key name +// pszValue [out] - value name (read from file or default) +// pszDefault [in/out] - default value if there wasn't pszKey +// in .ini file. +// Ret Value [out] - if the pszValue was read from file (=true) +// or is the default one (=false) +/////////////////////////////////////////////////////////////// +bool CIniFile::GetStr(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPTSTR pszValue, LPCTSTR pszDefault) +{ + // localize config + vector<_PROFILE*>::const_iterator cit=m_vConfigProfiles.begin(); + while (cit != m_vConfigProfiles.end()) + { + // if this is not a config name - enumerate next + if (_tcsicmp((*cit)->pszProfileName, pszConfig) != 0) + { + cit++; + continue; + } + + // config found - check for section + vector<_SECTION*>::const_iterator sit=(*cit)->vSections.begin(); + while (sit != (*cit)->vSections.end()) + { + // continue if this is not the needed section + if (_tcsicmp((*sit)->pszSectionName, pszSection) != 0) + { + sit++; + continue; + } + + // now - localize key in section + vector<_ENTRY*>::const_iterator eit=(*sit)->vEntries.begin(); + while (eit != (*sit)->vEntries.end()) + { + // continue if needed + if (_tcsicmp((*eit)->pszKey, pszKey) != 0) + { + eit++; + continue; + } + + // read associated value - from file + _tcscpy(pszValue, (*eit)->pszValue); + m_bDefault=false; + return true; + } + + // section was found, but key in it wasn't + _tcscpy(pszValue, pszDefault); + m_bDefault=true; + return false; + } + + // section not found + _tcscpy(pszValue, pszDefault); + m_bDefault=true; + return false; + } + + // nothing + _tcscpy(pszValue, pszDefault); + m_bDefault=true; + return false; +} + +/////////////////////////////////////////////////////////////// +// Reads string from .ini file +// Look @ CIniFile::GetStr for param desc +// Ret Value [out] - string that was read (or the default one) +/////////////////////////////////////////////////////////////// +LPTSTR CIniFile::GetString(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPTSTR pszValue, LPCTSTR pszDefault) +{ + GetStr(pszConfig, pszSection, pszKey, pszValue, pszDefault); + return pszValue; +} + +/////////////////////////////////////////////////////////////// +// Writes string to .ini file (to memory) +// For param desc's look @GetStr +// pszValue [in] - string to store under pszKey +/////////////////////////////////////////////////////////////// +void CIniFile::SetString(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszValue) +{ + // localize config + vector<_PROFILE*>::const_iterator cit=m_vConfigProfiles.begin(); + _PROFILE* pcfg=NULL; + while (cit != m_vConfigProfiles.end()) + { + // if this is not a config name - enumerate next + if (_tcsicmp((*cit)->pszProfileName, pszConfig) != 0) + { + cit++; + continue; + } + + // found + pcfg=*cit; + break; + } + + // if section doesn't exist - create it + if (pcfg == NULL) + { + pcfg=new _PROFILE; + pcfg->pszProfileName=new TCHAR[_tcslen(pszConfig)+1]; + _tcscpy(pcfg->pszProfileName, pszConfig); + m_vConfigProfiles.push_back(pcfg); + } + + // config is ready - now search for section + vector<_SECTION*>::const_iterator sit=pcfg->vSections.begin(); + _SECTION* psect=NULL; + while (sit != pcfg->vSections.end()) + { + // continue if this is not the needed section + if (_tcsicmp((*sit)->pszSectionName, pszSection) != 0) + { + sit++; + continue; + } + + // found + psect=*sit; + break; + } + + // create section if doesn't exist + if (psect == NULL) + { + psect=new _SECTION; + psect->pszSectionName=new TCHAR[_tcslen(pszSection)+1]; + _tcscpy(psect->pszSectionName, pszSection); + pcfg->vSections.push_back(psect); + } + + // now entry... + vector<_ENTRY*>::const_iterator eit=psect->vEntries.begin(); + _ENTRY* pentry=NULL; + while (eit != psect->vEntries.end()) + { + // continue if needed + if (_tcsicmp((*eit)->pszKey, pszKey) != 0) + { + eit++; + continue; + } + + // found + pentry=*eit; + break; + } + + // create entry if needed + if (pentry == NULL) + { + pentry=new _ENTRY; + pentry->pszKey=new TCHAR[_tcslen(pszKey)+1]; + _tcscpy(pentry->pszKey, pszKey); + pentry->pszValue=NULL; + psect->vEntries.push_back(pentry); + } + + // copy value to entry->pszValue + if (pentry->pszValue != NULL) + delete [] pentry->pszValue; + + pentry->pszValue=new TCHAR[_tcslen(pszValue)+1]; + _tcscpy(pentry->pszValue, pszValue); + + m_bModified=true; +} + +/////////////////////////////////////////////////////////////// +// Sets the int value in the .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// iValue [in] - value to set +/////////////////////////////////////////////////////////////// +void CIniFile::SetInt(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, int iValue) +{ + TCHAR szBuffer[11]; + SetString(pszConfig, pszSection, pszKey, _itot(iValue, szBuffer, 10)); +} + +/////////////////////////////////////////////////////////////// +// Gets the int value from .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// iDefault [in] - default value - used if the file doesn't +// contain neede value +// pszBuffer [in] - buffer for internal processing (must +// contain at last 5 TCHARs). +// Ret Value [out] - value associated with the given position +/////////////////////////////////////////////////////////////// +int CIniFile::GetInt(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, int iDefault, LPTSTR pszBuffer) +{ + // get string and process it + if (GetStr(pszConfig, pszSection, pszKey, pszBuffer, _T(""))) + return _ttoi(pszBuffer); + else + return iDefault; +} + +/////////////////////////////////////////////////////////////// +// Sets the bool value in the .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// bValue [in] - value to set +/////////////////////////////////////////////////////////////// +void CIniFile::SetBool(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bValue) +{ + TCHAR szBuffer[2]={ (TCHAR)(48+(bValue ? 1 : 0)), 0 }; + SetString(pszConfig, pszSection, pszKey, szBuffer); +} + +/////////////////////////////////////////////////////////////// +// Gets the bool value from .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// bDefault [in] - default value - used if the file doesn't +// contain needed value +// pszBuffer [in] - buffer for internal processing (must +// contain at last 2 TCHARs-better/safer is 1024). +// Ret Value [out] - value associated with the given position +/////////////////////////////////////////////////////////////// +bool CIniFile::GetBool(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bDefault, LPTSTR pszBuffer) +{ + // get string and process it + if (GetStr(pszConfig, pszSection, pszKey, pszBuffer, _T(""))) + return pszBuffer[0] != _T('0'); + else + return bDefault; +} + +/////////////////////////////////////////////////////////////// +// Sets the int64 value in the .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// llValue [in] - value to set +/////////////////////////////////////////////////////////////// +void CIniFile::SetInt64(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, __int64 llValue) +{ + TCHAR szBuffer[21]; + SetString(pszConfig, pszSection, pszKey, _i64tot(llValue, szBuffer, 10)); +} + +/////////////////////////////////////////////////////////////// +// Gets the int64 value from .ini file (memory) +// pszConfig, pszSection, pszKey [in] - position in .ini file +// llDefault [in] - default value - used if the file doesn't +// contain needed value +// pszBuffer [in] - buffer for internal processing (must +// contain at last 9 TCHARs-better/safer is 1024). +// Ret Value [out] - value associated with the given position +/////////////////////////////////////////////////////////////// +__int64 CIniFile::GetInt64(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, __int64 llDefault, LPTSTR pszBuffer) +{ + // get string and process it + if (GetStr(pszConfig, pszSection, pszKey, pszBuffer, _T(""))) + return _ttoi64(pszBuffer); + else + return llDefault; +} + +/////////////////////////////////////////////////////////////// +// Gets the profile name at a given index in a file +// uiIndex [in] - index of profile to retrieve +// pszName [out] - name of the profile +/////////////////////////////////////////////////////////////// +void CIniFile::GetProfileName(UINT uiIndex, LPTSTR pszName) +{ + _tcscpy(pszName, m_vConfigProfiles.at(uiIndex)->pszProfileName); +} + +/////////////////////////////////////////////////////////////// +// Sets profile name at a given index +// uiIndex [in] - profile index +// pszName [in] - new profile name +/////////////////////////////////////////////////////////////// +void CIniFile::SetProfileName(UINT uiIndex, LPCTSTR pszName) +{ + delete [] m_vConfigProfiles.at(uiIndex)->pszProfileName; + m_vConfigProfiles.at(uiIndex)->pszProfileName=new TCHAR[_tcslen(pszName)+1]; + _tcscpy(m_vConfigProfiles.at(uiIndex)->pszProfileName, pszName); +} + +/////////////////////////////////////////////////////////////// +// Deletes one of the configurations (completely) +// uiIndex [in] - profile index to delete +/////////////////////////////////////////////////////////////// +void CIniFile::DeleteProfile(UINT uiIndex) +{ + m_vConfigProfiles.erase(m_vConfigProfiles.begin()+uiIndex); +} + +/////////////////////////////////////////////////////////////// +// Creates new profile in .ini file +// pszName [in] - new profile's name +/////////////////////////////////////////////////////////////// +void CIniFile::CreateProfile(LPCTSTR pszName) +{ + _PROFILE* pcfg=new _PROFILE; + pcfg->pszProfileName=new _TCHAR[_tcslen(pszName)+1]; + _tcscpy(pcfg->pszProfileName, pszName); +} + +/////////////////////////////////////////////////////////////// +// (Internal) Frees all data associated with this class +/////////////////////////////////////////////////////////////// +void CIniFile::FreeData() +{ + // free name string + delete [] m_pszFilename; + m_pszFilename=NULL; + + // other data + _PROFILE* pcfg=NULL; // current config object + _SECTION* psect=NULL; // current section + _ENTRY* pentry=NULL; // current entry + size_t uiIndex1=m_vConfigProfiles.size(), uiIndex2, uiIndex3; + while (uiIndex1--) + { + // delete profile name + pcfg=m_vConfigProfiles.at(uiIndex1); + delete [] pcfg->pszProfileName; + + // delete all sections + uiIndex2=pcfg->vSections.size(); + while (uiIndex2--) + { + // delete section name + psect=pcfg->vSections.at(uiIndex2); + delete [] psect->pszSectionName; + + // free all key=value strings + uiIndex3=psect->vEntries.size(); + while (uiIndex3--) + { + pentry=psect->vEntries.at(uiIndex3); + + // delete all values and this entry + delete [] pentry->pszKey; + delete [] pentry->pszValue; + delete pentry; + } + + // free this section + delete psect; + } + + // delete this profile + delete pcfg; + } + + m_vConfigProfiles.clear(); + m_bModified=false; + m_bDefault=false; +} + +void CIniFile::RemoveSection(LPCTSTR pszConfig, LPCTSTR pszSection) +{ + // localize section + _PROFILE *pcfg=NULL; + _SECTION *psect=NULL; + + vector<_PROFILE*>::iterator it=m_vConfigProfiles.begin(); + while (it != m_vConfigProfiles.end()) + { + pcfg=(*it); + if (_tcscmp(pcfg->pszProfileName, pszConfig) == 0) + break; + pcfg=NULL; + it++; + } + + if (pcfg == NULL) + return; + + // find the section + vector<_SECTION*>::iterator sit=pcfg->vSections.begin(); + while(sit != pcfg->vSections.end()) + { + psect=(*sit); + if (_tcscmp(psect->pszSectionName, pszSection) == 0) + break; + psect=NULL; + sit++; + } + + if (psect == NULL) + return; + + // delete + delete [] psect->pszSectionName; + + // free all key=value strings + size_t tIndex=psect->vEntries.size(); + _ENTRY* pentry; + while (tIndex--) + { + pentry=psect->vEntries.at(tIndex); + + // delete all values and this entry + delete [] pentry->pszKey; + delete [] pentry->pszValue; + delete pentry; + } + + // free this section + delete psect; + pcfg->vSections.erase(sit); +} + +void CIniFile::RemoveKey(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bAllAfter) +{ + // localize section + _PROFILE *pcfg=NULL; + _SECTION *psect=NULL; + + vector<_PROFILE*>::iterator it=m_vConfigProfiles.begin(); + while (it != m_vConfigProfiles.end()) + { + pcfg=(*it); + if (_tcscmp(pcfg->pszProfileName, pszConfig) == 0) + break; + pcfg=NULL; + it++; + } + + if (pcfg == NULL) + return; + + // find the section + vector<_SECTION*>::iterator sit=pcfg->vSections.begin(); + while(sit != pcfg->vSections.end()) + { + psect=(*sit); + if (_tcscmp(psect->pszSectionName, pszSection) == 0) + break; + psect=NULL; + sit++; + } + + if (psect == NULL) + return; + + // localize the key(s) + _ENTRY* pentry=NULL; + vector<_ENTRY*>::iterator eit=psect->vEntries.begin(); + while (eit != psect->vEntries.end()) + { + pentry=(*eit); + if (_tcscmp(pentry->pszKey, pszKey) == 0) + break; + pentry=NULL; + eit++; + } + + if (pentry == NULL) + return; + + vector<_ENTRY*>::iterator eit2=eit; + if (bAllAfter) + { + while(eit != psect->vEntries.end()) + { + pentry=(*eit); + delete [] pentry->pszKey; + delete [] pentry->pszValue; + delete pentry; + eit++; + } + + psect->vEntries.erase(eit2, psect->vEntries.end()); + } + else + { + delete [] pentry->pszKey; + delete [] pentry->pszValue; + delete pentry; + psect->vEntries.erase(eit); + } +} + +const _PROFILE* CIniFile::GetProfile(PCTSTR pszConfig) +{ + _PROFILE *pcfg=NULL; + + vector<_PROFILE*>::iterator it=m_vConfigProfiles.begin(); + while (it != m_vConfigProfiles.end()) + { + pcfg=(*it); + if (_tcscmp(pcfg->pszProfileName, pszConfig) == 0) + break; + pcfg=NULL; + it++; + } + + if (pcfg == NULL) + return NULL; + else + return pcfg; +} + +const _SECTION* CIniFile::GetSection(PCTSTR pszConfig, PCTSTR pszSection) +{ + // localize section + _PROFILE *pcfg=NULL; + _SECTION *psect=NULL; + + vector<_PROFILE*>::iterator it=m_vConfigProfiles.begin(); + while (it != m_vConfigProfiles.end()) + { + pcfg=(*it); + if (_tcscmp(pcfg->pszProfileName, pszConfig) == 0) + break; + pcfg=NULL; + it++; + } + + if (pcfg == NULL) + return NULL; + + // find the section + vector<_SECTION*>::iterator sit=pcfg->vSections.begin(); + while(sit != pcfg->vSections.end()) + { + psect=(*sit); + if (_tcscmp(psect->pszSectionName, pszSection) == 0) + break; + psect=NULL; + sit++; + } + + if (psect == NULL) + return NULL; + else + return psect; +} Index: modules/App Framework/IniFile.h =================================================================== diff -u --- modules/App Framework/IniFile.h (revision 0) +++ modules/App Framework/IniFile.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,130 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + File: IniFile.h + Version: 1.0 + Author: Ixen Gerthannes (ixen@interia.pl) + File description: + Contains classes/structures providing functionality of ini + file. Ini file in this case is a bit modified, because it + provides something called profile. It could be used to + maintain more than one set of options in an ini file. + Classes: + CIniFile + - handles ini files in format: + - + - [section name] + - key=value + - work with/without mfc. + - NOT thread-safe + Structures: + _PROFILE - contains profile name and array of sections + _SECTION - contains section name and array of entries + _ENTRY - contains key name, value in string format +*************************************************************************/ + +#ifndef __INIFILE_H__ +#define __INIFILE_H__ + +#include "FileEx.h" +#include + +using namespace std; + +// internal structures used in managing profiles, keys, ... +struct _ENTRY +{ + TCHAR* pszKey; // key name - common for all config profiles + TCHAR* pszValue; // set of values bound to above key - differs between config-profiles +}; + +struct _SECTION +{ + TCHAR* pszSectionName; + vector<_ENTRY*> vEntries; +}; + +struct _PROFILE +{ + TCHAR* pszProfileName; + vector<_SECTION*> vSections; +}; + +// class +class CIniFile +{ +public: + // construction/destruction + CIniFile() { m_pszFilename=NULL; m_bModified=false; m_bDefault=false; }; + ~CIniFile() { Close(); }; + + // opening/closing + void Open(LPCTSTR pszFilename, PCTSTR pszOneSection=NULL, bool bEscapeConversion=false); // loads data from file and interpretes it + void Save(); // saves data to file (without closing it) + void Close(); // saves file and closes it + + // reading/writing some data from/to .ini file + bool GetStr(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPTSTR pszValue, LPCTSTR pszDefault); // gets string from .ini file + LPTSTR GetString(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPTSTR pszValue, LPCTSTR pszDefault); // gets string from .ini file + void SetString(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, LPCTSTR pszValue); // sets string in .ini file + + void SetInt(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, int iValue); + int GetInt(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, int iDefault, LPTSTR pszBuffer); + + void SetBool(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bValue); + bool GetBool(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bDefault, LPTSTR pszBuffer); + + void SetInt64(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, __int64 llValue); + __int64 GetInt64(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, __int64 llDefault, LPTSTR pszBuffer); + + // remove functions + void RemoveSection(LPCTSTR pszConfig, LPCTSTR pszSection); + void RemoveKey(LPCTSTR pszConfig, LPCTSTR pszSection, LPCTSTR pszKey, bool bAllAfter); + + // Get functions + const _PROFILE* GetProfile(PCTSTR pszConfig); + const _SECTION* GetSection(PCTSTR pszConfig, PCTSTR pszSection); + + // config-selection funcs + UINT GetProfilesCount() { return (UINT)m_vConfigProfiles.size(); }; // returns count of profiles + void GetProfileName(UINT uiIndex, LPTSTR pszName); // return profile name + void SetProfileName(UINT uiIndex, LPCTSTR pszName); // sets the profile name + void DeleteProfile(UINT uiIndex); // deletes whole profile + void CreateProfile(LPCTSTR pszName); // creates new profile + + // def + bool IsDefault() const { return m_bDefault; }; + +protected: + // helpers + void FreeData(); // frees data from m_vConfigProfiles + void UnescapeString(PTSTR pszData); + +protected: + TCHAR* m_pszFilename; // this configuration's file filename + bool m_bModified; // global modification flag + bool m_bDefault; // every GetXXX refreshed member - if returned value was the default one or + // read from file + + vector<_PROFILE*> m_vConfigProfiles; // contains configuration profiles's names (user names) + // each config profile contains the same set of sections and keys +}; + +#endif \ No newline at end of file Index: modules/App Framework/LanguageDialog.cpp =================================================================== diff -u --- modules/App Framework/LanguageDialog.cpp (revision 0) +++ modules/App Framework/LanguageDialog.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,671 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "LanguageDialog.h" + +///////////////////////////////////////////////////////////////////////////// +// CDlgTemplate +CDlgTemplate::CDlgTemplate(const DLGTEMPLATE* pDlgTemplate) +{ + Open(pDlgTemplate); +} + +CDlgTemplate::CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate) +{ + Open((DLGTEMPLATE*)pDlgTemplate); +} + +CDlgTemplate::~CDlgTemplate() +{ + delete [] m_pszMenu; + delete [] m_pszClass; + delete [] m_pszTitle; + delete [] m_pszFace; + + // items + vector<_ITEM>::iterator it; + for (it=m_vItems.begin();it != m_vItems.end();it++) + { + delete [] (*it).m_pbyCreationData; + delete [] (*it).m_pszClass; + delete [] (*it).m_pszTitle; + } +} + +bool CDlgTemplate::Open(const DLGTEMPLATE* pDlgTemplate) +{ + if (pDlgTemplate == NULL) + return false; + bool bExt=((DLGTEMPLATEEX*)pDlgTemplate)->signature == 0xffff; + const BYTE* pData=((BYTE*)pDlgTemplate); + if (bExt) + { + m_dlgTemplate=*((DLGTEMPLATEEX*)pDlgTemplate); + pData+=sizeof(DLGTEMPLATEEX); + } + else + { + ConvertDlgToEx(pDlgTemplate, &m_dlgTemplate); + pData+=sizeof(DLGTEMPLATE); + } + + // here is the menu, class and title + pData=ReadCompoundData(pData, &m_wMenu, &m_pszMenu); + pData=ReadCompoundData(pData, &m_wClass, &m_pszClass); + pData=ReadCompoundData(pData, &m_wTitle, &m_pszTitle); + + // font + if (m_dlgTemplate.style & DS_SETFONT || m_dlgTemplate.style & DS_SHELLFONT) + { + m_wFontSize=*((WORD*)pData); + pData+=sizeof(WORD); + if (bExt) + { + m_wWeight=*((WORD*)pData); + pData+=sizeof(WORD); + m_byItalic=*((BYTE*)pData); + pData+=sizeof(BYTE); + m_byCharset=*((BYTE*)pData); + pData+=sizeof(BYTE); + } + else + { + m_wWeight=FW_NORMAL; + m_byItalic=FALSE; + m_byCharset=DEFAULT_CHARSET; + } + DWORD dwLen=(DWORD)wcslen((wchar_t*)pData); + m_pszFace=new TCHAR[dwLen+1]; +#ifdef _UNICODE + _tcscpy(m_pszFace, (wchar_t*)pData); +#else + WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pData, dwLen+1, m_pszFace, dwLen+1, NULL, NULL); +#endif + pData+=(dwLen+1)*sizeof(wchar_t); + } + else + { + m_wFontSize=0xffff; + m_pszFace=NULL; + } + + // items + _ITEM item; + for (int i=0;i 0) + { + item.m_wCreationDataSize-=sizeof(WORD); + item.m_pbyCreationData=new BYTE[item.m_wCreationDataSize]; + memcpy(item.m_pbyCreationData, pData, item.m_wCreationDataSize); + } + else + item.m_pbyCreationData=NULL; + + m_vItems.push_back(item); + } + + return true; +} + +void CDlgTemplate::ConvertItemToEx(const DLGITEMTEMPLATE* pSrc, DLGITEMTEMPLATEEX* pDst) +{ + pDst->helpID=0; + pDst->exStyle=pSrc->dwExtendedStyle; + pDst->style=pSrc->style; + pDst->x=pSrc->x; + pDst->y=pSrc->y; + pDst->cx=pSrc->cx; + pDst->cy=pSrc->cy; + pDst->id=pSrc->id; +} + +void CDlgTemplate::ConvertDlgToEx(const DLGTEMPLATE* pSrc, DLGTEMPLATEEX* pDst) +{ + pDst->dlgVer=1; + pDst->signature=0x0000; + pDst->helpID=(ULONG)0; + pDst->exStyle=pSrc->dwExtendedStyle; + pDst->style=pSrc->style; + pDst->cDlgItems=pSrc->cdit; + pDst->x=pSrc->x; + pDst->y=pSrc->y; + pDst->cx=pSrc->cx; + pDst->cy=pSrc->cy; +} + +const BYTE* CDlgTemplate::ReadCompoundData(const BYTE* pBuffer, WORD* pwData, PTSTR* ppszStr) +{ + if (*((WORD*)pBuffer) == 0xffff) + { + *pwData=*((WORD*)(pBuffer+2)); + *ppszStr=NULL; + + return pBuffer+4; + } + else + { + *pwData=0xffff; + DWORD dwLen=(DWORD)wcslen((wchar_t*)pBuffer); + *ppszStr=new TCHAR[dwLen+1]; +#ifdef _UNICODE + _tcscpy(*ppszStr, (wchar_t*)pBuffer); +#else + WideCharToMultiByte(CP_ACP, 0, (wchar_t*)pBuffer, dwLen+1, *ppszStr, dwLen+1, NULL, NULL); +#endif + return pBuffer+(dwLen+1)*sizeof(wchar_t); + } + +} + +///////////////////////////////////////////////////////////////////////////// +// CLanguageDialog dialog + +CResourceManager *CLanguageDialog::m_prm=NULL; + +/////////////////////////////////////////////////////////////// +// Standard constructor +// pLock [in] - specifies address of a bool value that'll be +// used to check if another instance of this window has +// already been shown. Should be declared in derived class +// as 'static bool m_xxx;' and initialized to 0. +/////////////////////////////////////////////////////////////// +CLanguageDialog::CLanguageDialog(bool* pLock) : CDialog() +{ + m_pszResName=NULL; + m_uiResID=0; + m_pParent=NULL; + m_cType=-1; + m_bAutoDelete=false; + m_pFont=NULL; + m_pbLock=pLock; + m_bLockChanged=false; + m_bLockInstance=false; + m_iBaseX=m_iBaseY=0; + _ASSERT(m_prm); // make sure the CLanguageDialog::SetResManager() has been called aready + m_prm->m_lhDialogs.push_back(this); +} + +/////////////////////////////////////////////////////////////// +// Constructor that takes string based template name +// lpszTemplateName [in] - specifies the template name to load +// and show as this dialog. +// pParent [in] - logical (everyone knows) +// pLock [in] - address of a bool for dialog instance checks +/////////////////////////////////////////////////////////////// +CLanguageDialog::CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent, bool* pLock) : CDialog() +{ + m_pszResName=lpszTemplateName; + if (IS_INTRESOURCE(lpszTemplateName)) + m_uiResID=(WORD)lpszTemplateName; + else + m_uiResID=0; + m_pParent=pParent; + m_cType=-1; + m_bAutoDelete=false; + m_pFont=NULL; + m_pbLock=pLock; + m_bLockChanged=false; + m_bLockInstance=false; + m_iBaseX=m_iBaseY=0; + _ASSERT(m_prm); // make sure the CLanguageDialog::SetResManager() has been called aready + m_prm->m_lhDialogs.push_back(this); +} + +/////////////////////////////////////////////////////////////// +// Constructor that takes UINT based template name +// uiIDTemplate [in] - specifies the template ID to load +// and show as this dialog. +// pParent [in] - logical (everyone knows) +// pLock [in] - address of a bool for dialog instance checks +/////////////////////////////////////////////////////////////// +CLanguageDialog::CLanguageDialog(UINT uiIDTemplate, CWnd* pParent, bool* pLock) : CDialog() +{ + m_pszResName=MAKEINTRESOURCE(uiIDTemplate); + m_uiResID=uiIDTemplate; + m_pParent=pParent; + m_cType=-1; + m_bAutoDelete=false; + m_pFont=NULL; + m_pbLock=pLock; + m_bLockChanged=false; + m_bLockInstance=false; + m_iBaseX=m_iBaseY=0; + _ASSERT(m_prm); // make sure the CLanguageDialog::SetResManager() has been called aready + m_prm->m_lhDialogs.push_back(this); +} + +/////////////////////////////////////////////////////////////// +// Standard destructor +// Removes itself from a list in CWinApp (not to get any window +// messages anymore). +/////////////////////////////////////////////////////////////// +CLanguageDialog::~CLanguageDialog() +{ + list::iterator it=m_prm->m_lhDialogs.begin(); + while (it != m_prm->m_lhDialogs.end()) + { + if (*it == this) + { + m_prm->m_lhDialogs.erase(it); + break; + } + + it++; + } +} + +///////////////////////////////////////////////////////////////////////////// +// CLanguageDialog message handlers + +/////////////////////////////////////////////////////////////// +// Makes properly constructed dialog modal. +// RetVal [out] - value returned by dialog proc +/////////////////////////////////////////////////////////////// +INT_PTR CLanguageDialog::DoModal() +{ + if (m_pszResName) + { + HGLOBAL hDialog=m_prm->LoadResource(RT_DIALOG, m_pszResName); + if (!InitModalIndirect(hDialog)) + return -1; + } + m_cType=0; + return CDialog::DoModal(); +} + +/////////////////////////////////////////////////////////////// +// Creates (and shows probably) this constructed dialog. +// RetVal [out] - if creation succeeded +/////////////////////////////////////////////////////////////// +BOOL CLanguageDialog::Create() +{ + _ASSERT(m_pszResName); // nothing was set as a dialog template + + if (!m_bLockInstance || m_pbLock == NULL || !(*m_pbLock)) + { + HGLOBAL hDialog=m_prm->LoadResource(RT_DIALOG, m_pszResName); + + // modeless dialog + if (!CreateIndirect(hDialog, m_pParent)) + return FALSE; + + m_cType=1; + if (m_pbLock) + { + *m_pbLock=true; + m_bLockChanged=true; + } + + return TRUE; + } + else + { + m_bLockChanged=false; + Cleanup(); + return FALSE; + } +} + +/////////////////////////////////////////////////////////////// +// Changes values based on dialog units into the values in +// pixels. Change is based on std MapDialogRect if the language +// hasn't been changed otf or takes current font into +// consideration. +// pRect [in/out] - on [in] - dialog units, on [out] - pixels +/////////////////////////////////////////////////////////////// +void CLanguageDialog::MapRect(RECT* pRect) +{ + if (m_pFont) + { + pRect->left=MulDiv(pRect->left, m_iBaseX, 4); + pRect->right=MulDiv(pRect->right, m_iBaseX, 4); + pRect->top=MulDiv(pRect->top, m_iBaseY, 8); + pRect->bottom=MulDiv(pRect->bottom, m_iBaseY, 8); + } + else + MapDialogRect(pRect); +} + +/////////////////////////////////////////////////////////////// +// Helper function - called when this dialog receives message +// WM_RMNOTIFY (with WPARAM == RMNT_LANGCHANGE). Updates the +// dialog with data from a new template. Passes params to +// virtual function OnLanguageChanged. +// wOldLang [in] - specifies the old language code +// wNewLang [in] - specifies the new language code. +/////////////////////////////////////////////////////////////// +void CLanguageDialog::UpdateLanguage(WORD /*wOldLang*/, WORD /*wNewLang*/) +{ + // cannot update for string based template + if (m_uiResID == 0) + return; + + // set the title + SetWindowText(m_prm->LoadString((WORD)m_uiResID, 0)); + + // load the dialog template + CDlgTemplate dt; + if (!dt.Open(m_prm->LoadDialog(MAKEINTRESOURCE(m_uiResID)))) + { + TRACE("Cannot open dialog template in UpdateLanguage\n"); + return; + } + + // update the menu + if (GetMenu()) + m_prm->UpdateMenu(GetMenu()->m_hMenu, dt.m_wMenu); + + // font + if (!(GetLanguageUpdateOptions() & LDF_NODIALOGFONT)) + { + // dialog font + LOGFONT lf; + memset(&lf, 0, sizeof(LOGFONT)); + HDC hdc=::GetDC(NULL); + lf.lfHeight = -MulDiv(m_prm->m_ld.GetPointSize(), GetDeviceCaps(hdc, LOGPIXELSY), 72); + ::ReleaseDC(NULL, hdc); + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = m_prm->m_ld.GetCharset(); + _tcscpy(lf.lfFaceName, m_prm->m_ld.GetFontFace()); + + delete m_pFont; + m_pFont=new CFont(); + m_pFont->CreateFontIndirect(&lf); + + // change base dlg units + CalcBaseUnits(dt.m_pszFace, dt.m_wFontSize); + } + + if (!(GetLanguageUpdateOptions() & LDF_NODIALOGSIZE)) + { + // dialog size + CRect rcWin; + GetWindowRect(&rcWin); + + CRect rcDialog(0, 0, dt.m_dlgTemplate.cx, dt.m_dlgTemplate.cy); + MapRect(&rcDialog); + rcDialog.bottom+=2*GetSystemMetrics(SM_CYDLGFRAME)+GetSystemMetrics(SM_CYCAPTION); + + // correct the height by a menu height + if ((dt.m_wMenu != 0xffff) || ((dt.m_pszMenu != NULL) && _tcslen(dt.m_pszMenu) != 0)) + rcDialog.bottom+=GetSystemMetrics(SM_CYMENU); + + rcDialog.right+=2*GetSystemMetrics(SM_CXDLGFRAME); + rcDialog.OffsetRect(rcWin.CenterPoint().x-rcDialog.Width()/2, rcWin.CenterPoint().y-rcDialog.Height()/2); + + //TEMP + TRACE("Old dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu; \n\tNew dlg pos/size: x=%lu, y=%lu, cx=%lu, cy=%lu\n", rcWin.left, rcWin.top, rcWin.Width(), rcWin.Height(), rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height()); + SetWindowPos(NULL, rcDialog.left, rcDialog.top, rcDialog.Width(), rcDialog.Height(), SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); + } + + // the controls + CWnd* pWnd; + vector::iterator it; + for (it=dt.m_vItems.begin();it != dt.m_vItems.end();it++) + { + // skip controls that cannot be modified + if ( (*it).m_itemTemplate.id == 0xffff || (pWnd=GetDlgItem((*it).m_itemTemplate.id)) == NULL) + continue; + + // the font + if (!(GetLanguageUpdateOptions() & LDF_NODIALOGFONT)) + pWnd->SetFont(m_pFont, FALSE); + + // style&ex style + // modify only the rtl/ltr reading order + LONG lStyleEx=::GetWindowLong(pWnd->m_hWnd, GWL_EXSTYLE); + if (lStyleEx & WS_EX_RTLREADING) + { + if (!m_prm->m_ld.GetDirection()) + lStyleEx &= ~WS_EX_RTLREADING; + } + else + { + if (m_prm->m_ld.GetDirection()) + lStyleEx |= WS_EX_RTLREADING; + } + + ::SetWindowLong(pWnd->m_hWnd, GWL_EXSTYLE, lStyleEx); + + // size + CRect rc((*it).m_itemTemplate.x, (*it).m_itemTemplate.y, (*it).m_itemTemplate.x+(*it).m_itemTemplate.cx, (*it).m_itemTemplate.y+(*it).m_itemTemplate.cy); + MapRect(&rc); + pWnd->SetWindowPos(NULL, rc.left, rc.top, rc.Width(), rc.Height(), SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); + + // text/caption + if ( (*it).m_wClass == 0x0080 || (*it).m_wClass == 0x0082 || (*it).m_wClass == 0x0086 || ((*it).m_pszClass != NULL && _tcscmp((*it).m_pszClass, _T("STATICEX")) == 0) ) + pWnd->SetWindowText(m_prm->LoadString((WORD)m_uiResID, (*it).m_itemTemplate.id)); + } +} + +/////////////////////////////////////////////////////////////// +// Helper function - does the cleanup after destroying the +// dialog (that means releasing the instance lock, deleting +// unused fonts and in some cases deleting itself). +/////////////////////////////////////////////////////////////// +void CLanguageDialog::Cleanup() +{ + TRACE("CLanguageDialog::Cleanup()\n"); + + if (m_bLockChanged && m_pbLock) + *m_pbLock=false; + + delete m_pFont; + + if (m_bAutoDelete) + delete this; +} + +/////////////////////////////////////////////////////////////// +// Standard msg - initializes tool tip handling +/////////////////////////////////////////////////////////////// +BOOL CLanguageDialog::OnInitDialog() +{ + CDialog::OnInitDialog(); + + UpdateLanguage(0,0); // because initially all the texts are empty + + EnableToolTips(TRUE); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +/////////////////////////////////////////////////////////////// +// Standard handler for pressing cancel button in a dialog. +// For modeless dialog causes dialog to be destroyed. +/////////////////////////////////////////////////////////////// +void CLanguageDialog::OnCancel() +{ + switch (m_cType) + { + case 0: + CDialog::OnCancel(); + break; + case 1: + DestroyWindow(); + break; + } +} + +/////////////////////////////////////////////////////////////// +// Standard handler for pressing OK button in a dialog. +// For modeless dialog causes destruction of a dialog. +/////////////////////////////////////////////////////////////// +void CLanguageDialog::OnOK() +{ + switch(m_cType) + { + case 0: + CDialog::OnOK(); + break; + case 1: + DestroyWindow(); + break; + } +} + +/////////////////////////////////////////////////////////////// +// Standard override - calls cleanup. +/////////////////////////////////////////////////////////////// +void CLanguageDialog::PostNcDestroy() +{ + CDialog::PostNcDestroy(); + Cleanup(); +} + +/////////////////////////////////////////////////////////////// +// This dialog's window procedure handler - look at ms docs. +/////////////////////////////////////////////////////////////// +LRESULT CLanguageDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) +{ + switch(message) + { + case WM_RMNOTIFY: + if ((UINT)wParam == RMNT_LANGCHANGE) + { + UpdateLanguage(HIWORD(lParam), LOWORD(lParam)); + + // now update user controls (everybody has to do it him(her)self) + OnLanguageChanged(HIWORD(lParam), LOWORD(lParam)); + break; + } + case WM_NOTIFY: + { + NMHDR* pnmh=(NMHDR*)lParam; + if (pnmh->code == TTN_NEEDTEXT) + { + // establish the ID of a control + TOOLTIPTEXT *ppt=(TOOLTIPTEXT*)pnmh; + UINT nID; + if (ppt->uFlags & TTF_IDISHWND) + nID=(UINT)::GetDlgCtrlID((HWND)pnmh->idFrom); + else + nID=(UINT)pnmh->idFrom; + + return OnTooltipText(nID, ppt); + } + break; + } + } + + return CDialog::WindowProc(message, wParam, lParam); +} + +/////////////////////////////////////////////////////////////// +// Helper function. Recalculates current sizes of a dialog base +// units (font dependent) and stores in the internal members. +// pszFacename [in] - font's face name. +// wPointSize [in] - size of the font in points. +/////////////////////////////////////////////////////////////// +void CLanguageDialog::CalcBaseUnits(PCTSTR pszFacename, WORD wPointSize) +{ + LOGFONT lf; + HDC hDC = ::GetDC(NULL); + memset(&lf, 0, sizeof(LOGFONT)); + lf.lfHeight = -MulDiv(wPointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72); + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = DEFAULT_CHARSET; + lstrcpy(lf.lfFaceName, pszFacename); + + HFONT hNewFont = CreateFontIndirect(&lf); + if (hNewFont != NULL) + { + HFONT hFontOld = (HFONT)SelectObject(hDC, hNewFont); + TEXTMETRIC tm; + GetTextMetrics(hDC, &tm); + m_iBaseY = tm.tmHeight + tm.tmExternalLeading; + SIZE size; + ::GetTextExtentPoint32(hDC, _T("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"), 52, &size); + m_iBaseX = (size.cx + 26) / 52; + SelectObject(hDC, hFontOld); + DeleteObject(hNewFont); + } + else + { + // Could not create the font so just use the system's values + m_iBaseX = LOWORD(GetDialogBaseUnits()); + m_iBaseY = HIWORD(GetDialogBaseUnits()); + } + ::ReleaseDC(NULL, hDC); +} \ No newline at end of file Index: modules/App Framework/LanguageDialog.h =================================================================== diff -u --- modules/App Framework/LanguageDialog.h (revision 0) +++ modules/App Framework/LanguageDialog.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,202 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + CLanguageDialog template + + Files: LanguageDialog.h, LanguageDialog.cpp + Author: Ixen Gerthannes + Usage: + Derive your class from CLanguageDialog instead of CDialog, change all + calls from CDialog to CLanguageDialog, change call to base constructor + so it can take language as parameter. + Creating dialog class: + - derive class from CLanguageDialog + - change all occurences of CDialog to CLanguageDialog + - change parameters list of your default constructor so it can take + language as parameter (WORD wLang) + - modify call to base class constructor by putting into it declared + wLang from your constructor + Displaying dialog box: + - declare object as your dialog class + - eventually set public member m_bAutoDelete to true if you're + creating dialog with operator new, and it should be + automatically deleted when closed + - call DoModal/Create/CreateModeless member function for + modal/modeless/mixed mode dialog + Members: + Constructors - as described in CDialog constructors - language + specifies resource language to load + CLanguageDialog(); + CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL); + CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL); + Functions: + int DoModal(); - like in CDialog + BOOL Create(); - creates modeless dialog box; this class + automatically handles DestroyWindow, and like + void Cleanup(); - function cleans unused data - use only when + window object wasn't created yet (in Create() and earlier) + WORD GetCurrentLanguage() const; - retrieves current language + setting for this dialog + Attributes: + bool m_bAutoDelete; - specifies whether this dialog should be + deleted (by 'delete this') when closed. +*************************************************************************/ +#pragma once + +#include "ResourceManager.h" + +#pragma pack(push, 1) +struct DLGTEMPLATEEX +{ + WORD dlgVer; + WORD signature; + DWORD helpID; + DWORD exStyle; + DWORD style; + WORD cDlgItems; + short x; + short y; + short cx; + short cy; +}; + +struct DLGITEMTEMPLATEEX +{ + DWORD helpID; + DWORD exStyle; + DWORD style; + short x; + short y; + short cx; + short cy; + WORD id; + WORD __DUMMY__; +}; +#pragma pack(pop) + +class CDlgTemplate +{ +public: + CDlgTemplate() { m_wMenu=(WORD)-1; m_pszMenu=NULL; m_wClass=(WORD)-1; m_pszClass=NULL, m_wTitle=(WORD)-1; m_pszTitle=NULL; m_wFontSize=0; m_wWeight=0; m_byItalic=0; m_byCharset=0; m_pszFace=NULL; }; + CDlgTemplate(const DLGTEMPLATE* pDlgTemplate); + CDlgTemplate(const DLGTEMPLATEEX* pDlgTemplate); + ~CDlgTemplate(); + + bool Open(const DLGTEMPLATE* pDlgTemplate); + +protected: + void ConvertItemToEx(const DLGITEMTEMPLATE* pSrc, DLGITEMTEMPLATEEX* pDst); // converts DLGITEMTEMPLATE to DLGITEMTEMPLATEEX + void ConvertDlgToEx(const DLGTEMPLATE* pSrc, DLGTEMPLATEEX* pDst); + + const BYTE* ReadCompoundData(const BYTE* pBuffer, WORD* pwData, PTSTR* ppszStr); + +public: + struct _ITEM + { + DLGITEMTEMPLATEEX m_itemTemplate; + + WORD m_wClass; + TCHAR *m_pszClass; + + WORD m_wTitle; + TCHAR *m_pszTitle; + + WORD m_wCreationDataSize; + BYTE *m_pbyCreationData; + }; + vector<_ITEM> m_vItems; + + DLGTEMPLATEEX m_dlgTemplate; + + WORD m_wMenu; + TCHAR *m_pszMenu; + + WORD m_wClass; + TCHAR *m_pszClass; + + WORD m_wTitle; // always -1 + TCHAR *m_pszTitle; + + // font + WORD m_wFontSize; + WORD m_wWeight; + BYTE m_byItalic; + BYTE m_byCharset; + TCHAR *m_pszFace; +}; + +///////////////////////////////////////////////////////////////////////////// +// CLanguageDialog dialog +#define LDF_NODIALOGSIZE 0x01 +#define LDF_NODIALOGFONT 0x02 + +class CLanguageDialog : public CDialog +{ +public: +// Construction/destruction + CLanguageDialog(bool* pLock=NULL); + CLanguageDialog(PCTSTR lpszTemplateName, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor + CLanguageDialog(UINT uiIDTemplate, CWnd* pParent = NULL, bool* pLock=NULL); // standard constructor + + ~CLanguageDialog(); + + // static members - initialize global pointer to a resource manager + static void SetResManager(CResourceManager* prm) { m_prm=prm; }; + + // creation + virtual INT_PTR DoModal(); + virtual BOOL Create(); + + void MapRect(RECT* pRect); + CFont* GetFont() { return m_pFont ? m_pFont : ((CDialog*)this)->GetFont(); }; + +protected: + void UpdateLanguage(WORD wOldLang, WORD wNewLang); + virtual UINT GetLanguageUpdateOptions() { return 0; }; + virtual void OnLanguageChanged(WORD /*wOld*/, WORD /*wNew*/) { }; + void Cleanup(); + + virtual BOOL OnTooltipText(UINT /*uiID*/, TOOLTIPTEXT* /*pTip*/) { return FALSE; }; + virtual BOOL OnInitDialog(); + virtual void OnCancel(); + virtual void OnOK(); + virtual void PostNcDestroy(); + virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); + +private: + void CalcBaseUnits(PCTSTR pszFacename, WORD wPointSize); + +// Attributes +public: + bool m_bAutoDelete; // deletes this dialog when exiting + bool m_bLockInstance; // allows only one instance of this dialog if set + +protected: + static CResourceManager* m_prm; // points to the resource manager instance + + bool *m_pbLock; // dialog box instance lock system + bool m_bLockChanged; // if this dialog changed the lock + PCTSTR m_pszResName; // resource (string) name of the dialog template + UINT m_uiResID; // resource ID if any of the dialog template + CWnd* m_pParent; // parent window ptr + char m_cType; // type of this dialog box + CFont* m_pFont; // currently used font + int m_iBaseX, m_iBaseY; +}; \ No newline at end of file Index: modules/App Framework/LogFile.cpp =================================================================== diff -u --- modules/App Framework/LogFile.cpp (revision 0) +++ modules/App Framework/LogFile.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,387 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ + +#include "stdafx.h" +#include "LogFile.h" +#include "stdio.h" + +#pragma warning( disable : 4127 ) + +/////////////////////////////////////////////////////////////// +// Constructs this log file (sets members to initial state) +/////////////////////////////////////////////////////////////// +CLogFile::CLogFile() : CFileEx() +{ + // nullify filename, set std data + m_szFilename[0]=_T('\0'); + m_bSizeLimit=true; + m_dwSizeLimit=64UL*1024UL; + m_bPreciseLimiting=false; + m_dwTruncateBufferSize=64UL*1024UL; + m_bEnabled=true; + + InitializeCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Initializes this log file. Remembers pathname and sets +// enabled/disabled state. +/////////////////////////////////////////////////////////////// +void CLogFile::Init(LPCTSTR pszPath, CResourceManager* pManager, bool bEnable) +{ + // set filename + _tcscpy(m_szFilename, pszPath); + m_bEnabled=bEnable; + m_pResManager=pManager; +} + +/////////////////////////////////////////////////////////////// +// Allows to set maximum size of this log file. When adding +// next line of text to this file and when this option is +// enabled - the file will be truncated (truncation of data +// that lies at the beginning of file) before text is added. +/////////////////////////////////////////////////////////////// +void CLogFile::SetSizeLimit(bool bEnable, DWORD dwSizeLimit) +{ + EnterCriticalSection(&m_cs); + m_bSizeLimit=bEnable; + m_dwSizeLimit=dwSizeLimit; + LeaveCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Retrieves size limit and enabled limit status of this file. +// Look @ SetSizeLimit. +/////////////////////////////////////////////////////////////// +bool CLogFile::GetSizeLimit(DWORD* pdwSizeLimit) +{ + EnterCriticalSection(&m_cs); + bool bEnabled=m_bSizeLimit; + if (pdwSizeLimit) + *pdwSizeLimit=m_dwSizeLimit; + LeaveCriticalSection(&m_cs); + + return bEnabled; +} + +/////////////////////////////////////////////////////////////// +// Allows to enable/disable precise size limiting. Normally +// when file needs truncation (look @SetSizeLimit) this class +// truncates about 1/3 of the file. When this option is enabled +// truncation will take much less data (but this will cause +// that truncation will be needed more frequently) +/////////////////////////////////////////////////////////////// +void CLogFile::SetPreciseLimiting(bool bEnable) +{ + EnterCriticalSection(&m_cs); + m_bPreciseLimiting=bEnable; + LeaveCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Returns state of precise limiting (look@SetPreciseLimiting) +/////////////////////////////////////////////////////////////// +bool CLogFile::GetPreciseLimiting() +{ + return m_bPreciseLimiting; +} + +/////////////////////////////////////////////////////////////// +// Sets size of the buffer that will be used when truncating +// this file. Truncation is done by copying data from end of +// a file to the beginning and truncating a file. This buffer +// size specifies amount of data that will be read/write at +// once. +/////////////////////////////////////////////////////////////// +void CLogFile::SetTruncateBufferSize(DWORD dwSize) +{ + EnterCriticalSection(&m_cs); + m_dwTruncateBufferSize=dwSize; + LeaveCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Retrieve current size of the truncation buffer. (see +// SetTruncateBufferSize). +// Ret Value [out] - size of the truncation buffer +/////////////////////////////////////////////////////////////// +DWORD CLogFile::GetTruncateBufferSize() +{ + return m_dwTruncateBufferSize; +} + +/////////////////////////////////////////////////////////////// +// Enables (or disables) log functionality of this class. +// Disabling logging allows to "transparently" use of this +// class when we do not want to log any data. +// bEnable [in] - enables logging (true) or disables (false) +/////////////////////////////////////////////////////////////// +void CLogFile::EnableLogging(bool bEnable) +{ + EnterCriticalSection(&m_cs); + m_bEnabled=bEnable; + LeaveCriticalSection(&m_cs); +} + +/////////////////////////////////////////////////////////////// +// Returns current state of the logging (see EnableLogging) +// Ret Value [out] - if logging is enabled (true) +/////////////////////////////////////////////////////////////// +bool CLogFile::IsLoggingEnabled() +{ + return m_bEnabled; +} + +/////////////////////////////////////////////////////////////// +// Logs string with a given va_list. +// pszText [in] - text to log (it'll be expanded with data from +// va_list. +// arglist [in] - contains data that'll be used to expand +// pszText +// Ret Value [out] - if the text has been successfully written +/////////////////////////////////////////////////////////////// +bool CLogFile::LogV(LPCTSTR pszText, va_list arglist) +{ + // logging disabled - so we succeeded in processing + if (!m_bEnabled) + return true; + + EnterCriticalSection(&m_cs); + + try + { + // open the file + Open(m_szFilename, FA_APPEND); + + // process string + int iSize=_vstprintf(m_szText, pszText, arglist); + va_end(arglist); + + // trace it + TRACE("[Log file] %s\n", m_szText); + + // call the callbacks + for (vector::iterator it=m_vCallbacks.begin();it != m_vCallbacks.end();it++) + { + (*it->pfn)(it->pParam, m_szText); + } + + // check if log file isn't too large + if (m_bSizeLimit) + { + LONGLONG llCurrentSize=GetSize(); + + if (llCurrentSize+iSize+2 > m_dwSizeLimit) // limit check + { + // need to make this file shorter + // find end of line at about 1/3 file size + LONGLONG llNewSize=llCurrentSize-llCurrentSize/3; + if (m_bPreciseLimiting || m_dwSizeLimit-llNewSize < iSize+2) + { + // more place needed + llNewSize=(LONGLONG)m_dwSizeLimit-(iSize+2); + if (llNewSize < 0) + llNewSize=0; + } + + // truncate this file + LimitSize((DWORD)llNewSize); + } + } + + // now write data to file - append "\r\n" + WriteLine(m_szText); + + // Close + Close(); + } + catch (CFileException* e) + { + LeaveCriticalSection(&m_cs); + delete e; + return false; + } + + LeaveCriticalSection(&m_cs); + return true; +} + +/////////////////////////////////////////////////////////////// +// Logs string. Ellipsis param. +// pszText [in] - text to log (it'll be expanded with data from +// va_list. +// ... [in] - data that'll be used to expand pszText +// Ret Value [out] - if the text has been successfully written +/////////////////////////////////////////////////////////////// +bool CLogFile::Log(LPCTSTR pszText, ...) +{ + if (!m_bEnabled) + return true; + + va_list marker; + va_start(marker, pszText); + return LogV(pszText, marker); +} + +bool CLogFile::Log(UINT uiStrID, ...) +{ + if (!m_bEnabled) + return true; + + // load string + _ASSERT(m_pResManager); + + va_list marker; + va_start(marker, uiStrID); + return LogV(m_pResManager->LoadString(uiStrID), marker); +} + +bool CLogFile::LogError(UINT uiStrID, DWORD dwError, ...) +{ + if (!m_bEnabled) + return true; + + TCHAR szBuffer[_MAX_PATH]; + const TCHAR* pszText=m_pResManager->LoadString(uiStrID); + + // find the first %lu in the string + TCHAR* pszPos=_tcsstr(pszText, _T("%lu")); + if (pszPos == NULL) + return false; + _tcsncpy(m_szBuffer, pszText, pszPos-pszText); + m_szBuffer[pszPos-pszText]=_T('\0'); + + // append error number + _itot(dwError, szBuffer, 10); + _tcscat(m_szBuffer, szBuffer); + + // format error + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, 0, szBuffer, _MAX_PATH, NULL); + + while (szBuffer[_tcslen(szBuffer)-1] == _T('\n') || szBuffer[_tcslen(szBuffer)-1] == _T('\r')) + szBuffer[_tcslen(szBuffer)-1] = _T('\0'); + + // now find the first %s in a string + pszPos+=3; + TCHAR *pszPos2=_tcsstr(pszPos, _T("%s")); + int iSize=(int)_tcslen(m_szBuffer); + _tcsncpy(m_szBuffer+iSize, pszPos, pszPos2-pszPos); + m_szBuffer[iSize+pszPos2-pszPos]=_T('\0'); + + // paste the string (error desc) + _tcscat(m_szBuffer, szBuffer); + + // copy rest of the string + _tcscat(m_szBuffer, pszPos2+2); + + va_list marker; + va_start(marker, dwError); + return LogV(m_szBuffer, marker); +} + +void CLogFile::RegisterCallback(PFNLOGCALLBACK pfn, PVOID pParam) +{ + LOGCALLBACKENTRY lce; + lce.pfn=pfn; + lce.pParam=pParam; + m_vCallbacks.push_back(lce); +} + +void CLogFile::UnregisterCallback(PFNLOGCALLBACK pfn) +{ + // find the callback with the given address and remove it + for (vector::iterator it=m_vCallbacks.begin();it != m_vCallbacks.end();it++) + { + if (it->pfn == pfn) + { + m_vCallbacks.erase(it); + return; + } + } + TRACE("Warning: Unregister callback function in CLogFile::UnregisterCallback failed. No function found.\n"); +} + +/////////////////////////////////////////////////////////////// +// (Internal) Limits size of the file. Causes to find the +// nearest eol sign in file, and move all further data to +// beginning of the file. +// dwNewSize [in] - specifies new maximum file size needed +/////////////////////////////////////////////////////////////// +void CLogFile::LimitSize(DWORD dwNewSize) +{ + BYTE* pszBuffer=NULL; + try + { + // seek to end of file-dwNewSize + Seek(-(LONG)dwNewSize, FILE_END); + + // establish end of line after that position + pszBuffer=new BYTE[m_dwTruncateBufferSize]; // buffer for other data + + ReadLine((TCHAR*)pszBuffer, 1); // read line to the end - doesn't matter what it is + Flush(); // flush buffer (if used) - sets file pointer to proper pos. + + // now move data from that position to the beginning + DWORD dwDst=0, dwSrc=(DWORD)GetPos(); + + // buffer for data + DWORD dwRD, dwWR; + + // switch file to unbuffered mode (faster) + SwitchToUnbuffered(); + + // move + while(true) + { + // seek to src + Seek(dwSrc, FILE_BEGIN); + + // read data + if ((dwRD=ReadBuffer(pszBuffer, m_dwTruncateBufferSize)) == 0) + { + Seek(dwDst, FILE_BEGIN); + SetEndOfFile(); // leaves file ptr at the end of file + break; + } + else + { + Seek(dwDst, FILE_BEGIN); + dwWR=WriteBuffer(pszBuffer, dwRD); + + // update pos + dwDst+=dwWR; + dwSrc+=dwRD; + } + } + } + catch(...) + { + // something happened (shouldn't) + // restore file state + RestoreState(); + delete [] pszBuffer; + + throw; + } + + // free buffer + RestoreState(); + delete [] pszBuffer; +} Index: modules/App Framework/LogFile.h =================================================================== diff -u --- modules/App Framework/LogFile.h (revision 0) +++ modules/App Framework/LogFile.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,101 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/************************************************************************* + File: LogFile.h + Version: 1.0 + Author: Ixen Gerthannes (ixen@interia.pl) + File description: + Contain class that handle logging text to file. + Classes: + CLogFile (based on CFile - not MFC one). + - provides functionality of log file +*************************************************************************/ +#ifndef __LOGFILE_H__ +#define __LOGFILE_H__ + +#include "FileEx.h" +#include "ResourceManager.h" +#include "charvect.h" + +typedef void(*PFNLOGCALLBACK)(PVOID, PCTSTR); + +// struct that remembers the callback function and associated parameter +struct LOGCALLBACKENTRY +{ + PFNLOGCALLBACK pfn; + PVOID pParam; +}; + +class CLogFile : public CFileEx +{ +public: + CLogFile(); + ~CLogFile() { DeleteCriticalSection(&m_cs); }; + + void Init(LPCTSTR pszPath, CResourceManager* pManager, bool bEnable=true); // initializes this Log File + + // cfg functions + void EnableLogging(bool bEnable=true); // enables/disables logging + bool IsLoggingEnabled(); // determines if logging is enabled + void SetSizeLimit(bool bEnable, DWORD dwSizeLimit=64UL*1024UL); // enables/disables size limiting for this log file + bool GetSizeLimit(DWORD* pdwSizeLimit=NULL); + void SetPreciseLimiting(bool bEnable); + bool GetPreciseLimiting(); + void SetTruncateBufferSize(DWORD uiSize); + DWORD GetTruncateBufferSize(); + + // callback handling + void RegisterCallback(PFNLOGCALLBACK pfn, PVOID pParam); + void UnregisterCallback(PFNLOGCALLBACK pfn); + + // standard log functions + bool Log(UINT uiStrID, ...); + bool LogError(UINT uiStrID, DWORD dwError, ...); + bool Log(LPCTSTR pszText, ...); + bool LogV(LPCTSTR pszText, va_list arglist); + +protected: + void LimitSize(DWORD dwNewSize); // active limitation in file + +protected: + TCHAR m_szFilename[_MAX_PATH]; + + // cfg section + bool m_bEnabled; // is this log file enabled ? + bool m_bSizeLimit; // if size limit is needed + DWORD m_dwSizeLimit; // size limit + bool m_bPreciseLimiting; // increases precision of size limiting (slowly) + DWORD m_dwTruncateBufferSize; // buffer size used for truncating file + + // callback handling - calls each function when a new string is about to be saved in log + vector m_vCallbacks; + + // internal text buffer + TCHAR m_szText[1024]; // max line + TCHAR m_szBuffer[1024]; // for using with load from resource + + // res manager + CResourceManager *m_pResManager; + + // protection + CRITICAL_SECTION m_cs; +}; + +#endif \ No newline at end of file Index: modules/App Framework/MemDC.h =================================================================== diff -u --- modules/App Framework/MemDC.h (revision 0) +++ modules/App Framework/MemDC.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,106 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/////////////////////////////////////////////////////////////// +// CMemDC - memory DC +// +// Author: Keith Rule +// Email: keithr@europa.com +// Copyright 1996-1997, Keith Rule +// +// You may freely use or modify this code provided this +// Copyright is included in all derived versions. +// +/////////////////////////////////////////////////////////////// +#ifndef _MEMDC_H_ +#define _MEMDC_H_ + +/////////////////////////////////////////////////////////////// +// BCMenuMemDC - memory DC +// +// Author: Keith Rule +// Email: keithr@europa.com +// Copyright 1996-1997, Keith Rule +// +// You may freely use or modify this code provided this +// Copyright is included in all derived versions. +// +// History - 10/3/97 Fixed scrolling bug. +// Added print support. +// 25 feb 98 - fixed minor assertion bug +// +// This class implements a memory Device Context +/////////////////////////////////////////////////////////////// +class CMemDC : public CDC +{ +public: + + // constructor sets up the memory DC + CMemDC(CDC* pDC, LPCRECT lpSrcRect) : CDC() + { + ASSERT(pDC != NULL); + + m_rect.CopyRect(lpSrcRect); + m_pDC = pDC; + m_pOldBitmap = NULL; + m_bMemDC = !pDC->IsPrinting(); + + if (m_bMemDC) // Create a Memory DC + { + CreateCompatibleDC(pDC); + m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height()); + m_pOldBitmap = SelectObject(&m_bitmap); + SetWindowOrg(m_rect.left, m_rect.top); + } + else // Make a copy of the relevent parts of the current DC for printing + { + m_bPrinting = pDC->m_bPrinting; + m_hDC = pDC->m_hDC; + m_hAttribDC = pDC->m_hAttribDC; + } + } + + // Destructor copies the contents of the mem DC to the original DC + ~CMemDC() + { + if (m_bMemDC) + { + // Copy the offscreen bitmap onto the screen. + m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(), + this, m_rect.left, m_rect.top, SRCCOPY); + + //Swap back the original bitmap. + SelectObject(m_pOldBitmap); + } else { + // All we need to do is replace the DC with an illegal value, + // this keeps us from accidently deleting the handles associated with + // the CDC that was passed to the constructor. + m_hDC = m_hAttribDC = NULL; + } + } + +private: + CBitmap m_bitmap; // Offscreen bitmap + CBitmap* m_pOldBitmap; // bitmap originally found in BCMenuMemDC + CDC* m_pDC; // Saves CDC passed in constructor + CRect m_rect; // Rectangle of drawing area. + BOOL m_bMemDC; // TRUE if CDC really is a Memory DC. +}; + +#endif \ No newline at end of file Index: modules/App Framework/Plugin.cpp =================================================================== diff -u --- modules/App Framework/Plugin.cpp (revision 0) +++ modules/App Framework/Plugin.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,278 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "plugin.h" + +CPlugin::CPlugin(bool bInternal) +{ + m_hModule=NULL; + m_bInternal=bInternal; + m_byLoadState=PLGS_NOTLOADED; + m_lLockCount=0; + m_pszFilename=NULL; + m_bNeedChange=false; + + // cache + m_ppdData=NULL; + + // exports addresses + m_pfnInit=NULL; + m_pfnUninit=NULL; + m_pfnGetInfo=NULL; +} + +CPlugin::~CPlugin() +{ + // free all + Unload(true); // unload if loaded + + // free filename + delete [] m_pszFilename; + m_pszFilename=NULL; +} + +void CPlugin::Load(PCTSTR pszName, PFNEXTINFOPROC pfn) +{ + if (pszName && m_byLoadState != PLGS_NOTLOADED) + { + // trying to load a plugin to already initialized class + if (m_bInternal) + THROW_PLUGINEXCEPTIONEX(_T("Trying to load a plugin to already initialized class (internal plugin)."), NULL, PLERR_LOAD, 0); + else + THROW_PLUGINEXCEPTIONEX(_T("Trying to load a plugin to already initialized class (external plugin)."), pszName, PLERR_LOAD, 0); + } + + // check if loading is needed + if (!pszName) + { + if (m_byLoadState == PLGS_LOADED) + return; + else if (m_byLoadState == PLGS_NOTLOADED) + THROW_PLUGINEXCEPTIONEX(_T("Cannot re-load plugin (with NULL path) when it wasn't loaded before."), NULL, PLERR_LOAD, 0); // not loaded and pszName==NULL - this shouldn't happen + } + + // load - copy data to internal members + if (m_bInternal) + { + // copy only if there is anything to copy + if (pszName) + { + m_hModule=(HMODULE)pszName; // should be HMODULE of current app + m_pszFilename=(TCHAR*)pszName; + } + else + m_hModule=(HMODULE)m_pszFilename; + m_byLoadState=PLGS_LOADED; + } + else + { + // remember the name of this plugin (path) + if (pszName) + { + delete [] m_pszFilename; + m_pszFilename=new TCHAR[_tcslen(pszName)+1]; + _tcscpy(m_pszFilename, pszName); + } + + // try to open + m_hModule=LoadLibrary(m_pszFilename); + if (!m_hModule || !LoadExports()) + { + m_byLoadState=PLGS_NOTLOADED; + if (m_bInternal) + THROW_PLUGINEXCEPTIONEX(_T("Cannot load an internal plugin - probably LoadExports failed."), NULL, PLERR_LOAD, GetLastError()); + else + THROW_PLUGINEXCEPTIONEX(_T("Cannot load an external plugin - either LoadLibrary failed or LoadExports failed."), pszName, PLERR_LOAD, GetLastError()); + } + else + m_byLoadState=PLGS_LOADED; + } + + // now initialize the plugin + Init(pfn); +} + +void CPlugin::Unload(bool bCompletely) +{ + if (m_byLoadState == PLGS_NOTLOADED) + return; + + // uninit if loaded + if (m_byLoadState == PLGS_LOADED) + Uninit(); + + // release the loaded library (if partial - doesn't need to) + if (!m_bInternal && m_byLoadState == PLGS_LOADED) + { + if (!FreeLibrary(m_hModule)) + THROW_PLUGINEXCEPTIONEX(_T("Cannot release loaded plugin (FreeLibrary failed)."), m_pszFilename, PLERR_UNLOAD, GetLastError()); + } + m_hModule=NULL; + + // release the rest of data if completely + if (bCompletely) + { + // filename + if (!m_bInternal) + delete [] m_pszFilename; + m_pszFilename=NULL; + + // cached data + delete m_ppdData; + m_ppdData=NULL; + + // free other data + FreePluginData(); + } + + // determine load state + m_byLoadState=(BYTE)(bCompletely ? PLGS_NOTLOADED : PLGS_PARTIAL); +} + +bool CPlugin::LoadExports() +{ + _ASSERT(m_hModule); + + m_pfnInit=(PFNINIT)GetProcAddress(m_hModule, "Init"); + if (!m_pfnInit) + { + TRACE("Last Error: %lu\n!!!", GetLastError()); + return false; + } + m_pfnUninit=(PFNUNINIT)GetProcAddress(m_hModule, "Uninit"); + if (!m_pfnUninit) + return false; + m_pfnGetInfo=(PFNGETINFO)GetProcAddress(m_hModule, "GetInfo"); + if (!m_pfnUninit) + return false; + + return true; +} + +void CPlugin::Init(PFNEXTINFOPROC pfn) +{ + _ASSERT(m_hModule); + if (!m_bInternal) + { + // store pfn for future use + if (pfn) + m_pfnCallback=pfn; + + // call Init + TRACE("External CPlugin::Init()\n"); + if (!(*m_pfnInit)(m_pfnCallback)) + THROW_PLUGINEXCEPTIONEX(_T("External plugin initialization failed."), m_pszFilename, PLERR_INIT, 0); + } + else + TRACE("Internal CPlugin::Init() - does nothing\n"); +} + +void CPlugin::Uninit() +{ + if (!m_hModule) + return; + + if (!m_bInternal) + { + TRACE("External CPlugin::Uninit()\n"); + if (!(*m_pfnUninit)()) + THROW_PLUGINEXCEPTIONEX(_T("External plugin deinitialization failed."), m_pszFilename, PLERR_UNINIT, 0); + } + else + TRACE("Internal CPlugin::Uninit() - does nothing\n"); +} + +bool CPlugin::GetInfo(_PLUGININFO* pInfo) +{ + // alloc new _PLUGININFO + if (m_ppdData) + { + *pInfo=*m_ppdData; // get data from cache + return true; + } + else + { + if (!m_bInternal) + { + BeginUsage(); + // call + bool bRes=(*m_pfnGetInfo)(pInfo); + if (bRes) + { + // fill cache + m_ppdData=new _PLUGININFO; + *m_ppdData=*pInfo; + } + EndUsage(); + return bRes; + } + else + return false; // must override in internal plugin + } +} + +void CPlugin::BeginUsage() +{ + // only means something for partial plugin state + m_cs.Lock(); + if (m_byLoadState == PLGS_PARTIAL) + { + try + { + m_lLockCount++; + Load(NULL, m_pfnCallback); + m_bNeedChange=true; + } + catch (CPluginException*) + { + m_cs.Unlock(); + throw; + } + } + else if (m_bNeedChange) + m_lLockCount++; + + m_cs.Unlock(); +} + +void CPlugin::EndUsage() +{ + m_cs.Lock(); + try + { + if (m_bNeedChange) + { + if (m_lLockCount > 0) + m_lLockCount--; + if (m_lLockCount == 0) + { + Unload(false); + m_bNeedChange=false; + } + } + } + catch (CPluginException*) + { + m_cs.Unlock(); + throw; + } + + m_cs.Unlock(); +} Index: modules/App Framework/Plugin.h =================================================================== diff -u --- modules/App Framework/Plugin.h (revision 0) +++ modules/App Framework/Plugin.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,125 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PLUGIN_H__ +#define __PLUGIN_H__ + +#include "PluginCore.h" +#include "ExceptionEx.h" +#include "afxmt.h" + +typedef bool(*PFNINIT)(PFNEXTINFOPROC); +typedef bool(*PFNUNINIT)(); +typedef bool(*PFNGETINFO)(_PLUGININFO*); + +// error codes for plugins +#define PLERR_UNKNOWN 0 +#define PLERR_LOAD 1 +#define PLERR_UNLOAD 2 +#define PLERR_INIT 3 +#define PLERR_UNINIT 4 + +#define THROW_PLUGINEXCEPTIONEX(str_reason, filename, app_code, last_error) throw new CFileExceptionEx(__FILE__, __LINE__, __FUNCTION__, str_reason, filename, app_code, last_error) + +class CPluginException : public CExceptionEx +{ +public: + CPluginException(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, PCTSTR pszReason, PCTSTR pszFilename, DWORD dwReason=PLERR_UNKNOWN, DWORD dwLastError=0) : CExceptionEx(pszSrcFile, dwLine, pszFunc, pszReason, dwReason, dwLastError) { SetFilename(pszFilename); }; + CPluginException(PCTSTR pszSrcFile, DWORD dwLine, PCTSTR pszFunc, TCHAR* pszReason, PCTSTR pszFilename, DWORD dwReason=PLERR_UNKNOWN, DWORD dwLastError=0) : CExceptionEx(pszSrcFile, dwLine, pszFunc, pszReason, dwReason, dwLastError) { SetFilename(pszFilename); }; + virtual ~CPluginException() { delete [] m_pszFilename; }; + + virtual int RegisterInfo(__EXCPROPINFO* pInfo) + { + // if the pInfo is null - return count of a needed props + if (pInfo == NULL) + return 1+CExceptionEx::RegisterInfo(NULL); + + // call base class RegisterInfo + size_t tIndex=CExceptionEx::RegisterInfo(pInfo); + + // function has to register the info to be displayed (called from within GetInfo) + RegisterProp(pInfo+tIndex+0, _T("Plugin path"), PropType::dtPtrToString, &m_pszFilename); + + return 1; + }; + + +protected: + void SetFilename(PCTSTR pszFilename) { if (pszFilename) { m_pszFilename=new TCHAR[_tcslen(pszFilename)+1]; _tcscpy(m_pszFilename, pszFilename); } else m_pszFilename=NULL; }; + +public: + TCHAR *m_pszFilename; // name of the plugin +}; + +// plugin load state definitions +#define PLGS_NOTLOADED 0 /* plugin wasn't loaded yet */ +#define PLGS_LOADED 1 /* plugin has been loaded and is ready to use */ +#define PLGS_PARTIAL 2 /* plugin was once loaded and then unloaded->partial data is available */ + +class CPlugin +{ +public: + CPlugin(bool bInternal=false); + ~CPlugin(); + + void Load(PCTSTR pszName, PFNEXTINFOPROC pfn); // opens .dll file as a plugin & initializes it + void Unload(bool bCompletely=false); // unloads .dll (partially or completely) & deinitializes + + virtual void Init(PFNEXTINFOPROC pfn); // initializes this plugin with some callback + virtual void Uninit(); // uninitializes this plugin + + virtual bool GetInfo(_PLUGININFO* pInfo); // gets info about this plugin (use cache when possible) + + BYTE GetLoadState() { return m_byLoadState; }; + HMODULE GetModule() { return m_hModule; }; + bool IsInternal() { return m_bInternal; }; + + void BeginUsage(); // should be used before using function of a plugin + void EndUsage(); // should be used after using any plugin func + + // for use with internal plugins + void SetPluginInfo(_PLUGININFO* pData) { m_ppdData=pData; }; // sets the pointer + +protected: + virtual bool LoadExports(); // loads addresses of exported functions (from dll) + virtual void FreePluginData() { }; // for use in derived classes - have to free internal entries + + +protected: + TCHAR *m_pszFilename; // for external plugins - path to plugin, internal - handle to app hModule + HMODULE m_hModule; // dll address/app address + bool m_bInternal; // is this an internal plugin + BYTE m_byLoadState; // load state of this plugin + bool m_bNeedChange; // plugin was temporarily loaded from partial state - unload at the first occasion + + LONG volatile m_lLockCount; // for usage with partial state (specifies current count of loads) + CCriticalSection m_cs; + + PFNEXTINFOPROC m_pfnCallback; // address of a callback + + // cached data + _PLUGININFO* m_ppdData; // cached plugin data + + // exports addresses + PFNINIT m_pfnInit; + PFNUNINIT m_pfnUninit; + PFNGETINFO m_pfnGetInfo; +}; + +#endif \ No newline at end of file Index: modules/App Framework/PluginContainer.cpp =================================================================== diff -u --- modules/App Framework/PluginContainer.cpp (revision 0) +++ modules/App Framework/PluginContainer.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,139 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "PluginContainer.h" + +// member functions +CPluginContainer::CPluginContainer() +{ + +} + +CPluginContainer::~CPluginContainer() +{ + Close(); +} + +// scans (recursively) a folder for plugins that meet uiType criteria +void CPluginContainer::Scan(PCTSTR pszFolder, UINT uiType) +{ + // before we scan... + Prescan(pszFolder, uiType); + + // place for additional "\*.dll" + TCHAR *pszPath=new TCHAR[_tcslen(pszFolder)+7]; + _tcscpy(pszPath, pszFolder); + _tcscat(pszPath, _T("\\*.dll")); + + WIN32_FIND_DATA wfd; + CPlugin* pplg=NULL; + _PLUGININFO pi; + HANDLE hFind=FindFirstFile(pszPath, &wfd); + BOOL bFnd=TRUE; + TCHAR szPluginPath[_MAX_PATH]; + while (hFind != INVALID_HANDLE_VALUE && bFnd) + { + // found next file - establish full path to that file + _tcscpy(szPluginPath, pszFolder); + _tcscat(szPluginPath, _T("\\")); + _tcscat(szPluginPath, wfd.cFileName); + + // load external plugin + pplg=NewPlugin(); + try + { + pplg->Load(szPluginPath, m_pfnCallback); + + // get info about this plugin + if (!pplg->GetInfo(&pi) || !(pi.uiMask & uiType)) + { + pplg->Unload(true); + FreePlugin(pplg); + } + else + Add(pplg, &pi); // add to internal storage structure + } + catch (CPluginException* e) + { + FreePlugin(pplg); + delete e; + } + + // and next plugin to go + bFnd=FindNextFile(hFind, &wfd); + } + + // delete not needed pplg + delete pszPath; + Postscan(pszFolder, uiType); +} + +ULONGLONG CPluginContainer::Add(CPlugin* tPlugin, _PLUGININFO* ppi) +{ + UINT uiRes=OnPluginLoading(tPlugin, ppi); + if (uiRes == PL_REMOVE) + { + // plugin cannot be loaded + tPlugin->Unload(true); + FreePlugin(tPlugin); + return (ULONGLONG)-1; + } + else + { + // add plugin + if (uiRes == PL_ADDUNLOADED) + tPlugin->Unload(false); + + // add + m_mPlugins.insert(plugin_map::value_type(ppi->uliSignature.QuadPart, tPlugin)); + + // plugin has been successfully loaded into memory + OnPluginLoaded(tPlugin, ppi); + } + + return ppi->uliSignature.QuadPart; +} + +void CPluginContainer::Remove(ULONGLONG uiID) +{ + plugin_map::iterator it=m_mPlugins.find(uiID); + if (it != m_mPlugins.end()) + { + CPlugin* pplg=it->second; + + pplg->Unload(true); + FreePlugin(pplg); + m_mPlugins.erase(uiID); + } +} + +void CPluginContainer::Close() +{ + plugin_map::const_iterator it=m_mPlugins.begin(); + CPlugin *pplg; + while (it != m_mPlugins.end()) + { + pplg=it->second; + pplg->Unload(true); + FreePlugin(pplg); + it++; + } + m_mPlugins.clear(); +} Index: modules/App Framework/PluginContainer.h =================================================================== diff -u --- modules/App Framework/PluginContainer.h (revision 0) +++ modules/App Framework/PluginContainer.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,61 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PLUGINCONTAINER_H__ +#define __PLUGINCONTAINER_H__ + +#include +#include "Plugin.h" + +using namespace std; + +// constants - used in OnPluginLoading for determining action for plugin +#define PL_REMOVE 0 +#define PL_ADDUNLOADED 1 +#define PL_ADD 2 + +class CPluginContainer +{ +public: + CPluginContainer(); + ~CPluginContainer(); + + void Scan(PCTSTR pszFolder, UINT uiType); // scans for external plugins + ULONGLONG Add(CPlugin* tPlugin, _PLUGININFO* ppi); // adds plugin to plugin map + void Remove(ULONGLONG uiID); // removes plugin from map + void Close(); + + virtual CPlugin* NewPlugin() { return new CPlugin(); }; // allocates mem for plugin (depends on container type) + virtual void FreePlugin(CPlugin* pPlugin) { delete pPlugin; }; + + virtual void Prescan(PCTSTR /*pszFolder*/, UINT /*uiType*/) { }; // called before scanning + virtual void Postscan(PCTSTR /*pszFolder*/, UINT /*uiType*/) { }; // after scanning finished + + virtual UINT OnPluginLoading(CPlugin* /*tPlugin*/, _PLUGININFO* /*pInfo*/) { return PL_ADD; }; // plugin found/parially loaded + // - what to do ? + virtual void OnPluginLoaded(CPlugin* /*tPlugin*/, _PLUGININFO* /*pInfo*/) { }; // plugin has been added to a list + +public: + typedef map plugin_map; + PFNEXTINFOPROC m_pfnCallback; // callback for plugin usage - communication with app + plugin_map m_mPlugins; +}; + + +#endif Index: modules/App Framework/PluginCore.h =================================================================== diff -u --- modules/App Framework/PluginCore.h (revision 0) +++ modules/App Framework/PluginCore.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,49 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __PLUGINCORE_H__ +#define __PLUGINCORE_H__ + +typedef LRESULT(*PFNEXTINFOPROC)(ULONGLONG dwModuleID, UINT uMsg, WPARAM wParam, LPARAM lParam); + +// plugin structures +struct _PLUGININFO +{ + ULONG ulSize; // size of this structure + ULARGE_INTEGER uliSignature; // 64-bit unique ID of this plugin + + char szProgID[32]; // program string identificator for which this plugin was written - current "1.x" + UINT uiMask; // what this dll can do (type of this plugin - PT_... value) + + char szPluginName[128]; // full name of this plugin (preferred english description) + struct _VERSION + { + WORD wMajor; + WORD wMinor; + WORD wRelease; + WORD wBuild; + } vVersion; // plugin version + char szAuthor[128]; // name of the author (or company name or both) + char szPluginDescription[256]; // plugin info - what it can do, ... (preferred english) + + // update info + char szUpdateInfo[256]; // internet address of a file with new plugin info (address, version, ...). Currently unused, but may be in future. +}; + +#endif \ No newline at end of file Index: modules/App Framework/ResourceManager.cpp =================================================================== diff -u --- modules/App Framework/ResourceManager.cpp (revision 0) +++ modules/App Framework/ResourceManager.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,497 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "IniFile.h" +#include "ResourceManager.h" + +CLangData::CLangData(const CLangData& ld) +{ + szDefString=0; + pszFilename=NULL; + pszLngName=NULL; + pszBaseFile=NULL; + pszFontFace=NULL; + pszHelpName=NULL; + pszAuthor=NULL; + pszVersion=NULL; + pszStrings=NULL; + tCount=0; + + SetFilename(ld.GetFilename(true)); + SetLangName(ld.GetLangName()); + SetLangCode(ld.GetLangCode()); + SetFontFace(ld.GetFontFace()); + SetCharset(ld.GetCharset()); + SetPointSize(ld.GetPointSize()); + SetDirection(ld.GetDirection()); + SetHelpName(ld.GetHelpName()); + SetAuthor(ld.GetAuthor()); + SetVersion(ld.GetVersion()); + + SetStringData(ld.pszStrings, ld.tCount); +} + +bool CLangData::ReadInfo(PCTSTR pszFile) +{ + try + { + CIniFile file; + file.Open(pszFile, _T("Info"), true); + + TCHAR szData[512]; + SetLangName(file.GetString(_T("000"), _T("Info"), _T("Lang Name"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetLangCode((WORD)file.GetInt(_T("000"), _T("Info"), _T("Lang Code"), 0, szData)); + if (file.IsDefault()) + return false; + SetBaseFile(file.GetString(_T("000"), _T("Info"), _T("Base Language"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetFontFace(file.GetString(_T("000"), _T("Info"), _T("Font Face"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetCharset((BYTE)file.GetInt(_T("000"), _T("Info"), _T("Charset"), 0, szData)); + if (file.IsDefault()) + return false; + SetPointSize((WORD)file.GetInt(_T("000"), _T("Info"), _T("Size"), 0, szData)); + if (file.IsDefault()) + return false; + SetDirection(file.GetBool(_T("000"), _T("Info"), _T("RTL reading order"), false, szData)); + if (file.IsDefault()) + return false; + SetHelpName(file.GetString(_T("000"), _T("Info"), _T("Help name"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetAuthor(file.GetString(_T("000"), _T("Info"), _T("Author"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetVersion(file.GetString(_T("000"), _T("Info"), _T("Version"), szData, _T(""))); + if (file.IsDefault()) + return false; + + SetFilename(pszFile); + + return true; + } + catch(...) + { + return false; + } +} + +bool CLangData::ReadTranslation(PCTSTR pszFile, bool bUpdate) +{ + try + { + // load data from file + CIniFile file; + file.Open(pszFile, NULL, true); + + TCHAR szData[512]; + if (!bUpdate) + { + // std data + SetLangName(file.GetString(_T("000"), _T("Info"), _T("Lang Name"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetLangCode((WORD)file.GetInt(_T("000"), _T("Info"), _T("Lang Code"), 0, szData)); + if (file.IsDefault()) + return false; + SetBaseFile(file.GetString(_T("000"), _T("Info"), _T("Base Language"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetFontFace(file.GetString(_T("000"), _T("Info"), _T("Font Face"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetCharset((BYTE)file.GetInt(_T("000"), _T("Info"), _T("Charset"), 0, szData)); + if (file.IsDefault()) + return false; + SetPointSize((WORD)file.GetInt(_T("000"), _T("Info"), _T("Size"), 0, szData)); + if (file.IsDefault()) + return false; + SetDirection(file.GetBool(_T("000"), _T("Info"), _T("RTL reading order"), false, szData)); + if (file.IsDefault()) + return false; + SetHelpName(file.GetString(_T("000"), _T("Info"), _T("Help name"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetAuthor(file.GetString(_T("000"), _T("Info"), _T("Author"), szData, _T(""))); + if (file.IsDefault()) + return false; + SetVersion(file.GetString(_T("000"), _T("Info"), _T("Version"), szData, _T(""))); + if (file.IsDefault()) + return false; + } + + // read strings section + const _PROFILE* pcfg=file.GetProfile(_T("000")); + if (pcfg) + { + // enum through the sections + size_t tSkipped=(size_t)-1; + WORD wHiID, wLoID; + size_t tDataCount=0; + + // 1st phase - count data length + vector<_SECTION*>::const_iterator sit; + for (sit=pcfg->vSections.begin();sit != pcfg->vSections.end();sit++) + { + // skip "Info" section + if (tSkipped == -1 && _tcscmp((*sit)->pszSectionName, _T("Info")) == 0) + { + tSkipped=sit-pcfg->vSections.begin(); + continue; + } + + // now translate all the section of form [000] to the ID's, enum through the entries + for (vector<_ENTRY*>::iterator it=(*sit)->vEntries.begin();it != (*sit)->vEntries.end();it++) + { + if (!bUpdate || m_mStrings.find((_ttoi((*sit)->pszSectionName) << 16) | (_ttoi((*it)->pszKey))) == m_mStrings.end()) + tDataCount+=_tcslen((*it)->pszValue)+1; + } + } + + // allocate the buffer for all data + size_t tOffset=0; + if (bUpdate) + { + if (tDataCount == 0) + return true; + + // we need to reallocate the buffer + TCHAR* pszData=new TCHAR[tCount+tDataCount]; + memcpy(pszData, pszStrings, tCount*sizeof(TCHAR)); + + delete [] pszStrings; + pszStrings=pszData; + + tOffset=tCount; + tCount+=tDataCount; + } + else + { + // delete old settings + delete [] pszStrings; + m_mStrings.clear(); + + tCount=tDataCount; + pszStrings=new TCHAR[tDataCount]; + } + + // 2nd phase - copy all the data + for (sit=pcfg->vSections.begin();sit != pcfg->vSections.end();sit++) + { + // skip "Info" section + if (tSkipped == (size_t)(sit-pcfg->vSections.begin())) + continue; + + // now translate all the section of form [000] to the ID's, enum through the entries + wHiID=(WORD)_ttoi((*sit)->pszSectionName); + for (vector<_ENTRY*>::iterator it=(*sit)->vEntries.begin();it != (*sit)->vEntries.end();it++) + { + // add to the map + wLoID=(WORD)_ttoi((*it)->pszKey); + if (!bUpdate || m_mStrings.find((wHiID << 16) | wLoID) == m_mStrings.end()) + { + m_mStrings.insert(strings_map::value_type((((DWORD)wHiID) << 16 | wLoID), tOffset)); + + // copy string + _tcscpy(pszStrings+tOffset, (*it)->pszValue); + tOffset+=_tcslen(pszStrings+tOffset)+1; + } + } + } + } + + // free unneded data + file.Close(); + + if (!bUpdate) + { + // remember the filename + SetFilename(pszFile); + + // establish path to the base file + if (_tcslen(GetBaseFile()) != 0) + { + TCHAR* pszName=_tcsrchr(pszFile, _T('\\')); + if (pszName) + { + _tcsncpy(szData, pszFile, pszName-pszFile+1); + _tcscpy(szData+(pszName-pszFile+1), GetBaseFile()); + TRACE("Base (update) path=%s\n", szData); + ReadTranslation(szData, true); + } + } + } + + return true; + } + catch(...) + { + return false; + } +} + +PCTSTR CLangData::GetString(WORD wHiID, WORD wLoID) +{ + strings_map::iterator it=m_mStrings.find((wHiID << 16) | wLoID); + if (it != m_mStrings.end()) + return pszStrings+(*it).second; + else + return &szDefString; +} + +void CLangData::SetFilename(PCTSTR psz) +{ + if (pszFilename) + delete [] pszFilename; + + // copy + pszFilename=new TCHAR[_tcslen(psz)+1]; + _tcscpy(pszFilename, psz); +} + +PCTSTR CLangData::GetFilename(bool bFullPath) const +{ + if (bFullPath) + return pszFilename; + else + { + TCHAR *pszFnd=_tcsrchr(pszFilename, _T('\\')); + if (pszFnd) + return pszFnd+1; + else + return pszFilename; + } +} + +void CLangData::SetFnameData(PTSTR *ppszDst, PCTSTR pszSrc) +{ + if (*ppszDst) + delete [] (*ppszDst); + const TCHAR* pszLast=NULL; + if ( (pszLast=_tcsrchr(pszSrc, _T('\\'))) != NULL) + pszLast++; + else + pszLast=pszSrc; + + // copy + *ppszDst=new TCHAR[_tcslen(pszLast)+1]; + _tcscpy(*ppszDst, pszLast); +} + +// requires the param with ending '\\' +void CResourceManager::Scan(LPCTSTR pszFolder, vector* pvData) +{ + TCHAR szPath[_MAX_PATH]; + _tcscpy(szPath, pszFolder); + _tcscat(szPath, _T("*.lng")); + + WIN32_FIND_DATA wfd; + HANDLE hFind=::FindFirstFile(szPath, &wfd); + BOOL bFound=TRUE; + CLangData ld; + while (bFound && hFind != INVALID_HANDLE_VALUE) + { + if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + _tcscpy(szPath, pszFolder); + _tcscat(szPath, wfd.cFileName); + if (ld.ReadInfo(szPath)) + pvData->push_back(ld); + } + + bFound=::FindNextFile(hFind, &wfd); + } + + if (hFind != INVALID_HANDLE_VALUE) + ::FindClose(hFind); +} + +bool CResourceManager::SetLanguage(PCTSTR pszPath) +{ + EnterCriticalSection(&m_cs); + WORD wOldLang=m_ld.GetLangCode(); + bool bRet=m_ld.ReadTranslation(pszPath); + WORD wNewLang=m_ld.GetLangCode(); + LeaveCriticalSection(&m_cs); + if (!bRet) + return false; + + // update registered dialog boxes + list::iterator it=m_lhDialogs.begin(); + while (it != m_lhDialogs.end()) + { + if (::IsWindow((*it)->m_hWnd)) + (*it)->PostMessage(WM_RMNOTIFY, RMNT_LANGCHANGE, (LPARAM)(wOldLang << 16 | wNewLang)); + it++; + } + + // send the notification stuff to the others + if (m_pfnCallback) + (*m_pfnCallback)(ROT_EVERYWHERE, WM_RMNOTIFY, RMNT_LANGCHANGE, (LPARAM)(wOldLang << 16 | wNewLang)); + + return bRet; +} + +HGLOBAL CResourceManager::LoadResource(LPCTSTR pszType, LPCTSTR pszName) +{ + EnterCriticalSection(&m_cs); + + // find resource + HGLOBAL hRet=NULL; + HRSRC hr=FindResource(m_hRes, pszName, pszType); + if (hr) + hRet=::LoadResource(m_hRes, hr); + + LeaveCriticalSection(&m_cs); + return hRet; +} + +HACCEL CResourceManager::LoadAccelerators(LPCTSTR pszName) +{ + return ::LoadAccelerators(m_hRes, pszName); +} + +HBITMAP CResourceManager::LoadBitmap(LPCTSTR pszName) +{ + return ::LoadBitmap(m_hRes, pszName); +} + +HCURSOR CResourceManager::LoadCursor(LPCTSTR pszName) +{ + return ::LoadCursor(m_hRes, pszName); +} + +HICON CResourceManager::LoadIcon(LPCTSTR pszName) +{ + return ::LoadIcon(m_hRes, pszName); +} + +void CResourceManager::UpdateMenu(HMENU hMenu, WORD wMenuID) +{ + // change the strings inside the menu to the one from txt res file + int iCount=::GetMenuItemCount(hMenu); + MENUITEMINFO mif; + WORD wLoID; + TCHAR szItem[1024]; + for (int i=0;i +#include +#include +#include "af_defs.h" + +using namespace std; + +///////////////////////////////////////////////////////////////////////// +// types of notifications +// RMNT_LANGCHANGE, LPARAM - HIWORD - old language, LOWORD - new language +#define RMNT_LANGCHANGE 0x0001 + +/////////////////////////////////////////////////////////// +// language description structure +typedef map strings_map; + +class CLangData +{ +public: +// construction/destruction + CLangData() { szDefString=0; pszFilename=NULL; pszLngName=NULL; pszBaseFile=NULL; pszFontFace=NULL; pszHelpName=NULL; pszAuthor=NULL; pszVersion=NULL; pszStrings=NULL; tCount=0; } + ~CLangData() { delete [] pszFilename; delete [] pszLngName; delete [] pszBaseFile; delete [] pszFontFace; delete [] pszHelpName; delete [] pszAuthor; delete [] pszVersion; delete [] pszStrings; }; + CLangData(const CLangData& ld); + +protected: + void SetFnameData(PTSTR *ppszDst, PCTSTR pszSrc); + +public: +// operations + bool ReadInfo(PCTSTR pszFile); + bool ReadTranslation(PCTSTR pszFile, bool bUpdate=false); + + PCTSTR GetString(WORD wHiID, WORD wLoID); + +// attributes + void SetFilename(PCTSTR psz); + PCTSTR GetFilename(bool bFullPath) const; + + void SetLangName(PCTSTR psz) { if (pszLngName) delete [] pszLngName; pszLngName=new TCHAR[_tcslen(psz)+1]; _tcscpy(pszLngName, psz); }; + PCTSTR GetLangName() const { return pszLngName; }; + + void SetBaseFile(PCTSTR psz) { SetFnameData(&pszBaseFile, psz); }; + PCTSTR GetBaseFile() const { return pszBaseFile; }; + + void SetLangCode(WORD wLang) { wLangCode=wLang; }; + WORD GetLangCode() const { return wLangCode; }; + + void SetFontFace(PCTSTR psz) { if (pszFontFace) delete [] pszFontFace; pszFontFace=new TCHAR[_tcslen(psz)+1]; _tcscpy(pszFontFace, psz); }; + PCTSTR GetFontFace() const { return pszFontFace; }; + + void SetCharset(BYTE byChar) { byCharset=byChar; }; + BYTE GetCharset() const { return byCharset; }; + + void SetPointSize(WORD wSize) { wPointSize=wSize; }; + WORD GetPointSize() const { return wPointSize; }; + + void SetDirection(bool brtl) { bRTL=brtl; }; + bool GetDirection() const { return bRTL; }; + + void SetHelpName(PCTSTR psz) { SetFnameData(&pszHelpName, psz); }; + PCTSTR GetHelpName() const { return pszHelpName; }; + + void SetAuthor(PCTSTR psz) { if (pszAuthor) delete [] pszAuthor; pszAuthor=new TCHAR[_tcslen(psz)+1]; _tcscpy(pszAuthor, psz); }; + PCTSTR GetAuthor() const { return pszAuthor; }; + + void SetVersion(PCTSTR psz) { if (pszVersion) delete [] pszVersion; pszVersion=new TCHAR[_tcslen(psz)+1]; _tcscpy(pszVersion, psz); }; + PCTSTR GetVersion() const { return pszVersion; }; + + void SetStringData(PCTSTR psz, size_t tCnt) { tCount=tCnt; if (pszStrings) delete [] pszStrings; if (tCount > 0) { pszStrings=new TCHAR[tCnt]; memcpy(pszStrings, psz, tCnt*sizeof(TCHAR)); } }; + +public: + TCHAR *pszFilename; // file name of the language data (with path) + TCHAR *pszLngName; // name of the language (ie. Chinese (PRC)) + TCHAR *pszBaseFile; // file with base language data (wo path) + TCHAR *pszFontFace; // face name of the font that will be used in dialogs + WORD wLangCode; // language code + WORD wPointSize; // font point size + TCHAR *pszHelpName; // help name (wo the directory) for this language + TCHAR *pszAuthor; // author name + TCHAR *pszVersion; // version of this file + BYTE byCharset; // charset for use with the font + bool bRTL; // does the language require right-to-left reading order ? + + // strings (for controls in dialog boxes the ID contains hi:dlg ID, lo:ctrl ID, for strings hi part is 0) + strings_map m_mStrings; // maps string ID to the offset in pszStrings + TCHAR *pszStrings; // contains all the strings - NULL separated + size_t tCount; // length of the string table + TCHAR szDefString; // default empty string +}; + +///////////////////////////////////////////////////////////////////////////////////// + +class CResourceManager +{ +public: + CResourceManager() { m_pfnCallback=NULL; m_hRes=NULL; InitializeCriticalSection(&m_cs); }; + ~CResourceManager() { DeleteCriticalSection(&m_cs); }; + + void Init(HMODULE hrc) { m_hRes=hrc; }; + + void SetCallback(PFNNOTIFYCALLBACK pfn) { m_pfnCallback=pfn; }; + + void Scan(LPCTSTR pszFolder, vector* pvData); + bool SetLanguage(PCTSTR pszPath); + + // loading functions + HGLOBAL LoadResource(LPCTSTR pszType, LPCTSTR pszName); + HACCEL LoadAccelerators(LPCTSTR pszName); + HBITMAP LoadBitmap(LPCTSTR pszName); + HCURSOR LoadCursor(LPCTSTR pszName); + HICON LoadIcon(LPCTSTR pszName); + HANDLE LoadImage(LPCTSTR lpszName, UINT uType, int cxDesired, int cyDesired, UINT fuLoad); + HMENU LoadMenu(LPCTSTR pszName); + LPDLGTEMPLATE LoadDialog(LPCTSTR pszName); + + PCTSTR LoadString(UINT uiID); + PCTSTR LoadString(WORD wGroup, WORD wID); + PTSTR LoadStringCopy(UINT uiID, PTSTR pszStr, UINT uiMax); + + // res updating functions + void UpdateMenu(HMENU hMenu, WORD wMenuID); + +public: + CLangData m_ld; // current language data + list m_lhDialogs; // currently displayed dialog boxes (even hidden) + + HMODULE m_hRes; + PFNNOTIFYCALLBACK m_pfnCallback; +// UINT m_uiMsg; + CRITICAL_SECTION m_cs; +}; + +#endif \ No newline at end of file Index: modules/App Framework/TrayIcon.cpp =================================================================== diff -u --- modules/App Framework/TrayIcon.cpp (revision 0) +++ modules/App Framework/TrayIcon.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,158 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#include "stdafx.h" +#include "TrayIcon.h" + +///////////////////////////////////////////////////////////////////////////// +// CTrayIcon construction/creation/destruction + +CTrayIcon::CTrayIcon() +{ + memset(&m_tnd, 0, sizeof(m_tnd)); + m_bHidden=false; +} + +CTrayIcon::CTrayIcon(HWND hWnd, UINT uClbMsg, LPCTSTR szText, HICON hIcon, UINT uiID) +{ + CreateIcon(hWnd, uClbMsg, szText, hIcon, uiID); + m_bHidden=false; +} + +bool CTrayIcon::CreateIcon(HWND hWnd, UINT uClbMsg, LPCTSTR szText, HICON hIcon, UINT uiID) +{ + _ASSERT(hWnd); + + // load up the NOTIFYICONDATA structure + m_tnd.cbSize=sizeof(NOTIFYICONDATA); + m_tnd.hWnd=hWnd; + m_tnd.uID=uiID; + m_tnd.hIcon=hIcon; + m_tnd.uFlags=NIF_MESSAGE | NIF_ICON | NIF_TIP; + m_tnd.uCallbackMessage=uClbMsg; + _tcsncpy(m_tnd.szTip, szText, 64); + size_t tLen=_tcslen(szText); + if (tLen < 64) + m_tnd.szTip[tLen]=_T('\0'); + else + m_tnd.szTip[63]=_T('\0'); + + // Set the tray icon + return Shell_NotifyIcon(NIM_ADD, &m_tnd) != FALSE; +} + +CTrayIcon::~CTrayIcon() +{ + RemoveIcon(); +} + + +///////////////////////////////////////////////////////////////////////////// +// CTrayIcon icon manipulation + +void CTrayIcon::MoveToRight() +{ + HideIcon(); + ShowIcon(); +} + +void CTrayIcon::RemoveIcon() +{ + m_tnd.uFlags=0; + Shell_NotifyIcon(NIM_DELETE, &m_tnd); +} + +void CTrayIcon::HideIcon() +{ + if (!m_bHidden) + { + m_tnd.uFlags=NIF_ICON; + Shell_NotifyIcon (NIM_DELETE, &m_tnd); + m_bHidden=true; + } +} + +bool CTrayIcon::ShowIcon() +{ + if (m_bHidden) + { + m_tnd.uFlags=NIF_MESSAGE | NIF_ICON | NIF_TIP; + m_bHidden=false; + return Shell_NotifyIcon(NIM_ADD, &m_tnd) != FALSE; + } + return true; +} + +bool CTrayIcon::SetIcon(HICON hIcon) +{ + m_tnd.uFlags=NIF_ICON; + m_tnd.hIcon=hIcon; + + return Shell_NotifyIcon(NIM_MODIFY, &m_tnd) != 0; +} + +bool CTrayIcon::SetStandardIcon(LPCTSTR lpIconName) +{ + HICON hIcon=::LoadIcon(NULL, lpIconName); + return SetIcon(hIcon); +} + +HICON CTrayIcon::GetIcon() const +{ + return m_tnd.hIcon; +} + +///////////////////////////////////////////////////////////////////////////// +// CTrayIcon tooltip text manipulation + +bool CTrayIcon::SetTooltipText(LPCTSTR pszTip) +{ + m_tnd.uFlags = NIF_TIP; + _tcsncpy(m_tnd.szTip, pszTip, 64); + size_t tLen=_tcslen(pszTip); + if (tLen < 64) + m_tnd.szTip[tLen]=_T('\0'); + else + m_tnd.szTip[63]=_T('\0'); + + return Shell_NotifyIcon(NIM_MODIFY, &m_tnd) != FALSE; +} + +void CTrayIcon::GetTooltipText(LPTSTR pszText) const +{ + _tcscpy(pszText, m_tnd.szTip); +} + +///////////////////////////////////////////////////////////////////////////// +// CTrayIcon notification window stuff + +bool CTrayIcon::SetNotificationWnd(HWND hWnd) +{ + _ASSERT(hWnd); + + m_tnd.hWnd=hWnd; + m_tnd.uFlags=0; + + return Shell_NotifyIcon(NIM_MODIFY, &m_tnd) != FALSE; +} + +HWND CTrayIcon::GetNotificationWnd() const +{ + return m_tnd.hWnd; +} \ No newline at end of file Index: modules/App Framework/TrayIcon.h =================================================================== diff -u --- modules/App Framework/TrayIcon.h (revision 0) +++ modules/App Framework/TrayIcon.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,61 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +/* Code based on code written by Chris Maunder (Chris.Maunder@cbr.clw.csiro.au) */ + +#ifndef __TRAYICON_H__ +#define __TRAYICON_H__ + +#include "shellapi.h" + +class CTrayIcon +{ +public: +// construction/destruction + CTrayIcon(); + CTrayIcon(HWND hWnd, UINT uClbMsg, LPCTSTR szText, HICON hIcon, UINT uiID); + ~CTrayIcon(); + +//creation + bool CreateIcon(HWND hWnd, UINT uClbMsg, LPCTSTR szText, HICON hIcon, UINT uiID); + +// ToolTip text handleing + bool SetTooltipText(LPCTSTR pszTip); + void GetTooltipText(LPTSTR pszText) const; + +// Icon handling + bool SetIcon(HICON hIcon); + bool SetStandardIcon(LPCTSTR lpIconName); + HICON GetIcon() const; + void HideIcon(); + bool ShowIcon(); + void RemoveIcon(); + void MoveToRight(); + +// Notifications + bool SetNotificationWnd(HWND hWnd); + HWND GetNotificationWnd() const; + +// Attribs +public: + bool m_bHidden; // Has the icon been hidden? + NOTIFYICONDATA m_tnd; +}; + +#endif \ No newline at end of file Index: modules/App Framework/af_defs.h =================================================================== diff -u --- modules/App Framework/af_defs.h (revision 0) +++ modules/App Framework/af_defs.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,28 @@ +#ifndef __AFMESSAGES_H__ +#define __AFMESSAGES_H__ + +// messages used by the app framework's modules +#define WM_TRAYNOTIFY (WM_USER+0) +#define WM_CFGNOTIFY (WM_USER+1) +#define WM_RMNOTIFY (WM_USER+2) + +// message routing +// types of routing +// sends a message everywhere it could be sent (hwnds, registered modules, ...) +#define ROT_EVERYWHERE 0x0000000000000000 +// sends a message to all hwnds in an app +#define ROT_HWNDS 0x0100000000000000 +// sends a message to all registered modules +#define ROT_REGISTERED 0x0200000000000000 +// sends a message to one excact module +#define ROT_EXACT 0x0300000000000000 + +// internal modules +#define IMID_CONFIGMANAGER 0x0001000000000000 +#define IMID_RESOURCEMANAGER 0x0001000000000001 +#define IMID_LOGFILE 0x0001000000000002 + +// callbacks +typedef (*PFNNOTIFYCALLBACK)(ULONGLONG, UINT, WPARAM, LPARAM); + +#endif \ No newline at end of file Index: modules/App Framework/charvect.h =================================================================== diff -u --- modules/App Framework/charvect.h (revision 0) +++ modules/App Framework/charvect.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,105 @@ +/************************************************************************ + Copy Handler 1.x - program for copying data in Microsoft Windows + systems. + Copyright (C) 2001-2003 Ixen Gerthannes (ixen@interia.pl) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*************************************************************************/ +#ifndef __CHARVECT_H__ +#define __CHARVECT_H__ + +#include + +using namespace std; + +class char_vector : public vector +{ +public: + char_vector() : vector() { }; + char_vector(const char_vector& cv, bool bCopy) { insert(begin(), cv.begin(), cv.end(), bCopy); }; + ~char_vector() { erase(begin(), end(), true); }; + + void assign(size_type _Count, const PTSTR& _Type, bool bDelete, bool bCopy) { erase(begin(), end(), bDelete); insert(begin(), _Count, _Type, bCopy); }; + template void assign(_It _First, _It _Last, bool bDelete, bool bCopy) { erase(begin(), end(), bDelete); insert(begin(), _First, _Last, bCopy); }; + + void clear(bool bDelete) { erase(begin(), end(), bDelete); }; + + iterator erase(iterator _Where, bool bDelete) { if (bDelete) delete [] (*_Where); return ((vector*)this)->erase(_Where); }; + iterator erase(iterator _First, iterator _Last, bool bDelete) { if (bDelete) for (iterator _Run=_First;_Run != _Last;_Run++) delete [] (*_Run); return ((vector*)this)->erase(_First, _Last); }; + + void replace(iterator _Where, const PTSTR& _Val, bool bDelete, bool bCopy) + { + if (bDelete) + delete [] (*_Where); + if (bCopy) + { + (*_Where)=new TCHAR[_tcslen(_Val)+1]; + _tcscpy(*_Where, _Val); + } + else + (*_Where)=_Val; + }; + iterator insert(iterator _Where, const PTSTR& _Val, bool bCopy) + { + size_type _O = _Where - begin(); + insert(_Where, 1, _Val, bCopy); + return (begin() + _O); + }; + void insert(iterator _Where, size_type _Count, const PTSTR& _Val, bool bCopy) + { + if (bCopy) + { + size_type _Size=_tcslen(_Val)+1; + PTSTR *ppsz=new PTSTR[_Count]; + for (size_type i=0;i<_Count;i++) + { + ppsz[i]=new TCHAR[_Size]; + _tcscpy(ppsz[i], _Val); + } + + ((vector*)this)->insert(_Where, ppsz, ppsz+_Count); + delete [] ppsz; + } + else + ((vector*)this)->insert(_Where, _Count, _Val); + }; + template void insert(iterator _Where, _It _First, _It _Last, bool bCopy) + { + if (bCopy) + { + size_type _Cnt=_Last-_First; + PTSTR *ppsz=new PTSTR[_Cnt]; + for (size_type i=0;i<_Cnt;i++) + { + ppsz[i]=new TCHAR[_tcslen(*_First)+1]; + _tcscpy(ppsz[i], *_First); + + _First++; + } + + ((vector*)this)->insert(_Where, ppsz, ppsz+_Cnt); + delete [] ppsz; + } + else + ((vector*)this)->insert(_Where, _First, _Last); + }; + + void swap_items(iterator _Item1, iterator _Item2) { PTSTR psz=(*_Item1); (*_Item1)=(*_Item2); (*_Item2)=psz; }; + + void pop_back(bool bDelete) { if (bDelete) delete [] (*(end()-1)); ((vector*)this)->pop_back(); }; + void push_back(const PTSTR& _Val, bool bCopy) { insert(end(), 1, _Val, bCopy); }; +}; + +#endif \ No newline at end of file Index: modules/App Framework/conv.cpp =================================================================== diff -u --- modules/App Framework/conv.cpp (revision 0) +++ modules/App Framework/conv.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,52 @@ +#include "stdafx.h" +#include "conv.h" + +TCHAR __hex[16] = { _T('0'), _T('1'), _T('2'), _T('3'), _T('4'), _T('5'), _T('6'), _T('7'), _T('8'), _T('9'), _T('a'), _T('b'), _T('c'), _T('d'), _T('e'), _T('f'), }; + +void Bin2Hex(const BYTE* pbyIn, size_t tInCount, TCHAR *pszOut) +{ + for (size_t i=0;i> 4) & 0x0f]; + *pszOut++=__hex[pbyIn[i] & 0x0f]; + } +} + +bool Hex2Bin(PCTSTR pszIn, size_t tInCount, BYTE* pbyOut) +{ + // we can pass -1 as in size - count it then + if (tInCount == -1) + tInCount=_tcslen(pszIn); + + // make sure the tInCount is even + tInCount &= ~((size_t)1); + BYTE by; + for (size_t i=0;i= '0' && *pszIn <= '9') + by=(*pszIn - '0') << 4; + else if (*pszIn >= 'a' && *pszIn <= 'f') + by=(*pszIn - 'a' + 10) << 4; + else if (*pszIn >= 'A' && *pszIn <= 'F') + by=(*pszIn - 'A' + 10) << 4; + else + return false; + + // lsb 4bits + *pszIn++; + if (*pszIn >= '0' && *pszIn <= '9') + by|=(*pszIn - '0'); + else if (*pszIn >= 'a' && *pszIn <= 'f') + by|=(*pszIn - 'a' + 10); + else if (*pszIn >= 'A' && *pszIn <= 'F') + by|=(*pszIn - 'A' + 10); + else + return false; + + *pszIn++; + *pbyOut++=by; + } + + return true; +} Index: modules/App Framework/conv.h =================================================================== diff -u --- modules/App Framework/conv.h (revision 0) +++ modules/App Framework/conv.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,7 @@ +#ifndef __CONV_H__ +#define __CONV_H__ + +void Bin2Hex(const BYTE* pbyIn, size_t tInCount, TCHAR *pszOut); +bool Hex2Bin(PCTSTR pszIn, size_t tInCount, BYTE* pbyOut); + +#endif \ No newline at end of file Index: modules/App Framework/crc32.cpp =================================================================== diff -u --- modules/App Framework/crc32.cpp (revision 0) +++ modules/App Framework/crc32.cpp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,87 @@ +#include "stdafx.h" +#include "crc32.h" + +DWORD __CRC32Data__[256] = +{ + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D, +}; + +inline void CRC32Partial(BYTE byte, DWORD *pdwCrc32) +{ + *pdwCrc32 = ((*pdwCrc32) >> 8) ^ __CRC32Data__[byte ^ ((*pdwCrc32) & 0x000000FF)]; +} + +DWORD CRC32(BYTE* pbyData, DWORD dwLen) +{ + DWORD dwCRC=0xffffffff; + for (DWORD i=0;i + * @author Antoon Bosselaers + * @author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include + +#include "rijndael-alg-fst.h" + +/* +Te0[x] = S [x].[02, 01, 01, 03]; +Te1[x] = S [x].[03, 02, 01, 01]; +Te2[x] = S [x].[01, 03, 02, 01]; +Te3[x] = S [x].[01, 01, 03, 02]; +Te4[x] = S [x].[01, 01, 01, 01]; + +Td0[x] = Si[x].[0e, 09, 0d, 0b]; +Td1[x] = Si[x].[0b, 0e, 09, 0d]; +Td2[x] = Si[x].[0d, 0b, 0e, 09]; +Td3[x] = Si[x].[09, 0d, 0b, 0e]; +Td4[x] = Si[x].[01, 01, 01, 01]; +*/ + +static const u32 Te0[256] = { + 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, + 0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, + 0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU, + 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU, + 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, + 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, + 0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, + 0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU, + 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU, + 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, + 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, + 0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU, + 0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU, + 0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U, + 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, + 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, + 0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, + 0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU, + 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU, + 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, + 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, + 0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, + 0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU, + 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU, + 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, + 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, + 0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, + 0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U, + 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU, + 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, + 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, + 0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, + 0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU, + 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U, + 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, + 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, + 0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, + 0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U, + 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU, + 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, + 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, + 0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, + 0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U, + 0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU, + 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, + 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, + 0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, + 0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U, + 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U, + 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, + 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, + 0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, + 0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU, + 0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U, + 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, + 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, + 0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U, + 0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U, + 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U, + 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, + 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, + 0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, + 0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U, + 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU, +}; +static const u32 Te1[256] = { + 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, + 0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, + 0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU, + 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U, + 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, + 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, + 0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, + 0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U, + 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U, + 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, + 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, + 0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, + 0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U, + 0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU, + 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, + 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, + 0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, + 0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U, + 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U, + 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, + 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, + 0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, + 0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U, + 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU, + 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, + 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, + 0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, + 0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U, + 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU, + 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, + 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, + 0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, + 0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU, + 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U, + 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, + 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, + 0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, + 0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U, + 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U, + 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, + 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, + 0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, + 0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U, + 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U, + 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, + 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, + 0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, + 0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U, + 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU, + 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, + 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, + 0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, + 0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U, + 0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU, + 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, + 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, + 0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, + 0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U, + 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U, + 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, + 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, + 0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, + 0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU, + 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U, +}; +static const u32 Te2[256] = { + 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, + 0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, + 0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU, + 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U, + 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, + 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, + 0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, + 0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U, + 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U, + 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, + 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, + 0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U, + 0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U, + 0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU, + 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, + 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, + 0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, + 0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U, + 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U, + 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, + 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, + 0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, + 0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U, + 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU, + 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, + 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, + 0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, + 0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U, + 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU, + 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, + 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, + 0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, + 0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU, + 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U, + 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, + 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, + 0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, + 0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U, + 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U, + 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, + 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, + 0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, + 0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U, + 0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U, + 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, + 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, + 0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, + 0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U, + 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU, + 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, + 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, + 0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, + 0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U, + 0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU, + 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, + 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, + 0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U, + 0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U, + 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U, + 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, + 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, + 0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, + 0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU, + 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U, +}; +static const u32 Te3[256] = { + + 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, + 0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, + 0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U, + 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU, + 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, + 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, + 0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, + 0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU, + 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU, + 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, + 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, + 0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU, + 0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU, + 0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU, + 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, + 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, + 0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, + 0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU, + 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU, + 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, + 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, + 0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, + 0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U, + 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U, + 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, + 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, + 0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, + 0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU, + 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U, + 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, + 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, + 0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, + 0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U, + 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU, + 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, + 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, + 0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, + 0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU, + 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U, + 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, + 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, + 0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, + 0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U, + 0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U, + 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, + 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, + 0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, + 0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U, + 0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU, + 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, + 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, + 0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, + 0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU, + 0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU, + 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, + 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, + 0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U, + 0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U, + 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U, + 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, + 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, + 0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, + 0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU, + 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU, +}; +static const u32 Te4[256] = { + 0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU, + 0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U, + 0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU, + 0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U, + 0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU, + 0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U, + 0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU, + 0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U, + 0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U, + 0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU, + 0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U, + 0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U, + 0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U, + 0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU, + 0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U, + 0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U, + 0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU, + 0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U, + 0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U, + 0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U, + 0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU, + 0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU, + 0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U, + 0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU, + 0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU, + 0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U, + 0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU, + 0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U, + 0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU, + 0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U, + 0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U, + 0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U, + 0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU, + 0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U, + 0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU, + 0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U, + 0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU, + 0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U, + 0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U, + 0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU, + 0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU, + 0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU, + 0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U, + 0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U, + 0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU, + 0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U, + 0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU, + 0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U, + 0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU, + 0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U, + 0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU, + 0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU, + 0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U, + 0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU, + 0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U, + 0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU, + 0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U, + 0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U, + 0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U, + 0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU, + 0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU, + 0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U, + 0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU, + 0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U, +}; +static const u32 Td0[256] = { + 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, + 0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, + 0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U, + 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU, + 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, + 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, + 0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU, + 0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U, + 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU, + 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, + 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, + 0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, + 0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U, + 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU, + 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, + 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, + 0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, + 0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU, + 0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U, + 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, + 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, + 0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU, + 0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U, + 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU, + 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, + 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, + 0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U, + 0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU, + 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU, + 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, + 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, + 0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, + 0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU, + 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U, + 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, + 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, + 0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, + 0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U, + 0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U, + 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, + 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, + 0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, + 0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U, + 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U, + 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, + 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, + 0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, + 0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U, + 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U, + 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, + 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, + 0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, + 0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU, + 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU, + 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, + 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, + 0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, + 0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU, + 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU, + 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, + 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, + 0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U, + 0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U, + 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U, +}; +static const u32 Td1[256] = { + 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, + 0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U, + 0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU, + 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U, + 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, + 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, + 0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U, + 0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U, + 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U, + 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, + 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, + 0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, + 0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U, + 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU, + 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, + 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, + 0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, + 0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU, + 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU, + 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, + 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, + 0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U, + 0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU, + 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU, + 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, + 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, + 0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U, + 0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU, + 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U, + 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, + 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, + 0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, + 0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U, + 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU, + 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, + 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, + 0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, + 0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U, + 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U, + 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, + 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, + 0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, + 0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U, + 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU, + 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, + 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, + 0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, + 0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U, + 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU, + 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, + 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, + 0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, + 0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U, + 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U, + 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, + 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, + 0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, + 0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U, + 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U, + 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, + 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, + 0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, + 0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U, + 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U, +}; +static const u32 Td2[256] = { + 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, + 0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, + 0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U, + 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U, + 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, + 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, + 0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, + 0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U, + 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U, + 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, + 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, + 0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, + 0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU, + 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U, + 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, + 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, + 0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, + 0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U, + 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U, + 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, + + 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, + 0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, + 0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U, + 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U, + 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, + 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, + 0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU, + 0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U, + 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU, + 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, + 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, + 0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, + 0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU, + 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU, + 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, + 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, + 0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, + 0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U, + 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U, + 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, + 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, + 0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, + 0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU, + 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U, + 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, + 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, + 0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, + 0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U, + 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U, + 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, + 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, + 0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, + 0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U, + 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U, + 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, + 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, + 0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, + 0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U, + 0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U, + 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, + 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, + 0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, + 0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U, + 0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U, +}; +static const u32 Td3[256] = { + 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, + 0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, + 0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U, + 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U, + 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, + 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, + 0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, + 0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU, + 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U, + 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, + 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, + 0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, + 0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U, + 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U, + 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, + 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, + 0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, + 0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U, + 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U, + 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, + 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, + 0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, + 0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U, + 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U, + 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, + 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, + 0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U, + 0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U, + 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU, + 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, + 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, + 0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, + 0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U, + 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU, + 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, + 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, + 0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, + 0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U, + 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U, + 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, + 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, + 0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, + 0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U, + 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U, + 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, + 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, + 0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, + 0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU, + 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U, + 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, + 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, + 0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, + 0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U, + 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U, + 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, + 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, + 0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, + 0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU, + 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U, + 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, + 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, + 0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, + 0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U, + 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U, +}; +static const u32 Td4[256] = { + 0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U, + 0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U, + 0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU, + 0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU, + 0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U, + 0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U, + 0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U, + 0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU, + 0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U, + 0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU, + 0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU, + 0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU, + 0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U, + 0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U, + 0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U, + 0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U, + 0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U, + 0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U, + 0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU, + 0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U, + 0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U, + 0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU, + 0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U, + 0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U, + 0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U, + 0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU, + 0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U, + 0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U, + 0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU, + 0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U, + 0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U, + 0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU, + 0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U, + 0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU, + 0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU, + 0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U, + 0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U, + 0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U, + 0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U, + 0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU, + 0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U, + 0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U, + 0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU, + 0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU, + 0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU, + 0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U, + 0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU, + 0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U, + 0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U, + 0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U, + 0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U, + 0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU, + 0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U, + 0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU, + 0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU, + 0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU, + 0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU, + 0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U, + 0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU, + 0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U, + 0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU, + 0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U, + 0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U, + 0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU, +}; +static const u32 rcon[] = { + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ +}; + +#define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) + +#ifdef _MSC_VER +#define GETU32(p) SWAP(*((u32 *)(p))) +#define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } +#else +#define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) +#define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } +#endif + +/** + * Expand the cipher key into the encryption key schedule. + * + * @return the number of rounds for the given cipher key size. + */ +int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) { + int i = 0; + u32 temp; + + rk[0] = GETU32(cipherKey ); + rk[1] = GETU32(cipherKey + 4); + rk[2] = GETU32(cipherKey + 8); + rk[3] = GETU32(cipherKey + 12); + if (keyBits == 128) { + for (;;) { + temp = rk[3]; + rk[4] = rk[0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[5] = rk[1] ^ rk[4]; + rk[6] = rk[2] ^ rk[5]; + rk[7] = rk[3] ^ rk[6]; + if (++i == 10) { + return 10; + } + rk += 4; + } + } + rk[4] = GETU32(cipherKey + 16); + rk[5] = GETU32(cipherKey + 20); + if (keyBits == 192) { + for (;;) { + temp = rk[ 5]; + rk[ 6] = rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[ 7] = rk[ 1] ^ rk[ 6]; + rk[ 8] = rk[ 2] ^ rk[ 7]; + rk[ 9] = rk[ 3] ^ rk[ 8]; + if (++i == 8) { + return 12; + } + rk[10] = rk[ 4] ^ rk[ 9]; + rk[11] = rk[ 5] ^ rk[10]; + rk += 6; + } + } + rk[6] = GETU32(cipherKey + 24); + rk[7] = GETU32(cipherKey + 28); + if (keyBits == 256) { + for (;;) { + temp = rk[ 7]; + rk[ 8] = rk[ 0] ^ + (Te4[(temp >> 16) & 0xff] & 0xff000000) ^ + (Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^ + (Te4[(temp ) & 0xff] & 0x0000ff00) ^ + (Te4[(temp >> 24) ] & 0x000000ff) ^ + rcon[i]; + rk[ 9] = rk[ 1] ^ rk[ 8]; + rk[10] = rk[ 2] ^ rk[ 9]; + rk[11] = rk[ 3] ^ rk[10]; + if (++i == 7) { + return 14; + } + temp = rk[11]; + rk[12] = rk[ 4] ^ + (Te4[(temp >> 24) ] & 0xff000000) ^ + (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(temp ) & 0xff] & 0x000000ff); + rk[13] = rk[ 5] ^ rk[12]; + rk[14] = rk[ 6] ^ rk[13]; + rk[15] = rk[ 7] ^ rk[14]; + + rk += 8; + } + } + return 0; +} + +/** + * Expand the cipher key into the decryption key schedule. + * + * @return the number of rounds for the given cipher key size. + */ +int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits) { + int Nr, i, j; + u32 temp; + + /* expand the cipher key: */ + Nr = rijndaelKeySetupEnc(rk, cipherKey, keyBits); + /* invert the order of the round keys: */ + for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) { + temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp; + temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp; + temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp; + temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp; + } + /* apply the inverse MixColumn transform to all round keys but the first and the last: */ + for (i = 1; i < Nr; i++) { + rk += 4; + rk[0] = + Td0[Te4[(rk[0] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[0] ) & 0xff] & 0xff]; + rk[1] = + Td0[Te4[(rk[1] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[1] ) & 0xff] & 0xff]; + rk[2] = + Td0[Te4[(rk[2] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[2] ) & 0xff] & 0xff]; + rk[3] = + Td0[Te4[(rk[3] >> 24) ] & 0xff] ^ + Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^ + Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^ + Td3[Te4[(rk[3] ) & 0xff] & 0xff]; + } + return Nr; +} + +void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]) { + u32 s0, s1, s2, s3, t0, t1, t2, t3; +#ifndef FULL_UNROLL + int r; +#endif /* ?FULL_UNROLL */ + + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(pt ) ^ rk[0]; + s1 = GETU32(pt + 4) ^ rk[1]; + s2 = GETU32(pt + 8) ^ rk[2]; + s3 = GETU32(pt + 12) ^ rk[3]; +#ifdef FULL_UNROLL + /* round 1: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7]; + /* round 2: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11]; + /* round 3: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15]; + /* round 4: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19]; + /* round 5: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23]; + /* round 6: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27]; + /* round 7: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31]; + /* round 8: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35]; + /* round 9: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39]; + if (Nr > 10) { + /* round 10: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43]; + /* round 11: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47]; + if (Nr > 12) { + /* round 12: */ + s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48]; + s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49]; + s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50]; + s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51]; + /* round 13: */ + t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52]; + t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53]; + t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54]; + t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55]; + } + } + rk += Nr << 2; +#else /* !FULL_UNROLL */ + /* + * Nr - 1 full rounds: + */ + r = Nr >> 1; + for (;;) { + t0 = + Te0[(s0 >> 24) ] ^ + Te1[(s1 >> 16) & 0xff] ^ + Te2[(s2 >> 8) & 0xff] ^ + Te3[(s3 ) & 0xff] ^ + rk[4]; + t1 = + Te0[(s1 >> 24) ] ^ + Te1[(s2 >> 16) & 0xff] ^ + Te2[(s3 >> 8) & 0xff] ^ + Te3[(s0 ) & 0xff] ^ + rk[5]; + t2 = + Te0[(s2 >> 24) ] ^ + Te1[(s3 >> 16) & 0xff] ^ + Te2[(s0 >> 8) & 0xff] ^ + Te3[(s1 ) & 0xff] ^ + rk[6]; + t3 = + Te0[(s3 >> 24) ] ^ + Te1[(s0 >> 16) & 0xff] ^ + Te2[(s1 >> 8) & 0xff] ^ + Te3[(s2 ) & 0xff] ^ + rk[7]; + + rk += 8; + if (--r == 0) { + break; + } + + s0 = + Te0[(t0 >> 24) ] ^ + Te1[(t1 >> 16) & 0xff] ^ + Te2[(t2 >> 8) & 0xff] ^ + Te3[(t3 ) & 0xff] ^ + rk[0]; + s1 = + Te0[(t1 >> 24) ] ^ + Te1[(t2 >> 16) & 0xff] ^ + Te2[(t3 >> 8) & 0xff] ^ + Te3[(t0 ) & 0xff] ^ + rk[1]; + s2 = + Te0[(t2 >> 24) ] ^ + Te1[(t3 >> 16) & 0xff] ^ + Te2[(t0 >> 8) & 0xff] ^ + Te3[(t1 ) & 0xff] ^ + rk[2]; + s3 = + Te0[(t3 >> 24) ] ^ + Te1[(t0 >> 16) & 0xff] ^ + Te2[(t1 >> 8) & 0xff] ^ + Te3[(t2 ) & 0xff] ^ + rk[3]; + } +#endif /* ?FULL_UNROLL */ + /* + * apply last round and + * map cipher state to byte array block: + */ + s0 = + (Te4[(t0 >> 24) ] & 0xff000000) ^ + (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[0]; + PUTU32(ct , s0); + s1 = + (Te4[(t1 >> 24) ] & 0xff000000) ^ + (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[1]; + PUTU32(ct + 4, s1); + s2 = + (Te4[(t2 >> 24) ] & 0xff000000) ^ + (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[2]; + PUTU32(ct + 8, s2); + s3 = + (Te4[(t3 >> 24) ] & 0xff000000) ^ + (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[3]; + PUTU32(ct + 12, s3); +} + +void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]) { + u32 s0, s1, s2, s3, t0, t1, t2, t3; +#ifndef FULL_UNROLL + int r; +#endif /* ?FULL_UNROLL */ + + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(ct ) ^ rk[0]; + s1 = GETU32(ct + 4) ^ rk[1]; + s2 = GETU32(ct + 8) ^ rk[2]; + s3 = GETU32(ct + 12) ^ rk[3]; +#ifdef FULL_UNROLL + /* round 1: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7]; + /* round 2: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11]; + /* round 3: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15]; + /* round 4: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19]; + /* round 5: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23]; + /* round 6: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27]; + /* round 7: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31]; + /* round 8: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35]; + /* round 9: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39]; + if (Nr > 10) { + /* round 10: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43]; + /* round 11: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47]; + if (Nr > 12) { + /* round 12: */ + s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48]; + s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49]; + s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50]; + s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51]; + /* round 13: */ + t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52]; + t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53]; + t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54]; + t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55]; + } + } + rk += Nr << 2; +#else /* !FULL_UNROLL */ + /* + * Nr - 1 full rounds: + */ + r = Nr >> 1; + for (;;) { + t0 = + Td0[(s0 >> 24) ] ^ + Td1[(s3 >> 16) & 0xff] ^ + Td2[(s2 >> 8) & 0xff] ^ + Td3[(s1 ) & 0xff] ^ + rk[4]; + t1 = + Td0[(s1 >> 24) ] ^ + Td1[(s0 >> 16) & 0xff] ^ + Td2[(s3 >> 8) & 0xff] ^ + Td3[(s2 ) & 0xff] ^ + rk[5]; + t2 = + Td0[(s2 >> 24) ] ^ + Td1[(s1 >> 16) & 0xff] ^ + Td2[(s0 >> 8) & 0xff] ^ + Td3[(s3 ) & 0xff] ^ + rk[6]; + t3 = + Td0[(s3 >> 24) ] ^ + Td1[(s2 >> 16) & 0xff] ^ + Td2[(s1 >> 8) & 0xff] ^ + Td3[(s0 ) & 0xff] ^ + rk[7]; + + rk += 8; + if (--r == 0) { + break; + } + + s0 = + Td0[(t0 >> 24) ] ^ + Td1[(t3 >> 16) & 0xff] ^ + Td2[(t2 >> 8) & 0xff] ^ + Td3[(t1 ) & 0xff] ^ + rk[0]; + s1 = + Td0[(t1 >> 24) ] ^ + Td1[(t0 >> 16) & 0xff] ^ + Td2[(t3 >> 8) & 0xff] ^ + Td3[(t2 ) & 0xff] ^ + rk[1]; + s2 = + Td0[(t2 >> 24) ] ^ + Td1[(t1 >> 16) & 0xff] ^ + Td2[(t0 >> 8) & 0xff] ^ + Td3[(t3 ) & 0xff] ^ + rk[2]; + s3 = + Td0[(t3 >> 24) ] ^ + Td1[(t2 >> 16) & 0xff] ^ + Td2[(t1 >> 8) & 0xff] ^ + Td3[(t0 ) & 0xff] ^ + rk[3]; + } +#endif /* ?FULL_UNROLL */ + /* + * apply last round and + * map cipher state to byte array block: + */ + s0 = + (Td4[(t0 >> 24) ] & 0xff000000) ^ + (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t1 ) & 0xff] & 0x000000ff) ^ + rk[0]; + PUTU32(pt , s0); + s1 = + (Td4[(t1 >> 24) ] & 0xff000000) ^ + (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t2 ) & 0xff] & 0x000000ff) ^ + rk[1]; + PUTU32(pt + 4, s1); + s2 = + (Td4[(t2 >> 24) ] & 0xff000000) ^ + (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t3 ) & 0xff] & 0x000000ff) ^ + rk[2]; + PUTU32(pt + 8, s2); + s3 = + (Td4[(t3 >> 24) ] & 0xff000000) ^ + (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(t0 ) & 0xff] & 0x000000ff) ^ + rk[3]; + PUTU32(pt + 12, s3); +} + +#ifdef INTERMEDIATE_VALUE_KAT + +void rijndaelEncryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds) { + int r; + u32 s0, s1, s2, s3, t0, t1, t2, t3; + + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(block ) ^ rk[0]; + s1 = GETU32(block + 4) ^ rk[1]; + s2 = GETU32(block + 8) ^ rk[2]; + s3 = GETU32(block + 12) ^ rk[3]; + rk += 4; + + /* + * Nr - 1 full rounds: + */ + for (r = (rounds < Nr ? rounds : Nr - 1); r > 0; r--) { + t0 = + Te0[(s0 >> 24) ] ^ + Te1[(s1 >> 16) & 0xff] ^ + Te2[(s2 >> 8) & 0xff] ^ + Te3[(s3 ) & 0xff] ^ + rk[0]; + t1 = + Te0[(s1 >> 24) ] ^ + Te1[(s2 >> 16) & 0xff] ^ + Te2[(s3 >> 8) & 0xff] ^ + Te3[(s0 ) & 0xff] ^ + rk[1]; + t2 = + Te0[(s2 >> 24) ] ^ + Te1[(s3 >> 16) & 0xff] ^ + Te2[(s0 >> 8) & 0xff] ^ + Te3[(s1 ) & 0xff] ^ + rk[2]; + t3 = + Te0[(s3 >> 24) ] ^ + Te1[(s0 >> 16) & 0xff] ^ + Te2[(s1 >> 8) & 0xff] ^ + Te3[(s2 ) & 0xff] ^ + rk[3]; + + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + rk += 4; + + } + + /* + * apply last round and + * map cipher state to byte array block: + */ + if (rounds == Nr) { + t0 = + (Te4[(s0 >> 24) ] & 0xff000000) ^ + (Te4[(s1 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(s2 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(s3 ) & 0xff] & 0x000000ff) ^ + rk[0]; + t1 = + (Te4[(s1 >> 24) ] & 0xff000000) ^ + (Te4[(s2 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(s3 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(s0 ) & 0xff] & 0x000000ff) ^ + rk[1]; + t2 = + (Te4[(s2 >> 24) ] & 0xff000000) ^ + (Te4[(s3 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(s0 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(s1 ) & 0xff] & 0x000000ff) ^ + rk[2]; + t3 = + (Te4[(s3 >> 24) ] & 0xff000000) ^ + (Te4[(s0 >> 16) & 0xff] & 0x00ff0000) ^ + (Te4[(s1 >> 8) & 0xff] & 0x0000ff00) ^ + (Te4[(s2 ) & 0xff] & 0x000000ff) ^ + rk[3]; + + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + PUTU32(block , s0); + PUTU32(block + 4, s1); + PUTU32(block + 8, s2); + PUTU32(block + 12, s3); +} + +void rijndaelDecryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds) { + int r; + u32 s0, s1, s2, s3, t0, t1, t2, t3; + + /* + * map byte array block to cipher state + * and add initial round key: + */ + s0 = GETU32(block ) ^ rk[0]; + s1 = GETU32(block + 4) ^ rk[1]; + s2 = GETU32(block + 8) ^ rk[2]; + s3 = GETU32(block + 12) ^ rk[3]; + rk += 4; + + /* + * Nr - 1 full rounds: + */ + for (r = (rounds < Nr ? rounds : Nr) - 1; r > 0; r--) { + t0 = + Td0[(s0 >> 24) ] ^ + Td1[(s3 >> 16) & 0xff] ^ + Td2[(s2 >> 8) & 0xff] ^ + Td3[(s1 ) & 0xff] ^ + rk[0]; + t1 = + Td0[(s1 >> 24) ] ^ + Td1[(s0 >> 16) & 0xff] ^ + Td2[(s3 >> 8) & 0xff] ^ + Td3[(s2 ) & 0xff] ^ + rk[1]; + t2 = + Td0[(s2 >> 24) ] ^ + Td1[(s1 >> 16) & 0xff] ^ + Td2[(s0 >> 8) & 0xff] ^ + Td3[(s3 ) & 0xff] ^ + rk[2]; + t3 = + Td0[(s3 >> 24) ] ^ + Td1[(s2 >> 16) & 0xff] ^ + Td2[(s1 >> 8) & 0xff] ^ + Td3[(s0 ) & 0xff] ^ + rk[3]; + + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + rk += 4; + + } + + /* + * complete the last round and + * map cipher state to byte array block: + */ + t0 = + (Td4[(s0 >> 24) ] & 0xff000000) ^ + (Td4[(s3 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(s2 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(s1 ) & 0xff] & 0x000000ff); + t1 = + (Td4[(s1 >> 24) ] & 0xff000000) ^ + (Td4[(s0 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(s3 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(s2 ) & 0xff] & 0x000000ff); + t2 = + (Td4[(s2 >> 24) ] & 0xff000000) ^ + (Td4[(s1 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(s0 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(s3 ) & 0xff] & 0x000000ff); + t3 = + (Td4[(s3 >> 24) ] & 0xff000000) ^ + (Td4[(s2 >> 16) & 0xff] & 0x00ff0000) ^ + (Td4[(s1 >> 8) & 0xff] & 0x0000ff00) ^ + (Td4[(s0 ) & 0xff] & 0x000000ff); + + if (rounds == Nr) { + t0 ^= rk[0]; + t1 ^= rk[1]; + t2 ^= rk[2]; + t3 ^= rk[3]; + } + + PUTU32(block , t0); + PUTU32(block + 4, t1); + PUTU32(block + 8, t2); + PUTU32(block + 12, t3); +} + +#endif /* INTERMEDIATE_VALUE_KAT */ Index: modules/App Framework/rijndael-alg-fst.h =================================================================== diff -u --- modules/App Framework/rijndael-alg-fst.h (revision 0) +++ modules/App Framework/rijndael-alg-fst.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,47 @@ +/** + * rijndael-alg-fst.h + * + * @version 3.0 (December 2000) + * + * Optimised ANSI C code for the Rijndael cipher (now AES) + * + * @author Vincent Rijmen + * @author Antoon Bosselaers + * @author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef __RIJNDAEL_ALG_FST_H +#define __RIJNDAEL_ALG_FST_H + +#define MAXKC (256/32) +#define MAXKB (256/8) +#define MAXNR 14 + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; + +int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); +int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits); +void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]); +void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]); + +#ifdef INTERMEDIATE_VALUE_KAT +void rijndaelEncryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds); +void rijndaelDecryptRound(const u32 rk[/*4*(Nr + 1)*/], int Nr, u8 block[16], int rounds); +#endif /* INTERMEDIATE_VALUE_KAT */ + +#endif /* __RIJNDAEL_ALG_FST_H */ Index: modules/App Framework/rijndael-api-fst.c =================================================================== diff -u --- modules/App Framework/rijndael-api-fst.c (revision 0) +++ modules/App Framework/rijndael-api-fst.c (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,442 @@ +/** + * rijndael-api-fst.c + * + * @version 2.9 (December 2000) + * + * Optimised ANSI C code for the Rijndael cipher (now AES) + * + * @author Vincent Rijmen + * @author Antoon Bosselaers + * @author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Acknowledgements: + * + * We are deeply indebted to the following people for their bug reports, + * fixes, and improvement suggestions to this implementation. Though we + * tried to list all contributions, we apologise in advance for any + * missing reference. + * + * Andrew Bales + * Markus Friedl + * John Skodon + */ + +#include +#include +#include + +#include "rijndael-alg-fst.h" +#include "rijndael-api-fst.h" + +int makeKey(keyInstance *key, BYTE direction, int keyLen, const char *keyMaterial) { + int i; + char *keyMat; + u8 cipherKey[MAXKB]; + + if (key == NULL) { + return BAD_KEY_INSTANCE; + } + + if ((direction == DIR_ENCRYPT) || (direction == DIR_DECRYPT)) { + key->direction = direction; + } else { + return BAD_KEY_DIR; + } + + if ((keyLen == 128) || (keyLen == 192) || (keyLen == 256)) { + key->keyLen = keyLen; + } else { + return BAD_KEY_MAT; + } + + if (keyMaterial != NULL) { + strncpy(key->keyMaterial, keyMaterial, keyLen/4); + } + + /* initialize key schedule: */ + keyMat = key->keyMaterial; + for (i = 0; i < key->keyLen/8; i++) { + int t, v; + + t = *keyMat++; + if ((t >= '0') && (t <= '9')) v = (t - '0') << 4; + else if ((t >= 'a') && (t <= 'f')) v = (t - 'a' + 10) << 4; + else if ((t >= 'A') && (t <= 'F')) v = (t - 'A' + 10) << 4; + else return BAD_KEY_MAT; + + t = *keyMat++; + if ((t >= '0') && (t <= '9')) v ^= (t - '0'); + else if ((t >= 'a') && (t <= 'f')) v ^= (t - 'a' + 10); + else if ((t >= 'A') && (t <= 'F')) v ^= (t - 'A' + 10); + else return BAD_KEY_MAT; + + cipherKey[i] = (u8)v; + } + if (direction == DIR_ENCRYPT) { + key->Nr = rijndaelKeySetupEnc(key->rk, cipherKey, keyLen); + } else { + key->Nr = rijndaelKeySetupDec(key->rk, cipherKey, keyLen); + } + rijndaelKeySetupEnc(key->ek, cipherKey, keyLen); + return TRUE; +} + +int cipherInit(cipherInstance *cipher, BYTE mode, char *IV) { + if ((mode == MODE_ECB) || (mode == MODE_CBC) || (mode == MODE_CFB1)) { + cipher->mode = mode; + } else { + return BAD_CIPHER_MODE; + } + if (IV != NULL) { + int i; + for (i = 0; i < MAX_IV_SIZE; i++) { + int t, j; + + t = IV[2*i]; + if ((t >= '0') && (t <= '9')) j = (t - '0') << 4; + else if ((t >= 'a') && (t <= 'f')) j = (t - 'a' + 10) << 4; + else if ((t >= 'A') && (t <= 'F')) j = (t - 'A' + 10) << 4; + else return BAD_CIPHER_INSTANCE; + + t = IV[2*i+1]; + if ((t >= '0') && (t <= '9')) j ^= (t - '0'); + else if ((t >= 'a') && (t <= 'f')) j ^= (t - 'a' + 10); + else if ((t >= 'A') && (t <= 'F')) j ^= (t - 'A' + 10); + else return BAD_CIPHER_INSTANCE; + + cipher->IV[i] = (u8)j; + } + } else { + memset(cipher->IV, 0, MAX_IV_SIZE); + } + return TRUE; +} + +int blockEncrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer) { + int i, k, t, numBlocks; + u8 block[16], *iv; + + if (cipher == NULL || + key == NULL || + key->direction == DIR_DECRYPT) { + return BAD_CIPHER_STATE; + } + if (input == NULL || inputLen <= 0) { + return 0; /* nothing to do */ + } + + numBlocks = inputLen/128; + + switch (cipher->mode) { + case MODE_ECB: + for (i = numBlocks; i > 0; i--) { + rijndaelEncrypt(key->rk, key->Nr, input, outBuffer); + input += 16; + outBuffer += 16; + } + break; + + case MODE_CBC: + iv = cipher->IV; + for (i = numBlocks; i > 0; i--) { + ((u32*)block)[0] = ((u32*)input)[0] ^ ((u32*)iv)[0]; + ((u32*)block)[1] = ((u32*)input)[1] ^ ((u32*)iv)[1]; + ((u32*)block)[2] = ((u32*)input)[2] ^ ((u32*)iv)[2]; + ((u32*)block)[3] = ((u32*)input)[3] ^ ((u32*)iv)[3]; + rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); + iv = outBuffer; + input += 16; + outBuffer += 16; + } + break; + + case MODE_CFB1: + iv = cipher->IV; + for (i = numBlocks; i > 0; i--) { + memcpy(outBuffer, input, 16); + for (k = 0; k < 128; k++) { + rijndaelEncrypt(key->ek, key->Nr, iv, block); + outBuffer[k >> 3] ^= (block[0] & 0x80U) >> (k & 7); + for (t = 0; t < 15; t++) { + iv[t] = (iv[t] << 1) | (iv[t + 1] >> 7); + } + iv[15] = (iv[15] << 1) | ((outBuffer[k >> 3] >> (7 - (k & 7))) & 1); + } + outBuffer += 16; + input += 16; + } + break; + + default: + return BAD_CIPHER_STATE; + } + + return 128*numBlocks; +} + +/** + * Encrypt data partitioned in octets, using RFC 2040-like padding. + * + * @param input data to be encrypted (octet sequence) + * @param inputOctets input length in octets (not bits) + * @param outBuffer encrypted output data + * + * @return length in octets (not bits) of the encrypted output buffer. + */ +int padEncrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputOctets, BYTE *outBuffer) { + int i, numBlocks, padLen; + u8 block[16], *iv; + + if (cipher == NULL || + key == NULL || + key->direction == DIR_DECRYPT) { + return BAD_CIPHER_STATE; + } + if (input == NULL || inputOctets <= 0) { + return 0; /* nothing to do */ + } + + numBlocks = inputOctets/16; + + switch (cipher->mode) { + case MODE_ECB: + for (i = numBlocks; i > 0; i--) { + rijndaelEncrypt(key->rk, key->Nr, input, outBuffer); + input += 16; + outBuffer += 16; + } + padLen = 16 - (inputOctets - 16*numBlocks); + assert(padLen > 0 && padLen <= 16); + memcpy(block, input, 16 - padLen); + memset(block + 16 - padLen, padLen, padLen); + rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); + break; + + case MODE_CBC: + iv = cipher->IV; + for (i = numBlocks; i > 0; i--) { + ((u32*)block)[0] = ((u32*)input)[0] ^ ((u32*)iv)[0]; + ((u32*)block)[1] = ((u32*)input)[1] ^ ((u32*)iv)[1]; + ((u32*)block)[2] = ((u32*)input)[2] ^ ((u32*)iv)[2]; + ((u32*)block)[3] = ((u32*)input)[3] ^ ((u32*)iv)[3]; + rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); + iv = outBuffer; + input += 16; + outBuffer += 16; + } + padLen = 16 - (inputOctets - 16*numBlocks); + assert(padLen > 0 && padLen <= 16); + for (i = 0; i < 16 - padLen; i++) { + block[i] = input[i] ^ iv[i]; + } + for (i = 16 - padLen; i < 16; i++) { + block[i] = (BYTE)padLen ^ iv[i]; + } + rijndaelEncrypt(key->rk, key->Nr, block, outBuffer); + break; + + default: + return BAD_CIPHER_STATE; + } + + return 16*(numBlocks + 1); +} + +int blockDecrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer) { + int i, k, t, numBlocks; + u8 block[16], *iv; + + if (cipher == NULL || + key == NULL || + cipher->mode != MODE_CFB1 && key->direction == DIR_ENCRYPT) { + return BAD_CIPHER_STATE; + } + if (input == NULL || inputLen <= 0) { + return 0; /* nothing to do */ + } + + numBlocks = inputLen/128; + + switch (cipher->mode) { + case MODE_ECB: + for (i = numBlocks; i > 0; i--) { + rijndaelDecrypt(key->rk, key->Nr, input, outBuffer); + input += 16; + outBuffer += 16; + } + break; + + case MODE_CBC: + iv = cipher->IV; + for (i = numBlocks; i > 0; i--) { + rijndaelDecrypt(key->rk, key->Nr, input, block); + ((u32*)block)[0] ^= ((u32*)iv)[0]; + ((u32*)block)[1] ^= ((u32*)iv)[1]; + ((u32*)block)[2] ^= ((u32*)iv)[2]; + ((u32*)block)[3] ^= ((u32*)iv)[3]; + memcpy(cipher->IV, input, 16); + memcpy(outBuffer, block, 16); + input += 16; + outBuffer += 16; + } + break; + + case MODE_CFB1: + iv = cipher->IV; + for (i = numBlocks; i > 0; i--) { + memcpy(outBuffer, input, 16); + for (k = 0; k < 128; k++) { + rijndaelEncrypt(key->ek, key->Nr, iv, block); + for (t = 0; t < 15; t++) { + iv[t] = (iv[t] << 1) | (iv[t + 1] >> 7); + } + iv[15] = (iv[15] << 1) | ((input[k >> 3] >> (7 - (k & 7))) & 1); + outBuffer[k >> 3] ^= (block[0] & 0x80U) >> (k & 7); + } + outBuffer += 16; + input += 16; + } + break; + + default: + return BAD_CIPHER_STATE; + } + + return 128*numBlocks; +} + +int padDecrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputOctets, BYTE *outBuffer) { + int i, numBlocks, padLen; + u8 block[16]; + + if (cipher == NULL || + key == NULL || + key->direction == DIR_ENCRYPT) { + return BAD_CIPHER_STATE; + } + if (input == NULL || inputOctets <= 0) { + return 0; /* nothing to do */ + } + if (inputOctets % 16 != 0) { + return BAD_DATA; + } + + numBlocks = inputOctets/16; + + switch (cipher->mode) { + case MODE_ECB: + /* all blocks but last */ + for (i = numBlocks - 1; i > 0; i--) { + rijndaelDecrypt(key->rk, key->Nr, input, outBuffer); + input += 16; + outBuffer += 16; + } + /* last block */ + rijndaelDecrypt(key->rk, key->Nr, input, block); + padLen = block[15]; + if (padLen >= 16) { + return BAD_DATA; + } + for (i = 16 - padLen; i < 16; i++) { + if (block[i] != padLen) { + return BAD_DATA; + } + } + memcpy(outBuffer, block, 16 - padLen); + break; + + case MODE_CBC: + /* all blocks but last */ + for (i = numBlocks - 1; i > 0; i--) { + rijndaelDecrypt(key->rk, key->Nr, input, block); + ((u32*)block)[0] ^= ((u32*)cipher->IV)[0]; + ((u32*)block)[1] ^= ((u32*)cipher->IV)[1]; + ((u32*)block)[2] ^= ((u32*)cipher->IV)[2]; + ((u32*)block)[3] ^= ((u32*)cipher->IV)[3]; + memcpy(cipher->IV, input, 16); + memcpy(outBuffer, block, 16); + input += 16; + outBuffer += 16; + } + /* last block */ + rijndaelDecrypt(key->rk, key->Nr, input, block); + ((u32*)block)[0] ^= ((u32*)cipher->IV)[0]; + ((u32*)block)[1] ^= ((u32*)cipher->IV)[1]; + ((u32*)block)[2] ^= ((u32*)cipher->IV)[2]; + ((u32*)block)[3] ^= ((u32*)cipher->IV)[3]; + padLen = block[15]; + if (padLen <= 0 || padLen > 16) { + return BAD_DATA; + } + for (i = 16 - padLen; i < 16; i++) { + if (block[i] != padLen) { + return BAD_DATA; + } + } + memcpy(outBuffer, block, 16 - padLen); + break; + + default: + return BAD_CIPHER_STATE; + } + + return 16*numBlocks - padLen; +} + +#ifdef INTERMEDIATE_VALUE_KAT +/** + * cipherUpdateRounds: + * + * Encrypts/Decrypts exactly one full block a specified number of rounds. + * Only used in the Intermediate Value Known Answer Test. + * + * Returns: + * TRUE - on success + * BAD_CIPHER_STATE - cipher in bad state (e.g., not initialized) + */ +int cipherUpdateRounds(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer, int rounds) { + u8 block[16]; + + if (cipher == NULL || key == NULL) { + return BAD_CIPHER_STATE; + } + + memcpy(block, input, 16); + + switch (key->direction) { + case DIR_ENCRYPT: + rijndaelEncryptRound(key->rk, key->Nr, block, rounds); + break; + + case DIR_DECRYPT: + rijndaelDecryptRound(key->rk, key->Nr, block, rounds); + break; + + default: + return BAD_KEY_DIR; + } + + memcpy(outBuffer, block, 16); + + return TRUE; +} +#endif /* INTERMEDIATE_VALUE_KAT */ Index: modules/App Framework/rijndael-api-fst.h =================================================================== diff -u --- modules/App Framework/rijndael-api-fst.h (revision 0) +++ modules/App Framework/rijndael-api-fst.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,119 @@ +/** + * rijndael-api-fst.h + * + * @version 2.9 (December 2000) + * + * Optimised ANSI C code for the Rijndael cipher (now AES) + * + * @author Vincent Rijmen + * @author Antoon Bosselaers + * @author Paulo Barreto + * + * This code is hereby placed in the public domain. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Acknowledgements: + * + * We are deeply indebted to the following people for their bug reports, + * fixes, and improvement suggestions to this implementation. Though we + * tried to list all contributions, we apologise in advance for any + * missing reference. + * + * Andrew Bales + * Markus Friedl + * John Skodon + */ + +#ifndef __RIJNDAEL_API_FST_H +#define __RIJNDAEL_API_FST_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "rijndael-alg-fst.h" + +/* Generic Defines */ +#define DIR_ENCRYPT 0 /* Are we encrpyting? */ +#define DIR_DECRYPT 1 /* Are we decrpyting? */ +#define MODE_ECB 1 /* Are we ciphering in ECB mode? */ +#define MODE_CBC 2 /* Are we ciphering in CBC mode? */ +#define MODE_CFB1 3 /* Are we ciphering in 1-bit CFB mode? */ +#define TRUE 1 +#define FALSE 0 +#define BITSPERBLOCK 128 /* Default number of bits in a cipher block */ + +/* Error Codes */ +#define BAD_KEY_DIR -1 /* Key direction is invalid, e.g., unknown value */ +#define BAD_KEY_MAT -2 /* Key material not of correct length */ +#define BAD_KEY_INSTANCE -3 /* Key passed is not valid */ +#define BAD_CIPHER_MODE -4 /* Params struct passed to cipherInit invalid */ +#define BAD_CIPHER_STATE -5 /* Cipher in wrong state (e.g., not initialized) */ +#define BAD_BLOCK_LENGTH -6 +#define BAD_CIPHER_INSTANCE -7 +#define BAD_DATA -8 /* Data contents are invalid, e.g., invalid padding */ +#define BAD_OTHER -9 /* Unknown error */ + +/* Algorithm-specific Defines */ +#define MAX_KEY_SIZE 64 /* # of ASCII char's needed to represent a key */ +#define MAX_IV_SIZE 16 /* # bytes needed to represent an IV */ + +/* Typedefs */ + +typedef unsigned char BYTE; + +/* The structure for key information */ +typedef struct { + BYTE direction; /* Key used for encrypting or decrypting? */ + int keyLen; /* Length of the key */ + char keyMaterial[MAX_KEY_SIZE+1]; /* Raw key data in ASCII, e.g., user input or KAT values */ + int Nr; /* key-length-dependent number of rounds */ + u32 rk[4*(MAXNR + 1)]; /* key schedule */ + u32 ek[4*(MAXNR + 1)]; /* CFB1 key schedule (encryption only) */ +} keyInstance; + +/* The structure for cipher information */ +typedef struct { /* changed order of the components */ + BYTE mode; /* MODE_ECB, MODE_CBC, or MODE_CFB1 */ + BYTE IV[MAX_IV_SIZE]; /* A possible Initialization Vector for ciphering */ +} cipherInstance; + +/* Function prototypes */ + +int makeKey(keyInstance *key, BYTE direction, int keyLen, const char *keyMaterial); + +int cipherInit(cipherInstance *cipher, BYTE mode, char *IV); + +int blockEncrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer); + +int padEncrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputOctets, BYTE *outBuffer); + +int blockDecrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer); + +int padDecrypt(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputOctets, BYTE *outBuffer); + +#ifdef INTERMEDIATE_VALUE_KAT +int cipherUpdateRounds(cipherInstance *cipher, keyInstance *key, + BYTE *input, int inputLen, BYTE *outBuffer, int Rounds); +#endif /* INTERMEDIATE_VALUE_KAT */ + +#ifdef __cplusplus +} +#endif +#endif /* __RIJNDAEL_API_FST_H */ Index: modules/App Framework/sha256.c =================================================================== diff -u --- modules/App Framework/sha256.c (revision 0) +++ modules/App Framework/sha256.c (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,369 @@ +/* + * FIPS-180-2 compliant SHA-256 implementation + * + * Copyright (C) 2001-2003 Christophe Devine + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "sha256.h" + +#define GET_UINT32(n,b,i) \ +{ \ + (n) = ( (uint32) (b)[(i) ] << 24 ) \ + | ( (uint32) (b)[(i) + 1] << 16 ) \ + | ( (uint32) (b)[(i) + 2] << 8 ) \ + | ( (uint32) (b)[(i) + 3] ); \ +} + +#define PUT_UINT32(n,b,i) \ +{ \ + (b)[(i) ] = (uint8) ( (n) >> 24 ); \ + (b)[(i) + 1] = (uint8) ( (n) >> 16 ); \ + (b)[(i) + 2] = (uint8) ( (n) >> 8 ); \ + (b)[(i) + 3] = (uint8) ( (n) ); \ +} + +void sha256_starts( sha256_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x6A09E667; + ctx->state[1] = 0xBB67AE85; + ctx->state[2] = 0x3C6EF372; + ctx->state[3] = 0xA54FF53A; + ctx->state[4] = 0x510E527F; + ctx->state[5] = 0x9B05688C; + ctx->state[6] = 0x1F83D9AB; + ctx->state[7] = 0x5BE0CD19; +} + +void sha256_process( sha256_context *ctx, uint8 data[64] ) +{ + uint32 temp1, temp2, W[64]; + uint32 A, B, C, D, E, F, G, H; + + GET_UINT32( W[0], data, 0 ); + GET_UINT32( W[1], data, 4 ); + GET_UINT32( W[2], data, 8 ); + GET_UINT32( W[3], data, 12 ); + GET_UINT32( W[4], data, 16 ); + GET_UINT32( W[5], data, 20 ); + GET_UINT32( W[6], data, 24 ); + GET_UINT32( W[7], data, 28 ); + GET_UINT32( W[8], data, 32 ); + GET_UINT32( W[9], data, 36 ); + GET_UINT32( W[10], data, 40 ); + GET_UINT32( W[11], data, 44 ); + GET_UINT32( W[12], data, 48 ); + GET_UINT32( W[13], data, 52 ); + GET_UINT32( W[14], data, 56 ); + GET_UINT32( W[15], data, 60 ); + +#define SHR(x,n) ((x & 0xFFFFFFFF) >> n) +#define ROTR(x,n) (SHR(x,n) | (x << (32 - n))) + +#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) +#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) + +#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) +#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) + +#define F0(x,y,z) ((x & y) | (z & (x | y))) +#define F1(x,y,z) (z ^ (x & (y ^ z))) + +#define _R(t) \ +( \ + W[t] = S1(W[t - 2]) + W[t - 7] + \ + S0(W[t - 15]) + W[t - 16] \ +) + +#define P(a,b,c,d,e,f,g,h,x,K) \ +{ \ + temp1 = h + S3(e) + F1(e,f,g) + K + x; \ + temp2 = S2(a) + F0(a,b,c); \ + d += temp1; h = temp1 + temp2; \ +} + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + E = ctx->state[4]; + F = ctx->state[5]; + G = ctx->state[6]; + H = ctx->state[7]; + + P( A, B, C, D, E, F, G, H, W[ 0], 0x428A2F98 ); + P( H, A, B, C, D, E, F, G, W[ 1], 0x71374491 ); + P( G, H, A, B, C, D, E, F, W[ 2], 0xB5C0FBCF ); + P( F, G, H, A, B, C, D, E, W[ 3], 0xE9B5DBA5 ); + P( E, F, G, H, A, B, C, D, W[ 4], 0x3956C25B ); + P( D, E, F, G, H, A, B, C, W[ 5], 0x59F111F1 ); + P( C, D, E, F, G, H, A, B, W[ 6], 0x923F82A4 ); + P( B, C, D, E, F, G, H, A, W[ 7], 0xAB1C5ED5 ); + P( A, B, C, D, E, F, G, H, W[ 8], 0xD807AA98 ); + P( H, A, B, C, D, E, F, G, W[ 9], 0x12835B01 ); + P( G, H, A, B, C, D, E, F, W[10], 0x243185BE ); + P( F, G, H, A, B, C, D, E, W[11], 0x550C7DC3 ); + P( E, F, G, H, A, B, C, D, W[12], 0x72BE5D74 ); + P( D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE ); + P( C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7 ); + P( B, C, D, E, F, G, H, A, W[15], 0xC19BF174 ); + P( A, B, C, D, E, F, G, H, _R(16), 0xE49B69C1 ); + P( H, A, B, C, D, E, F, G, _R(17), 0xEFBE4786 ); + P( G, H, A, B, C, D, E, F, _R(18), 0x0FC19DC6 ); + P( F, G, H, A, B, C, D, E, _R(19), 0x240CA1CC ); + P( E, F, G, H, A, B, C, D, _R(20), 0x2DE92C6F ); + P( D, E, F, G, H, A, B, C, _R(21), 0x4A7484AA ); + P( C, D, E, F, G, H, A, B, _R(22), 0x5CB0A9DC ); + P( B, C, D, E, F, G, H, A, _R(23), 0x76F988DA ); + P( A, B, C, D, E, F, G, H, _R(24), 0x983E5152 ); + P( H, A, B, C, D, E, F, G, _R(25), 0xA831C66D ); + P( G, H, A, B, C, D, E, F, _R(26), 0xB00327C8 ); + P( F, G, H, A, B, C, D, E, _R(27), 0xBF597FC7 ); + P( E, F, G, H, A, B, C, D, _R(28), 0xC6E00BF3 ); + P( D, E, F, G, H, A, B, C, _R(29), 0xD5A79147 ); + P( C, D, E, F, G, H, A, B, _R(30), 0x06CA6351 ); + P( B, C, D, E, F, G, H, A, _R(31), 0x14292967 ); + P( A, B, C, D, E, F, G, H, _R(32), 0x27B70A85 ); + P( H, A, B, C, D, E, F, G, _R(33), 0x2E1B2138 ); + P( G, H, A, B, C, D, E, F, _R(34), 0x4D2C6DFC ); + P( F, G, H, A, B, C, D, E, _R(35), 0x53380D13 ); + P( E, F, G, H, A, B, C, D, _R(36), 0x650A7354 ); + P( D, E, F, G, H, A, B, C, _R(37), 0x766A0ABB ); + P( C, D, E, F, G, H, A, B, _R(38), 0x81C2C92E ); + P( B, C, D, E, F, G, H, A, _R(39), 0x92722C85 ); + P( A, B, C, D, E, F, G, H, _R(40), 0xA2BFE8A1 ); + P( H, A, B, C, D, E, F, G, _R(41), 0xA81A664B ); + P( G, H, A, B, C, D, E, F, _R(42), 0xC24B8B70 ); + P( F, G, H, A, B, C, D, E, _R(43), 0xC76C51A3 ); + P( E, F, G, H, A, B, C, D, _R(44), 0xD192E819 ); + P( D, E, F, G, H, A, B, C, _R(45), 0xD6990624 ); + P( C, D, E, F, G, H, A, B, _R(46), 0xF40E3585 ); + P( B, C, D, E, F, G, H, A, _R(47), 0x106AA070 ); + P( A, B, C, D, E, F, G, H, _R(48), 0x19A4C116 ); + P( H, A, B, C, D, E, F, G, _R(49), 0x1E376C08 ); + P( G, H, A, B, C, D, E, F, _R(50), 0x2748774C ); + P( F, G, H, A, B, C, D, E, _R(51), 0x34B0BCB5 ); + P( E, F, G, H, A, B, C, D, _R(52), 0x391C0CB3 ); + P( D, E, F, G, H, A, B, C, _R(53), 0x4ED8AA4A ); + P( C, D, E, F, G, H, A, B, _R(54), 0x5B9CCA4F ); + P( B, C, D, E, F, G, H, A, _R(55), 0x682E6FF3 ); + P( A, B, C, D, E, F, G, H, _R(56), 0x748F82EE ); + P( H, A, B, C, D, E, F, G, _R(57), 0x78A5636F ); + P( G, H, A, B, C, D, E, F, _R(58), 0x84C87814 ); + P( F, G, H, A, B, C, D, E, _R(59), 0x8CC70208 ); + P( E, F, G, H, A, B, C, D, _R(60), 0x90BEFFFA ); + P( D, E, F, G, H, A, B, C, _R(61), 0xA4506CEB ); + P( C, D, E, F, G, H, A, B, _R(62), 0xBEF9A3F7 ); + P( B, C, D, E, F, G, H, A, _R(63), 0xC67178F2 ); + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; + ctx->state[4] += E; + ctx->state[5] += F; + ctx->state[6] += G; + ctx->state[7] += H; +} + +void sha256_update( sha256_context *ctx, uint8 *input, uint32 length ) +{ + uint32 left, fill; + + if( ! length ) return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += length; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < length ) + ctx->total[1]++; + + if( left && length >= fill ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, fill ); + sha256_process( ctx, ctx->buffer ); + length -= fill; + input += fill; + left = 0; + } + + while( length >= 64 ) + { + sha256_process( ctx, input ); + length -= 64; + input += 64; + } + + if( length ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, length ); + } +} + +static uint8 sha256_padding[64] = +{ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +void sha256_finish( sha256_context *ctx, uint8 digest[32] ) +{ + uint32 last, padn; + uint32 high, low; + uint8 msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_UINT32( high, msglen, 0 ); + PUT_UINT32( low, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + sha256_update( ctx, sha256_padding, padn ); + sha256_update( ctx, msglen, 8 ); + + PUT_UINT32( ctx->state[0], digest, 0 ); + PUT_UINT32( ctx->state[1], digest, 4 ); + PUT_UINT32( ctx->state[2], digest, 8 ); + PUT_UINT32( ctx->state[3], digest, 12 ); + PUT_UINT32( ctx->state[4], digest, 16 ); + PUT_UINT32( ctx->state[5], digest, 20 ); + PUT_UINT32( ctx->state[6], digest, 24 ); + PUT_UINT32( ctx->state[7], digest, 28 ); +} + +#ifdef TEST + +#include +#include + +/* + * those are the standard FIPS-180-2 test vectors + */ + +static char *msg[] = +{ + "abc", + "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + NULL +}; + +static char *val[] = +{ + "ba7816bf8f01cfea414140de5dae2223" \ + "b00361a396177a9cb410ff61f20015ad", + "248d6a61d20638b8e5c026930c3e6039" \ + "a33ce45964ff2167f6ecedd419db06c1", + "cdc76e5c9914fb9281a1c7e284d73e67" \ + "f1809a48a497200e046d39ccc7112cd0" +}; + +int main( int argc, char *argv[] ) +{ + FILE *f; + int i, j; + char output[65]; + sha256_context ctx; + unsigned char buf[1000]; + unsigned char sha256sum[32]; + + if( argc < 2 ) + { + printf( "\n SHA-256 Validation Tests:\n\n" ); + + for( i = 0; i < 3; i++ ) + { + printf( " Test %d ", i + 1 ); + + sha256_starts( &ctx ); + + if( i < 2 ) + { + sha256_update( &ctx, (uint8 *) msg[i], + strlen( msg[i] ) ); + } + else + { + memset( buf, 'a', 1000 ); + + for( j = 0; j < 1000; j++ ) + { + sha256_update( &ctx, (uint8 *) buf, 1000 ); + } + } + + sha256_finish( &ctx, sha256sum ); + + for( j = 0; j < 32; j++ ) + { + sprintf( output + j * 2, "%02x", sha256sum[j] ); + } + + if( memcmp( output, val[i], 64 ) ) + { + printf( "failed!\n" ); + return( 1 ); + } + + printf( "passed.\n" ); + } + + printf( "\n" ); + } + else + { + if( ! ( f = fopen( argv[1], "rb" ) ) ) + { + perror( "fopen" ); + return( 1 ); + } + + sha256_starts( &ctx ); + + while( ( i = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) + { + sha256_update( &ctx, buf, i ); + } + + sha256_finish( &ctx, sha256sum ); + + for( j = 0; j < 32; j++ ) + { + printf( "%02x", sha256sum[j] ); + } + + printf( " %s\n", argv[1] ); + } + + return( 0 ); +} + +#endif \ No newline at end of file Index: modules/App Framework/sha256.h =================================================================== diff -u --- modules/App Framework/sha256.h (revision 0) +++ modules/App Framework/sha256.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,33 @@ +#ifndef _SHA256_H +#define _SHA256_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifndef uint8 +#define uint8 unsigned char +#endif + +#ifndef uint32 +#define uint32 unsigned long int +#endif + +typedef struct +{ + uint32 total[2]; + uint32 state[8]; + uint8 buffer[64]; +} +sha256_context; + +void sha256_starts( sha256_context *ctx ); +void sha256_update( sha256_context *ctx, uint8 *input, uint32 length ); +void sha256_finish( sha256_context *ctx, uint8 digest[32] ); + +#ifdef __cplusplus +} +#endif + +#endif /* sha256.h */ \ No newline at end of file Index: modules/debug.h =================================================================== diff -u --- modules/debug.h (revision 0) +++ modules/debug.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,280 @@ +#ifndef __DEBUG_H__ +#define __DEBUG_H__ + +// time measuring macros +#ifdef _DEBUG + static long __dwst, __dwen; + #define MEASURE_TIME(lines, text) __dwst=GetTickCount(); lines __dwen=GetTickCount(); TRACE(text, __dwen-__dwst); +#else + #define MEASURE_TIME(lines, text) lines +#endif + +#ifdef _DEBUG + #define TRACELOGFONT(str, lf)\ + {\ + TRACE( str "\tlfHeight: %ld\n\tlfWidth: %ld\n\tlfEscapement: %ld\n\tlfOrientation: %ld\n\tlfWeight: %ld\n", (lf).lfHeight, (lf).lfWidth, (lf).lfEscapement, (lf).lfOrientation, (lf).lfWeight);\ + TRACE("\tlfItalic: %d\n\tlfUnderline: %d\n\tlfStrikeOut: %d\n\tlfCharSet: %d\n\tlfOutPrecision: %d\n\tlfClipPrecision: %d\n\tlfQuality: %d\n\tlfPitchAndFamily: %d\n\tlfFaceName: %s\n", (lf).lfItalic, (lf).lfUnderline, (lf).lfStrikeOut, (lf).lfCharSet, (lf).lfOutPrecision, (lf).lfClipPrecision, (lf).lfQuality, (lf).lfPitchAndFamily, (lf).lfFaceName);\ + } +#else + #define TRACELOGFONT(lf) +#endif + +// window messages +#ifdef _DEBUG +struct __dbg_msg__ +{ + UINT uiMsg; + TCHAR *pszText; +}; + +////////////////////////////////////// + +#define GEN_PAIR(str) { str, #str } + +static __dbg_msg__ __msgs__[] = { + GEN_PAIR(WM_NULL), + GEN_PAIR(WM_CREATE), + GEN_PAIR(WM_DESTROY), + GEN_PAIR(WM_MOVE), + GEN_PAIR(WM_SIZE), + GEN_PAIR(WM_ACTIVATE), + GEN_PAIR(WM_SETFOCUS), + GEN_PAIR(WM_KILLFOCUS), + GEN_PAIR(WM_ENABLE), + GEN_PAIR(WM_SETREDRAW), + GEN_PAIR(WM_SETTEXT), + GEN_PAIR(WM_GETTEXT), + GEN_PAIR(WM_GETTEXTLENGTH), + GEN_PAIR(WM_PAINT), + GEN_PAIR(WM_CLOSE), + GEN_PAIR(WM_QUERYENDSESSION), + GEN_PAIR(WM_QUERYOPEN), + GEN_PAIR(WM_ENDSESSION), + GEN_PAIR(WM_QUIT), + GEN_PAIR(WM_ERASEBKGND), + GEN_PAIR(WM_SYSCOLORCHANGE), + GEN_PAIR(WM_SHOWWINDOW), + GEN_PAIR(WM_WININICHANGE), + GEN_PAIR(WM_DEVMODECHANGE), + GEN_PAIR(WM_ACTIVATEAPP), + GEN_PAIR(WM_FONTCHANGE), + GEN_PAIR(WM_TIMECHANGE), + GEN_PAIR(WM_CANCELMODE), + GEN_PAIR(WM_SETCURSOR), + GEN_PAIR(WM_MOUSEACTIVATE), + GEN_PAIR(WM_CHILDACTIVATE), + GEN_PAIR(WM_QUEUESYNC), + GEN_PAIR(WM_GETMINMAXINFO), + GEN_PAIR(WM_PAINTICON), + GEN_PAIR(WM_ICONERASEBKGND), + GEN_PAIR(WM_NEXTDLGCTL), + GEN_PAIR(WM_SPOOLERSTATUS), + GEN_PAIR(WM_DRAWITEM), + GEN_PAIR(WM_MEASUREITEM), + GEN_PAIR(WM_DELETEITEM), + GEN_PAIR(WM_VKEYTOITEM), + GEN_PAIR(WM_CHARTOITEM), + GEN_PAIR(WM_SETFONT), + GEN_PAIR(WM_GETFONT), + GEN_PAIR(WM_SETHOTKEY), + GEN_PAIR(WM_GETHOTKEY), + GEN_PAIR(WM_QUERYDRAGICON), + GEN_PAIR(WM_COMPAREITEM), + { 0x003d, "WM_GETOBJECT" }, + GEN_PAIR(WM_COMPACTING), + GEN_PAIR(WM_COMMNOTIFY), + GEN_PAIR(WM_WINDOWPOSCHANGING), + GEN_PAIR(WM_WINDOWPOSCHANGED), + GEN_PAIR(WM_POWER), + GEN_PAIR(WM_COPYDATA), + GEN_PAIR(WM_CANCELJOURNAL), + GEN_PAIR(WM_NOTIFY), + GEN_PAIR(WM_INPUTLANGCHANGEREQUEST), + GEN_PAIR(WM_INPUTLANGCHANGE), + GEN_PAIR(WM_TCARD), + GEN_PAIR(WM_HELP), + GEN_PAIR(WM_USERCHANGED), + GEN_PAIR(WM_NOTIFYFORMAT), + GEN_PAIR(WM_CONTEXTMENU), + GEN_PAIR(WM_STYLECHANGING), + GEN_PAIR(WM_STYLECHANGED), + GEN_PAIR(WM_DISPLAYCHANGE), + GEN_PAIR(WM_GETICON), + GEN_PAIR(WM_SETICON), + GEN_PAIR(WM_NCCREATE), + GEN_PAIR(WM_NCDESTROY), + GEN_PAIR(WM_NCCALCSIZE), + GEN_PAIR(WM_NCHITTEST), + GEN_PAIR(WM_NCPAINT), + GEN_PAIR(WM_NCACTIVATE), + GEN_PAIR(WM_GETDLGCODE), + GEN_PAIR(WM_SYNCPAINT), + GEN_PAIR(WM_NCMOUSEMOVE), + GEN_PAIR(WM_NCLBUTTONDOWN), + GEN_PAIR(WM_NCLBUTTONUP), + GEN_PAIR(WM_NCLBUTTONDBLCLK), + GEN_PAIR(WM_NCRBUTTONDOWN), + GEN_PAIR(WM_NCRBUTTONUP), + GEN_PAIR(WM_NCRBUTTONDBLCLK), + GEN_PAIR(WM_NCMBUTTONDOWN), + GEN_PAIR(WM_NCMBUTTONUP), + GEN_PAIR(WM_NCMBUTTONDBLCLK), + { 0x00AB, "WM_NCXBUTTONDOWN" }, + { 0x00AC, "WM_NCXBUTTONUP" }, + { 0x00AD, "WM_NCXBUTTONDBLCLK" }, + { 0x00FF, "WM_INPUT" }, + GEN_PAIR(WM_KEYFIRST), + GEN_PAIR(WM_KEYDOWN), + GEN_PAIR(WM_KEYUP), + GEN_PAIR(WM_CHAR), + GEN_PAIR(WM_DEADCHAR), + GEN_PAIR(WM_SYSKEYDOWN), + GEN_PAIR(WM_SYSKEYUP), + GEN_PAIR(WM_SYSCHAR), + GEN_PAIR(WM_SYSDEADCHAR), + GEN_PAIR(WM_UNICHAR), + GEN_PAIR(WM_KEYLAST), + GEN_PAIR(WM_IME_STARTCOMPOSITION), + GEN_PAIR(WM_IME_ENDCOMPOSITION), + GEN_PAIR(WM_IME_COMPOSITION), + GEN_PAIR(WM_IME_KEYLAST), + GEN_PAIR(WM_INITDIALOG), + GEN_PAIR(WM_COMMAND), + GEN_PAIR(WM_SYSCOMMAND), + GEN_PAIR(WM_TIMER), + GEN_PAIR(WM_HSCROLL), + GEN_PAIR(WM_VSCROLL), + GEN_PAIR(WM_INITMENU), + GEN_PAIR(WM_INITMENUPOPUP), + GEN_PAIR(WM_MENUSELECT), + GEN_PAIR(WM_MENUCHAR), + GEN_PAIR(WM_ENTERIDLE), + { 0x0122, "WM_MENURBUTTONUP" }, + { 0x0123, "WM_MENUDRAG" }, + { 0x0124, "WM_MENUGETOBJECT" }, + { 0x0125, "WM_UNINITMENUPOPUP" }, + { 0x0126, "WM_MENUCOMMAND" }, + { 0x0127, "WM_CHANGEUISTATE" }, + { 0x0128, "WM_UPDATEUISTATE" }, + { 0x0129, "WM_QUERYUISTATE" }, + GEN_PAIR(WM_CTLCOLORMSGBOX), + GEN_PAIR(WM_CTLCOLOREDIT), + GEN_PAIR(WM_CTLCOLORLISTBOX), + GEN_PAIR(WM_CTLCOLORBTN), + GEN_PAIR(WM_CTLCOLORDLG), + GEN_PAIR(WM_CTLCOLORSCROLLBAR), + GEN_PAIR(WM_CTLCOLORSTATIC), + GEN_PAIR(WM_MOUSEFIRST), + GEN_PAIR(WM_MOUSEMOVE), + GEN_PAIR(WM_LBUTTONDOWN), + GEN_PAIR(WM_LBUTTONUP), + GEN_PAIR(WM_LBUTTONDBLCLK), + GEN_PAIR(WM_RBUTTONDOWN), + GEN_PAIR(WM_RBUTTONUP), + GEN_PAIR(WM_RBUTTONDBLCLK), + GEN_PAIR(WM_MBUTTONDOWN), + GEN_PAIR(WM_MBUTTONUP), + GEN_PAIR(WM_MBUTTONDBLCLK), + GEN_PAIR(WM_MOUSEWHEEL), + { 0x020B, "WM_XBUTTONDOWN" }, + { 0x020C, "WM_XBUTTONUP" }, + { 0x020D, "WM_XBUTTONDBLCLK" }, + GEN_PAIR(WM_MOUSELAST), + GEN_PAIR(WM_MOUSELAST), + GEN_PAIR(WM_MOUSELAST), + GEN_PAIR(WM_PARENTNOTIFY), + GEN_PAIR(WM_ENTERMENULOOP), + GEN_PAIR(WM_EXITMENULOOP), + GEN_PAIR(WM_NEXTMENU), + GEN_PAIR(WM_SIZING), + GEN_PAIR(WM_CAPTURECHANGED), + GEN_PAIR(WM_MOVING), + GEN_PAIR(WM_POWERBROADCAST), + GEN_PAIR(WM_DEVICECHANGE), + GEN_PAIR(WM_MDICREATE), + GEN_PAIR(WM_MDIDESTROY), + GEN_PAIR(WM_MDIACTIVATE), + GEN_PAIR(WM_MDIRESTORE), + GEN_PAIR(WM_MDINEXT), + GEN_PAIR(WM_MDIMAXIMIZE), + GEN_PAIR(WM_MDITILE), + GEN_PAIR(WM_MDICASCADE), + GEN_PAIR(WM_MDIICONARRANGE), + GEN_PAIR(WM_MDIGETACTIVE), + GEN_PAIR(WM_MDISETMENU), + GEN_PAIR(WM_ENTERSIZEMOVE), + GEN_PAIR(WM_EXITSIZEMOVE), + GEN_PAIR(WM_DROPFILES), + GEN_PAIR(WM_MDIREFRESHMENU), + GEN_PAIR(WM_IME_SETCONTEXT), + GEN_PAIR(WM_IME_NOTIFY), + GEN_PAIR(WM_IME_CONTROL), + GEN_PAIR(WM_IME_COMPOSITIONFULL), + GEN_PAIR(WM_IME_SELECT), + GEN_PAIR(WM_IME_CHAR), + { 0x0288, "WM_IME_REQUEST" }, + GEN_PAIR(WM_IME_KEYDOWN), + GEN_PAIR(WM_IME_KEYUP), + GEN_PAIR(WM_MOUSEHOVER), + GEN_PAIR(WM_MOUSELEAVE), + { 0x02A0, "WM_NCMOUSEHOVER" }, + { 0x02A2, "WM_NCMOUSELEAVE" }, + { 0x02B1, "WM_WTSSESSION_CHANGE" }, + { 0x02C0, "WM_TABLET_FIRST" }, + { 0x02DF, "WM_TABLET_LAST" }, + GEN_PAIR(WM_CUT), + GEN_PAIR(WM_COPY), + GEN_PAIR(WM_PASTE), + GEN_PAIR(WM_CLEAR), + GEN_PAIR(WM_UNDO), + GEN_PAIR(WM_RENDERFORMAT), + GEN_PAIR(WM_RENDERALLFORMATS), + GEN_PAIR(WM_DESTROYCLIPBOARD), + GEN_PAIR(WM_DRAWCLIPBOARD), + GEN_PAIR(WM_PAINTCLIPBOARD), + GEN_PAIR(WM_VSCROLLCLIPBOARD), + GEN_PAIR(WM_SIZECLIPBOARD), + GEN_PAIR(WM_ASKCBFORMATNAME), + GEN_PAIR(WM_CHANGECBCHAIN), + GEN_PAIR(WM_HSCROLLCLIPBOARD), + GEN_PAIR(WM_QUERYNEWPALETTE), + GEN_PAIR(WM_PALETTEISCHANGING), + GEN_PAIR(WM_PALETTECHANGED), + GEN_PAIR(WM_HOTKEY), + GEN_PAIR(WM_PRINT), + GEN_PAIR(WM_PRINTCLIENT), + { 0x0319, "WM_APPCOMMAND" }, + { 0x031A, "WM_THEMECHANGED" }, + GEN_PAIR(WM_HANDHELDFIRST), + GEN_PAIR(WM_HANDHELDLAST), + GEN_PAIR(WM_AFXFIRST), + GEN_PAIR(WM_AFXLAST), + GEN_PAIR(WM_PENWINFIRST), + GEN_PAIR(WM_PENWINLAST), + GEN_PAIR(WM_APP), + GEN_PAIR(WM_USER) + }; +///////////////////////////////// + +static char* UINTToMsg(UINT uiMsg, char* szBuffer) +{ + int iCount=sizeof(__msgs__)/(sizeof(UINT)+sizeof(char*)); + for (int i=0;i' button on the right. + +.topic IDH_OVERALL_PROGRESS_STATIC +Shows progression information for all the tasks from the task's list. + +.topic IDH_OVERALL_TRANSFER_STATIC +Shows current transfer rate for all the working tasks from the task's list. \ No newline at end of file Index: other/Help/English/137.txt =================================================================== diff -u --- other/Help/English/137.txt (revision 0) +++ other/Help/English/137.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +.topic 1 +Closes the window and stores the changed settings. + +.topic 2 +Closes this window and discards all changes. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_DEFAULTSIZE_EDIT +Buffer size that would be used to copy or move data when 'Use only default buffer' checkbox is checked or any other buffer size cannot be applied. + +.topic IDH_DEFAULTMULTIPLIER_COMBO +Specifies the size units in which the value on the left is specified. + +.topic IDH_ONEDISKSIZE_EDIT +Buffer size that would be used to copy data between two places that lies on the same physical hard disk. The larger values in this buffer size could significantly improve copying performance. Too large values could lower the performance. One of the buffer sizes is chosen automatically unless the checkbox 'Use only default buffer' is checked. + +.topic IDH_ONEDISKMULTIPLIER_COMBO +Specifies the size units in which the value on the left is specified. + +.topic IDH_TWODISKSSIZE_EDIT +Buffer size that would be used to copy data between two different physical hard disks. This value shouldn't be too large because of possible performance degradation. One of the buffer sizes is chosen automatically unless the checkbox 'Use only default buffer' is checked. + +.topic IDH_TWODISKSMULTIPLIER_COMBO +Specifies the size units in which the value on the left is specified. + +.topic IDH_CDROMSIZE_EDIT +Buffer size that would be used to copy data from CD-ROM to any other storage medium. The value shouldn't be too large because the CD-ROM is rather slow device (comparing to a newer hard disks). One of the buffer sizes is chosen automatically unless the checkbox 'Use only default buffer' is checked. + +.topic IDH_CDROMMULTIPLIER_COMBO +Specifies the size units in which the value on the left is specified. + +.topic IDH_LANSIZE_EDIT +Buffer size that would be used to copy data from or to local network. The value should depend on the network performance - ie. on 10Mbps networks it should be lower than on 1Gbps networks. One of the buffer sizes is chosen automatically unless the checkbox 'Use only default buffer' is checked. + +.topic IDH_LANMULTIPLIER_COMBO +Specifies the size units in which the value on the left is specified. + +.topic IDH_ONLYDEFAULT_CHECK +Specifies if the task(s) should use only the default buffer size to copy/move data or should auto-detect the needed buffer size by analysing the source and destination storage medium. \ No newline at end of file Index: other/Help/English/144.txt =================================================================== diff -u --- other/Help/English/144.txt (revision 0) +++ other/Help/English/144.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,14 @@ +.topic 1 +Applies all the changes made in this dialog box and closes it. + +.topic 2 +Discards all the changes made in this dialog box. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_PROPERTIES_LIST +Shows the list of program's properties you can change. + +.topic IDH_APPLY_BUTTON +Applies all changes made in this dialog box. \ No newline at end of file Index: other/Help/English/145.txt =================================================================== diff -u --- other/Help/English/145.txt (revision 0) +++ other/Help/English/145.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2 @@ +.topic IDH_PROGRESS_LIST +Shows the status of currently active tasks. The view depends on the options' set in the configuration dialog in section 'Miniview'. Index: other/Help/English/149.txt =================================================================== diff -u --- other/Help/English/149.txt (revision 0) +++ other/Help/English/149.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,68 @@ +.topic 1 +Closes this window and starts a new task that would perform needed operation. + +.topic 2 +Closes this window and discards all changes you have made. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_FILES_LIST +Specifies the list of files and folders to be copied or moved to the destination folder. You can manage these items by the four buttons on the right. + +.topic IDH_ADDFILE_BUTTON +Adds one or more files to the list of files/folders (on the left) to be copied or moved. + +.topic IDH_ADDDIR_BUTTON +Adds a directory to the list of files/folders (on the left) to be copied or moved. + +.topic IDH_REMOVEFILEFOLDER_BUTTON +Removes files and/or folders from the list on the left. + +.topic IDH_IMPORT_BUTTON +Imports the files and folders paths from the text file. Each line of the text file must specify the path to the folder or file to be imported. + +.topic IDH_DESTPATH_COMBOBOXEX +Destination path - all the files and folders from the list above would be copied or moved to this location. + +.topic IDH_DESTBROWSE_BUTTON +Opens the folder's choosing dialog in which you can specify the destination path. + +.topic IDH_OPERATION_COMBO +Specifies operation that would be performed on the files and folders from the list. + +.topic IDH_PRIORITY_COMBO +Specifies priority level at which the task would run. Use with caution when using very fast storage media - ie. ram disk or other memory-based device. + +.topic IDH_COUNT_EDIT +Specifies the count of copies (of the source files) that would be done in the destination location. Useful when copying one thing to the unreliable medias such as floppy disks. + +.topic IDH_BUFFERSIZES_LIST +Specifies the buffer sizes that will be used by the task. You can change them by clicking on the button on the right. + +.topic IDH_BUFFERSIZES_BUTTON +Allows you to change the buffer sizes that will be used to perform the needed operation. + +.topic IDH_FILTERS_CHECK +Enables or disables the filenames filtering for this task. + +.topic IDH_FILTERS_LIST +Specifies the list of active filters that will be used to perform the needed operation. You can add and remove them using the buttons on the right. Double-clicking the item allows you to edit selected filter. + +.topic IDH_ADDFILTER_BUTTON +Adds a new filter to the filter's list. + +.topic IDH_REMOVEFILTER_BUTTON +Removes the selected filter from the list. + +.topic IDH_ADVANCED_CHECK +Enables or disables the advanced options. + +.topic IDH_IGNOREFOLDERS_CHECK +An advanced copy/move option. When selected it only copies the files to the destination location. So if you copy the 'c:\windows' folder to 'd:\' you will have all the files from 'c:\windows' and all of its subfolders in the root directory of drive 'd'. + +.topic IDH_ONLYSTRUCTURE_CHECK +An advanced copy/move option. If selected then does not copy the contents of the files. So if you copy the 700MB file you will have an empty file in the destination location. Be careful when you move data because you may lose all the data being copied. + +.topic IDH_FORCEDIRECTORIES_CHECK +An advanced copy/move option. If selected then creates the whole source path (relative to the root directory of the source disk drive) in the destination location. Ie. if you are copying the 'c:\windows\system' directory to 'd:\' you will get the 'd:\windows\system' directories in the destination location and the 'system' folder will contain the contents of the 'c:\windows\system'. \ No newline at end of file Index: other/Help/English/161.txt =================================================================== diff -u --- other/Help/English/161.txt (revision 0) +++ other/Help/English/161.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 1 +Replaces the path entered in the higher one of the edit boxes to the one from the edit box below and closes this dialog box. + +.topic 2 +Discards all changes and closes this dialog box. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_PATHS_LIST +The list of the default paths that could be changed to something else. If any path is selected it will appear in the edit box below. + +.topic IDH_SOURCE_EDIT +Specifies the path that will be replaced with the one from the edit box below. + +.topic IDH_DESTINATION_EDIT +Specifies path to which the one from above would be changed. You can enter the path manually or by the '...' button on the right. + +.topic IDH_BROWSE_BUTTON +Browses for a path that will be displayed in the window on the left. \ No newline at end of file Index: other/Help/English/162.txt =================================================================== diff -u --- other/Help/English/162.txt (revision 0) +++ other/Help/English/162.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +.topic 2 +Cancels the whole task. + +.topic IDH_MESSAGE_EDIT +Specifies the error description - the reason for which the file could not be opened. + +.topic IDH_FILENAME_EDIT +Specifies the name of the expected file. + +.topic IDH_FILESIZE_EDIT +Specifies the size of the expected file. + +.topic IDH_CREATETIME_EDIT +Specifies the creation date/time of the expected file. + +.topic IDH_MODIFY_TIME_EDIT +Specifies the last modification date/time of the expected file. + +.topic IDH_DEST_FILENAME_EDIT +Specifies the name of the file that has been found. + +.topic IDH_DEST_FILESIZE_EDIT +Specifies the size of the file that has been found. + +.topic IDH_DEST_CREATETIME_EDIT +Specifies the creation date/time of the file that has been found. + +.topic IDH_DEST_MODIFYTIME_EDIT +Specifies the last modification date/time of the file that has been found. + +.topic IDH_RETRY_BUTTON +Tries again to open the file. + +.topic IDH_IGNORE_BUTTON +Ignores this error and skips the file. + +.topic IDH_IGNORE_ALL_BUTTON +Ignores this error and skips copying the file. Also if the task will encounter any similar errors in the future - it will automatically ignore the error. + +.topic IDH_WAIT_BUTTON +Changes state of the task to an error. If the configuration option 'Auto resume on error' is set - the task will be resumed in a configured time. Index: other/Help/English/164.txt =================================================================== diff -u --- other/Help/English/164.txt (revision 0) +++ other/Help/English/164.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,44 @@ +.topic 2 +Cancels the whole task. + +.topic IDH_FILENAME_EDIT +Name of the source file. + +.topic IDH_FILESIZE_EDIT +Size of the source file. + +.topic IDH_CREATETIME_EDIT +Creation date/time of the source file. + +.topic IDH_MODIFY_TIME_EDIT +Last mofification date/time of the source file. + +.topic IDH_DEST_FILENAME_EDIT +Name of the destination file. + +.topic IDH_DEST_FILESIZE_EDIT +Size of the destination file. + +.topic IDH_DEST_CREATETIME_EDIT +Creation date/time of the destination file. + +.topic IDH_DEST_MODIFYTIME_EDIT +Last modification date/time of the destination file. + +.topic IDH_COPY_REST_ALL_BUTTON +Copies the rest of a file (only appends the missing part). Also if the task will encounter any similar situations in the future - it will automatically copy the rest of the file. + +.topic IDH_COPY_REST_BUTTON +Copies the rest of a file (only appends the missing part). + +.topic IDH_RECOPY_ALL_BUTTON +Copies file from the beginning. Also if the task will encounter any similar situations in the future - it will automatically recopy the file. + +.topic IDH_RECOPY_BUTTON +Copies file from the beginning. + +.topic IDH_IGNORE_BUTTON +Ignores this error and skips the file. + +.topic IDH_IGNORE_ALL_BUTTON +Ignores this error and skips copying the file. Also if the task will encounter any similar errors in the future - it will automatically ignore the error. Index: other/Help/English/165.txt =================================================================== diff -u --- other/Help/English/165.txt (revision 0) +++ other/Help/English/165.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,38 @@ +.topic 2 +Cancels the whole task. + +.topic IDH_FILENAME_EDIT +Name of the source file. + +.topic IDH_FILESIZE_EDIT +Size of the source file. + +.topic IDH_CREATETIME_EDIT +Creation date/time of the source file. + +.topic IDH_MODIFY_TIME_EDIT +Last mofification date/time of the source file. + +.topic IDH_DEST_FILENAME_EDIT +Name of the destination file. + +.topic IDH_DEST_FILESIZE_EDIT +Size of the destination file. + +.topic IDH_DEST_CREATETIME_EDIT +Creation date/time of the destination file. + +.topic IDH_DEST_MODIFYTIME_EDIT +Last modification date/time of the destination file. + +.topic IDH_RECOPY_ALL_BUTTON +Copies file from the beginning. Also if the task will encounter any similar situations in the future - it will automatically recopy the file. + +.topic IDH_RECOPY_BUTTON +Copies file from the beginning. + +.topic IDH_IGNORE_BUTTON +Ignores this error and skips the file. + +.topic IDH_IGNORE_ALL_BUTTON +Ignores this error and skips copying the file. Also if the task will encounter any similar errors in the future - it will automatically ignore the error. Index: other/Help/English/167.txt =================================================================== diff -u --- other/Help/English/167.txt (revision 0) +++ other/Help/English/167.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 2 +Cancels the whole task. + +.topic IDH_FILENAME_EDIT +Specifies the name of the file that could not be opened. + +.topic IDH_MESSAGE_EDIT +Specifies the error description - the reason for which the file could not be opened. + +.topic IDH_RETRY_BUTTON +Retries the opening operation. + +.topic IDH_IGNORE_BUTTON +Ignores the error and skips copying the file. + +.topic IDH_IGNORE_ALL_BUTTON +Ignores the error and skips copying the file. Also if the task will encounter any similar errors in the future - it will automatically ignore the error. + +.topic IDH_WAIT_BUTTON +Changes state of the task to an error. If the configuration option 'Auto resume on error' is set - the task will be resumed in a configured time. Index: other/Help/English/173.txt =================================================================== diff -u --- other/Help/English/173.txt (revision 0) +++ other/Help/English/173.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 2 +Cancels the whole task. + +.topic IDH_HEADER_STATIC +Displays the info about an error. Contains the destination path in which there is not enough space. + +.topic IDH_FILES_LIST +Displays the list of files that are to be copied to the destination location. + +.topic IDH_REQUIRED_STATIC +Specifies required free space needed to copy the files. + +.topic IDH_AVAILABLE_STATIC +Specifies available space in the destination location. + +.topic IDH_RETRY_BUTTON +Tries again to continue copying. + +.topic IDH_IGNORE_BUTTON +Ignores this error and continues copying. \ No newline at end of file Index: other/Help/English/182.txt =================================================================== diff -u --- other/Help/English/182.txt (revision 0) +++ other/Help/English/182.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2 @@ +.topic 2 +Cancels the shutdown sequence and closes this dialog box. \ No newline at end of file Index: other/Help/English/195.txt =================================================================== diff -u --- other/Help/English/195.txt (revision 0) +++ other/Help/English/195.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,89 @@ +.topic 1 +Closes the window and saves the data. + +.topic 2 +Closes the window and discards the data. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_FILTER_CHECK +Enables the inclusion mask filtering. The file names have to match one of these masks to be copied. + +.topic IDH_FILTER_COMBO +Enter the needed inclusion masks here. If you want to enter more than one mask you should separate them by the '|' sign. + +.topic IDH_EXCLUDEMASK_CHECK +Enables the exclusion mask filtering. The file names must *not* match none of these masks to be copied. + +.topic IDH_FILTEREXCLUDE_COMBO +Enter the needed exclusion masks here. If you want to enter more than one mask you should separate them by the '|' sign. + +.topic IDH_SIZE_CHECK +Enables the file sizes filtering. The file to be copied must match the settings below to be copied. + +.topic IDH_SIZETYPE1_COMBO +Specifies the relation between size of the source file and the size specified on the right that needs to be meet for the file to be copied. + +.topic IDH_SIZE1_EDIT +Specifies the size to which the source file size will be compared. + +.topic IDH_SIZE1MULTI_COMBO +The multiplier for the value on the left. + +.topic IDH_SIZE2_CHECK +Enables the second file sizes filtering. The file to be copied must match the settings above and on the right to be copied. + +.topic IDH_SIZETYPE2_COMBO +Specifies the second relation between size of the source file and the size specified on the right that needs to be met for the file to be copied. + +.topic IDH_SIZE2_EDIT +Specifies the size to which the source file size will be compared. + +.topic IDH_SIZE2MULTI_COMBO +The multiplier for the value on the left. + +.topic IDH_DATE_CHECK +Enables filtering files by its' dates and times. + +.topic IDH_DATETYPE_COMBO +Type of date/time that will be processed when comparing source file's date/time with the specified one. + +.topic IDH_DATE1TYPE_COMBO +Specifies the relation between date/time of the source file and the specified date and/or time that needs to be met for the file to be copied. + +.topic IDH_DATE1_DATETIMEPICKER +Specifies the date that will be compared to the source file's date. Needs to be met for the file to be copied. Used only if checked. + +.topic IDH_TIME1_DATETIMEPICKER +Specifies the time that will be compared to the source file's time. Needs to be met for the file to be copied. Used only if checked. + +.topic IDH_DATE2_CHECK +Enables filtering files by its' dates and times (second section). + +.topic IDH_DATE2TYPE_COMBO +Specifies the second relation between date/time of the source file and the specified date and/or time that needs to be met for the file to be copied. + +.topic IDH_DATE2_DATETIMEPICKER +Specifies the second date that will be compared to the source file's date. Needs to be met for the file to be copied. Used only if checked. + +.topic IDH_TIME2_DATETIMEPICKER +Specifies the second time that will be compared to the source file's time. Needs to be met for the file to be copied. Used only if checked. + +.topic IDH_ATTRIBUTES_CHECK +Enables filterinf files by their attributes. + +.topic IDH_ARCHIVE_CHECK +Allows filtering by the 'Archive' attribute. If unchecked - the attribute must not be set for a file to be copied, if checked - must be set and if grayed - it does not matter. + +.topic IDH_READONLY_CHECK +Allows filtering by the 'Read only' attribute. If unchecked - the attribute must not be set for a file to be copied, if checked - must be set and if grayed - it does not matter. + +.topic IDH_HIDDEN_CHECK +Allows filtering by the 'Hidden' attribute. If unchecked - the attribute must not be set for a file to be copied, if checked - must be set and if grayed - it does not matter. + +.topic IDH_SYSTEM_CHECK +Allows filtering by the 'System' attribute. If unchecked - the attribute must not be set for a file to be copied, if checked - must be set and if grayed - it does not matter. + +.topic IDH_DIRECTORY_CHECK +Allows filtering by the 'Directory' attribute. If unchecked - the attribute must not be set for a file to be copied, if checked - must be set and if grayed - it does not matter. Index: other/Help/English/208.txt =================================================================== diff -u --- other/Help/English/208.txt (revision 0) +++ other/Help/English/208.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,35 @@ +.topic 1 +Saves all the changes made in this dialog box and closes it. + +.topic 2 +Discards all changes made in this dialog box. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_SHORTCUT_LIST +List of currently defined shortcuts. You can edit them by using the elements below. + +.topic IDH_UP_BUTTON +Moves the selected shortcut(s) up by one position. + +.topic IDH_DOWN_BUTTON +Moves the selected shortcut(s) down by one position. + +.topic IDH_NAME_EDIT +Specifies name of the shortcut. + +.topic IDH_PATH_COMBOBOXEX +Specifies path of the shortcut. You can enter the path manually or by using the '...' button on the right. + +.topic IDH_BROWSE_BUTTON +Browses for a path that will be displayed in the window on the left. + +.topic IDH_ADD_BUTTON +Adds the shortcut defined by the edit and combo box above to the shortcut's list. + +.topic IDH_CHANGE_BUTTON +Changes the selected shortcut in the list with the one defined by the edit and combo box above. + +.topic IDH_DELETE_BUTTON +Deletes selected shortcut from the list. \ No newline at end of file Index: other/Help/English/209.txt =================================================================== diff -u --- other/Help/English/209.txt (revision 0) +++ other/Help/English/209.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,26 @@ +.topic 1 +Exits this dialog box and saves the changes. + +.topic 2 +Exit this dialog box without saving the changes. + +.topic IDH_HELP_BUTTON +Displays help information for this dialog box. + +.topic IDH_RECENT_LIST +The list of recently used paths. You can manage them by the elements below. + +.topic IDH_PATH_EDIT +Displays path either at the list's current selection or a new one - specifies by user. May be changed manually by entering the path from keyboard or by the '...' button on the right. + +.topic IDH_BROWSE_BUTTON +Browses for a path that will be displayed in the window on the left. + +.topic IDH_ADD_BUTTON +Adds the entered path into the list. + +.topic IDH_CHANGE_BUTTON +Replaces the list's current selection with an entered path. + +.topic IDH_DELETE_BUTTON +Deletes current selection from the list. \ No newline at end of file Index: other/Help/English/HTMLDefines.h =================================================================== diff -u --- other/Help/English/HTMLDefines.h (revision 0) +++ other/Help/English/HTMLDefines.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,295 @@ +// Help Map file generated from application's resource.h file. + +// Commands (ID_* and IDM_*) +#define HID_POPUP_SHOW_STATUS 0x8005 +#define HID_POPUP_TIME_CRITICAL 0x8006 +#define HID_POPUP_HIGHEST 0x8007 +#define HID_POPUP_ABOVE_NORMAL 0x8008 +#define HID_POPUP_NORMAL 0x8009 +#define HID_POPUP_BELOW_NORMAL 0x800A +#define HID_POPUP_LOWEST 0x800B +#define HID_POPUP_IDLE 0x800C +#define HID_POPUP_CUSTOM_BUFFERSIZE 0x8019 +#define HID_POPUP_OPTIONS 0x8022 +#define HID_SHOW_MINI_VIEW 0x8023 +#define HID_POPUP_CUSTOM_COPY 0x8024 +#define HID_POPUP_REPLACE_PATHS 0x8025 +#define HID_POPUP_MONITORING 0x8026 +#define HID_POPUP_SHUTAFTERFINISHED 0x8027 +#define HID_POPUP_REGISTERDLL 0x8029 +#define HID_POPUP_UNREGISTERDLL 0x802A +#define HID_POPUP_HELP 0x802E +#define HID_POPUP_TEMP 0x802F + +// Prompts (IDP_*) + +// Resources (IDR_*) +#define HIDR_MANIFEST 0x20001 +#define HIDR_MAINFRAME 0x20080 +#define HIDR_SYSTEMTYPE 0x20081 +#define HIDR_POPUP_MENU 0x20082 +#define HIDR_PRIORITY_MENU 0x20087 +#define HIDR_BUFFERSIZE_MENU 0x20088 +#define HIDR_PAUSE_LIST_MENU 0x2008A +#define HIDR_ADVANCED_MENU 0x200A0 +#define HIDR_POPUP_TOOLBAR 0x200AA +#define HIDR_THANKS_TEXT 0x200D3 + +// Dialogs (IDD_*) +#define HIDD_ABOUTBOX 0x20064 +#define HIDD_STATUS_DIALOG 0x20083 +#define HIDD_BUFFERSIZE_DIALOG 0x20089 +#define HIDD_OPTIONS_DIALOG 0x20090 +#define HIDD_MINIVIEW_DIALOG 0x20091 +#define HIDD_CUSTOM_COPY_DIALOG 0x20095 +#define HIDD_FOLDER_BROWSING_DIALOG 0x20096 +#define HIDD_NEW_FOLDER_DIALOG 0x20097 +#define HIDD_NEW_QUICK_ACCESS_DIALOG 0x20098 +#define HIDD_REPLACE_PATHS_DIALOG 0x200A1 +#define HIDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 0x200A2 +#define HIDD_FEEDBACK_REPLACE_FILES_DIALOG 0x200A4 +#define HIDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 0x200A5 +#define HIDD_FEEDBACK_DSTFILE_DIALOG 0x200A7 +#define HIDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 0x200AD +#define HIDD_SHUTDOWN_DIALOG 0x200B6 +#define HIDD_FILTER_DIALOG 0x200C3 +#define HIDD_SHORTCUTEDIT_DIALOG 0x200D0 +#define HIDD_RECENTEDIT_DIALOG 0x200D1 + +// Frame Controls (IDW_*) + +// Controls (IDC_*) +#define IDH_ABOUTBOX 0xD2 +#define IDH_PROGRAM_STATIC 0x3E8 +#define IDH_ADDFILE_BUTTON 0x3EA +#define IDH_STATUS_LIST 0x3EB +#define IDH_REMOVEFILEFOLDER_BUTTON 0x3EC +#define IDH_ALL_PROGRESS 0x3ED +#define IDH_DESTPATH_EDIT 0x3EE +#define IDH_TASK_PROGRESS 0x3EF +#define IDH_DESTBROWSE_BUTTON 0x3F0 +#define IDH_OPERATION_COMBO 0x3F1 +#define IDH_FILTERS_LIST 0x3F2 +#define IDH_ADDDIR_BUTTON 0x3F3 +#define IDH_BUFFERSIZES_LIST 0x3F4 +#define IDH_SET_BUFFERSIZE_BUTTON 0x3F5 +#define IDH_FILTERS_CHECK 0x3F6 +#define IDH_IGNOREFOLDERS_CHECK 0x3F7 +#define IDH_SET_PRIORITY_BUTTON 0x3F8 +#define IDH_ONLYSTRUCTURE_CHECK 0x3F9 +#define IDH_PAUSE_BUTTON 0x3FA +#define IDH_STANDARD_CHECK 0x3FB +#define IDH_FORCEDIRECTORIES_CHECK 0x3FC +#define IDH_RESUME_BUTTON 0x3FD +#define IDH_CANCEL_BUTTON 0x3FE +#define IDH_ADVANCED_CHECK 0x3FF +#define IDH_BUFFERSIZES_BUTTON 0x400 +#define IDH_ADDFILTER_BUTTON 0x401 +#define IDH_REMOVEFILTER_BUTTON 0x402 +#define IDH_SOURCE_STATIC 0x403 +#define IDH_DESTINATION_STATIC 0x404 +#define IDH_OPERATION_STATIC 0x405 +#define IDH_BUFFERSIZE_STATIC 0x406 +#define IDH_PRIORITY_STATIC 0x407 +#define IDH_ERRORS_STATIC 0x408 +#define IDH_PROGRESS_STATIC 0x409 +#define IDH_TRANSFER_STATIC 0x40A +#define IDH_OVERALL_PROGRESS_STATIC 0x40B +#define IDH_OVERALL_TRANSFER_STATIC 0x40C +#define IDH_TIME_STATIC 0x40D +#define IDH_ROLL_UNROLL_BUTTON 0x40E +#define IDH_SIZE_EDIT 0x40F +#define IDH_ASSOCIATEDFILES__STATIC 0x410 +#define IDH_START_ALL_BUTTON 0x411 +#define IDH_RESTART_BUTTON 0x412 +#define IDH_DELETE_BUTTON 0x413 +#define IDH_PAUSE_ALL_BUTTON 0x414 +#define IDH_RESTART_ALL_BUTTON 0x415 +#define IDH_CANCEL_ALL_BUTTON 0x416 +#define IDH_REMOVE_FINISHED_BUTTON 0x417 +#define IDH_PROPERTIES_LIST 0x418 +#define IDH_PROGRESS_LIST 0x419 +#define IDH_SOURCE_EDIT 0x41A +#define IDH_DESTINATION_EDIT 0x41B +#define IDH_DIRECTORY_TREE 0x41D +#define IDH_QUICK_ACCESS_LIST 0x41E +#define IDH_PATH_EDIT 0x41F +#define IDH_HEADER_TEXT_STATIC 0x420 +#define IDH_FIND_PATH_BUTTON 0x421 +#define IDH_NEW_FOLDER_BUTTON 0x422 +#define IDH_PATH_STATIC 0x423 +#define IDH_ADD_BUTTON 0x424 +#define IDH_REMOVE_BUTTON 0x425 +#define IDH_TITLE_EDIT 0x426 +#define IDH_BROWSE_BUTTON 0x428 +#define IDH_FILES_LIST 0x429 +#define IDH_ADD_DIRECTORY_BUTTON 0x42A +#define IDH_MASK_EDIT 0x42B +#define IDH_OPERATION_TYPE_COMBO 0x42C +#define IDH_ADD_FILES_BUTTON 0x42D +#define IDH_BUFFERSIZE_EDIT 0x42E +#define IDH_PRIORITY_COMBO 0x42F +#define IDH_IGNORE_FOLDERS_CHECK 0x431 +#define IDH_ONLY_CREATE_CHECK 0x432 +#define IDH_ADVANCED_BUTTON 0x435 +#define IDH_PATHS_LIST 0x436 +#define IDH_FILENAME_EDIT 0x440 +#define IDH_FILESIZE_EDIT 0x441 +#define IDH_DESTFILENAME_EDIT 0x442 +#define IDH_CREATETIME_EDIT 0x443 +#define IDH_MODIFY_TIME_EDIT 0x444 +#define IDH_DEST_FILENAME_EDIT 0x445 +#define IDH_DEST_FILESIZE_EDIT 0x446 +#define IDH_DEST_CREATETIME_EDIT 0x447 +#define IDH_DEST_MODIFYTIME_EDIT 0x448 +#define IDH_IGNORE_BUTTON 0x449 +#define IDH_IGNORE_ALL_BUTTON 0x44A +#define IDH_WAIT_BUTTON 0x44B +#define IDH_RETRY_BUTTON 0x44C +#define IDH_COPY_REST_BUTTON 0x44F +#define IDH_RECOPY_BUTTON 0x450 +#define IDH_COPY_REST_ALL_BUTTON 0x452 +#define IDH_RECOPY_ALL_BUTTON 0x453 +#define IDH_MESSAGE_EDIT 0x458 +#define IDH_COUNT_EDIT 0x45F +#define IDH_SHOW_LOG_BUTTON 0x460 +#define IDH_STICK_BUTTON 0x462 +#define IDH_FREESPACE_STATIC 0x463 +#define IDH_DISK_STATIC 0x464 +#define IDH_REQUIRED_STATIC 0x467 +#define IDH_AVAILABLE_STATIC 0x468 +#define IDH_TEST_BUTTON 0x469 +#define IDH_SOURCEFILENAME_EDIT 0x46A +#define IDH_YESALL_BUTTON 0x46B +#define IDH_NOALL_BUTTON 0x46C +#define IDH_DEFAULTMULTIPLIER_COMBO 0x46D +#define IDH_DEFAULTSIZE_EDIT 0x46E +#define IDH_ONEDISKSIZE_EDIT 0x46F +#define IDH_CHANGEBUFFER_BUTTON 0x471 +#define IDH_ONEDISKMULTIPLIER_COMBO 0x472 +#define IDH_TWODISKSSIZE_EDIT 0x473 +#define IDH_TWODISKSMULTIPLIER_COMBO 0x474 +#define IDH_CDROMSIZE_EDIT 0x475 +#define IDH_CDROMMULTIPLIER_COMBO 0x476 +#define IDH_LANSIZE_EDIT 0x477 +#define IDH_LANMULTIPLIER_COMBO 0x478 +#define IDH_ONLYDEFAULT_CHECK 0x479 +#define IDH_TIME_PROGRESS 0x47A +#define IDH_ERRORS_EDIT 0x47B +#define IDH_FILTER_COMBO 0x47D +#define IDH_FILTER_CHECK 0x47E +#define IDH_SIZE_CHECK 0x47F +#define IDH_SIZE1_EDIT 0x480 +#define IDH_SIZE1MULTI_COMBO 0x481 +#define IDH_SIZETYPE1_COMBO 0x482 +#define IDH_SIZE1_SPIN 0x483 +#define IDH_SIZE2_EDIT 0x484 +#define IDH_SIZE2MULTI_COMBO 0x485 +#define IDH_SIZETYPE2_COMBO 0x486 +#define IDH_SIZE2_SPIN 0x487 +#define IDH_SIZE2_CHECK 0x488 +#define IDH_DATE_CHECK 0x489 +#define IDH_ATTRIBUTES_CHECK 0x48A +#define IDH_ARCHIVE_CHECK 0x48B +#define IDH_READONLY_CHECK 0x48C +#define IDH_HIDDEN_CHECK 0x48D +#define IDH_SYSTEM_CHECK 0x48E +#define IDH_DATETYPE_COMBO 0x48F +#define IDH_DATE1TYPE_COMBO 0x490 +#define IDH_DATE1_DATETIMEPICKER 0x491 +#define IDH_TIME1_DATETIMEPICKER 0x492 +#define IDH_DATE2_CHECK 0x493 +#define IDH_DATE2TYPE_COMBO 0x494 +#define IDH_DATE2_DATETIMEPICKER 0x495 +#define IDH_TIME2_DATETIMEPICKER 0x496 +#define IDH_DIRECTORY_CHECK 0x497 +#define IDH_FILTEREXCLUDE_COMBO 0x498 +#define IDH_EXCLUDEMASK_CHECK 0x499 +#define IDH_COUNT_SPIN 0x49A +#define IDH_DESTPATH_COMBOBOXEX 0x49B +#define IDH_SHORTCUT_LIST 0x49C +#define IDH_NAME_EDIT 0x49D +#define IDH_PATH_COMBOBOXEX 0x49E +#define IDH_CHANGE_BUTTON 0x4A1 +#define IDH_RECENT_LIST 0x4A6 +#define IDH_IMPORT_BUTTON 0x4A7 +#define IDH_UP_BUTTON 0x4A8 +#define IDH_DOWN_BUTTON 0x4A9 +#define IDH_THANX_EDIT 0x4AE +#define IDH_COPYRIGHT_STATIC 0x4AF +#define IDH_FOLDER_TREE 0x4B0 +#define IDH_DISTRIBUTION_STATIC 0x4B0 +#define IDH_NEWFOLDER_BUTTON 0x4B1 +#define IDH_HOMEPAGE_STATIC 0x4B1 +#define IDH_TITLE_STATIC 0x4B2 +#define IDH_HOMEPAGELINK_STATIC 0x4B2 +#define IDH_LARGEICONS_BUTTON 0x4B3 +#define IDH_CONTACT_STATIC 0x4B3 +#define IDH_HOMEPAGELINK2_STATIC 0x4B3 +#define IDH_SMALLICONS_BUTTON 0x4B4 +#define IDH_GENFORUM_STATIC 0x4B4 +#define IDH_LIST_BUTTON 0x4B5 +#define IDH_DEVFORUM_STATIC 0x4B5 +#define IDH_REPORT_BUTTON 0x4B6 +#define IDH_CONTACT1LINK_STATIC 0x4B6 +#define IDH_CONTACT2LINK_STATIC 0x4B7 +#define IDH_GENFORUMPAGELINK_STATIC 0x4B8 +#define IDH_TOGGLE_BUTTON 0x4B9 +#define IDH_GENFORUMSUBSCRIBELINK_STATIC 0x4B9 +#define IDH_ADDSHORTCUT_BUTTON 0x4BA +#define IDH_GENFORUMUNSUBSCRIBELINK_STATIC 0x4BA +#define IDH_REMOVESHORTCUT_BUTTON 0x4BB +#define IDH_GENFORUMSENDLINK_STATIC 0x4BB +#define IDH_DEVFORUMPAGELINK_STATIC 0x4BC +#define IDH_DEVFORUMSUBSCRIBELINK_STATIC 0x4BD +#define IDH_DEVFORUMUNSUBSCRIBELINK_STATIC 0x4BE +#define IDH_DEVFORUMSENDLINK_STATIC 0x4BF +#define IDH_THANX_STATIC 0x4C0 +#define IDH_UPX_STATIC 0x4C1 +#define IDH_CONTACT3LINK_STATIC 0x4C1 +#define IDH_APPLY_BUTTON 0x4C2 +#define IDH_001_STATIC 0x4C3 +#define IDH_002_STATIC 0x4C4 +#define IDH_003_STATIC 0x4C5 +#define IDH_004_STATIC 0x4C6 +#define IDH_005_STATIC 0x4C7 +#define IDH_006_STATIC 0x4C8 +#define IDH_007_STATIC 0x4C9 +#define IDH_008_STATIC 0x4CA +#define IDH_009_STATIC 0x4CB +#define IDH_010_STATIC 0x4CC +#define IDH_011_STATIC 0x4CD +#define IDH_012_STATIC 0x4CE +#define IDH_013_STATIC 0x4CF +#define IDH_014_STATIC 0x4D0 +#define IDH_015_STATIC 0x4D1 +#define IDH_016_STATIC 0x4D2 +#define IDH_017_STATIC 0x4D3 +#define IDH_018_STATIC 0x4D4 +#define IDH_019_STATIC 0x4D5 +#define IDH_020_STATIC 0x4D6 +#define IDH_021_STATIC 0x4D7 +#define IDH_022_STATIC 0x4D8 +#define IDH_023_STATIC 0x4D9 +#define IDH_024_STATIC 0x4DA +#define IDH_025_STATIC 0x4DB +#define IDH_026_STATIC 0x4DC +#define IDH_027_STATIC 0x4DD +#define IDH_028_STATIC 0x4DE +#define IDH_029_STATIC 0x4DF +#define IDH_030_STATIC 0x4E0 +#define IDH_BAR1_STATIC 0x4E1 +#define IDH_BAR2_STATIC 0x4E2 +#define IDH_BAR3_STATIC 0x4E3 +#define IDH_BAR4_STATIC 0x4E4 +#define IDH_BAR5_STATIC 0x4E5 +#define IDH_HEADER_STATIC 0x4E6 +#define IDH_HOSTLINK_STATIC 0x4E7 +#define IDH_HELP_BUTTON 0x4E9 +#define IDH_PROGRAM_STATICEX 0x4EF +#define IDH_FULLVERSION_STATICEX 0x4F0 +#define IDH_HOMEPAGE_STATICEX 0x4F1 +#define IDH_CONTACT_STATICEX 0x4F2 +#define IDH_LICENSE_STATICEX 0x4F3 +#define IDH_CONTACTAUTHOR_STATICEX 0x4F4 +#define IDH_CONTACTSUPPORT_STATICEX 0x4F5 Index: other/Help/English/advmenu.htm =================================================================== diff -u --- other/Help/English/advmenu.htm (revision 0) +++ other/Help/English/advmenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,23 @@ + + + + + + +Advanced context menu + + + +
+Advanced context menu is placed in the status dialog. +
    +
  • Change paths... - allows user to change some source paths (ie. when copying files from c:\windows you restart the computer and after it the drive letter from c changed to d you can change the source path from c:\windows to d:\windows). Command opens the replace paths dialog.
  • +
+
+
+ + + + Index: other/Help/English/buffersize.htm =================================================================== diff -u --- other/Help/English/buffersize.htm (revision 0) +++ other/Help/English/buffersize.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,29 @@ + + + + + + +Buffer size dialog + + + +
+This dialog may be displayed through the configuration dialog in 'Buffer' section or through the status dialog. + +
    +
  • Default - default buffer size. Used when the configuration option 'Use only default buffer' (in section 'Buffer') is set, or when none of the other buffer sizes doesn't match the current situation.
  • +
  • For copying inside one disk boundary - Buffer is used when the source files and the destination folder lies on the same physical disk. Size of that buffer is usually bigger than the standard two-disks buffer, because if you copy data in bigger packs you do not burden your hard disk as much as when you use small buffers.
  • +
  • For copying between two different disks - The buffer is used when you copy data from one physical hard disk to another one.
  • +
  • For copying with CD-ROM use - This buffer size is used when you copy something between CD-ROM and any other storage medium.
  • +
  • For copying with network use - This buffer size is used when you copy something from or to the local network.
  • +
  • Use only default buffer - when this option is checked, the task(s) will always use the default buffer size ignoring type of source and destination storage medium.
  • +
+
+
+ + + + Index: other/Help/English/bugs.htm =================================================================== diff -u --- other/Help/English/bugs.htm (revision 0) +++ other/Help/English/bugs.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,29 @@ + + + + + + +Known bugs/issues + + + +
+ +
    +
  • moving data over the network always causes files' contents to be copied, but in some cases it could be done without copying (ie. when browsing local computer through the Network Neighbourhood).
  • + +
  • intercepting drag&drop operations by program (by left mouse button) doesn't work on older systems (especially Windows 98 and 95).
  • + +
  • drawing icons in explorer context menus doesn't work on older Windows versions
  • +
  • when copying many small files the program is rather slow
  • + +
+
+
+ + + + Index: other/Help/English/ch.gif =================================================================== diff -u Binary files differ Index: other/Help/English/customcopy.htm =================================================================== diff -u --- other/Help/English/customcopy.htm (revision 0) +++ other/Help/English/customcopy.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ + + + + + + +Custom copy dialog + + + +
+ +
    +
  • Source files/folders - contains list of files and folders that are to be copied. You can manage these items by the buttons on the right.
  • +
  • Add file(s)... button - allows user to add one or more files to the source list
  • +
  • Add folder - allows user to add a folder to a source list
  • +
  • Delete - deletes selected items from source list.
  • +
  • Import... - allows user to import source files and folders from the file. Each line of the file should contain one full file or folder path.
  • +
  • Destination folder - allows user to enter destination path into which the source files will be copied or moved. You can change it manually be entering path from keyboard or by clicking the '...' button on the right.
  • +
  • Operation type - specifies operation that will be performed on source files
  • +
  • Priority - specifies thread priority at which the working thread will work.
  • +
  • Count of copies - specifies count of copies of the source files that should be performed. Possible values are from range 0..~240. This is useful when copying something small to the failure-prone storage medium (ie. floppy disk).
  • +
  • Buffer sizes - specifies sizes of the buffer that will be used to copy or move the source data into destination location
  • +
  • Filtering - when checked - allows user to specify filters to be used when copying. Buttons at right side allow user to add or remove a filter. Add button opens the filter dialog.
  • +
  • +Advanced options +
      +
    • Do not create destination directories - copy files loosely to destination folder - when selected it causes task not to create destination directories and to copy all found files in every searched folder to the destination folder, but without creating the folders that are usually created.
    • +
    • Create directory structure in the destination folder (relatively to root directory) - when copying files program will create the whole path found on source media in the destination directory.
    • +
    • Do not copy/move the contents of files - only create it (empty) - acts as a normal copyin/moving, but does not copy the contents of files. The destination files will be empty. Be careful when moving data that way.
    • +
    +
+ +
+
+ + + + Index: other/Help/English/explorermenu.htm =================================================================== diff -u --- other/Help/English/explorermenu.htm (revision 0) +++ other/Help/English/explorermenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ + + + + + + +Explorer's context menus + + + +
+When using shell integration some items (commands) are added to explorer context menus. There are two types of explorer menus which are modified by the Copy Handler: +
    +
  • +Drag&drop context menu - displayed when you drag some files and/or folders from one place to another by right mouse button. +
      +
    • (CH) Copy here - copies the dragged files to the place where the files were dropped
    • +
    • (CH) Move here - moves the dragged files to the place where the files were dropped
    • +
    • (CH) Copy/move special... - opens the custom copy dialog where you can adjust some settings regarding the drag&drop operation.
    • +
    +
  • +
  • +Standard context menu - Displayed when you click on any file or folder (or folder background). +
      +
    • (CH) Paste - enabled only when menu was opened by r-clicking on the folder or folder's background and when in clipboard there are some files or folders. Works the same way the normal Windows paste command, but the operation is processed by Copy Handler instead of Windows.
    • +
    • (CH) Paste special... - enabled only when menu was opened by r-clicking on the folder or folder's background and when in clipboard there are some files or folders. Works a bit similar to the previous option, but displays custom copy dialog where user can adjust some settings before operation begins.
    • +
    • (CH) Copy to - expandable menu. Enabled only when menu was opened by r-clicking on file or folder (not folder background) and when there is at least one shortcut defined in configuration section 'Shortcuts'. Copies the selected files to the location where the selected shortcut points.
    • +
    • (CH) Move to - command almost identical to the above one, but instead of copying it moves files and foldeers.
    • +
    • (CH) Copy/move special to... - works similarly to the 'copy to' command, but displays the +custom copy dialog where user can adjust some settings before operation starts.
    • +
    +
  • +
+ +Each command in explorer's context menus may be enabled or disabled in configuration dialog in section 'Shell'. +
+
+ + + + Index: other/Help/English/faq.htm =================================================================== diff -u --- other/Help/English/faq.htm (revision 0) +++ other/Help/English/faq.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,21 @@ + + + + + + +F.A.Q. + + + +
+Q: Why does the commands (CH) Copy to, (CH) Move to and (CH) Copy/move to special... in the explorer context menu are grayed out ?

+A: To make theses options appear active you have to define some shortcuts in the configuration dialog in the section "Shortcuts". These shortcuts defines some frequently used destination locations that would be displayed under the commands mentioned above.

+
+
+
+See also: Configuration dialog +
+ + + Index: other/Help/English/feeddstfile.htm =================================================================== diff -u --- other/Help/English/feeddstfile.htm (revision 0) +++ other/Help/English/feeddstfile.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,28 @@ + + + + + + +Feedback dialog - cannot open destination file for writing + + + +
+This dialog is being shown by a task, when the processing thread cannot open the destination file for writing. +The dialog displays which file couldn't be open and the error code. +
    +
  • Retry - tries again to open the file for writing.
  • +
  • Ignore - ignores this error and skips the file.
  • +
  • Ignore all - like the above button, but also ignores the next errors of this type.
  • +
  • Wait - changes state of the task to error. If the configuration option 'Auto resume on error' is set - the task will be resumed in a configured time.
  • +
  • Cancel - cancels the task.
  • +
+
+
+ + + + Index: other/Help/English/feediwr.htm =================================================================== diff -u --- other/Help/English/feediwr.htm (revision 0) +++ other/Help/English/feediwr.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,30 @@ + + + + + + +Feedback dialog - cannot open source file + + + +
+This dialog is displayed by the task when the working thread cannot open the source file to be copied. Dialog displays info about expected file and the found one. Also shows the encountered error. +
    +
  • Retry - tries again to open the source file.
  • +
  • Ignore - ignores this error and skips the file.
  • +
  • Ignore all - like the above button, but also ignores the next errors of this type.
  • +
  • Wait - changes state of the task to error. If the configuration option 'Auto resume on error' is set - the task will be resumed in a configured time.
  • +
  • Cancel - cancels the task.
  • +
+
+
+ + + + Index: other/Help/English/feednotenoughroom.htm =================================================================== diff -u --- other/Help/English/feednotenoughroom.htm (revision 0) +++ other/Help/English/feednotenoughroom.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,30 @@ + + + + + + +Feedback dialog - not enough free space + + + +
+This dialog is displayed when there is not enough free space in the destination location to copy or move the source files. +Dialog automatically refreshes the count of free space on drive. +
    +
  • Retry - tries again to copy the files.
  • +
  • Continue - ignores missing free space and continues copying.
  • +
  • Cancel - cancels the task.
  • +
+
+
+ + + + Index: other/Help/English/feedreplacefiles.htm =================================================================== diff -u --- other/Help/English/feedreplacefiles.htm (revision 0) +++ other/Help/English/feedreplacefiles.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,40 @@ + + + + + + +Feedback dialog - smaller destination file found + + + +
+This dialog is displayed when the working thread finds that there is a file in the destination location that is smaller than the file being copied. The possible reasons are: +
    +
  • there is an older version of the file in the destination location; in that case you should recopy the file
  • +
  • there is a part of the file being copied in the destination location; the file were not copied to the end; you should copy rest the file
  • +
+
+Possible operations: +
    +
  • Copy rest - copies the rest of a file.
  • +
  • Copy rest all - as above, but does the 'Copy rest' for all subsequent situations, where the destination file is smaller than the source one.
  • +
  • Recopy - recopies the whole file from the beginning
  • +
  • Recopy all - like the above, but does the 'Recopy' for all subsequent situations, where the destination file is smaller than the source one.
  • +
  • Ignore - ignores this info, and skips the file.
  • +
  • Ignore all - like the above button, but also ignores the next infos of this type.
  • +
  • Cancel - cancels the task.
  • +
+
+
+ + + + + Index: other/Help/English/feedsmallreplace.htm =================================================================== diff -u --- other/Help/English/feedsmallreplace.htm (revision 0) +++ other/Help/English/feedsmallreplace.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,32 @@ + + + + + + +Feedback dialog - destination file found + + + +
+This dialog is displayed when the working thread finds that there is a file in the destination location that is greater or equal in size to file being copied. If the files are identical - you should ignore. But if they differs you should recopy. + +
    +
  • Recopy - recopies the whole file from the beginning
  • +
  • Recopy all - like the above, but does the 'Recopy' for all subsequent situations, where the destination file is greater or equal in size to source one.
  • +
  • Ignore - ignores this info, and skips the file.
  • +
  • Ignore all - like the above button, but also ignores the next infos of this type.
  • +
  • Cancel - cancels the task.
  • +
+
+
+ + + + Index: other/Help/English/filterdlg.htm =================================================================== diff -u --- other/Help/English/filterdlg.htm (revision 0) +++ other/Help/English/filterdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,29 @@ + + + + + + +Filter dialog + + + +
+This dialog could be displayed only from the custom copy dialog for adding/changing the filtering options for the task. +
    +
  • Include mask - you may enter the mask of files that will be copied (ie. *.jpg - copies only the jpg files). If you want to specify more than one mask - separate it by '|' sign - ie. *.jpg|*.gif|*.bmp.
  • +
  • Exclude mask - specifies mask of the files that will not be copied. Mask is enteres in a way described in Include mask
  • +
  • Filtering by size - allows to specify up to two size conditions from the components that lies below. Only files that matches all the conditions are copied
  • +
  • Filtering by date - allows user to specify max. two conditions regarding date and time of the file. Yo may select one of three date types (last access time, last write time and creation time).
  • +
  • By attributes - copies only files which matches the specified attibutes. Grayed check boxes means that this attribute doesn't matter.
  • +
+ +All the filter settings must match to the file attributes in order to copy the file. +
+
+
+See also: Custom copy dialog +
+ + + Index: other/Help/English/folderdlg.htm =================================================================== diff -u --- other/Help/English/folderdlg.htm (revision 0) +++ other/Help/English/folderdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ + + + + + + +Folder dialog + + + +
+This is the dialog displayed when the configuration option 'Monitoring clipboard' is enabled and some filenames are in the clipboard.

+ +The left part of the dialog contains list of shortcuts. It could be used to select path faster. The four buttons are used for changing view of the shortcut list. The two buttons below allows adding and deleting shortcuts.
+The right part of the dialog contains the tree view with folder's structure. You can select a path from it or enter the whole path manually in the combo box below. The button above creates a new folder in a currently selected folder.
+
+
+
+ + + + Index: other/Help/English/headfoot.js =================================================================== diff -u --- other/Help/English/headfoot.js (revision 0) +++ other/Help/English/headfoot.js (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ +function header(text) +{ + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write("
"); + document.write("\"CH"); + document.write("
Copy Handler help file
"); + document.write("
"); + document.write( text ); + document.write("
"); + document.write("

"); +} + +function footer() +{ + document.write("
"); + document.write("
"); + document.write("
Copyright � 2003-2004 J�zef Starosczyk.
"); + document.write("
"); + document.write("
"); +} \ No newline at end of file Index: other/Help/English/help.hhc =================================================================== diff -u --- other/Help/English/help.hhc (revision 0) +++ other/Help/English/help.hhc (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,148 @@ + + + + + + + + + + +
    +
  • + + + +
  • + + + +
  • + + +
      +
    • + + + +
    • + + + +
    • + + + +
    +
  • + + +
      +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    +
  • + + +
      +
    • + + + +
    • + + + +
    +
  • + + + +
  • + + + +
  • + + + +
  • + + + +
+ Index: other/Help/English/help.hhk =================================================================== diff -u --- other/Help/English/help.hhk (revision 0) +++ other/Help/English/help.hhk (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,698 @@ + + + + + + +
    +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + + + + + + + + + +
  • + + + + + + +
  • + + + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
+ Index: other/Help/English/help.hhp =================================================================== diff -u --- other/Help/English/help.hhp (revision 0) +++ other/Help/English/help.hhp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,91 @@ +[OPTIONS] +Auto Index=Yes +Binary TOC=Yes +Compatibility=1.1 or later +Compiled file=English.chm +Contents file=help.hhc +Default topic=welcome.htm +Display compile notes=No +Display compile progress=No +Full-text search=Yes +Index file=help.hhk +Language=0x409 Angielski (Stany Zjednoczone) +Title=Copy Handler help file + + +[FILES] +advmenu.htm +buffersize.htm +bugs.htm +customcopy.htm +explorermenu.htm +feeddstfile.htm +feediwr.htm +feednotenoughroom.htm +feedreplacefiles.htm +feedsmallreplace.htm +filterdlg.htm +folderdlg.htm +history.htm +installation.htm +license.htm +mainmenu.htm +miniview.htm +options.htm +recentdlg.htm +replacepaths.htm +requirements.htm +shortcutsdlg.htm +shutdowndlg.htm +status.htm +support.htm +thanks.htm +using.htm +welcome.htm +reporting.htm +faq.htm +ch.gif +style.css + +[ALIAS] +HIDD_BUFFERSIZE_DIALOG=buffersize.htm +HIDD_CUSTOM_COPY_DIALOG=customcopy.htm +HIDD_FEEDBACK_DSTFILE_DIALOG=feeddstfile.htm +HIDD_FEEDBACK_IGNOREWAITRETRY_DIALOG=feediwr.htm +HIDD_FEEDBACK_NOTENOUGHPLACE_DIALOG=feednotenoughroom.htm +HIDD_FEEDBACK_REPLACE_FILES_DIALOG=feedreplacefiles.htm +HIDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG=feedsmallreplace.htm +HIDD_FILTER_DIALOG=filterdlg.htm +HIDD_MINIVIEW_DIALOG=miniview.htm +HIDD_OPTIONS_DIALOG=options.htm +HIDD_RECENTEDIT_DIALOG=recentdlg.htm +HIDD_REPLACE_PATHS_DIALOG=replacepaths.htm +HIDD_SHORTCUTEDIT_DIALOG=shortcutsdlg.htm +HIDD_SHUTDOWN_DIALOG=shutdowndlg.htm +HIDD_STATUS_DIALOG=status.htm + +[MAP] +#include HTMLDefines.h + +[TEXT POPUPS] +HTMLDefines.h +0.txt +100.txt +131.txt +137.txt +144.txt +145.txt +149.txt +161.txt +162.txt +164.txt +165.txt +167.txt +173.txt +182.txt +195.txt +208.txt +209.txt + +[INFOTYPES] + Index: other/Help/English/history.htm =================================================================== diff -u --- other/Help/English/history.htm (revision 0) +++ other/Help/English/history.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,200 @@ + + + + + + +Program history/what's new + + + + +
+
    + +
  • 1.28
  • +
      +
    • Fixed bug where files which name starts with a dot were not copied.
    • +
    • Added some new translations
    • +
    • Many internal changes in the code (changed stl support to the stlPort from http://www.stlport.com)
    • +
    + +
  • 1.26
  • +
      +
    • corrected a displaying of the paths in the status dialog box
    • +
    • corrected on-the-fly language change in the task list in the status dialog box
    • +
    • corrected handling of the directory paths in configuration
    • +
    • when a "not enough free space" dialog appears it automatically disappears (now) as soon as there is enough space to perform the operation
    • +
    • change in program's file names
    • +
    • changed the handling of the languages; now they are based on text files instead of dll's
    • +
    • corrected shell extension bug (problems with the CTRL key and detecting the operation)
    • +
    • +
    + + +
  • 1.25
  • +
      +
    • added help files to the program instead of readme files
    • +
    • corrected bug when the newly created shortcuts (in folder choosing dialog) were not being saved
    • +
    • some small optimizations and corrections
    • +
    + +
  • 1.20
  • +
      +
    • this program has changed licensing to GNU General Public License (what means, that the full source code is available at http://www.copyhandler.prv.pl)
    • +
    • added language plugin support
    • +
    • changed installer to NSIS
    • +
    • optimized tray restart detection
    • +
    • modified about dialog
    • +
    • now all strings are being read from resource tables
    • +
    • modified handling of configuration - it supports now applying, and changing language on the fly
    • +
    • when registering or unregistering shell extension dll from program's menu fails - it displays error code
    • +
    • added section 'Log file' which is currently unused
    • +
    • now pasting by CH doesn't clear the clipboard
    • +
    • some small optimizations
    • +
    + +
  • 1.13i
  • +
      +
    • Corrected error connected with detecting partitions (the same disk or not the same) on newer computers or with much of hardware inside
    • +
    • Changed some texts - ie. in English there is One disk instead of OD
    • +
    • Corrected detection of floppy drive/path to floppy in choosing destination folder dialog
    • +
    • Modified some dialogs to be displayed on taskbar (ie. status window)
    • +
    • Corrected bug connected with manually entering a path in some windows - previously the count of chars depended on size of the window
    • +
    • Added french language to a program (thanx to Julien (Vk))
    • +
    • Now the executable and dll are really packed with UPX, not like in 1.13g version ;)
    • +
    + +
  • 1.13g
  • +
      +
    • corrected error connected with 'Copy to' explorer menu item (and similar ones) (in previous version it doesn't do anything)
    • +
    • added two new options connected with priority manipulation - application priority and disabling thread priority boosting
    • +
    • corrected error connected with counting free space on disk (if size of free space on disk was equal to size of resources being copied program displayed window with info about missing disk free space)
    • +
    • corrected error connected with files' copying which dates were from outside the range of 1970...2038 year (program crashed)
    • +
    • added capability of changing the shortcuts' order
    • +
    • program and dll were compressed by UPX Software
    • +
    + +
  • 1.13e
  • +
      +
    • corrected some errors in program's text - ie. missing 'special' word in context menu (in english language version)
    • +
    • corrected a little work of experimental option 'Dragging by left mouse button'
    • +
    • added function for importing file paths to copy from text file
    • +
    • added function for forcing of create full source paths in destination folder
    • +
    • the taskbar icon will automatically reappear when explorer restarts
    • +
    • additional configuration option - choosing of default action for dragging files with left mouse button (if option 'Intercept ...' is enabled)
    • +
    + +
  • 1.13
  • +
      +
    • Corrected error - commands in explorer's 'File' menu were displayed many times - the more times 'File' menu was opened the more commands appeared
    • +
    • Corrected annoying behaviour - saving state of finished/paused/cancelled tasks were done unnecessarily (ie. when using disk defragmenters operation was interrupted each time the program was saving temporary data) - now when going to one of those states the temporary data is stored only once.
    • +
    + +
  • 1.12 Final
  • +
      +
    • Little changes in polish version of program - to "more polish"
    • +
    • Changed standard path for temporary files to system TEMP folder
    • +
    • Corrected error connected with changing buffer sizes in status dialog
    • +
    • Removed unused file Quick access data.ini - contents were moved into file copy handler.ini
    • +
    • Corrected some stuff connected with incompatibilities within Windows systems - now program should properly work on Windows 95/98/Me/NT4/2000/XP
    • +
    • Changed a little (actually rewritten) dialog for choosing destination folder
    • +
    • Changed 'copy/move settings' dialog and expanded filtering capabilities
    • +
    • Corrected shell handling - additional commands and two experimental options (works only on some systems)
    • +
    • A few other things which aren't important enough to write about...
    • +
    +
  • 1.11
  • +
      +
    • added new option - chosing progress bar style in mini status (smooth/boxed)
    • +
    • corrected starting state of .ini file - ineffective buffer sizes settings
    • +
    +
  • 1.10 Final
  • +
      +
    • corrected detecting partitions lying on one physical disk
    • +
    • added setup program for handling installation
    • +
    • added info about new e-mails in about box
    • +
    • removed automatic shell extension register at program start - instead setup program will handle this
    • +
    • corrected handling of automatic program loading with system
    • +
    + +
  • 1.10 beta 4
  • +
      +
    • corrected error connected with copying data in Windows NT/2000/XP with disabled buffering
    • +
    • corrected speed of pausing, resuming, ... of tasks, especially at NT series of Windows (NT/2000/XP)
    • +
    • corrected bug connected with setting destination folder for temporary data
    • +
    • added autodetection of buffer size and 5 different buffer sizes for 5 different types of copying; changed way to enter buffer sizes, ...
    • +
    • corrected strange effects connected with large buffer sizes
    • +
    • additional options in program's main menu - registration/unregistration of shell extension DLL
    • +
    • showing status window now cause autohide of mini status
    • +
    • when entering path to sounds and to temporary folder you can use some shortcuts (these paths doesn't end with \, so you have to add it when modifying path ie. < WINDOWS >\media; paths entered that way has to be enter uppercase - < WINDOWS > instead < windows > or < Windows >; paths entered that way contain no spaces, though it may look differently):
    • +
        +
      • < WINDOWS > - windows directory (ie. c:\windows)
      • +
      • < TEMP > - directory for temporary data (ie. c:\windows\temp)
      • +
      • < SYSTEM > - system directory (ie. c:\windows\system)
      • +
      • < APPDATA > - directory for application's data (ie. c:\windows\AppData)
      • +
      • < DESKTOP > - directory with files that are places on desktop (ie. c:\windows\desktop)
      • +
      • < PERSONAL > - private directory for logged user (ie. c:\my documents)
      • +
      +
    • corrected shutdown of program (by the menu option 'exit' and by system shutdown) - now program saves its state before exit; program's shutdown was also speeded up
    • +
    • now system shutdown allows cancelling for some time and also works under Windows NT/2000/XP; additionally, when auto system shutdown after finished is enabled and none of tasks isn't currently processed - program will not shut down the system - it'll wait for any task to start; you may also set type of shutdown (force/normal)
    • +
    • corrected mini status from the point of view of cooperation with Windows NT/2000/XP - now, you can use buttons placed on caption bar of mini status
    • +
    • pressing resume button on waiting task will cause that task to start, even if normally 'limiting operations' do not allow task to start
    • +
    • if 'limit maximum operations' option is enabled - the tasks will be started in order they appear on the task list
    • +
    • changed a little handling of .log files and errors - now, except of error number there is shown info about error, and a place in program where error occurs
    • +
    • in status window added additional info about temporary file associated with given task
    • +
    • a little modifications of UI (icons were taken from Windows XP - I hope nobody would be angry), optimalizations, other...
    • +
    + +
  • 1.03
  • +
      +
    • corected many errors connected with displaying text - especially when selecting large fonts in display properties (control panel), or setting some strange color and size scheme
    • +
    • changed handling copy without buffering - previously file was copied by multiplies of buffer size. If read data size wasn't the multiply of the buffer size then program stored overfluous info to destination file, and after a moment changed size of the file to a size of source file. Now copying has a two passes - first copies files by the multiplies of buffer size, and the second the rest data (concerns only files copying with no buffering)
    • +
    • added new option in program's main menu - shutting down the systemafter finished copying
    • +
    • corrected handling of displaying dialog box informing about missing enough free space on disk - now, when copying was interrupted in a half and then resumed - when calculating needed free space there is being taken the copied part into consideration.
    • +
    • corrected (a little) visual confirmation dialogs - they're now a little more 'clean', but further they're wretched
    • +
    • corrected error - limiting count of simultaneously performed operations in some situations stops working correctly, and requires to restart program.
    • +
    • corrected moving data inside one partition boundary - previously moving data this way caused generating an error 'File exists' if there was folder or file with the same name with this being copied
    • +
    • corrected incorrectly showed progress in case copying data with disabled buffering (it may caused some other problems of which I haven't known).
    • +
    • little corrections to a tab order in many dialogs +
    + +
  • 1.02
  • +
      +
    • replaced BCMenu old version with the new one (user interface change: default item is shown with bold atribute of text)
    • +
    • now there isn't showed 0% after finished moving files (not folders) inside one partition boundary.
    • +
    • added feature for copying files without buffering (it's usable when copying large files)
    • +
        +
      • buffer sizes are rounded up to the nearest multiple of 64kB.
      • +
      • if file is being copied without buffering and has size which is not multiple of 4kB then destination file in one moment will have size greater than source file. (Attention: If in this moment copying will be interrupted, then later resumed - program will start copying from beginning, unless option of using visual confirmation dialogs is set to heavy).
      • +
      • there are two new options - first allows enabling/disabling of using copy wihout buffering, the secode allows to specify minimal file size, which qualify it to copy without buffering (copying small files without buffering will cause to lower copying speed)
      • +
      +
    • corrected handling of configuration (now it shouldn't block other parts of program)
    • +
    • corrected tab order in some windows
    • +
    • changed arrangement of main menu in program; added new item in this menu - now 'Monitoring clipboard' could be chosen from that menu (not only from Options)
    • +
    + +
  • 1.01a
  • +
      +
    • corrected DLL cooperation with ANSI version of Windows (98/Me)
    • +
    + +
  • 1.01
  • +
      +
    • corrected situation, when missing source file (with visual confirmation dialogs turned on) caused program to do the "forbidden operation".
    • +
    • now, the window for custom copy parameters shows the operation type (copy, move)
    • +
    • corrected cooperation of program with UNICODE versions of Windows (NT/2000/XP) - now program (really the DLL) should work properly under that systems.
    • +
    • if "View log" doesn't show notepad with log file then it shows info with error
    • +
    • in choose destination directory window (with enabled clipboard monitoring) appear info on disk's free space
    • +
    • if encountered copy error, then automatically retrying will be performed after some time (set in options) counted from that encounter, not like earlier from last retry attempt.
    • +
    • if program state, that there is no room for the files (it's checked at the beginning of operation) then it show some info about it.
    • +
    • corrected incorrectly showed strings for Explorer context menus.
    • +
    +
+
+
+
+See also: Known bugs/issues +
+ + + Index: other/Help/English/installation.htm =================================================================== diff -u --- other/Help/English/installation.htm (revision 0) +++ other/Help/English/installation.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,50 @@ + + + + + + +Installation + + + +
+
Installation

+ + + + + + + +
[Exe]Execute the executable file and proceed with the onscreen infos.
[Zip]Unzip file to some folder on the hard disk and run program Copy Handler from that folder. If you want to enable shell integration just choose 'Register shell extension dll' from the program menu in system tray.
+ +
+
Upgrade (installing new version on the old one)

+ + + +
[Exe]Just run the new install file and follow the instructions
[Zip]Uninstall the old version (look below) and install the new one (look above)
+
+ +
Uninstallation

+ + + + + + +
[Exe]Run the uninstaller from the folder in which you have installed the program, from the start menu or add/remove programs in control panel and proceed with the infos displayed on screen
[Zip] +#1. With program running choose option 'Unregister shell extension dll' from its menu.
+#2. Log off or restart your computer.
+#3. If you see program's icon in taskbar after restart - choose from it's menu option 'Exit'
+#4. Delete the folder in which you have previously installed Copy Handler
+
+
+
+ + + + Index: other/Help/English/license.htm =================================================================== diff -u --- other/Help/English/license.htm (revision 0) +++ other/Help/English/license.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,358 @@ + + + + + + +GNU General Public License + + + +
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    
+    Copyright (C) 19yy  
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+
+See also: Contact/support +
+ + + Index: other/Help/English/mainmenu.htm =================================================================== diff -u --- other/Help/English/mainmenu.htm (revision 0) +++ other/Help/English/mainmenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ + + + + + + +Main menu description + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Show status...Shows status window which displays detailed info about tasks (in progress, finished, cancelled, ...).

Show mini-status...Shows mini-status window that shows simplified view of a tasks in progress.

Enter copy parameters...Shows custom copy parameters dialog that allows user to enter a source files and folders to be copied, destination folder and to specify needed additional options.

Register shell extension dllIf you have installed shell extension dll (when it is in a folder from which you have run the program) it allows to register it in system registry (this allows using additional commands in explorer context menus).

Unregister shell extension dllCommand allows to unregister shell extension dll (it will remove all commands in explorer context menus).

Monitor clipboardThis command is closely related to 'Clipboard monitoring' option ('program' section) in configuration. When you choose this command it is like you are changing the configuration option.

Shutdown after finishedCommand closely related to the 'Shutdown system after copying finishes' option ('program' section) in configuration. When you choose this command it is like you were changing the appropriate configuration option.

Options...Shows configuration dialog where you can fully configure and adjust program to your needs.

Help...Shows the help file.

About...Shows dialog with the info about this program.

ExitEnds working of this program.

+
+
+ + + + Index: other/Help/English/miniview.htm =================================================================== diff -u --- other/Help/English/miniview.htm (revision 0) +++ other/Help/English/miniview.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ + + + + + + +Mini-status window + + + +
+This dialog shows short info about currently pending tasks. It could be configured in configuration dialog in section 'Miniview'. +
+
+ + + + Index: other/Help/English/options.htm =================================================================== diff -u --- other/Help/English/options.htm (revision 0) +++ other/Help/English/options.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,136 @@ + + + + + + +Configuration dialog + + + +
+ +
    +
  • Program - general options concerning the program
  • +
      +
    • Clipboard monitoring - specifies whether clipboard should be monitored for new data (if it's enabled then after copying files to clipboard there should appear window to choose destination folder)
    • +
    • Scan clipboard every ... [ms] - specify time interval in miliseconds at which the clipboard will be checked (look above)
    • +
    • Run program with system - specify whether the program should start with system or not (enabling it will cause some entries to be added to the registry)
    • +
    • Shutdown system after copying finishes - if we are going to copy something huge, we can turn this on, and after copying finishes the system will shut down (unless there will be error encountered, or something strange happens)
    • +
    • Wait ... [ms] befor shutdown - specifies amount of time for showing shutdown window with cancel possibility
    • +
    • Type of shutdown - specifies, if system should be shutdown normally or by force
    • +
    • Autosave every ... [ms] - to be able to resume copying after ie. system restert, data describing what has been copied should be written to disk. This option specify interval at which it is done.
    • +
    • Application's priority class - specifies the Copy Handler application priority class - use it with caution, because with high priorities the program can cause system to respond very slowly and with the idle - copying data can be very slow.
    • +
    • Folder for temporary data - folder for temporary data (look above)
    • +
    • Folder with plugins - specifies folder containing plugins for this program (currently unused)
    • +
    • Directory with help files - a path to a folder that contains the help files for this program
    • +
    • Language - specify language for the program and the shell extension DLL
    • +
    • Directory with language files - specifies the path to a directory where the language files are located
    • +
    + +
  • Status window - options for the status window
  • +
      +
    • Refresh status every ... [ms] - interval that specify how often data will be refreshed in the status window
    • +
    • Show details in status window - specify, if the right side of status window should be visible (containing details)
    • +
    • Automatically remove finished tasks - if copying finishes, some temporary files remain in memory and on disk, thanks to which you can see how many time copying occupied, what was the average transfer, or you have ie. the possibility to restart the task. If we enable this option, then the temporary files will be almost immediately deleted.
    • +
    + +
  • Miniview - options for mini status window
  • +
      +
    • Show file names - specifies if in the miniview file names of files actually copied should appear or only the progress bars.
    • +
    • Show single tasks - specifies if the miniview should display all tasks or only one, common progress.
    • +
    • Refresh status every ... [ms] - how often miniview should be refreshed
    • +
    • Show at program startup - if miniview should be shown at program startup
    • +
    • Hide when empty - when no tasks are processed it causes miniview to hide (if later same task will beegin processing - miniview will be automatically shown)
    • +
    • Use smooth progress bars - allows user to choose between two styles of progress bars inside miniview: boxed and smooth
    • +
    + +
  • Choose folder dialog - options associated with folder choosing dialog
  • +
      +
    • Show extended view - specifies if shortcuts' list should be visible when showing folder dialog.
    • +
    • Dialog width [pixels] - dialog box width in pixels.
    • +
    • Dialog height [pixels] - dialog box height in pixels.
    • +
    • Shortcuts' list style - specifies the style of the shortcuts' list.
    • +
    • Ignore additional shell dialogs - specifies if folder dialog should ignore additional system dialogs (ie. Insert disk, Disk ... not available, ...).
    • +
    + +
  • Shell - options associated with explorer and shell
  • +
      +
    • Show 'Copy' command in drag&drop menu - enables Copy command in drag&drop menu.
    • +
    • Show 'Move' command in drag&drop menu - enables Move command in drag&drop menu.
    • +
    • Show 'Copy/move special' command in drag&drop menu - enables Copy/move special in drag&drop menu.
    • +
    • Show 'Paste' command in context menu - enables Paste command in explorer's context menu.
    • +
    • Show 'Paste special' command in context menu - enables Paste special command in explorer's context menu.
    • +
    • Show 'Copy to' command in context menu - enables Copy to command in explorer's context menu.
    • +
    • Show 'Move to' command in context menu - enables Move to command in explorer's context menu.
    • +
    • Show 'Copy/move special to' command in context menu - enables Copy/move special to command in explorer's context menu.
    • +
    • Show free space with shortcuts' names - specifies if in the submenus associated with Copy to command (and similar) there should be displayed available free space.
    • +
    • Show icons with shortcuts (experimental) - specifies, if in the submenus associated with Copy to command (and similar) there should be displayed shell icons for shortcuts. Experimental option - drawing doesn't work properly on some older systems. If you see some strange submenu (when you select Copy to command or similar one) you should disable this option.
    • +
    • Intercept drag&drop operation by left mouse button (experimental) - specifies, if drag&drop operations in explorer (by left mouse button) should be intercepted by this program. Experimental option - first - it doesn't work on some systems (especially the older ones). Second - it causes commands 'Paste' and 'Paste shortcut' (and what goes with it - also Ctrl+V key combination) from explorer's context menu to be intercepted too (program treats the second one just as the first one).
    • +
    • Default action for dragging by left mouse button - specifies action that will be performed when dragging files/folders in explorers' windows (if none of the modifying keys (Ctrl, Shift, Alt) will be pressed). Autodetection is now in experimental phase - it "predicts" what is the indicator at mouse cursor - not necessarily correctly.
    • +
    + +
  • Copying/moving thread - options for copying/moving
  • +
      +
    • Auto "copy-rest" of files - specify, if the larger source file should overwrite the smaller destination, or if the destination files should be filled up by the source file.
    • +
    • Set attributes of destination files - should attributes for destination files be set ?
    • +
    • Set date/time of destionation files - like above, but date/time
    • +
    • Protect read-only files - when moving data (at the last phase - deleting files) it specify, if read-only files should be deleted (if not - we got error). It also tells if the destination read-only files should be overwritten.
    • +
    • Limit maximum operations running simultaneously to ... - it allows to limit maximum count of operations pending at once. When we specify 0 - we remove limitation.
    • +
    • Read tasks size before blocking - if we enable above option, then this option specify if searching for files (and counting its size) should be done before (Yes) or after (No) blocking progress of task
    • +
    • Show visual confirmation dialogs - specify if when copying ie. not completely copied file there should be displayed a window with question of overwriting, copying rest, ... .Three grades specify: disabled - the windows are not shown, Normal - windows are shown only in indispensable cases, and Heavy (I haven't found better name :) ) causes asking about everything (almost).
    • +
    • Use timed confirmation dialogs - if above dialogs should auto-confirm default option after some time.
    • +
    • Time of showing confirmation dialogs - specify time for above window.
    • +
    • Auto resume on error - if there was an error encountered - this option specify if the task should be resumed after some time.
    • +
    • Auto resume every ... [ms] - specify interval for above option.
    • +
    • Default thread priority - specify default priority for copying thread. This value will be assigned to every new task.
    • +
    • Disable priority boosting - specifies, if system should boost thread priority if application works in foreground
    • +
    • Don't delete files before copying finishes (moving) - it allows to choose how files are moved - either they are deleted (all) after copying all, or one by one (after copying every single file).
    • +
    • Create .log files - if program should create log files for every task performed(thanks to it you could report some errors), or look how the copying was performed, or if there was errors, what errors, ...
    • +
    + +
  • Buffer - options connected with buffers
  • +
      +
    • Use only default buffer - if we enable this option - program will use only the default buffer size. In other case program will try to find the proper buffer size by checking the storage medias on which the source and destination files are stored.
    • +
    • Default buffer size - specifies the default buffer size. If 'Use only default buffer' option is turned on - this buffer size will be used for all copyings, if it's turned on - this buffer serves for copying files, which are not contained in one of below categories
    • +
    • Buffer size for copying inside one physical disk boundary - specifies buffer size for copying data inside one physical disk boundary (when the source files and the destination folder lies on the same physical hard disk).
    • +
    • Buffer size for copying between two different disks - specifies buffer size for copying data between two different physical hard disks.
    • +
    • Buffer size for copying from CD-ROM - buffer size for copying data from CD-ROM to any other place
    • +
    • Buffer size for copying over a network - buffer size used, when copying data from or to a local network
    • +
    • Disable buffering for large files - allows to turn off buffering for files with specified size(below) and greater (copying large files without buffering in many cases is faster than copying with buffering).
    • +
    • Minimum file size for which buffering should be disabled - specifies minimum file size for which buffering should be disabled (according to my experiments this value on my computer should be about 2MB, but on another systems it may be other).
    • +
    + +
  • Sounds - specify sound options for program
  • +
      +
    • Playing sounds - should program play sounds for some events ?
    • +
    • Sound on error - path to .wav file (with sound), which should be played, when error occurs.
    • +
    • Sound on copying finished - path to .wav file (with sound), which should be played, after task finishes.
    • +
    + +
  • Shortcuts - specifies options associated with shortcuts used in explorer's context menus and in folder choosing dialog
  • +
      +
    • Defined shortcuts' count - specifies count of currently defined shortcuts. To edit - double click or press the button on the right.
    • +
    + +
  • Recently used paths - specifies options associated with paths chosed recently as a destination for copy/move operations
  • +
      +
    • Count of recent paths - specifies count of paths that are currently remembered. To edit - double click or press the button on the right.
    • +
    +
+
+
+ + + + Index: other/Help/English/recentdlg.htm =================================================================== diff -u --- other/Help/English/recentdlg.htm (revision 0) +++ other/Help/English/recentdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + +Recent paths edit dialog + + + +
+This dialog is displayed by the configuration dialog to edit the recently used paths. +
    +
  • Recently used paths - list of recently used paths that you may modify.
  • +
  • Path - using the 3 buttons (Add, Update and Delete) you can may operate on the displayed paths to make it more appropriate.
  • +
+
+
+ + + + Index: other/Help/English/replacepaths.htm =================================================================== diff -u --- other/Help/English/replacepaths.htm (revision 0) +++ other/Help/English/replacepaths.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ + + + + + + +Replace paths dialog + + + +
+This dialog allows user to change the source path of a selected task in the status window to a new value. +
    +
  • Source paths - specifies the source paths that at the beginning were added to this task. You can select one of them or you may enter path manually into the edit box below.
  • +
  • Change to - here you can enter the new path. You may do it manually by entering text from the keyboard or by clicking the '...' button and selecting folder from the window that opens.
  • +
+
+
+ + + + Index: other/Help/English/reporting.htm =================================================================== diff -u --- other/Help/English/reporting.htm (revision 0) +++ other/Help/English/reporting.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,38 @@ + + + + + + +Bug reports + + + +
+If you encounter a problem with the program that may be a result of a programming error you may write to support@copyhandler.com or copyhandler@o2.pl.
+
+All of the bug reports are welcome, but before you write:
+
    +
  • make sure you have the latest version of the program. You can download it from the web page.
  • +
  • [concerning only the zip version] make sure you have properly replaced the shell extension dll. Most of the errors comes from using old dll with a new program. If you have used the previous version of program - unregister shell extension dll, restart the computer, delete the old shell extension dll, copy the new one into that place and register the extension in the program's menu. See also the installation/deinstallation procedure.
  • +
+ +What the mail should contain (not all is required, but everything may be helpful) ? +
    +
  • The detailed bug description (what happened, how can I reproduce the error). This is required; if I do not know how to reproduce the error how can I fix it ?
  • +
  • The configuration file of the Copy Handler (copy handler.ini) if the error could be related to the options set. If you are not sure - include compressed (zip or rar archives preferred) configuration file in the mail. Not required, but in some cases may be helpful.
  • +
  • The system configuration (version of a Windows system, version of the Internet explorer installed in system, version of Copy Handler that you have used). Not required, but helpful - some problems appears only in specific systems.
  • +
  • The speed of the processor and count of RAM. Not required, but in some cases helpful.
  • +
  • Any other info (perhaps a screen shot) that may be helpful.
  • +
+ +If you want to include any attachment with the mail - make sure it's in the small format (ie. for screenshots and images make sure they are in .jpg or .gif format. Absolutely do not send images in .bmp format). Any other attachment should be compressed by ZIP or RAR compressor. + +
+
+ + + + Index: other/Help/English/requirements.htm =================================================================== diff -u --- other/Help/English/requirements.htm (revision 0) +++ other/Help/English/requirements.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,28 @@ + + + + + + +Program requirements + + + +
+To properly work this program requires: +
    +
  • Pentium class or 100% compatible processor (maybe it would work on 386 or 486-class systems, but it has not been tested).
  • +
  • Microsoft Windows 95/98/Me/NT4/2000/XP operating system
  • +
  • About 1 MB free space on hard disk
  • +
  • display with at least 800x600 resolution (program will also run with lower resolutions, but some dialogs wouldn't be fully visible)
  • +
  • MFC libraries version 4.2 installed in a system (usually they are shipped with system)
  • +
  • Tahoma font installed in a system
  • +
+
+
+
+See also: License, Program's history +
+ + + Index: other/Help/English/shortcutsdlg.htm =================================================================== diff -u --- other/Help/English/shortcutsdlg.htm (revision 0) +++ other/Help/English/shortcutsdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + +Shortcuts edit dialog + + + +
+This dialog could be displayed by the configuration dialog to edit the shortcuts that are used in explorer context menus and in the folder dialog. +
    +
  • Shortcuts - list of the currently defined shortcuts.
  • +
  • Move up/Move down - these two buttons allow to change the order of the items in the list.
  • +
  • Shortcut's properties - this set of items allow user to manage the shortcuts in the list. Each shortcut has the name that is displayed and an associated path.
  • +
+
+
+ + + + Index: other/Help/English/shutdowndlg.htm =================================================================== diff -u --- other/Help/English/shutdowndlg.htm (revision 0) +++ other/Help/English/shutdowndlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,21 @@ + + + + + + +Shutdown dialog + + + +
+This dialog is displayed when the configuration option 'Shutdown system after copying finishes' (in the 'Program section') is set and all the tasks are finished. + +
+
+
+See also: Configuration dialog +
+ + + Index: other/Help/English/status.htm =================================================================== diff -u --- other/Help/English/status.htm (revision 0) +++ other/Help/English/status.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,67 @@ + + + + + + +Status dialog + + + +
+ +
    +
  • +Left side of of the window +
      +
    • Operations list window - displays list of tasks with different status (finished, cancelled, ...). For each task there is given status of it, current filename being processed, destination folder to which files are stored and percentage progress of a task.
    • +
    • Pause button - pauses selected task. If another task is waiting for this one to be finished it now starts.
    • +
    • Resume button - resumes work of the selected, paused task. Also if task is in wait state (waiting for another one to finish) this button causes it to start. When used on 'wait state' task it ignores configuration option 'Limit maximum operations running simultaneously' ('Copying/moving thread' section).
    • +
    • Restart button - causes selected task to restart. Causes task to run from the beginning (with searching for files).
    • +
    • Cancel button - cancels the currently selected task.
    • +
    • Remove button - when the task is finished or cancelled this command removes task from the list. If task is running program asks if user want to cancel current task.
    • +
    • Pause/all button - work like Pause button, but for all of the tasks.
    • +
    • Resume/all button - work like Resume button, but does not ignore the configuration option 'Limit maximum operations running simultaneously' ('Copying/moving thread' section).
    • +
    • Cancel/all button - cancels all the tasks.
    • +
    • Remove/all button - removes all the cancelled and finished tasks from the list.
    • +
    • Restart/all button - restarts all the tasks from the list.
    • +
    • Stick button - causes the status dialog to be positioned in right-bottom corner of the screen.
    • +
    • '<<' button - changes the dialog view to simple/advanced.
    • +
    • Advanced button - Shows menu with advanced options regarding one or more tasks from the list.
    • +
    +
  • + +
  • +Current selection statistics - statistics for the task selected in Operations list window. +
      +
    • Associated file - filename that contains info about current task. When you restart the system Copy Handler load task info from this file. Files are placed in a location specified by configuration option 'Folder for temporary data' (in 'Program' section).
    • +
    • Operation - specifies type and status of the selected task.
    • +
    • Source object - current filename that is being processed (copied or moved into destination location).
    • +
    • Destination object - destination folder into which the selected task copies the files and folders.
    • +
    • Buffer size - specifies the buffer size which is currently being used for the copying. You may change the size of the buffers by clicking on '...' button on the right. It will bring up the buffer size dialog.
    • +
    • Thread priority - task priority at which the thread is running. You can change it by clicking the '>' button on the right and choosing from the menu needed priority.
    • +
    • Comments - displays error descriptions if any occured.
    • +
    • View log button - shows log file contents associated with the current task.
    • +
    • Processed - gives info on how many files and folders has been processed/count of all files and folders, size of data that has been processed/count of all data and passes that has been made/count of all passes. There are more than 1 pass when you specify more than one copy to make.
    • +
    • Time - displays elapsed time (of this tasks' working) and the estimated time that the operation would take.
    • +
    • Transfer - shows current transfer rate for this task (current and average). The current speed of copying is measured by dividing the size of data that has been copied in the last interval of time (it is about value specified in configuration option 'Refresh status every ... [ms]' in 'Status dialog' section) by the real, precise time that passed when copying the data. The data may be a bit inaccurate when using large buffers. Program reads one buffer at a time, so it may happen that when using large buffers or a small refresh intervals the transfer will drastically change from 0 B/s to ie. 24MB/s (for 24MB buffer). Average spped is measured by dividing size of all the copied data by the overall time.
    • +
    • Progress - file-size based progress bar.
    • +
    +
  • + +
  • +Global statistics +
      +
    • Processed - very similar to 'Processed' from above, but it displays info about all the tasks in a list (it doesn't matter if it's finished, cancelled, running or sth).
    • +
    • Transfer - displays current transfer for all running tasks in a list
    • +
    • Progress - size-based progress bar for all the tasks in a list (ignores state of a task. Counts all of them).
    • +
    +
  • +
+
+ + + + Index: other/Help/English/style.css =================================================================== diff -u --- other/Help/English/style.css (revision 0) +++ other/Help/English/style.css (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ +.footer +{ + font-weight: normal; + font-size: x-small; + color: silver; + font-family: Arial; +} +.header +{ + font-weight: normal; + font-size: x-small; + color: silver; + font-family: Arial; +} +.headertitle +{ + font-size: medium; + color: black; + font-family: Arial; +} +.section +{ + font-weight: normal; + font-size: medium; + color: black; + font-family: Arial; +} +.text +{ + font-size: x-small; + color: black; + font-family: Arial; +} +PRE +{ + font-size: x-small; +} +.seealso +{ + font-size: x-small; + color: black; + font-family: Arial; +} Index: other/Help/English/support.htm =================================================================== diff -u --- other/Help/English/support.htm (revision 0) +++ other/Help/English/support.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,55 @@ + + + + + + +Contact/support + + + + +
+If have any suggestions, like/do not like something regarding this program - let me know:

+ + support@copyhandler.com

+ copyhandler@o2.pl

+ +If you have found a bug in the program - read how to report it.

+
+ +If you like this program and would like to support it's future development - you may donate something to my bank account:
+BRE SA-WBE/Lodz (Poland)
+78 1140 2004 0000 3102 3116 3975
+
+

+
Discussion forums:

+General discussion forum - you can send there some questions, bugs reports and other...but not the spam.
+Page [http://groups.yahoo.com/group/copyhandler]
+Subscribe [copyhandler-subscribe@yahoogroups.com]
+Unsubscribe [copyhandler-unsubscribe@yahoogroups.com]
+Post message [copyhandler@yahoogroups.com]
+ +
+ +Developer's discussion forum for Copy Handler - for comments regarding Copy Handler's code, connected with programming CH and other...
+Page [http://groups.yahoo.com/group/chdev]
+Post message [chdev@yahoogroups.com]
+Subscribe [chdev-subscribe@yahoogroups.com]
+Unsubscribe [chdev-unsubscribe@yahoogroups.com]
+ +
+ +Also if you're looking for the newest version - take a look at:
+ +http://www.copyhandler.com
+http://www.copyhandler.prv.pl
+ +
+
+
+See also: Bugs reporting, License, Thanks +
+ + + Index: other/Help/English/template.htm =================================================================== diff -u --- other/Help/English/template.htm (revision 0) +++ other/Help/English/template.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ + + + + + + +<!-- Title --> + + + +
+Contents +
+
+
+See also: +
+ + + Index: other/Help/English/thanks.htm =================================================================== diff -u --- other/Help/English/thanks.htm (revision 0) +++ other/Help/English/thanks.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,53 @@ + + + + + + +Thanks list + + + +
+I'd like to thank everyone who had helped me in creating this program - in particular:
+People that has the "physical" contribution into the project:
+
    +
  • El Magico - installer script, author of many bug-reports, great ideas...
  • +
  • Barnaba - currently handles home page of this program
  • +
  • Tomas S. Refsland - server and domain sponsor
  • +
  • Kaleb - previous webmaster of a Copy Handler site
  • +
  • Marcin Kedzia & DMK Project - the recent sponsor of our web page - http://www.dmkproject.pl
  • +
+ +Authors of the language packs shipped with the program:

+    For the current list of installed language packs look at program's about box.

+ +People who's code I have used in a current version of the program (obtained at http://www.codeguru.com):
+
    +
  • Antonio Tejada Lacaci - CFileInfoArray (with major modifications)
  • +
  • Keith Rule - CMemDC
  • +
  • Brett R. Mitchell - CPropertyListCtrl (with some additions)
  • +
+ +People/institutions - authors of the programs that has been used to create Copy Handler:
+
    +
  • Microsoft - author of: Visual Studio 6.0, all the Windows systems and some icons (http://www.microsoft.com)
  • +
  • Markus Oberhumer & Laszlo Molnar - UPX Software - executable files compression (http://upx.tsx.org)
  • +
+ +Other people (for many things)...: +
    +
  • Chis Octavian
  • +
  • Peter Bijl
  • +
  • Sebastian Schuberth
  • +
+ +If you feel you should be listed here, and you are not - please write to me. +
+
+
+See also: Contact/support, License +
+ + + Index: other/Help/English/using.htm =================================================================== diff -u --- other/Help/English/using.htm (revision 0) +++ other/Help/English/using.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,33 @@ + + + + + + +How to use ? + + + +
+How to copy something using Copy Handler ?
+If you have registered shell extension DLL:
+
    +
  • Drag some files/folder in explorer by right mouse button, drop it somewhere else and choose one of the options from context menu that begins with (CH)
  • +
  • Copy something to clipboard (by selecting some files in explorer and pressing ctrl+C on your keyboard or by choosing 'Copy' command from explorer context menu) and paste it in other location by '(CH) Paste' or '(CH) Paste special...'. If you have turned on the option 'Monitor clipboard' - after the copying something into the clipboard there should be displayed a dialog where you can choose the destination location for the selected files and folders and the type of operation.
  • +
  • If you have selected option 'Intercept dragging' and you have rather new system (Windows Me, 2000 or XP) you can also drag&drop files by left mouse button and use standard Windows 'Paste' command or ctrl+V.
  • +
+ +If you haven't registered the shell extension:
+
    +
  • The only way to start copying or moving data is to select 'Enter custom copy parameters...' from program's menu, to fill it with needed data (source files and destination folder) and to accept the entered data with OK button.
  • +
+ +
+
+ + + + + Index: other/Help/English/welcome.htm =================================================================== diff -u --- other/Help/English/welcome.htm (revision 0) +++ other/Help/English/welcome.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,36 @@ + + + + + + +Welcome + + + + +
+Copy Handler program is a small tool designed for copy/move files and folders between different storage medias +(hard disks, floppy disks, local networks, CD-ROMs and many other).
+This help file contains most of the information you would like to know about using Copy Handler.
+ + +
+
!!Attention!!

+Author of this program (that is me) do not take any responsibility for any damage produced by this program or its working. If you think, that you might lose something very important to you, and you don't trust this program - simply do not use it. As for me it works fine. (Look at the license for details). +
+ + + + Index: other/Help/HTMLDefines.h =================================================================== diff -u --- other/Help/HTMLDefines.h (revision 0) +++ other/Help/HTMLDefines.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,295 @@ +// Help Map file generated from application's resource.h file. + +// Commands (ID_* and IDM_*) +#define HID_POPUP_SHOW_STATUS 0x8005 +#define HID_POPUP_TIME_CRITICAL 0x8006 +#define HID_POPUP_HIGHEST 0x8007 +#define HID_POPUP_ABOVE_NORMAL 0x8008 +#define HID_POPUP_NORMAL 0x8009 +#define HID_POPUP_BELOW_NORMAL 0x800A +#define HID_POPUP_LOWEST 0x800B +#define HID_POPUP_IDLE 0x800C +#define HID_POPUP_CUSTOM_BUFFERSIZE 0x8019 +#define HID_POPUP_OPTIONS 0x8022 +#define HID_SHOW_MINI_VIEW 0x8023 +#define HID_POPUP_CUSTOM_COPY 0x8024 +#define HID_POPUP_REPLACE_PATHS 0x8025 +#define HID_POPUP_MONITORING 0x8026 +#define HID_POPUP_SHUTAFTERFINISHED 0x8027 +#define HID_POPUP_REGISTERDLL 0x8029 +#define HID_POPUP_UNREGISTERDLL 0x802A +#define HID_POPUP_HELP 0x802E +#define HID_POPUP_TEMP 0x802F + +// Prompts (IDP_*) + +// Resources (IDR_*) +#define HIDR_MANIFEST 0x20001 +#define HIDR_MAINFRAME 0x20080 +#define HIDR_SYSTEMTYPE 0x20081 +#define HIDR_POPUP_MENU 0x20082 +#define HIDR_PRIORITY_MENU 0x20087 +#define HIDR_BUFFERSIZE_MENU 0x20088 +#define HIDR_PAUSE_LIST_MENU 0x2008A +#define HIDR_ADVANCED_MENU 0x200A0 +#define HIDR_POPUP_TOOLBAR 0x200AA +#define HIDR_THANKS_TEXT 0x200D3 + +// Dialogs (IDD_*) +#define HIDD_ABOUTBOX 0x20064 +#define HIDD_STATUS_DIALOG 0x20083 +#define HIDD_BUFFERSIZE_DIALOG 0x20089 +#define HIDD_OPTIONS_DIALOG 0x20090 +#define HIDD_MINIVIEW_DIALOG 0x20091 +#define HIDD_CUSTOM_COPY_DIALOG 0x20095 +#define HIDD_FOLDER_BROWSING_DIALOG 0x20096 +#define HIDD_NEW_FOLDER_DIALOG 0x20097 +#define HIDD_NEW_QUICK_ACCESS_DIALOG 0x20098 +#define HIDD_REPLACE_PATHS_DIALOG 0x200A1 +#define HIDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 0x200A2 +#define HIDD_FEEDBACK_REPLACE_FILES_DIALOG 0x200A4 +#define HIDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 0x200A5 +#define HIDD_FEEDBACK_DSTFILE_DIALOG 0x200A7 +#define HIDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 0x200AD +#define HIDD_SHUTDOWN_DIALOG 0x200B6 +#define HIDD_FILTER_DIALOG 0x200C3 +#define HIDD_SHORTCUTEDIT_DIALOG 0x200D0 +#define HIDD_RECENTEDIT_DIALOG 0x200D1 + +// Frame Controls (IDW_*) + +// Controls (IDC_*) +#define IDH_ABOUTBOX 0xD2 +#define IDH_PROGRAM_STATIC 0x3E8 +#define IDH_ADDFILE_BUTTON 0x3EA +#define IDH_STATUS_LIST 0x3EB +#define IDH_REMOVEFILEFOLDER_BUTTON 0x3EC +#define IDH_ALL_PROGRESS 0x3ED +#define IDH_DESTPATH_EDIT 0x3EE +#define IDH_TASK_PROGRESS 0x3EF +#define IDH_DESTBROWSE_BUTTON 0x3F0 +#define IDH_OPERATION_COMBO 0x3F1 +#define IDH_FILTERS_LIST 0x3F2 +#define IDH_ADDDIR_BUTTON 0x3F3 +#define IDH_BUFFERSIZES_LIST 0x3F4 +#define IDH_SET_BUFFERSIZE_BUTTON 0x3F5 +#define IDH_FILTERS_CHECK 0x3F6 +#define IDH_IGNOREFOLDERS_CHECK 0x3F7 +#define IDH_SET_PRIORITY_BUTTON 0x3F8 +#define IDH_ONLYSTRUCTURE_CHECK 0x3F9 +#define IDH_PAUSE_BUTTON 0x3FA +#define IDH_STANDARD_CHECK 0x3FB +#define IDH_FORCEDIRECTORIES_CHECK 0x3FC +#define IDH_RESUME_BUTTON 0x3FD +#define IDH_CANCEL_BUTTON 0x3FE +#define IDH_ADVANCED_CHECK 0x3FF +#define IDH_BUFFERSIZES_BUTTON 0x400 +#define IDH_ADDFILTER_BUTTON 0x401 +#define IDH_REMOVEFILTER_BUTTON 0x402 +#define IDH_SOURCE_STATIC 0x403 +#define IDH_DESTINATION_STATIC 0x404 +#define IDH_OPERATION_STATIC 0x405 +#define IDH_BUFFERSIZE_STATIC 0x406 +#define IDH_PRIORITY_STATIC 0x407 +#define IDH_ERRORS_STATIC 0x408 +#define IDH_PROGRESS_STATIC 0x409 +#define IDH_TRANSFER_STATIC 0x40A +#define IDH_OVERALL_PROGRESS_STATIC 0x40B +#define IDH_OVERALL_TRANSFER_STATIC 0x40C +#define IDH_TIME_STATIC 0x40D +#define IDH_ROLL_UNROLL_BUTTON 0x40E +#define IDH_SIZE_EDIT 0x40F +#define IDH_ASSOCIATEDFILES__STATIC 0x410 +#define IDH_START_ALL_BUTTON 0x411 +#define IDH_RESTART_BUTTON 0x412 +#define IDH_DELETE_BUTTON 0x413 +#define IDH_PAUSE_ALL_BUTTON 0x414 +#define IDH_RESTART_ALL_BUTTON 0x415 +#define IDH_CANCEL_ALL_BUTTON 0x416 +#define IDH_REMOVE_FINISHED_BUTTON 0x417 +#define IDH_PROPERTIES_LIST 0x418 +#define IDH_PROGRESS_LIST 0x419 +#define IDH_SOURCE_EDIT 0x41A +#define IDH_DESTINATION_EDIT 0x41B +#define IDH_DIRECTORY_TREE 0x41D +#define IDH_QUICK_ACCESS_LIST 0x41E +#define IDH_PATH_EDIT 0x41F +#define IDH_HEADER_TEXT_STATIC 0x420 +#define IDH_FIND_PATH_BUTTON 0x421 +#define IDH_NEW_FOLDER_BUTTON 0x422 +#define IDH_PATH_STATIC 0x423 +#define IDH_ADD_BUTTON 0x424 +#define IDH_REMOVE_BUTTON 0x425 +#define IDH_TITLE_EDIT 0x426 +#define IDH_BROWSE_BUTTON 0x428 +#define IDH_FILES_LIST 0x429 +#define IDH_ADD_DIRECTORY_BUTTON 0x42A +#define IDH_MASK_EDIT 0x42B +#define IDH_OPERATION_TYPE_COMBO 0x42C +#define IDH_ADD_FILES_BUTTON 0x42D +#define IDH_BUFFERSIZE_EDIT 0x42E +#define IDH_PRIORITY_COMBO 0x42F +#define IDH_IGNORE_FOLDERS_CHECK 0x431 +#define IDH_ONLY_CREATE_CHECK 0x432 +#define IDH_ADVANCED_BUTTON 0x435 +#define IDH_PATHS_LIST 0x436 +#define IDH_FILENAME_EDIT 0x440 +#define IDH_FILESIZE_EDIT 0x441 +#define IDH_DESTFILENAME_EDIT 0x442 +#define IDH_CREATETIME_EDIT 0x443 +#define IDH_MODIFY_TIME_EDIT 0x444 +#define IDH_DEST_FILENAME_EDIT 0x445 +#define IDH_DEST_FILESIZE_EDIT 0x446 +#define IDH_DEST_CREATETIME_EDIT 0x447 +#define IDH_DEST_MODIFYTIME_EDIT 0x448 +#define IDH_IGNORE_BUTTON 0x449 +#define IDH_IGNORE_ALL_BUTTON 0x44A +#define IDH_WAIT_BUTTON 0x44B +#define IDH_RETRY_BUTTON 0x44C +#define IDH_COPY_REST_BUTTON 0x44F +#define IDH_RECOPY_BUTTON 0x450 +#define IDH_COPY_REST_ALL_BUTTON 0x452 +#define IDH_RECOPY_ALL_BUTTON 0x453 +#define IDH_MESSAGE_EDIT 0x458 +#define IDH_COUNT_EDIT 0x45F +#define IDH_SHOW_LOG_BUTTON 0x460 +#define IDH_STICK_BUTTON 0x462 +#define IDH_FREESPACE_STATIC 0x463 +#define IDH_DISK_STATIC 0x464 +#define IDH_REQUIRED_STATIC 0x467 +#define IDH_AVAILABLE_STATIC 0x468 +#define IDH_TEST_BUTTON 0x469 +#define IDH_SOURCEFILENAME_EDIT 0x46A +#define IDH_YESALL_BUTTON 0x46B +#define IDH_NOALL_BUTTON 0x46C +#define IDH_DEFAULTMULTIPLIER_COMBO 0x46D +#define IDH_DEFAULTSIZE_EDIT 0x46E +#define IDH_ONEDISKSIZE_EDIT 0x46F +#define IDH_CHANGEBUFFER_BUTTON 0x471 +#define IDH_ONEDISKMULTIPLIER_COMBO 0x472 +#define IDH_TWODISKSSIZE_EDIT 0x473 +#define IDH_TWODISKSMULTIPLIER_COMBO 0x474 +#define IDH_CDROMSIZE_EDIT 0x475 +#define IDH_CDROMMULTIPLIER_COMBO 0x476 +#define IDH_LANSIZE_EDIT 0x477 +#define IDH_LANMULTIPLIER_COMBO 0x478 +#define IDH_ONLYDEFAULT_CHECK 0x479 +#define IDH_TIME_PROGRESS 0x47A +#define IDH_ERRORS_EDIT 0x47B +#define IDH_FILTER_COMBO 0x47D +#define IDH_FILTER_CHECK 0x47E +#define IDH_SIZE_CHECK 0x47F +#define IDH_SIZE1_EDIT 0x480 +#define IDH_SIZE1MULTI_COMBO 0x481 +#define IDH_SIZETYPE1_COMBO 0x482 +#define IDH_SIZE1_SPIN 0x483 +#define IDH_SIZE2_EDIT 0x484 +#define IDH_SIZE2MULTI_COMBO 0x485 +#define IDH_SIZETYPE2_COMBO 0x486 +#define IDH_SIZE2_SPIN 0x487 +#define IDH_SIZE2_CHECK 0x488 +#define IDH_DATE_CHECK 0x489 +#define IDH_ATTRIBUTES_CHECK 0x48A +#define IDH_ARCHIVE_CHECK 0x48B +#define IDH_READONLY_CHECK 0x48C +#define IDH_HIDDEN_CHECK 0x48D +#define IDH_SYSTEM_CHECK 0x48E +#define IDH_DATETYPE_COMBO 0x48F +#define IDH_DATE1TYPE_COMBO 0x490 +#define IDH_DATE1_DATETIMEPICKER 0x491 +#define IDH_TIME1_DATETIMEPICKER 0x492 +#define IDH_DATE2_CHECK 0x493 +#define IDH_DATE2TYPE_COMBO 0x494 +#define IDH_DATE2_DATETIMEPICKER 0x495 +#define IDH_TIME2_DATETIMEPICKER 0x496 +#define IDH_DIRECTORY_CHECK 0x497 +#define IDH_FILTEREXCLUDE_COMBO 0x498 +#define IDH_EXCLUDEMASK_CHECK 0x499 +#define IDH_COUNT_SPIN 0x49A +#define IDH_DESTPATH_COMBOBOXEX 0x49B +#define IDH_SHORTCUT_LIST 0x49C +#define IDH_NAME_EDIT 0x49D +#define IDH_PATH_COMBOBOXEX 0x49E +#define IDH_CHANGE_BUTTON 0x4A1 +#define IDH_RECENT_LIST 0x4A6 +#define IDH_IMPORT_BUTTON 0x4A7 +#define IDH_UP_BUTTON 0x4A8 +#define IDH_DOWN_BUTTON 0x4A9 +#define IDH_THANX_EDIT 0x4AE +#define IDH_COPYRIGHT_STATIC 0x4AF +#define IDH_FOLDER_TREE 0x4B0 +#define IDH_DISTRIBUTION_STATIC 0x4B0 +#define IDH_NEWFOLDER_BUTTON 0x4B1 +#define IDH_HOMEPAGE_STATIC 0x4B1 +#define IDH_TITLE_STATIC 0x4B2 +#define IDH_HOMEPAGELINK_STATIC 0x4B2 +#define IDH_LARGEICONS_BUTTON 0x4B3 +#define IDH_CONTACT_STATIC 0x4B3 +#define IDH_HOMEPAGELINK2_STATIC 0x4B3 +#define IDH_SMALLICONS_BUTTON 0x4B4 +#define IDH_GENFORUM_STATIC 0x4B4 +#define IDH_LIST_BUTTON 0x4B5 +#define IDH_DEVFORUM_STATIC 0x4B5 +#define IDH_REPORT_BUTTON 0x4B6 +#define IDH_CONTACT1LINK_STATIC 0x4B6 +#define IDH_CONTACT2LINK_STATIC 0x4B7 +#define IDH_GENFORUMPAGELINK_STATIC 0x4B8 +#define IDH_TOGGLE_BUTTON 0x4B9 +#define IDH_GENFORUMSUBSCRIBELINK_STATIC 0x4B9 +#define IDH_ADDSHORTCUT_BUTTON 0x4BA +#define IDH_GENFORUMUNSUBSCRIBELINK_STATIC 0x4BA +#define IDH_REMOVESHORTCUT_BUTTON 0x4BB +#define IDH_GENFORUMSENDLINK_STATIC 0x4BB +#define IDH_DEVFORUMPAGELINK_STATIC 0x4BC +#define IDH_DEVFORUMSUBSCRIBELINK_STATIC 0x4BD +#define IDH_DEVFORUMUNSUBSCRIBELINK_STATIC 0x4BE +#define IDH_DEVFORUMSENDLINK_STATIC 0x4BF +#define IDH_THANX_STATIC 0x4C0 +#define IDH_UPX_STATIC 0x4C1 +#define IDH_CONTACT3LINK_STATIC 0x4C1 +#define IDH_APPLY_BUTTON 0x4C2 +#define IDH_001_STATIC 0x4C3 +#define IDH_002_STATIC 0x4C4 +#define IDH_003_STATIC 0x4C5 +#define IDH_004_STATIC 0x4C6 +#define IDH_005_STATIC 0x4C7 +#define IDH_006_STATIC 0x4C8 +#define IDH_007_STATIC 0x4C9 +#define IDH_008_STATIC 0x4CA +#define IDH_009_STATIC 0x4CB +#define IDH_010_STATIC 0x4CC +#define IDH_011_STATIC 0x4CD +#define IDH_012_STATIC 0x4CE +#define IDH_013_STATIC 0x4CF +#define IDH_014_STATIC 0x4D0 +#define IDH_015_STATIC 0x4D1 +#define IDH_016_STATIC 0x4D2 +#define IDH_017_STATIC 0x4D3 +#define IDH_018_STATIC 0x4D4 +#define IDH_019_STATIC 0x4D5 +#define IDH_020_STATIC 0x4D6 +#define IDH_021_STATIC 0x4D7 +#define IDH_022_STATIC 0x4D8 +#define IDH_023_STATIC 0x4D9 +#define IDH_024_STATIC 0x4DA +#define IDH_025_STATIC 0x4DB +#define IDH_026_STATIC 0x4DC +#define IDH_027_STATIC 0x4DD +#define IDH_028_STATIC 0x4DE +#define IDH_029_STATIC 0x4DF +#define IDH_030_STATIC 0x4E0 +#define IDH_BAR1_STATIC 0x4E1 +#define IDH_BAR2_STATIC 0x4E2 +#define IDH_BAR3_STATIC 0x4E3 +#define IDH_BAR4_STATIC 0x4E4 +#define IDH_BAR5_STATIC 0x4E5 +#define IDH_HEADER_STATIC 0x4E6 +#define IDH_HOSTLINK_STATIC 0x4E7 +#define IDH_HELP_BUTTON 0x4E9 +#define IDH_PROGRAM_STATICEX 0x4EF +#define IDH_FULLVERSION_STATICEX 0x4F0 +#define IDH_HOMEPAGE_STATICEX 0x4F1 +#define IDH_CONTACT_STATICEX 0x4F2 +#define IDH_LICENSE_STATICEX 0x4F3 +#define IDH_CONTACTAUTHOR_STATICEX 0x4F4 +#define IDH_CONTACTSUPPORT_STATICEX 0x4F5 Index: other/Help/Polish/0.txt =================================================================== diff -u --- other/Help/Polish/0.txt (revision 0) +++ other/Help/Polish/0.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2 @@ +.topic 0 +�aden temat nie zosta� powi�zany z t� pozycj�. \ No newline at end of file Index: other/Help/Polish/100.txt =================================================================== diff -u --- other/Help/Polish/100.txt (revision 0) +++ other/Help/Polish/100.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,44 @@ +.topic 0x00 +�aden temat nie zosta� powi�zany z t� pozycj�. + +.topic 1 +Zamyka to okno. + +.topic IDH_HOMEPAGELINK_STATIC +Odno�nik do strony domowej programu. + +.topic IDH_HOSTLINK_STATIC +Odno�nik do strony naszego sponsora internetowego. + +.topic IDH_CONTACT1LINK_STATIC +M�j preferowany adres korespondencyjny. Napisz maila, je�eli chcesz zg�osi� b��d, wyrazi� opini� na temat programu lub je�li chcesz o co� zapyta�. + +.topic IDH_CONTACT2LINK_STATIC +M�j drugi adres korespondencyjny. Napisz maila, je�eli chcesz zg�osi� b��d, wyrazi� opini� na temat programu lub je�li chcesz o co� zapyta�. + +.topic IDH_GENFORUMPAGELINK_STATIC +Odno�nik do strony z forum dyskusyjnym. Je�eli chcesz otrzymywa� powiadomienia o nowych wersjach programu, zapisz si� na niego. + +.topic IDH_GENFORUMSUBSCRIBELINK_STATIC +Odno�nik do adresu mailowego, dzi�ki kt�remu mo�na si� na list� dyskusyjn� 'copy handler'. + +.topic IDH_GENFORUMUNSUBSCRIBELINK_STATIC +Odno�nik do adresu mailowego, dzi�ki kt�remu mo�na si� wypisa� z listy dyskusyjnej 'copy handler'. + +.topic IDH_GENFORUMSENDLINK_STATIC +Powiniene� napisa� maila na ten adres, je�eli chcesz, �eby wszyscy zarejestrowani u�ytkownicy dostawali poczt�. + +.topic IDH_DEVFORUMPAGELINK_STATIC +Odno�nik do strony z forum dyskusyjnym dla programist�w. Powiniene� zapisa� si� na t� list� dyskusyjn�, je�eli piszesz wtyczki do Copy Handlera (np. t�umaczysz program). Je�eli jakie� stringi powinny by� dodane (lub zmienione) w programie, wy�l� maila na forum z dziennikiem zmian. R�wnie� je�eli masz jakie� komentarze dot. kodu �r�d�owego Copy Handlera, mo�esz napisa� tutaj. + +.topic IDH_DEVFORUMSUBSCRIBELINK_STATIC +Odno�nik do adresu mailowego, dzi�ki kt�remu mo�na si� na list� dyskusyjn� 'chdev'. + +.topic IDH_DEVFORUMUNSUBSCRIBELINK_STATIC +Odno�nik do adresu mailowego, dzi�ki kt�remu mo�na si� wypisa� z listy dyskusyjnej 'chdev'. + +.topic IDH_DEVFORUMSENDLINK_STATIC +Musisz napisa� maila na ten adres, je�eli chcesz, �eby wszyscy zarejestrowani u�ytkownicy chdev dostawali poczt�. + +.topic IDH_THANX_EDIT +Lista os�b, kt�rym chcia�bym serdecznie podzi�kowa� za pomoc przy tworzeniu tego programu. \ No newline at end of file Index: other/Help/Polish/131.txt =================================================================== diff -u --- other/Help/Polish/131.txt (revision 0) +++ other/Help/Polish/131.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,86 @@ +.topic IDH_STATUS_LIST +Lista wszystkich zada� i troch� informacji o ka�dym z nich (obecny status, aktualna nazwa pliku �r�d�owego, �cie�ka docelowa i procentowy post�p). Po klikni�ciu na pozycj� z listy, detale zostan� wy�wietlone po prawej stronie. Mo�na manipulowa� zadaniami w tej li�cie, u�ywaj�c przycisk�w znajduj�cych si� poni�ej. + +.topic IDH_PAUSE_BUTTON +Zatrzymuje zaznaczone zadanie. Je�eli inne zadanie oczekiwa�o na jego zako�czenie, zostanie wznowione rozpocz�te. + +.topic IDH_RESTART_BUTTON +Powoduje ponowne uruchomienie zaznaczonego zadania. Zadanie zostanie uruchomione od pocz�tku. + +.topic IDH_CANCEL_BUTTON +Anuluje aktualnie zaznaczone zadanie. + +.topic IDH_DELETE_BUTTON +Usuwa zaznaczone zadanie z listy operacji. Je�eli zadanie jest uruchomione (nie jest w stanie anulowania ani uko�czenia), program zapyta, czy je zako�czy�. + +.topic IDH_PAUSE_ALL_BUTTON +Wstrzymuje wszystkie zadania z listy operacji. + +.topic IDH_RESUME_BUTTON +Wznawia prac� zaznaczonego-wstrzymanego zadania. Podobnie je�eli zadanie jest w stanie oczekiwania (oczekuje na zako�czenie innego), klikni�cie na ten przycisk spowoduje jego uruchomienie. Je�eli akcja zostanie wykonana przy tym rodzaju wznowienia, zadanie zignoruje ustawienie w opcjach pozycji 'Ogranicz ilo�� jednocze�nie wykonywanych operacji' i uruchomi zadanie r�wnolegle + +.topic IDH_START_ALL_BUTTON +Rozpoczyna wszystkie zaplanowane zadania z listy operacji. + +.topic IDH_CANCEL_ALL_BUTTON +Anuluje wszystkie zaplanowane zadania z listy operacji. + +.topic IDH_REMOVE_FINISHED_BUTTON +Usuwa wszystkie anulowane i uko�czone zadania z listy operacji. + +.topic IDH_RESTART_ALL_BUTTON +Uruchamia ponownie wszystkie zaplanowane zadania z listy operacji. + +.topic IDH_ADVANCED_BUTTON +Pokazuje menu z zaawansowanymi ustawieniami odno�nie pojedynczego lub wi�kszej ilo�ci zada� z listy operacji. + +.topic IDH_STICK_BUTTON +Powoduje 'przyklejenie' okna statusu do prawego, dolnego rogu ekranu. + +.topic IDH_ROLL_UNROLL_BUTTON +Zmienia widok okna z zaawansowanego na uproszczony i odwrotnie. + +.topic IDH_SET_BUFFERSIZE_BUTTON +Zmienia obecny rozmiar bufora dla aktualnie zaznaczonego zadania. + +.topic IDH_SET_PRIORITY_BUTTON +Zmienia priorytet aktualnie zaznaczonego zadania. + +.topic IDH_SHOW_LOG_BUTTON +Pokazuje pliki .log (dziennika) powi�zane z aktualnie zaznaczonym zadaniem. + +.topic IDH_ERRORS_EDIT +Wy�wietla informacje o b��dzie, je�eli jaki� zostanie znaleziony. + +.topic IDH_ASSOCIATEDFILES__STATIC +Pokazuje �cie�ki do plik�w, kt�re opisuj� obecnie zaznaczone zadanie. Pliki .atd i .atp zapami�tuj� obecny stan zadania. Plik .log zawiera dziennik z informacjami generowanymi przez zaznaczone zadanie. + +.topic IDH_OPERATION_STATIC +Pokazuje typy operacji i status obecnie zaznaczonego zadania. + +.topic IDH_SOURCE_STATIC +Pokazuje aktualne �cie�ki do plik�w, kt�re s� przetwarzane w zaznaczonym zadaniu. + +.topic IDH_DESTINATION_STATIC +Pokazuje �cie�k� docelow�, do kt�rej zaznaczone zadanie kopiuje lub przenosi dane. + +.topic IDH_PROGRESS_STATIC +Pokazuje aktualne statystyki post�pu zaznaczonego zadania. + +.topic IDH_TIME_STATIC +Pokazuje czas, kt�ry up�yn�� oraz szacowany czas uko�czenia zaznaczonego zadania. + +.topic IDH_TRANSFER_STATIC +Pokazuje obecn� i przeci�tn� pr�dko�� transferu dla zaznaczonego zadania. + +.topic IDH_BUFFERSIZE_STATIC +Wy�wietla rozmiar bufora, kt�ry jest u�ywany przy kopiowaniu obecnego pliku do docelowej lokalizacji. Inforamcja jest wy�wietlana dla obecnego zadania z listy operacji. Mo�esz zmieni� jego wielko��, klikaj�c na przycisk '...' po prawej stronie. + +.topic IDH_PRIORITY_STATIC +Pokazuje priorytet, z jakim obecne zadanie zosta�o uruchomione. Mo�na go zmieni�, u�ywaj�c przycisku '>' po prawej stronie. + +.topic IDH_OVERALL_PROGRESS_STATIC +Pokazuje informacje o post�pie dla wszystkich zada� z listy operacji. + +.topic IDH_OVERALL_TRANSFER_STATIC +Pokazuje obecn� pr�dko�� transferu dla wszystkich dzia�aj�cych zada� z listy operacji. \ No newline at end of file Index: other/Help/Polish/137.txt =================================================================== diff -u --- other/Help/Polish/137.txt (revision 0) +++ other/Help/Polish/137.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +.topic 1 +Zamyka okno i zapami�tuje zmienione ustawienia. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla inforamcje pomocy dla tego okna. + +.topic IDH_DEFAULTSIZE_EDIT +Rozmiar bufora, jaki powinien by� u�yty przy kopiowaniu lub przenoszeniu danych, gdy opcja 'U�ywaj tylko domy�lnego bufora' jest w��czona lub gdy �aden inny rozmiar bufora nie pasuje do obecnej operacji. + +.topic IDH_DEFAULTMULTIPLIER_COMBO +Ustawia jednostk� wielko�ci, w kt�rej wyra�one s� warto�ci po lewej stronie. + +.topic IDH_ONEDISKSIZE_EDIT +Rozmiar bufora, jaki powienien by� u�yty przy kopiowaniu danych pomi�dzy dwoma miejscami le��cymi na tym samym fizycznym dysku twardym. Du�e wielko�ci bufora mog� znacz�co poprawi� wydajno�� kopiowania, jednak zbyt wielkie spowoduj� jej obni�enie. Warto�ci te s� wybierane automatycznie, dop�ki zaznaczone jest pole 'U�ywaj tylko domy�lnego bufora'. + +.topic IDH_ONEDISKMULTIPLIER_COMBO +Okre�la jednostk� wielko�ci, w kt�rej wyra�one s� warto�ci po lewej stronie. + +.topic IDH_TWODISKSSIZE_EDIT +Rozmiar bufora, jaki powinien by� u�yty przy kopiowaniu danych pomi�dzy dwoma oddzielnymi fizycznymi dyskami twardymi. Warto�ci nie powinny by� zbyt du�e, poniewa� wyst�puje prawdopodobie�stwo obni�enia wydajno�ci. Warto�ci te s� wybierane automatycznie, dop�ki zaznaczone jest pole 'U�ywaj tylko domy�lnego bufora'. + +.topic IDH_TWODISKSMULTIPLIER_COMBO +Okre�la jednostk� wielko�ci, w kt�rej wyra�one s� warto�ci po lewej stronie. + +.topic IDH_CDROMSIZE_EDIT +Rozmiar bufora, jaki powinien by� u�yty przy kopiowaniu danych z nap�du CD-ROM na inny no�nik pami�ci. Warto�ci nie powinny by� zbyt du�e, poniewa� nap�dy CD-ROM s� raczej wolnymi urz�dzeniami (w por�wnaniu z nowszymi dyskami twardymi). Warto�ci te s� wybierane automatycznie, dop�ki zaznaczone jest pole 'U�ywaj tylko domy�lnego bufora'. + +.topic IDH_CDROMMULTIPLIER_COMBO +Okre�la jednostk� wielko�ci, w kt�rej wyra�one s� warto�ci po lewej stronie. + +.topic IDH_LANSIZE_EDIT +Rozmiar bufora, jaki powinien by� u�yty przy kopiowaniu danych do lub z sieci lokalnej. Warto�ci powinny by� uzale�nione od wydajno�ci sieci - np. na 10Mbps ��czu powinny by� mniejsze ni� na ��czu 1Gbps. Warto�ci te s� wybierane automatycznie, dop�ki zaznaczone jest pole 'U�ywaj tylko domy�lnego bufora'. + +.topic IDH_LANMULTIPLIER_COMBO +Okre�la jednostk� wielko�ci, w kt�rej wyra�one s� warto�ci po lewej stronie. + +.topic IDH_ONLYDEFAULT_CHECK +Okre�la, czy zadanie (zadania) powinny u�ywa� tylko domy�lnych wielko�ci bufor�w do kopiowania/przenoszenia danych czy te� powinny automatycznie wykrywa� potrzebny rozmiar bufora, analizuj�c no�niki �r�d�owe i docelowe. \ No newline at end of file Index: other/Help/Polish/144.txt =================================================================== diff -u --- other/Help/Polish/144.txt (revision 0) +++ other/Help/Polish/144.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,14 @@ +.topic 1 +Zapami�tuje zmienione ustawienia i zamyka okno. + +.topic 2 +Anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla informacje pomocy dla tego okna. + +.topic IDH_PROPERTIES_LIST +Pokazuje list� w�a�ciwo�ci programu, kt�re mo�na zmieni�. + +.topic IDH_APPLY_BUTTON +Zastosowuje wszystkie zmiany wprowadzone w tym oknie. \ No newline at end of file Index: other/Help/Polish/145.txt =================================================================== diff -u --- other/Help/Polish/145.txt (revision 0) +++ other/Help/Polish/145.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2 @@ +.topic IDH_PROGRESS_LIST +Pokazuje status obecnie aktywnych zada�. Wygl�d jest uzale�niony od ustawie� okna konfiguracyjnego, sekcja 'Miniaturowy widok'. \ No newline at end of file Index: other/Help/Polish/149.txt =================================================================== diff -u --- other/Help/Polish/149.txt (revision 0) +++ other/Help/Polish/149.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,68 @@ +.topic 1 +Zamyka okno i rozpoczyna nowe zadanie, kt�re wykonuje zaplanowane operacje. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Pokazuje informacje pomocy dla tego okna. + +.topic IDH_FILES_LIST +Okre�la list� plik�w i folder�w do skopiowania lub przeniesienia do katalogu docelowego. Mo�na zarz�dza� tymi elementami dzi�ki czterem przyciskom znajduj�cymi si� po prawej stronie. + +.topic IDH_ADDFILE_BUTTON +Dodaje jeden lub wi�cej plik�w do listy z plikami/folderami (po lewej stronie) do skopiowania lub przeniesienia. + +.topic IDH_ADDDIR_BUTTON +Dodaje katalog do listy z plikami/folderami (po lewej stronie) do skopiowania lub przeniesienia. + +.topic IDH_REMOVEFILEFOLDER_BUTTON +Usuwa pliki i/lub foldery z listy po lewej stronie. + +.topic IDH_IMPORT_BUTTON +Importuje �cie�ki plik�w i folder�w z pliku tekstowego. Ka�da linia tekstu musi okre�la� �cie�k� do folderu lub pliku, kt�ry ma by� zaimportowany. + +.topic IDH_DESTPATH_COMBOBOXEX +�cie�ka docelowa - wszystkie pliki i foldery z powy�szej listy zostan� skopiowane lub przeniesione do tego miejsca. + +.topic IDH_DESTBROWSE_BUTTON +Otwiera okno wyboru katalogu, gdzie b�dzie mo�na okre�li� �cie�k� docelow�. + +.topic IDH_OPERATION_COMBO +Okre�la operacj�, kt�ra b�dzie wykonana na plikach i folderach z listy. + +.topic IDH_PRIORITY_COMBO +Okre�la poziom priorytetu, z jakim b�dzie uruchomione zadanie. Zaleca si� u�ywanie go z rozwag� przy korzystaniu z bardzo szybkich pami�ci masowych (np. ram dysk�w lub innych tego typu urz�dze�). + +.topic IDH_COUNT_EDIT +Okre�la liczb� kopii (plik�w �r�d�owych), kt�re zostan� utworzone w katalogu docelowym. U�yteczne, gdy kopiowane s� ma�e ilo�ci danych na pami�� �atwo podatn� na zniszczenie, np. na dyskietk�. + +.topic IDH_BUFFERSIZES_LIST +Okre�la rozmiary bufora, kt�ry b�dzie u�yty przy wykonywaniu zadaniu. Mo�na go zmieni�, klikaj�c na przycisk po prawej stronie. + +.topic IDH_BUFFERSIZES_BUTTON +Umo�liwia zmienienie rozmiar�w bufora, kt�ry b�dzie u�yty do wykonania zaplanowanych operacji. + +.topic IDH_FILTERS_CHECK +W��cza lub wy��cza stosowanie filtrowania nazw plik�w w zadaniu. + +.topic IDH_FILTERS_LIST +Okre�la list� aktywnych filtr�w, kt�re zostan� u�yte do wykonania potrzebnych operacji. Mo�na je dodawa� lub usuwa�, u�ywaj�c przycisk�w po prawej stronie. Podw�jne klikni�cie na elemencie spowoduje edycj� wybranego filtra. + +.topic IDH_ADDFILTER_BUTTON +Dodaje nowy filtr do listy filtr�w. + +.topic IDH_REMOVEFILTER_BUTTON +Usuwa zaznaczony filtr z listy. + +.topic IDH_ADVANCED_CHECK +W��cza lub wy��cza zaawansowane opcje. + +.topic IDH_IGNOREFOLDERS_CHECK +Zaawansowana opcja kopiowania/przenoszenia. Kiedy jest aktywna, program skopiuje tylko pliki do katalogu docelowego, pomijaj�c struktur� katalog�w. Je�li kopiowany jest katalog 'C:\WINDOWS' na 'D:\', powstan� wszystkie pliki z 'C:\WINDOWS' ale bez �adnego podkatalogu wewn�trz w g��wnym folderze na dysku 'D:\'. + +.topic IDH_ONLYSTRUCTURE_CHECK +Zaawansowana opcja kopiowania/przenoszenia. Je�eli zostanie uaktywniona, program skopiuje tylko struktur� plik�w, bez ich zawarto�ci. Zaleca si� u�ywanie tego ustawnienia z rozwag�, poniewa� mo�na straci� wszystkie kopiowane dane. + +.topic IDH_FORCEDIRECTORIES_CHECK +Zaawansowana opcja kopiowania/przenoszenia. Je�eli zostanie uaktywniona, program tworzy pe�n� �cie�k� docelow� (zale�n� od g��wnego folderu dysku �r�d�owego) w katalogu docelowym. Np. je�li kopiowany jest katalog 'C:\WINDOWS\SYSTEM' na 'D:\', powstanie folder 'D:\WINDOWS\SYSTEM' w katalogu docelowym, a folder 'system' b�dzie mia� zawarto�� 'C:\WINDOWS\SYSTEM'. \ No newline at end of file Index: other/Help/Polish/161.txt =================================================================== diff -u --- other/Help/Polish/161.txt (revision 0) +++ other/Help/Polish/161.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 1 +Zamienia �cie�k� podan� powy�ej w oknie edycji na t� z okna edycji poni�ej i zamyka okno. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla informacje pomocy dla tego okna. + +.topic IDH_PATHS_LIST +Lista domy�lnych �cie�ek, kt�re mog� by� zamienione na inne. Je�eli jaka� �cie�ka jest zaznaczona, pojawi si� w oknie edycji poni�ej. + +.topic IDH_SOURCE_EDIT +Okre�la �cie�k�, kt�ra b�dzie zamieniona na t� z okna edycji poni�ej. + +.topic IDH_DESTINATION_EDIT +Okre�la �cie�k�, na kt�r� jedna z powy�szych zostanie zamieniona. Mo�na wpisywa� �cie�k� r�cznie z klawiatury lub wskaza� j�, klikaj�c na przycisk '...' po prawej stronie. + +.topic IDH_BROWSE_BUTTON +Przegl�da w poszukiwaniu �cie�ki, kt�ra b�dzie wy�wietlona w oknie po lewej stronie. \ No newline at end of file Index: other/Help/Polish/162.txt =================================================================== diff -u --- other/Help/Polish/162.txt (revision 0) +++ other/Help/Polish/162.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,41 @@ +.topic 2 +Anuluje ca�e zadanie. + +.topic IDH_MESSAGE_EDIT +Okre�la opis b��du - pow�d, przez kt�ry plik nie m�g� zosta� otwarty. + +.topic IDH_FILENAME_EDIT +Okre�la nazw� oczekiwanego pliku. + +.topic IDH_FILESIZE_EDIT +Okre�la rozmiar oczekiwanego pliku. + +.topic IDH_CREATETIME_EDIT +Okre�la czas/dat� utworzenia oczekiwanego pliku. + +.topic IDH_MODIFY_TIME_EDIT +Okre�la ostatni czas/dat� modyfikacji oczekiwanego pliku. + +.topic IDH_DEST_FILENAME_EDIT +Okre�la nazw� pliku, kt�ry zosta� znaleziony. + +.topic IDH_DEST_FILESIZE_EDIT +Okre�la rozmiar pliku, kt�ry zosta� znaleziony. + +.topic IDH_DEST_CREATETIME_EDIT +Okre�la czas/dat� utworzenia pliku, kt�ry zosta� znaleziony. + +.topic IDH_DEST_MODIFYTIME_EDIT +Okre�la ostatni czas/dat� modyfikacji pliku, kt�ry zosta� znaleziony. + +.topic IDH_RETRY_BUTTON +Ponawia pr�b� otwarcia pliku. + +.topic IDH_IGNORE_BUTTON +Ignoruje b��d i pomija plik. + +.topic IDH_IGNORE_ALL_BUTTON +Ignoruje b��d i pomija kopiowany plik. Je�eli w przysz�o�ci zadanie napotka na podobny b��d - automatycznie go zignoruje. + +.topic IDH_WAIT_BUTTON +Zmienia stan zadania, gdy napotka b��d. Je�eli opcja 'Wznawiaj automatycznie' jest w��czona - zadanie b�dzie przywr�cone po ustalonym czasie oczekiwania. \ No newline at end of file Index: other/Help/Polish/164.txt =================================================================== diff -u --- other/Help/Polish/164.txt (revision 0) +++ other/Help/Polish/164.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,44 @@ +.topic 2 +Anuluje ca�e zadanie. + +.topic IDH_FILENAME_EDIT +Nazwa pliku �r�d�owego. + +.topic IDH_FILESIZE_EDIT +Rozmiar pliku �r�d�owego. + +.topic IDH_CREATETIME_EDIT +Data/czas utworzenia pliku �r�d�owego. + +.topic IDH_MODIFY_TIME_EDIT +Data/czas ostatniej modyfikacji pliku �r�d�owego. + +.topic IDH_DEST_FILENAME_EDIT +Nazwa pliku docelowego. + +.topic IDH_DEST_FILESIZE_EDIT +Rozmiar pliku docelowego. + +.topic IDH_DEST_CREATETIME_EDIT +Data/czas utworzenia pliku docelowego. + +.topic IDH_DEST_MODIFYTIME_EDIT +Data/czas ostatniej modyfikacji pliku docelowego. + +.topic IDH_COPY_REST_ALL_BUTTON +Dokopiowuje reszt� pliku (tylko do��cza brakuj�c� cz��). Je�eli w przysz�o�ci zadanie napotka na podobn� sytuacj� - automatycznie dokopiuje reszt� pliku. + +.topic IDH_COPY_REST_BUTTON +Dokopiowuje reszt� pliku (tylko do��cza brakuj�c� cz��). + +.topic IDH_RECOPY_ALL_BUTTON +Kopiuje plik od pocz�tku. Je�eli w przysz�o�ci zadanie napotka na podobn� sytuacj� - automatycznie ponowi kopiowanie pliku. + +.topic IDH_RECOPY_BUTTON +Kopiuje plik od pocz�tku. + +.topic IDH_IGNORE_BUTTON +Ignoruje ten b��d i pomija plik. + +.topic IDH_IGNORE_ALL_BUTTON +Ignoruje ten b��d i pomija kopiowany plik. Je�eli w przysz�o�ci zadanie napotka na podobn� sytuacj� - automatycznie zignoruje b��d. \ No newline at end of file Index: other/Help/Polish/165.txt =================================================================== diff -u --- other/Help/Polish/165.txt (revision 0) +++ other/Help/Polish/165.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,38 @@ +.topic 2 +Anuluje ca�e zadanie. + +.topic IDH_FILENAME_EDIT +Nazwa pliku �r�d�owego. + +.topic IDH_FILESIZE_EDIT +Rozmiar pliku �r�d�owego. + +.topic IDH_CREATETIME_EDIT +Data/czas utworzenia pliku �r�d�owego. + +.topic IDH_MODIFY_TIME_EDIT +Data/czas ostatniej modyfikacji pliku �r�d�owego. + +.topic IDH_DEST_FILENAME_EDIT +Nazwa pliku docelowego. + +.topic IDH_DEST_FILESIZE_EDIT +Rozmiar pliku docelowego. + +.topic IDH_DEST_CREATETIME_EDIT +Data/czas utworzenia pliku docelowego. + +.topic IDH_DEST_MODIFYTIME_EDIT +Data/czas ostatniej modyfikacji pliku docelowego. + +.topic IDH_RECOPY_ALL_BUTTON +Kopiuje plik od pocz�tku. Je�eli w przysz�o�ci zadanie napotka na podobn� sytuacj� - automatycznie ponowi kopiowanie pliku. + +.topic IDH_RECOPY_BUTTON +Kopiuje plik od pocz�tku. + +.topic IDH_IGNORE_BUTTON +Ignoruje ten b��d i pomija plik. + +.topic IDH_IGNORE_ALL_BUTTON +Ignoruje ten b��d i pomija kopiowany plik. Je�eli w przysz�o�ci zadanie napotka na podobny� sytuacj� - automatycznie zignoruje b��d. \ No newline at end of file Index: other/Help/Polish/167.txt =================================================================== diff -u --- other/Help/Polish/167.txt (revision 0) +++ other/Help/Polish/167.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 2 +Anuluje ca�e zadanie. + +.topic IDH_FILENAME_EDIT +Okre�la nazw� pliku, kt�ry nie m�g� zosta� otwarty. + +.topic IDH_MESSAGE_EDIT +Okre�la opis b��du - pow�d, przez kt�ry plik nie m�g� zosta� otwarty. + +.topic IDH_RETRY_BUTTON +Ponawia pr�b� otwarcia pliku. + +.topic IDH_IGNORE_BUTTON +Ignoruje b��d i pomija kopiowany plik. + +.topic IDH_IGNORE_ALL_BUTTON +Ignoruje b��d i pomija kopiowany plik. Je�eli w przysz�o�ci zadanie napotka na podobn� sytuacj� - automatycznie zignoruje b��d. + +.topic IDH_WAIT_BUTTON +Zmienia stan zadania, gdy napotka b��d. Je�eli opcja 'Wznawiaj automatycznie' jest w��czona - zadanie b�dzie przywr�cone po ustalonym czasie oczekiwania. \ No newline at end of file Index: other/Help/Polish/173.txt =================================================================== diff -u --- other/Help/Polish/173.txt (revision 0) +++ other/Help/Polish/173.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +.topic 2 +Anuluje ca�e zadanie. + +.topic IDH_HEADER_STATIC +Wy�wietla informacje o b��dzie. W miejscu docelowym, na kt�re wskazuje �cie�ka, nie ma wystarczaj�cej ilo�ci wolnego miejsca. + +.topic IDH_FILES_LIST +Wy�wietla list� plik�w, kt�re s� kopiowane do miejsca docelowego. + +.topic IDH_REQUIRED_STATIC +Okre�la wymagan� ilo�� wolnego miejsca, kt�ra jest potrzebna do skopiowania plik�w. + +.topic IDH_AVAILABLE_STATIC +Okre�la ilo�� dost�pnego miejsca w miejscu docelowym. + +.topic IDH_RETRY_BUTTON +Ponawia pr�b� kopiowania pliku. + +.topic IDH_IGNORE_BUTTON +Ignoruje ten b��d i kontynuuje kopiowanie. \ No newline at end of file Index: other/Help/Polish/182.txt =================================================================== diff -u --- other/Help/Polish/182.txt (revision 0) +++ other/Help/Polish/182.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,2 @@ +.topic 2 +Anuluje sekwencj� odliczania i zamyka to okno. \ No newline at end of file Index: other/Help/Polish/195.txt =================================================================== diff -u --- other/Help/Polish/195.txt (revision 0) +++ other/Help/Polish/195.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,89 @@ +.topic 1 +Zamyka okno i zapami�tuje zmienione ustawienia. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla informacje pomocy dla tego okna. + +.topic IDH_FILTER_CHECK +Umo�liwia filtrowanie wzgl�dem zgodno�ci nazw z mask�. Aby pliki zosta�y skopiowane, ich nazwy musz� odpowiada� jednej z tych masek. + +.topic IDH_FILTER_COMBO +Miejsce wprowadzania wymaganej maski filtruj�c� (zgodno�� nazwy z mask�). Je�eli wymagana jest wi�cej ni� jedna maska, nale�y je odseparowa� od siebie, u�ywaj�c znaku '|'. + +.topic IDH_EXCLUDEMASK_CHECK +Umo�liwia filtrowanie wzgl�dem niezgodno�ci nazw z mask�. Nazwy plik�w *nie mog�* zawiera� �adnych z tych masek, aby zosta�y skopiowane. + +.topic IDH_FILTEREXCLUDE_COMBO +Miejsce wprowadzania wymaganej maski filtruj�c� (niezgodno�� nazwy z mask�). Je�eli wymagana jest wi�cej ni� jedna maska, nale�y je odseparowa� od siebie, u�ywaj�c znaku '|'. + +.topic IDH_SIZE_CHECK +Umo�liwia filtrowanie wzgl�dem rozmiaru plik�w. Nazwy plik�w musz� zgadza� si� z ustawieniami poni�ej, aby zosta�y skopiowane. + +.topic IDH_SIZETYPE1_COMBO +Okre�la relacj� mi�dzy rozmiarem pliku �r�d�owego, a rozmiarem okre�lonym po prawej stronie. Wymaga zgodno�ci, aby plik zosta� skopiowany. + +.topic IDH_SIZE1_EDIT +Okre�la rozmiar, do jakiego plik �r�d�owy b�dzie por�wnywany. + +.topic IDH_SIZE1MULTI_COMBO +Mno�nik dla warto�ci po lewej stronie. + +.topic IDH_SIZE2_CHECK +Umo�liwia filtrowanie plik�w wzgl�dem drugiego rozmiaru. Nazwy plik�w musz� zgadza� si� z ustawieniami powy�ej, aby zosta�y skopiowane. + +.topic IDH_SIZETYPE2_COMBO +Okre�la relacje mi�dzy rozmiarem pliku �r�d�owego, a drugim rozmiarem okre�lonym po prawej stronie. Wymaga zgodno�ci, aby plik zosta� skopiowany. + +.topic IDH_SIZE2_EDIT +Okre�la rozmiar, do kt�rego plik �r�d�owy b�dzie por�wnywany. + +.topic IDH_SIZE2MULTI_COMBO +Mno�nik dla warto�ci po lewej stronie. + +.topic IDH_DATE_CHECK +Umo�liwia filtrowanie plik�w wzgl�dem ich dat i czas�w. + +.topic IDH_DATETYPE_COMBO +Rodzaj daty/czasu, kt�ra b�dzie przetworzona przy por�wnywaniu daty/czasu pliku �r�d�owego z wyszczeg�lnionym. + +.topic IDH_DATE1TYPE_COMBO +Okre�la relacje mi�dzy dat�/czasem pliku �r�d�owego, a wyszczeg�lnion� dat� i/lub czasem. Wymaga zgodno�ci, aby plik zosta� skopiowany. + +.topic IDH_DATE1_DATETIMEPICKER +Okre�la dat�, kt�ra b�dzie por�wnywana do daty pliku �r�d�owego. Wymaga zgodno�ci, aby plik zosta� skopiowany. U�ywane tylko wtedy, gdy zaznaczone. + +.topic IDH_TIME1_DATETIMEPICKER +Okre�la dat�, kt�ra b�dzie por�wnywana do daty pliku �r�d�owego. Wymaga zgodno�ci, aby plik zosta� skopiowany. U�ywane tylko wtedy, gdy zaznaczone. + +.topic IDH_DATE2_CHECK +Umo�liwia filtrowanie plik�w wzgl�dem ich dat i czas�w (sekcja druga). + +.topic IDH_DATE2TYPE_COMBO +Okre�la drug� relacj� mi�dzy dat�/czasem pliku �r�d�owego a okre�lon� dat� i/lub czasem. Wymaga zgodno�ci, aby plik zosta� skopiowany. + +.topic IDH_DATE2_DATETIMEPICKER +Okre�la drug� dat�, kt�ra b�dzie por�wnywana do daty pliku �r�d�owego. Wymaga zgodno�ci, aby plik zosta� skopiowany. U�ywane tylko wtedy, gdy zaznaczone. + +.topic IDH_TIME2_DATETIMEPICKER +Okre�la drugi czas, kt�ry b�dzie por�wnywany do czasu pliku �r�d�owego. Wymaga zgodno�ci, aby plik zosta� skopiowany. U�ywane tylko wtedy, gdy zaznaczone. + +.topic IDH_ATTRIBUTES_CHECK +Umo�liwia filtrowanie plik�w wzgl�dem ich atrybut�w. + +.topic IDH_ARCHIVE_CHECK +Zezwala na filtrowanie wzgl�dem atrybutu 'Archiwalny'. Je�eli odznaczone - plik nie mo�e mie� ustawionego tego atrybutu, aby zosta� skopiowany; je�eli zaznaczone - musi by� ustawiony; je�eli jest szarawe - nie ma to znaczenia. + +.topic IDH_READONLY_CHECK +Zezwala na filtrowanie wzgl�dem atrybutu 'Tylko do odczytu'. Je�eli odznaczone - plik nie mo�e mie� ustawionego tego atrybutu, aby zosta� skopiowany; je�eli zaznaczone - musi by� ustawiony; je�eli jest szarawe - nie ma to znaczenia. + +.topic IDH_HIDDEN_CHECK +Zezwala na filtrowanie wzgl�dem atrybutu 'Ukryty'. Je�eli odznaczone - plik nie mo�e mie� ustawionego tego atrybutu, aby zosta� skopiowany; je�eli zaznaczone - musi by� ustawiony; je�eli jest szarawe - nie ma to znaczenia. + +.topic IDH_SYSTEM_CHECK +Zezwala na filtrowanie wzgl�dem atrybutu 'Systemowy'. Je�eli odznaczone - plik nie mo�e mie� ustawionego tego atrybutu, aby zosta� skopiowany; je�eli zaznaczone - musi by� ustawiony; je�eli jest szarawe - nie ma to znaczenia. + +.topic IDH_DIRECTORY_CHECK +Zezwala na filtrowanie wzgl�dem atrybutu 'Katalog'. Je�eli odznaczone - plik nie mo�e mie� ustawionego tego atrybutu, aby zosta� skopiowany; je�eli zaznaczone - musi by� ustawiony; je�eli jest szarawe - nie ma to znaczenia. \ No newline at end of file Index: other/Help/Polish/208.txt =================================================================== diff -u --- other/Help/Polish/208.txt (revision 0) +++ other/Help/Polish/208.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,35 @@ +.topic 1 +Zamyka okno i zapami�tuje zmienione ustawienia. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla informacje pomocy dla tego okna. + +.topic IDH_SHORTCUT_LIST +Lista obecnie zdefiniowanych skr�t�w. Mo�na je edytowa�, u�ywaj�c poni�szych element�w. + +.topic IDH_UP_BUTTON +Przenosi zaznaczony skr�t (skr�ty) w g�r� o jedn� pozycj�. + +.topic IDH_DOWN_BUTTON +Przenosi zaznaczony skr�t (skr�ty) w d� o jedn� pozycj�. + +.topic IDH_NAME_EDIT +Okre�la nazw� dla skr�tu. + +.topic IDH_PATH_COMBOBOXEX +Okre�la �cie�k� skr�tu. Mo�na wpisa� �cie�k� r�cznie z klawiatury lub wskaza� j�, klikaj�c na przycisk '...' po prawej stronie. + +.topic IDH_BROWSE_BUTTON +Przegl�da w poszukiwaniu �cie�ki, kt�ra b�dzie wy�wietlona w oknie po lewej stronie. + +.topic IDH_ADD_BUTTON +Dodaje skr�t zdefiniowany przez edycj� powy�szego pola kombi do listy skr�t�w. + +.topic IDH_CHANGE_BUTTON +Zmienia zaznaczony skr�t w li�cie na ten zdefiniowany przez edycj� i powy�sze pole kombi. + +.topic IDH_DELETE_BUTTON +Usuwa zaznaczony skr�t z listy. \ No newline at end of file Index: other/Help/Polish/209.txt =================================================================== diff -u --- other/Help/Polish/209.txt (revision 0) +++ other/Help/Polish/209.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,26 @@ +.topic 1 +Zamyka okno i zapami�tuje zmienione ustawienia. + +.topic 2 +Zamyka okno i anuluje wszystkie wprowadzone zmiany. + +.topic IDH_HELP_BUTTON +Wy�wietla inforamcje pomocy dla tego okna. + +.topic IDH_RECENT_LIST +Lista ostatnio u�ywanych �cie�ek. Mo�na nimi zarz�dza� dzi�ki poni�szym elementom. + +.topic IDH_PATH_EDIT +Wy�wietla �cie�ki obecnie zaznaczonej listy lub ca�kem nowej - okre�lane przez u�ytkownika. Mo�na wpisa� �cie�k� r�cznie z klawiatury lub wskaza� j�, klikaj�c na przycisk '...' po prawej stronie. + +.topic IDH_BROWSE_BUTTON +Przegl�da w poszukiwaniu �cie�ki, kt�ra b�dzie wy�wietlona w oknie po lewej stronie. + +.topic IDH_ADD_BUTTON +Dodaje podan� �cie�k� do listy. + +.topic IDH_CHANGE_BUTTON +Zamienia obecnie zaznaczon� list� z podan� �cie�k�. + +.topic IDH_DELETE_BUTTON +Usuwa obecne zaznaczenie z listy. \ No newline at end of file Index: other/Help/Polish/HTMLDefines.h =================================================================== diff -u --- other/Help/Polish/HTMLDefines.h (revision 0) +++ other/Help/Polish/HTMLDefines.h (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,295 @@ +// Help Map file generated from application's resource.h file. + +// Commands (ID_* and IDM_*) +#define HID_POPUP_SHOW_STATUS 0x8005 +#define HID_POPUP_TIME_CRITICAL 0x8006 +#define HID_POPUP_HIGHEST 0x8007 +#define HID_POPUP_ABOVE_NORMAL 0x8008 +#define HID_POPUP_NORMAL 0x8009 +#define HID_POPUP_BELOW_NORMAL 0x800A +#define HID_POPUP_LOWEST 0x800B +#define HID_POPUP_IDLE 0x800C +#define HID_POPUP_CUSTOM_BUFFERSIZE 0x8019 +#define HID_POPUP_OPTIONS 0x8022 +#define HID_SHOW_MINI_VIEW 0x8023 +#define HID_POPUP_CUSTOM_COPY 0x8024 +#define HID_POPUP_REPLACE_PATHS 0x8025 +#define HID_POPUP_MONITORING 0x8026 +#define HID_POPUP_SHUTAFTERFINISHED 0x8027 +#define HID_POPUP_REGISTERDLL 0x8029 +#define HID_POPUP_UNREGISTERDLL 0x802A +#define HID_POPUP_HELP 0x802E +#define HID_POPUP_TEMP 0x802F + +// Prompts (IDP_*) + +// Resources (IDR_*) +#define HIDR_MANIFEST 0x20001 +#define HIDR_MAINFRAME 0x20080 +#define HIDR_SYSTEMTYPE 0x20081 +#define HIDR_POPUP_MENU 0x20082 +#define HIDR_PRIORITY_MENU 0x20087 +#define HIDR_BUFFERSIZE_MENU 0x20088 +#define HIDR_PAUSE_LIST_MENU 0x2008A +#define HIDR_ADVANCED_MENU 0x200A0 +#define HIDR_POPUP_TOOLBAR 0x200AA +#define HIDR_THANKS_TEXT 0x200D3 + +// Dialogs (IDD_*) +#define HIDD_ABOUTBOX 0x20064 +#define HIDD_STATUS_DIALOG 0x20083 +#define HIDD_BUFFERSIZE_DIALOG 0x20089 +#define HIDD_OPTIONS_DIALOG 0x20090 +#define HIDD_MINIVIEW_DIALOG 0x20091 +#define HIDD_CUSTOM_COPY_DIALOG 0x20095 +#define HIDD_FOLDER_BROWSING_DIALOG 0x20096 +#define HIDD_NEW_FOLDER_DIALOG 0x20097 +#define HIDD_NEW_QUICK_ACCESS_DIALOG 0x20098 +#define HIDD_REPLACE_PATHS_DIALOG 0x200A1 +#define HIDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 0x200A2 +#define HIDD_FEEDBACK_REPLACE_FILES_DIALOG 0x200A4 +#define HIDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 0x200A5 +#define HIDD_FEEDBACK_DSTFILE_DIALOG 0x200A7 +#define HIDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 0x200AD +#define HIDD_SHUTDOWN_DIALOG 0x200B6 +#define HIDD_FILTER_DIALOG 0x200C3 +#define HIDD_SHORTCUTEDIT_DIALOG 0x200D0 +#define HIDD_RECENTEDIT_DIALOG 0x200D1 + +// Frame Controls (IDW_*) + +// Controls (IDC_*) +#define IDH_ABOUTBOX 0xD2 +#define IDH_PROGRAM_STATIC 0x3E8 +#define IDH_ADDFILE_BUTTON 0x3EA +#define IDH_STATUS_LIST 0x3EB +#define IDH_REMOVEFILEFOLDER_BUTTON 0x3EC +#define IDH_ALL_PROGRESS 0x3ED +#define IDH_DESTPATH_EDIT 0x3EE +#define IDH_TASK_PROGRESS 0x3EF +#define IDH_DESTBROWSE_BUTTON 0x3F0 +#define IDH_OPERATION_COMBO 0x3F1 +#define IDH_FILTERS_LIST 0x3F2 +#define IDH_ADDDIR_BUTTON 0x3F3 +#define IDH_BUFFERSIZES_LIST 0x3F4 +#define IDH_SET_BUFFERSIZE_BUTTON 0x3F5 +#define IDH_FILTERS_CHECK 0x3F6 +#define IDH_IGNOREFOLDERS_CHECK 0x3F7 +#define IDH_SET_PRIORITY_BUTTON 0x3F8 +#define IDH_ONLYSTRUCTURE_CHECK 0x3F9 +#define IDH_PAUSE_BUTTON 0x3FA +#define IDH_STANDARD_CHECK 0x3FB +#define IDH_FORCEDIRECTORIES_CHECK 0x3FC +#define IDH_RESUME_BUTTON 0x3FD +#define IDH_CANCEL_BUTTON 0x3FE +#define IDH_ADVANCED_CHECK 0x3FF +#define IDH_BUFFERSIZES_BUTTON 0x400 +#define IDH_ADDFILTER_BUTTON 0x401 +#define IDH_REMOVEFILTER_BUTTON 0x402 +#define IDH_SOURCE_STATIC 0x403 +#define IDH_DESTINATION_STATIC 0x404 +#define IDH_OPERATION_STATIC 0x405 +#define IDH_BUFFERSIZE_STATIC 0x406 +#define IDH_PRIORITY_STATIC 0x407 +#define IDH_ERRORS_STATIC 0x408 +#define IDH_PROGRESS_STATIC 0x409 +#define IDH_TRANSFER_STATIC 0x40A +#define IDH_OVERALL_PROGRESS_STATIC 0x40B +#define IDH_OVERALL_TRANSFER_STATIC 0x40C +#define IDH_TIME_STATIC 0x40D +#define IDH_ROLL_UNROLL_BUTTON 0x40E +#define IDH_SIZE_EDIT 0x40F +#define IDH_ASSOCIATEDFILES__STATIC 0x410 +#define IDH_START_ALL_BUTTON 0x411 +#define IDH_RESTART_BUTTON 0x412 +#define IDH_DELETE_BUTTON 0x413 +#define IDH_PAUSE_ALL_BUTTON 0x414 +#define IDH_RESTART_ALL_BUTTON 0x415 +#define IDH_CANCEL_ALL_BUTTON 0x416 +#define IDH_REMOVE_FINISHED_BUTTON 0x417 +#define IDH_PROPERTIES_LIST 0x418 +#define IDH_PROGRESS_LIST 0x419 +#define IDH_SOURCE_EDIT 0x41A +#define IDH_DESTINATION_EDIT 0x41B +#define IDH_DIRECTORY_TREE 0x41D +#define IDH_QUICK_ACCESS_LIST 0x41E +#define IDH_PATH_EDIT 0x41F +#define IDH_HEADER_TEXT_STATIC 0x420 +#define IDH_FIND_PATH_BUTTON 0x421 +#define IDH_NEW_FOLDER_BUTTON 0x422 +#define IDH_PATH_STATIC 0x423 +#define IDH_ADD_BUTTON 0x424 +#define IDH_REMOVE_BUTTON 0x425 +#define IDH_TITLE_EDIT 0x426 +#define IDH_BROWSE_BUTTON 0x428 +#define IDH_FILES_LIST 0x429 +#define IDH_ADD_DIRECTORY_BUTTON 0x42A +#define IDH_MASK_EDIT 0x42B +#define IDH_OPERATION_TYPE_COMBO 0x42C +#define IDH_ADD_FILES_BUTTON 0x42D +#define IDH_BUFFERSIZE_EDIT 0x42E +#define IDH_PRIORITY_COMBO 0x42F +#define IDH_IGNORE_FOLDERS_CHECK 0x431 +#define IDH_ONLY_CREATE_CHECK 0x432 +#define IDH_ADVANCED_BUTTON 0x435 +#define IDH_PATHS_LIST 0x436 +#define IDH_FILENAME_EDIT 0x440 +#define IDH_FILESIZE_EDIT 0x441 +#define IDH_DESTFILENAME_EDIT 0x442 +#define IDH_CREATETIME_EDIT 0x443 +#define IDH_MODIFY_TIME_EDIT 0x444 +#define IDH_DEST_FILENAME_EDIT 0x445 +#define IDH_DEST_FILESIZE_EDIT 0x446 +#define IDH_DEST_CREATETIME_EDIT 0x447 +#define IDH_DEST_MODIFYTIME_EDIT 0x448 +#define IDH_IGNORE_BUTTON 0x449 +#define IDH_IGNORE_ALL_BUTTON 0x44A +#define IDH_WAIT_BUTTON 0x44B +#define IDH_RETRY_BUTTON 0x44C +#define IDH_COPY_REST_BUTTON 0x44F +#define IDH_RECOPY_BUTTON 0x450 +#define IDH_COPY_REST_ALL_BUTTON 0x452 +#define IDH_RECOPY_ALL_BUTTON 0x453 +#define IDH_MESSAGE_EDIT 0x458 +#define IDH_COUNT_EDIT 0x45F +#define IDH_SHOW_LOG_BUTTON 0x460 +#define IDH_STICK_BUTTON 0x462 +#define IDH_FREESPACE_STATIC 0x463 +#define IDH_DISK_STATIC 0x464 +#define IDH_REQUIRED_STATIC 0x467 +#define IDH_AVAILABLE_STATIC 0x468 +#define IDH_TEST_BUTTON 0x469 +#define IDH_SOURCEFILENAME_EDIT 0x46A +#define IDH_YESALL_BUTTON 0x46B +#define IDH_NOALL_BUTTON 0x46C +#define IDH_DEFAULTMULTIPLIER_COMBO 0x46D +#define IDH_DEFAULTSIZE_EDIT 0x46E +#define IDH_ONEDISKSIZE_EDIT 0x46F +#define IDH_CHANGEBUFFER_BUTTON 0x471 +#define IDH_ONEDISKMULTIPLIER_COMBO 0x472 +#define IDH_TWODISKSSIZE_EDIT 0x473 +#define IDH_TWODISKSMULTIPLIER_COMBO 0x474 +#define IDH_CDROMSIZE_EDIT 0x475 +#define IDH_CDROMMULTIPLIER_COMBO 0x476 +#define IDH_LANSIZE_EDIT 0x477 +#define IDH_LANMULTIPLIER_COMBO 0x478 +#define IDH_ONLYDEFAULT_CHECK 0x479 +#define IDH_TIME_PROGRESS 0x47A +#define IDH_ERRORS_EDIT 0x47B +#define IDH_FILTER_COMBO 0x47D +#define IDH_FILTER_CHECK 0x47E +#define IDH_SIZE_CHECK 0x47F +#define IDH_SIZE1_EDIT 0x480 +#define IDH_SIZE1MULTI_COMBO 0x481 +#define IDH_SIZETYPE1_COMBO 0x482 +#define IDH_SIZE1_SPIN 0x483 +#define IDH_SIZE2_EDIT 0x484 +#define IDH_SIZE2MULTI_COMBO 0x485 +#define IDH_SIZETYPE2_COMBO 0x486 +#define IDH_SIZE2_SPIN 0x487 +#define IDH_SIZE2_CHECK 0x488 +#define IDH_DATE_CHECK 0x489 +#define IDH_ATTRIBUTES_CHECK 0x48A +#define IDH_ARCHIVE_CHECK 0x48B +#define IDH_READONLY_CHECK 0x48C +#define IDH_HIDDEN_CHECK 0x48D +#define IDH_SYSTEM_CHECK 0x48E +#define IDH_DATETYPE_COMBO 0x48F +#define IDH_DATE1TYPE_COMBO 0x490 +#define IDH_DATE1_DATETIMEPICKER 0x491 +#define IDH_TIME1_DATETIMEPICKER 0x492 +#define IDH_DATE2_CHECK 0x493 +#define IDH_DATE2TYPE_COMBO 0x494 +#define IDH_DATE2_DATETIMEPICKER 0x495 +#define IDH_TIME2_DATETIMEPICKER 0x496 +#define IDH_DIRECTORY_CHECK 0x497 +#define IDH_FILTEREXCLUDE_COMBO 0x498 +#define IDH_EXCLUDEMASK_CHECK 0x499 +#define IDH_COUNT_SPIN 0x49A +#define IDH_DESTPATH_COMBOBOXEX 0x49B +#define IDH_SHORTCUT_LIST 0x49C +#define IDH_NAME_EDIT 0x49D +#define IDH_PATH_COMBOBOXEX 0x49E +#define IDH_CHANGE_BUTTON 0x4A1 +#define IDH_RECENT_LIST 0x4A6 +#define IDH_IMPORT_BUTTON 0x4A7 +#define IDH_UP_BUTTON 0x4A8 +#define IDH_DOWN_BUTTON 0x4A9 +#define IDH_THANX_EDIT 0x4AE +#define IDH_COPYRIGHT_STATIC 0x4AF +#define IDH_FOLDER_TREE 0x4B0 +#define IDH_DISTRIBUTION_STATIC 0x4B0 +#define IDH_NEWFOLDER_BUTTON 0x4B1 +#define IDH_HOMEPAGE_STATIC 0x4B1 +#define IDH_TITLE_STATIC 0x4B2 +#define IDH_HOMEPAGELINK_STATIC 0x4B2 +#define IDH_LARGEICONS_BUTTON 0x4B3 +#define IDH_CONTACT_STATIC 0x4B3 +#define IDH_HOMEPAGELINK2_STATIC 0x4B3 +#define IDH_SMALLICONS_BUTTON 0x4B4 +#define IDH_GENFORUM_STATIC 0x4B4 +#define IDH_LIST_BUTTON 0x4B5 +#define IDH_DEVFORUM_STATIC 0x4B5 +#define IDH_REPORT_BUTTON 0x4B6 +#define IDH_CONTACT1LINK_STATIC 0x4B6 +#define IDH_CONTACT2LINK_STATIC 0x4B7 +#define IDH_GENFORUMPAGELINK_STATIC 0x4B8 +#define IDH_TOGGLE_BUTTON 0x4B9 +#define IDH_GENFORUMSUBSCRIBELINK_STATIC 0x4B9 +#define IDH_ADDSHORTCUT_BUTTON 0x4BA +#define IDH_GENFORUMUNSUBSCRIBELINK_STATIC 0x4BA +#define IDH_REMOVESHORTCUT_BUTTON 0x4BB +#define IDH_GENFORUMSENDLINK_STATIC 0x4BB +#define IDH_DEVFORUMPAGELINK_STATIC 0x4BC +#define IDH_DEVFORUMSUBSCRIBELINK_STATIC 0x4BD +#define IDH_DEVFORUMUNSUBSCRIBELINK_STATIC 0x4BE +#define IDH_DEVFORUMSENDLINK_STATIC 0x4BF +#define IDH_THANX_STATIC 0x4C0 +#define IDH_UPX_STATIC 0x4C1 +#define IDH_CONTACT3LINK_STATIC 0x4C1 +#define IDH_APPLY_BUTTON 0x4C2 +#define IDH_001_STATIC 0x4C3 +#define IDH_002_STATIC 0x4C4 +#define IDH_003_STATIC 0x4C5 +#define IDH_004_STATIC 0x4C6 +#define IDH_005_STATIC 0x4C7 +#define IDH_006_STATIC 0x4C8 +#define IDH_007_STATIC 0x4C9 +#define IDH_008_STATIC 0x4CA +#define IDH_009_STATIC 0x4CB +#define IDH_010_STATIC 0x4CC +#define IDH_011_STATIC 0x4CD +#define IDH_012_STATIC 0x4CE +#define IDH_013_STATIC 0x4CF +#define IDH_014_STATIC 0x4D0 +#define IDH_015_STATIC 0x4D1 +#define IDH_016_STATIC 0x4D2 +#define IDH_017_STATIC 0x4D3 +#define IDH_018_STATIC 0x4D4 +#define IDH_019_STATIC 0x4D5 +#define IDH_020_STATIC 0x4D6 +#define IDH_021_STATIC 0x4D7 +#define IDH_022_STATIC 0x4D8 +#define IDH_023_STATIC 0x4D9 +#define IDH_024_STATIC 0x4DA +#define IDH_025_STATIC 0x4DB +#define IDH_026_STATIC 0x4DC +#define IDH_027_STATIC 0x4DD +#define IDH_028_STATIC 0x4DE +#define IDH_029_STATIC 0x4DF +#define IDH_030_STATIC 0x4E0 +#define IDH_BAR1_STATIC 0x4E1 +#define IDH_BAR2_STATIC 0x4E2 +#define IDH_BAR3_STATIC 0x4E3 +#define IDH_BAR4_STATIC 0x4E4 +#define IDH_BAR5_STATIC 0x4E5 +#define IDH_HEADER_STATIC 0x4E6 +#define IDH_HOSTLINK_STATIC 0x4E7 +#define IDH_HELP_BUTTON 0x4E9 +#define IDH_PROGRAM_STATICEX 0x4EF +#define IDH_FULLVERSION_STATICEX 0x4F0 +#define IDH_HOMEPAGE_STATICEX 0x4F1 +#define IDH_CONTACT_STATICEX 0x4F2 +#define IDH_LICENSE_STATICEX 0x4F3 +#define IDH_CONTACTAUTHOR_STATICEX 0x4F4 +#define IDH_CONTACTSUPPORT_STATICEX 0x4F5 Index: other/Help/Polish/advmenu.htm =================================================================== diff -u --- other/Help/Polish/advmenu.htm (revision 0) +++ other/Help/Polish/advmenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,21 @@ + + + + + + + +Menu Zaawansowane + + + +
Menu Zaawansowane umieszczone jest w oknie statusu. +
    +
  • Zamie� �cie�ki - pozwala u�ytkownikowi na zmian� niekt�rych �cie�ek �r�d�owych (np. kopiujesz pliki z 'C:\WINDOWS', w czasie operacji uruchamiasz ponownie komputer, po czym litera dysku z 'C:\' zmienia si� na 'D:\' (na przyk�ad). Polecenie zezwala Ci na zamian� �cie�ki �r�d�owej z 'C:\WINDOWS' na 'D:\WINDOWS'). Aby wprowadzi� zmiany, zadanie musi by� spauzowane. Polecenie otwiera okno zamiany �cie�ek.
  • +
+
+
+ + + + Index: other/Help/Polish/buffersize.htm =================================================================== diff -u --- other/Help/Polish/buffersize.htm (revision 0) +++ other/Help/Polish/buffersize.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,26 @@ + + + + + + + +Okno ustawie� wielko�ci bufora + + + +
To okno mo�e zosta� wy�wietlone z okna ustawie� (sekcja 'Bufor') lub z okna statusu. +
    +
  • Domy�lny - domy�lny rozmiar bufora. U�ywane, kiedy w��czona jest opcja 'U�ywaj tylko domy�lnego bufora' w opcjach konfiguracji (sekcja 'Bufor'), lub gdy �aden inny rozmiar bufora nie pasuje do obecnej operacji.
  • +
  • Dla kopiowania w obr�bie jednego dysku - bufor ten u�ywany jest, gdy pliki �r�d�owe i folder docelowy le�� na tym samym fizycznym dysku twardym. Rozmiar bufora jest zazwyczaj wi�kszy ni� standardowy bufor do kopiowania pomi�dzy dwoma dyskami, poniewa� je�eli kopiowane s� dane wi�kszymi porcjami, dysk nie jest tak bardzo obci��any, jak ma to miejsce przy ma�ym buforze.
  • +
  • Dla kopiowania pomi�dzy dwoma dyskami - bufor ten jest u�ywany, gdy dane s� kopiowane z jednego dysku fizycznego na drugi.
  • +
  • Dla kopiowania z u�yciem CD-ROMu - bufor ten jest u�ywany, gdy kopiowane s� dane z nap�du CD-ROM na inny no�nik pami�ci.
  • +
  • Dla kopiowania z u�yciem sieci - bufor ten jest u�ywany, gdy kopiowane s� dane do lub z sieci lokalnej.
  • +
  • U�yj tylko domy�lnego bufora - je�eli ta opcja jest zaznaczona, zadanie (zadania) b�d� zawsze u�ywa�y domy�lnej wielko�ci bufora, ignoruj�c rodzaj �r�d�a i miejsce docelowe no�nika danych.
  • +
+
+
+
Zobacz tak�e: Okno ustawie�, Okno statusu.
+ + + Index: other/Help/Polish/bugs.htm =================================================================== diff -u --- other/Help/Polish/bugs.htm (revision 0) +++ other/Help/Polish/bugs.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,26 @@ + + + + + + + +Znane b��dy / problemy + + + +
+
    +
  • przenoszenie po sieci powoduje zawsze kopiowanie zawarto�ci, pomimo, i� w niekt�rych przypadkach da si� to zrobi� bez kopiowania,
  • +
  • przechwytywanie przez program przeci�ganie plik�w lewym przyciskiem myszy nie dzia�a na cz�ci system�w (zw�aszcza tych starszych - np. Windows 98, + 95),
  • +
  • rysowanie ikon w menu kontekstowym Eksplorera nie dzia�a w starszych wersjach systemu Windows,
  • +
  • kopiowanie wielu ma�ych plik�w jest raczej powolne.
  • +
+
+
+ + + + Index: other/Help/Polish/ch.gif =================================================================== diff -u Binary files differ Index: other/Help/Polish/customcopy.htm =================================================================== diff -u --- other/Help/Polish/customcopy.htm (revision 0) +++ other/Help/Polish/customcopy.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,38 @@ + + + + + + + +Okno kopiowania z parametrami + + + +
+
    +
  • Lista plik�w/folder�w �r�d�owych - zawiera list� plik�w i folder�w, kt�re s� kopiowane. Mo�na nimi zarz�dza�, korzystaj�c z przycisk�w po prawej stronie.
  • +
  • Dodaj plik(i)... - zezwala u�ytkownikowi na dodanie jednego lub wi�kszej ilo�ci plik�w do listy danych �r�d�owych.
  • +
  • Dodaj folder... - zezwala u�ytkownikowi na dodanie katalogu do listy danych �r�d�owych.
  • +
  • Usu� - Usuwa zaznaczone obiekty z listy danych �r�d�owych.
  • +
  • Importuj... - zezwala u�ytkownikowi na import plik�w i folder�w �r�d�owych z pliku. Ka�da linia pliku powinna zawiera� jedn�, pe�n� �cie�k� do pliku lub katalogu.
  • +
  • Folder docelowy - zezwala u�ytkownikowi na podanie �cie�ki docelowej, do kt�rej pliki �r�d�owe b�d� skopiowane lub przeniesione. Mo�na wpisa� �cie�k� r�cznie za pomoc� klawiatury lub wskaza� j�, klikaj�c na przycisk '...' po prawej stronie.
  • +
  • Rodzaj operacji - okre�la operacj�, kt�ra b�dzie wykonana na plikach �r�d�owych.
  • +
  • Priorytet - okre�la priorytet w�tku, z jakim b�dzie uruchomione zadanie.
  • +
  • Ilo�� kopii - okre�la ilo�� kopii plik�w �r�d�owych, kt�re powinny zosta� przetworzone. Dost�pne warto�ci s� z przedzia�u 0~240. U�yteczne, gdy kopiowane s� ma�e ilo�ci danych na niepewny rodzaj pami�ci, np. na dyskietk�.
  • +
  • Wielko�ci bufor�w - okre�laj� rozmiary bufora, kt�ry b�dzie u�yty przy kopiowaniu lub przenoszeniu danych �r�d�owych do miejsca docelowego.
  • +
  • Filtrowanie - kiedy jest zaznaczone - zezwala u�ytkownikowi na okre�lenie rodzaj�w filtr�w, kt�re b�d� u�yte przy kopiowaniu. Przyciski po prawej stronie zezwalaj� u�ytkownikowi na dodanie lub usuni�cie filtru. Przycisk '+' (Dodaj) otwiera okno ustawie� filtrowania.
  • +
  • Operacje zaawansowane +
      +
    • Nie tw�rz katalog�w docelowych - kopiuj pliki - kiedy jest zaznaczone powoduje, �e zadanie pomija struktur� katalog�w i kopiuje wszystkie znalezione pliki z ka�dego przeszukanego folderu do folderu docelowego.
    • +
    • Tw�rz struktur� katalog�w w folderze docelowym (wzgl�dem katalogu g��wnego dysku) - podczas kopiowania plik�w program utworzy ca�� �cie�k� znalezionego �r�d�a na no�niku danych w katalogu docelowym.
    • +
    • Nie kopiuj/przeno� zawarto�ci plik�w - tylko je tw�rz (puste) - dzia�a jak normalne kopiowanie/przenoszenie, ale nie kopiuje zawarto�ci plik�w - docelowe elementy b�d� puste. Uwa�aj, kiedy korzystasz z tej opcji, poniewa� mo�esz straci� wszystkie kopiowane dane.
    • +
    +
+ +
+
+ + + + Index: other/Help/Polish/explorermenu.htm =================================================================== diff -u --- other/Help/Polish/explorermenu.htm (revision 0) +++ other/Help/Polish/explorermenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,37 @@ + + + + + + + +Menu kontekstowe Eksplorera + + + +
Kiedy u�ywane jest rozszerzenie pow�oki systemowej, niekt�re obiekty (polecenia) s� dodawane do menu kontekstowego Eksploratora. Wyst�puj� dwa typy menu, kt�re s� modyfikowane przez Copy Handlera: +
    +
  • Menu kontekstowe 'drag&drop' ('przeci�gnij i upu��') - jest ono wy�wietlane, gdy pliki i/lub foldery s� przeci�gane z jednego miejsca do drugiego z u�yciem prawego przycisku myszy. +
      +
    • (CH) Kopiuj tutaj - kopiuje przeci�gane pliki do miejsca, w kt�rym zosta�y upuszczone.
    • +
    • (CH) Przenie� tutaj - przenosi przeci�gane pliki do miejsca, w kt�rym zosta�y upuszczone.
    • +
    • (CH) Kopiu/przenie� specjalne... - otwiera okno kopiowania z parametrami, gdzie mo�na dostosowa� niekt�re ustawienia odno�nie operacji 'przeci�gnij i upu��'.
    • +
    +
  • +
    +
  • Standardowe menu kontekstowe - wy�wietlane po klikni�ciu na jaki� plik lub folder (lub jego t�o). +
      +
    • (CH) Wklej - w��czane tylko wtedy, gdy menu zosta�o otwarte prawym przyciskiem myszy na katalogu lub jego tle i w schowku znajduj� si� pliki lub foldery. Dzia�a w taki sam spos�b jak normalne windowsowe polecenie wklejania, ale operacja jest wykonywana z u�yciem Copy Handlera.
    • +
    • (CH) Wklej specjalne... - w��czane tylko wtedy, gdy menu zosta�o otwarte prawym przyciskiem myszy na katalogu lub jego tle i w schowku znajduj� si� pliki lub foldery. Dzia�a w troszk� podobny spos�b do poprzedniej opcji, wy�wietlaj�c dodatkowo okno kopiowania z parametrami, gdzie mo�na dostosowa� niekt�re ustawienia, zanim operacja zostanie rozpocz�ta.
    • +
    • (CH) Kopiuj do - menu rozszerzalne. W��czane tylko wtedy, gdy menu zosta�o otwarte prawym przyciskiem myszy na pliku lub katalogu (ale nie na jego tle) i kiedy istnieje co najmniej jeden zdefiniowany skr�t w opcjach (sekcja 'Skr�ty'). Polecenie kopiuje zaznaczone pliki do miejsca, na kt�re wskazuje wybrany skr�t.
    • +
    • (CH) Przenie� do - polecenie prawie identyczne z poprzednim, z tym, �e w przeciwie�stwie do niego przenosi pliki lub foldery.
    • +
    • (CH) Kopiuj/przenie� specjalne do... - dzia�a podobnie do polecenia 'Kopiuj do', wy�wietlaj�c dodatkowo okno kopiowania z parametrami, gdzie mo�na dostosowa� niekt�re ustawienia, zanim operacja zostanie rozpocz�ta.
    • +
    +
  • +
+ Ka�de polecenie z menu kontekstowego Eksplorera mo�e zosta� w��czone lub wy��czone w oknie ustawie� (sekcja 'Pow�oka systemowa').
+
+ + + + Index: other/Help/Polish/faq.htm =================================================================== diff -u --- other/Help/Polish/faq.htm (revision 0) +++ other/Help/Polish/faq.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,23 @@ + + + + + + +F.A.Q. - Cz�sto Zadawane Pytania + + + +
+P: Dlaczego polecenia (CH) Kopiuj do, (CH) Przenie� do, (CH) Kopiuj/przenie� specjalne, itp. w menu kontekstowym Eksplorera s� nieaktywne?
+
+O: Aby powy�sze opcje zacz�y by� aktywne, musisz zdefiniowa� jakie� skr�ty w oknie ustawie�, sekcja "Skr�ty". Wskazuj� one na cz�sto u�ywane miejsca, do kt�rych kopiujesz/przenosisz pliki. Gdy je ustawisz, b�d� wy�wietlone poni�ej wspomnianych polece�.
+
+
+
+
+Zobacz tak�e: Okno ustawie�. +
+ + + Index: other/Help/Polish/feeddstfile.htm =================================================================== diff -u --- other/Help/Polish/feeddstfile.htm (revision 0) +++ other/Help/Polish/feeddstfile.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + + +Komunikat o b��dzie - nie mo�na otworzy� pliku docelowego do zapisu + + + +
Zadanie wy�wietla to okno, gdy w�tek przetwarzaj�cy nie mo�e otworzy� pliku docelowego do zapisu. Znajduj� si� tu informacje o tym, kt�ry plik nie mo�e zosta� otwarty oraz kod b��du. +
    +
  • Pon�w - ponawia pr�b� otwarcia pliku do zapisu.
  • +
  • Ignoruj - ignoruje b��d i pomija plik.
  • +
  • Ignoruj wszystkie - analogicznie jak poprzedni przycisk, ale w tym wypadku zadanie b�dzie pomija�o wszystkie podobne b��dy tego typu (je�eli wyst�pi�).
  • +
  • Czekaj - zmienia stan zadania w przypadku wyst�pieniu b��du. Je�eli w oknie ustawie� 'Opcja automatycznego wznawiania' (sekcja 'W�tek kopiuj�cy) jest w��czona - zadanie b�dzie wznowione po ustawionym wcze�niej czasie.
  • +
  • Anuluj - anuluje zadanie.
  • +
+
+
+ + + + Index: other/Help/Polish/feediwr.htm =================================================================== diff -u --- other/Help/Polish/feediwr.htm (revision 0) +++ other/Help/Polish/feediwr.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + + +Komunikat o b��dzie - nie mo�na otworzy� pliku �r�d�owego + + + +
Zadanie wy�wietla to okno, gdy w�tek przetwarzaj�cy nie mo�e otworzy� pliku �r�d�owego do skopiowania. W oknie wy�wietlane s� informacje o oczekiwanym pliku oraz kod b��du. +
    +
  • Pon�w - ponawia pr�b� otwarcia pliku �r�d�owego.
  • +
  • Ignoruj - ignoruje b��d i pomija plik.
  • +
  • Ignoruj wszystkie - analogicznie jak poprzedni przycisk, ale w tym wypadku zadanie b�dzie pomija�o wszystkie podobne b��dy tego typu (je�eli wyst�pi�).
  • +
  • Czekaj - zmienia stan zadania w przypadku wyst�pieniu b��du. Je�eli w oknie ustawie� 'Opcja automatycznego wznawiania' (sekcja 'W�tek kopiuj�cy) jest w��czona - zadanie b�dzie wznowione po okre�lonym wcze�niej czasie.
  • +
  • Anuluj - anuluje zadanie.
  • +
+
+
+ + + + Index: other/Help/Polish/feednotenoughroom.htm =================================================================== diff -u --- other/Help/Polish/feednotenoughroom.htm (revision 0) +++ other/Help/Polish/feednotenoughroom.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,23 @@ + + + + + + + +Komunikat o b��dzie - brak wystarczaj�cej ilo�ci wolnego miejsca + + + +
Zadanie wy�wietla to okno, gdy brak jest wolnej przestrzeni dyskowej w miejscu docelowym do skopiowania lub przeniesienia plik�w �r�d�owych. Okno automatycznie od�wie�a wyliczan� ilo�� wolnego miejsca na dysku. +
    +
  • Pon�w - ponawia pr�b� otwarcia pliku �r�d�owego.
  • +
  • Kontynuuj - ignoruje brakuj�c� woln� przestrze� i kontynuuje kopiowanie.
  • +
  • Anuluj - anuluje zadanie.
  • +
+
+
+ + + + Index: other/Help/Polish/feedreplacefiles.htm =================================================================== diff -u --- other/Help/Polish/feedreplacefiles.htm (revision 0) +++ other/Help/Polish/feedreplacefiles.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,34 @@ + + + + + + + +Komunikat o b��dzie - napotkano mniejszy plik docelowy + + + +
Zadanie wy�wietla to okno, gdy w�tek przetwarzaj�cy znajdzie w miejscu docelowym plik o mniejszej wielko�ci ni� kopiowany.
Mo�liwe przyczyny: +
    +
  • w miejscu docelowym znajduje si� starsza wersja pliku - w tym przypadku powinno sie skopiowa� plik od nowa,
  • +
  • w miejscu docelowym znajduje si� cz�� kopiowanego pliku, gdy� nie zosta� on poprawnie skopiowany do ko�ca - w tym przypadku powinno si� dokopiowa� reszt�.
  • +
+
+ Dopuszczalne operacje: +
    +
  • Dokopiuj - kopiuje reszt� pliku.
  • +
  • Dokopiuj wszystkie - jak powy�ej, z tym, �e w przypadku znalezienia nast�pnych plik�w o wielko�ci mniejszej ni� pliku �r�d�owego, zostanie automatycznie wykonana operacja dokopiowania.
  • +
  • Kopiuj od nowa - kopiuje ca�y plik od pocz�tku.
  • +
  • Kopiuj od nowa wszystkie - jak powy�ej, z tym, �e w przypadku znalezienia nast�pnych plik�w o wielko�ci mniejszej ni� pliku �r�d�owego, zostanie automatycznie wykonana operacja kopiowania od pocz�tku.
  • +
  • Ignoruj - ignoruje informacj� i pomija plik.
  • +
  • Ignoruj wszystkie - analogicznie jak poprzedni przycisk, ale w tym wypadku zadanie b�dzie pomija�o wszystkie podobne informacje tego typu (je�eli wyst�pi�).
  • +
  • Anuluj - anuluje zadanie.
  • +
+
+
+ + + + + Index: other/Help/Polish/feedsmallreplace.htm =================================================================== diff -u --- other/Help/Polish/feedsmallreplace.htm (revision 0) +++ other/Help/Polish/feedsmallreplace.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + + +Komunikat o b��dzie - plik docelowy istnieje + + + +
Zadanie wy�wietla to okno, gdy w�tek przetwarzaj�cy znajdzie w miejscu docelowym plik o rozmiarze wi�kszym lub r�wnym plikowi kopiowanemu. Je�eli pliki s� identyczne - powinno si� to zignorowa�, ale je�eli r�ni� si� - powinno si� go skopiowa� od nowa. +
    +
  • Kopiuj od nowa - kopiuje ca�y plik od pocz�tku.
  • +
  • Kopiuj od nowa wszystkie - jak powy�ej, z tym, �e w przypadku znalezienia nast�pnych plik�w o wielko�ci wi�kszej lub r�wnej plikowi �r�d�owemu, zostanie automatycznie wykonana operacja kopiowania od pocz�tku.
  • +
  • Ignoruj - ignoruje informacj� i pomija plik.
  • +
  • Ignoruj wszystkie - analogicznie jak poprzedni przycisk, ale w tym wypadku zadanie b�dzie pomija�o wszystkie podobne informacje tego typu (je�eli wyst�pi�).
  • +
  • Anuluj - anuluje zadanie.
  • +
+
+
+ + + + Index: other/Help/Polish/filterdlg.htm =================================================================== diff -u --- other/Help/Polish/filterdlg.htm (revision 0) +++ other/Help/Polish/filterdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,26 @@ + + + + + + + +Okno ustawie� filtrowania + + + +
Aby doda� lub zmieni� opcje filtrowania, nale�y otworzy� okno + kopiowania z parametrami. +
    +
  • Maska - mo�na poda� mask� nazw plik�w do skopiowania (np. '*.JPG' - kopiuje tylko pliki o rozszerzeniu JPG). Je�eli wyst�pi potrzeba zastosowania wi�cej ni� jednej maski - nale�y oddzieli� je za pomoc� znaku '|' (np. '*.JPG|*.GIF|*.BMP').
  • +
  • Wy��cz - okre�la mask� nazw plik�w, kt�re nie zostan� skopiowane. Maska jest podawana w spos�b okre�lony powy�ej.
  • +
  • Wielko�� - zezwala na okre�lenie do dw�ch rozmiar�w plik�w, wed�ug kt�rych ma odby� si� filtrowane. Aby plik zosta� skopiowany, musi odpowiada� ustawionym warto�ciom.
  • +
  • Data - zezwala na okre�lenie do dw�ch dat i czas�w, wed�ug kt�rych ma odby� si� filtrowane. Dost�pne s� trzy rodzaje selekcji: wed�ug czasu utworzenia pliku, ostatniej modyfikacji lub ostatniego otwarcia.
  • +
  • Wg atrybut�w - kopiuje tylko te pliki, kt�rych atrybuty spe�niaj� postawione wymagania. Szarawe pola zaznaczenia oznacza, �e atrybut nie jest brany pod uwag�.
  • +
+ Aby plik zosta� skopiowany, jego atrybuty musz� zgadza� si� ze wszystkimi ustawionymi filtrami.
+
+ + + + Index: other/Help/Polish/folderdlg.htm =================================================================== diff -u --- other/Help/Polish/folderdlg.htm (revision 0) +++ other/Help/Polish/folderdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,22 @@ + + + + + + + +Okno wyboru folderu docelowego - automonitorowanie schowka + + + +
To okno jest wy�wietlane, gdy w oknie ustawie� opcja 'Monitorowanie schowek' (sekcja 'Program') jest aktywna i w schowku znajduj� si� jakie� pliki.
+
+ Lewa cz�� okna zawiera list� zdefiniowanych skr�t�w, kt�re mog� zosta� u�yte do szybszego wskazania �cie�ki docelowej. Cztery przyciski powy�ej listy odpowiadaj� s� za widok. Dwa przyciski poni�ej zezwalaj� na dodawanie i usuwanie skr�t�w.
+ Prawa cz�� okna zawiera drzewo ze struktur� katalog�w. Mo�na zaznaczy� tam �cie�k� �cie�k� lub poda� j� r�cznie, wpisuj�c j� do okienka poni�ej. Przycisk powy�ej tworzy nowy folder w obecnie zaznaczonym katalogu.
+
+
+
+ + + + Index: other/Help/Polish/headfoot.js =================================================================== diff -u --- other/Help/Polish/headfoot.js (revision 0) +++ other/Help/Polish/headfoot.js (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ +function header(text) +{ + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write("
"); + document.write("\"CH"); + document.write("
Plik pomocy programu Copy Handler
"); + document.write("
"); + document.write( text ); + document.write("
"); + document.write("

"); +} + +function footer() +{ + document.write("
"); + document.write("
"); + document.write("
Copyright 2003-2004 Damian Kr�l.
"); + document.write("
"); + document.write("
"); +} \ No newline at end of file Index: other/Help/Polish/help.hhc =================================================================== diff -u --- other/Help/Polish/help.hhc (revision 0) +++ other/Help/Polish/help.hhc (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,148 @@ + + + + + + + + + + +
    +
  • + + + +
  • + + + +
  • + + +
      +
    • + + + +
    • + + + +
    • + + + +
    +
  • + + +
      +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    • + + + +
    +
  • + + +
      +
    • + + + +
    • + + + +
    +
  • + + + +
  • + + + +
  • + + + +
  • + + + +
+ Index: other/Help/Polish/help.hhk =================================================================== diff -u --- other/Help/Polish/help.hhk (revision 0) +++ other/Help/Polish/help.hhk (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,695 @@ + + + + + + +
    +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + + + + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + +
  • + + + + +
  • + + + + + + +
  • + + + + + + + + +
  • + + + +
+ Index: other/Help/Polish/help.hhp =================================================================== diff -u --- other/Help/Polish/help.hhp (revision 0) +++ other/Help/Polish/help.hhp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,89 @@ +[OPTIONS] +Auto Index=Yes +Binary TOC=Yes +Compatibility=1.1 or later +Compiled file=Polish.chm +Contents file=help.hhc +Default topic=welcome.htm +Display compile progress=No +Full-text search=Yes +Index file=help.hhk +Language=0x415 Polish +Title=Copy Handler help file + + +[FILES] +advmenu.htm +buffersize.htm +bugs.htm +customcopy.htm +explorermenu.htm +faq.htm +feeddstfile.htm +feediwr.htm +feednotenoughroom.htm +feedreplacefiles.htm +feedsmallreplace.htm +filterdlg.htm +folderdlg.htm +history.htm +installation.htm +license.htm +mainmenu.htm +miniview.htm +options.htm +recentdlg.htm +replacepaths.htm +requirements.htm +shortcutsdlg.htm +shutdowndlg.htm +status.htm +support.htm +thanks.htm +using.htm +welcome.htm +reporting.htm +ch.gif +style.css + +[ALIAS] +HIDD_BUFFERSIZE_DIALOG=buffersize.htm +HIDD_CUSTOM_COPY_DIALOG=customcopy.htm +HIDD_FEEDBACK_DSTFILE_DIALOG=feeddstfile.htm +HIDD_FEEDBACK_IGNOREWAITRETRY_DIALOG=feediwr.htm +HIDD_FEEDBACK_NOTENOUGHPLACE_DIALOG=feednotenoughroom.htm +HIDD_FEEDBACK_REPLACE_FILES_DIALOG=feedreplacefiles.htm +HIDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG=feedsmallreplace.htm +HIDD_FILTER_DIALOG=filterdlg.htm +HIDD_MINIVIEW_DIALOG=miniview.htm +HIDD_OPTIONS_DIALOG=options.htm +HIDD_RECENTEDIT_DIALOG=recentdlg.htm +HIDD_REPLACE_PATHS_DIALOG=replacepaths.htm +HIDD_SHORTCUTEDIT_DIALOG=shortcutsdlg.htm +HIDD_SHUTDOWN_DIALOG=shutdowndlg.htm +HIDD_STATUS_DIALOG=status.htm + +[MAP] +#include HTMLDefines.h + +[TEXT POPUPS] +HTMLDefines.h +0.txt +100.txt +131.txt +137.txt +144.txt +145.txt +149.txt +161.txt +162.txt +164.txt +165.txt +167.txt +173.txt +182.txt +195.txt +208.txt +209.txt + +[INFOTYPES] Index: other/Help/Polish/history.htm =================================================================== diff -u --- other/Help/Polish/history.htm (revision 0) +++ other/Help/Polish/history.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,213 @@ + + + + + + + +Historia programu / Co nowego? + + + +
+
    + +
  • 1.28
  • +
      +
    • poprawiono problem z kopiowaniem plik�w, kt�rych nazwy rozpoczyna�y si� kropk�
    • +
    • dodano kilka nowych t�umacze�
    • +
    • wiele zmian wewn�trznych w kodzie (np. zmieniono obs�ug� stl na stlPort z http://www.stlport.com)
    • +
    + +
  • 1.26
  • +
      +
    • poprawiono wy�wietlanie �cie�ek w oknie statusu,
    • +
    • poprawiono zmian� j�zyka 'w locie' w li�cie zada� w oknie statusu,
    • +
    • poprawiono obs�ug� �cie�ek katalog�w w konfiguracji,
    • +
    • okno "Brak wystarczaj�cej ilo�ci wolnego miejsca" zostanie teraz automatycznie zamkni�te, gdy tylko zwolni si� miejsce na wykonanie operacji,
    • +
    • zmieniono nazwy plik�w programu,
    • +
    • zmieniono obs�ug� j�zyk�w - teraz s� one oparte na plikach tekstowych zamiast bibliotek,
    • +
    • poprawiono b��d obs�ugi pow�oki (problem z ob�ug� wykrywania operacji przy wci�ni�tym klawiszu [CTRL]).
    • +
    +
+
    +
  • 1.25
  • +
      +
    • dodano system pomocy do programu,
    • +
    • poprawiono b��d, kiedy nowo utworzone skr�ty (okno wyboru folderu) nie by�y zapisywane,
    • +
    • inne drobne optymalizacje i poprawki.
    • +
    +
+
    +
  • 1.20
  • +
      +
    • zmieni� si� spos�b licencjonowania programu. Teraz program zgodny jest z licencj� GNU General Public License (co oznacza, �e pe�ny kod programu jest dost�pny na http://www.copyhandler.prv.pl),
    • +
    • dodano wsparcie dla plugina j�zykowego,
    • +
    • zmieniono program instalacyjny na NSIS,
    • +
    • zoptymalizowano wykrywanie restartu tray'a,
    • +
    • zmodyfikowano okno 'O programie',
    • +
    • obecnie wszystkie stringi s� odczytywane z tablic zasob�w,
    • +
    • zmodyfikowano obs�ug� okna konfiguracji - obs�uguje zastosowywanie zmian (przycisk 'Zastosuj'), dodano r�wnie� zmian� j�zyka 'w locie',
    • +
    • gdy operacja w��czenia lub wy��czenia integracji z pow�ok� systemow� nie powiedzie si�, program wy�wietli komunikat o b��dzie,
    • +
    • dodano sekcj� 'Plik Log' (chwilowo nieu�ywana),
    • +
    • wklejanie z u�yciem CH nie powoduje ju� opr�niania schowka,
    • +
    • kilka mniejszych optymalizacji...
    • +
    +
+
    +
  • 1.13i
  • +
      +
    • poprawiono b��d wykrywania partycji (ten sam dysk, czy inny) na nowszych komputerach lub z wi�ksz� ilo�ci� urz�dze�,
    • +
    • dokonano lekkich zmian w tek�cie - np. w angielskim zamiast 'OD' jest 'One disk',
    • +
    • poprawiono wykrywanie obecno�ci stacji dysk�w / �cie�ki dost�pu do niej w oknie wyboru folderu docelowego,
    • +
    • zmodyfikowano kilka okien dialogowych (np. okno statusu) tak, aby wy�wietla�o si� w pasku zada�,
    • +
    • poprawiono b��d zwi�zany z wprowadzaniem �cie�ek dost�pu w niekt�rych oknach - poprzednio ilo�� tekstu zale�a�a od aktualnej wielko�ci okna,
    • +
    • dodano j�zyk francuski do programu (dzi�ki Julienowi (Vk)),
    • +
    • teraz rzeczywi�cie plik wykonywalny i biblioteka DLL s� spakowane UPX'em, nie jak w wersji 1.13g ;)
    • +
    +
+
    +
  • 1.13g
  • +
      +
    • poprawiono b��d zwi�zany z funkcj� 'Kopiuj do' i pochodnymi w menu kontekstowym Eksplorera (w poprzedniej wersji nie wykonywa�a zamierzonego dzia�ania),
    • +
    • dodano dwie dodatkowe opcje zwi�zane z regulacj� priorytetu - priorytet aplikacji i wy��czanie podbijania priorytetu w�tku kopiuj�cego
    • +
    • poprawiono b��d zwi�zany z obliczaniem wolnego miejsca na dysku (je�li ilo�� miejsca na dysku by�a r�wna wielko�ci zasob�w do skopiowania program wy�wietla� okno informuj�ce o braku miejsca),
    • +
    • poprawiono b��d zwi�zany z kopiowaniem plik�w, kt�rych data utworzenia/modyfikacji/zapisu zawiera�y si� poza zakresem roku 1970~2038 (program wykonywa� nieprawid�ow� operacj�),
    • +
    • dodano mo�liwo�� ustalania kolejno�ci skr�t�w,
    • +
    • program i biblioteka DLL zosta�y skompresowane oprogramowaniem UPX.
    • +
    +
+
    +
  • 1.13e
  • +
      +
    • poprawiono kilka kolejnych liter�wek - np. brak wyrazu 'special' w menu kontekstowym w wersji angloj�zycznej,
    • +
    • poprawiono nieco dzia�anie eksperymentalnej opcji przeci�gania lewym przyciskiem myszy,
    • +
    • dodano mo�liwo�� importu �cie�ek do kopiowania z pliku tekstowego,
    • +
    • dodano mo�liwo�� forsownego tworzenia pe�nych �cie�ek �r�d�owych w miejscu docelowym,
    • +
    • ikona programu w tray'u automatycznie poka�e si� po restarcie Eksplorera,
    • +
    • dodatkowa opcja w konfiguracji - wyb�r domy�lnej akcji dla przeci�gania plik�w lewym przyciskiem myszy (je�li jest w��czona opcja przechwytywania).
    • +
    +
+
    +
  • 1.13
  • +
      +
    • poprawiono b��d zwi�zany z wielokrotnym wy�wietlaniem komend w menu 'Plik' Eksplorera (im wi�cej razy otwarto menu, tym wi�cej pojawia�o si� komend),
    • +
    • poprawiono denerwuj�ce zachowanie - zapisywanie stanu operacji zako�czonych/spauzowanych/anulowanych by�o wykonywane niepotrzebnie, jako �e �adne dane dotycz�ce tych operacji nie by�y modyfikowane. (np. u�ywaj�c defragmentatora dysk�w - operacja by�a przerywana podczas ka�dego niepotrzebnego zapisu danych) - teraz przechodz�c do jednego z wymienionych stan�w dane zapisywane s� tylko raz.
    • +
    +
+
    +
  • 1.12 Final
  • +
      +
    • lekkie zmiany w tek�cie - na "bardziej polskie",
    • +
    • zmieniono standardow� �cie�k� dla danych tymczasowych na katalog TEMP,
    • +
    • usuni�to b��d zwi�zany z ustawianiem wielko�ci bufor�w w oknie statusu,
    • +
    • wywalono niepotrzebny plik 'Quick access data.ini' - zawarto�� zosta�a wkomponowana do pliku 'Copy Handler.ini',
    • +
    • poprawiono kilka drobiazg�w zwi�zanych z niekompatybilno�ci� system�w - teraz program powinien bez przeszk�d dzia�a� na systemach Windows 95/98/Me/NT4/2000/XP,
    • +
    • troch� zmieniono (w�a�ciwie przepisano od nowa) okno dialogowe wyboru folderu docelowego,
    • +
    • zmieniono nieco okno dialogowe ustawie� kopiowania oraz rozszerzono mo�liwo�ci filtrowania plik�w,
    • +
    • poprawiono troch� obs�ug� shella - dodatkowe komendy i dwie opcje eksperymentalne (dzia�aj� tylko na niekt�rych systemach),
    • +
    • kilka innych drobiazg�w, o kt�rych nie warto pisa�...
    • +
    +
+
    +
  • 1.11
  • +
      +
    • dodano now� opcj� - wyb�r stylu pask�w post�pu w mini statusie (p�ynne/skokowe),
    • +
    • poprawiono pocz�tkowy stan pliku INI - nieefektywne ustawienie wielko�ci bufor�w.
    • +
    +
+
    +
  • 1.10 Final
  • +
      +
    • poprawiono wykrywanie partycji le��cych na jednym dysku fizycznym,
    • +
    • dodano program instaluj�cy,
    • +
    • do okna 'o programie' dodano informacj� o nowym e-mail'u,
    • +
    • usuni�to automatyczne rejestrowanie rozszerzenia pow�oki systemowej podczas startu programu - teraz zajmie si� tym instalator,
    • +
    • poprawiono nieco obs�ug� automatycznego uruchomienia programu wraz z systemem.
    • +
    +
+
    +
  • 1.10 beta 4
  • +
      +
    • poprawiono b��d zwi�zany z kopiowaniem danych w systemach Windows NT/2000/XP z wy��czonym buforowaniem,
    • +
    • poprawiono szybko�� pauzowania, wznawiania, itp. zada�, zw�aszcza pod seriami NT (NT/2000/XP) Windowsa,
    • +
    • poprawiono b��d zwi�zany z ustalaniem folderu docelowego dla tymczasowych danych,
    • +
    • do�o�ono obs�ug� autodetekcji bufora oraz 5 r�nego rodzaju bufor�w odpowiednich do rodzaju kopiowania; zmieniono w zwi�zku z tym spos�b wpisywania wielko�ci bufor�w, itp.,
    • +
    • poprawiono wyst�puj�ce dziwne efekty dla du�ych wielko�ci bufor�w,
    • +
    • dodatkowe opcje w g��wnym menu programu - rejestracja/derejestracja rozszerzenia pow�oki systemowej (shella),
    • +
    • w��czanie okna statusu powoduje teraz automatyczne ukrycie ministatusu,
    • +
    • przy podawaniu �cie�ki dost�pu do d�wi�k�w, oraz do folderu tymczasowego mo�na stosowa� teraz skr�ty (okre�lone �cie�ki nie ko�cz� si� \, wi�c trzeba go dopisa� podczas modyfikacji �cie�ki np. < WINDOWS >\media; �cie�ki podane w ten spos�b musz� by� wpisywane wielkimi literami - < WINDOWS >, a nie < windows > lub < Windows >; �cie�ki wpisywane w ten spos�b nie zawieraj� spacji, cho� tu mo�e to wygl�da� inaczej):
    • +
        +
      • < WINDOWS > - katalog windows (np. c:\windows),
      • +
      • < TEMP > - katalog na pliki tymczasowe (np. c:\windows\temp),
      • +
      • < SYSTEM > - katalog systemowy (np. c:\windows\system),
      • +
      • < APPDATA > - katalog na dane aplikacji (np. c:\windows\Dane aplikacji),
      • +
      • < DESKTOP > - katalog w kt�rym trzymana jest zawarto�� pulpitu (np. C:\WINDOWS\PULPIT),
      • +
      • < PERSONAL > - katalog prywatny zalogowanego u�ytkownika (np. C:\MOJE DOKUMENTY),
      • +
      +
    • poprawiono wy��czanie programu (poprzez opcj� menu oraz poprzez zamkni�cie systemu) - teraz program zapisuje stan kopiowa� przez wyj�ciem; przyspieszono te� wy��czanie programu,
    • +
    • teraz wy��czanie systemu pozwala przez okre�lony czas na anulowanie, oraz dzia�a pod Windows NT/2000/XP; dodatkowo, je�li zaznaczymy opcj� automatycznego wy��czenia systemu po zako�czeniu kopiowania a �adne zadanie nie jest aktualnie przetwarzane program nie b�dzie si� stara� wy��czy� systemu - poczeka na rozpocz�cie i zako�czenie jakiego� zadania; mo�na r�wnie� ustali� rodzaj wy��czenia (force/zwyk�e),
    • +
    • poprawiono mini status pod k�tem wsp�pracy z Windows NT/2000/XP - teraz mo�na korzysta� z przycisk�w umieszczonych na pasku tytu�u,
    • +
    • naci�ni�cie przycisku wznowienia na oczekuj�cym zadaniu spowoduje, �e zadanie to b�dzie wznowione bez wzgl�du na ograniczenie ilo�ci jednocze�nie wykonywanych zada�,
    • +
    • je�li zostanie ograniczona ilo�� jednocze�nie wykonywanych zada�, to zadania oczekuj�ce b�d� za��cza� si� w kolejno�ci w jakiej zosta�y wpisane na list�,
    • +
    • zmieniono nieco obs�ug� plik�w LOG oraz b��d�w - teraz opr�cz numeru b��du jest wy�wietlany komunikat o b��dzie oraz miejsce programu, w kt�rym nast�pi� �w b��d,
    • +
    • w oknie statusu do�o�ono dodatkow� informacj� o tymczasowych plikach skojarzonych z zaznaczonym zadaniam,
    • +
    • drobne modyfikacje UI (ikony wzi�te z Windowsa XP - mam nadziej�, �e nikt si� nie pogniewa), optymalizacje, inne...
    • +
    +
+
    +
  • 1.03
  • +
      +
    • poprawiono wiele b��d�w zwi�zanych z wy�wietlaniem tekstu - zw�aszcza przy ustawieniu wi�kszej czcionki we w�a�ciwo�ciach wy�wietlania, lub ustawieniu dziwnego schematu kolor�w lub wielko�ci element�w wizualnych,
    • +
    • zmieniono nieco obs�ug� kopiowania plik�w z wy��czonym buforowaniem - poprzednio plik kopiowany by� wielokrotno�ciami wielko�ci bufora. Je�li odczytana ilo�� danych nie by�a wielokrotno�ci� wielko�ci bufora - program zapisywa� nadmiar informacji do pliku, a po chwili zmienia� wielko�� pliku na oczekiwan�. Teraz kopiowanie takie odbywa si� w dw�ch przej�ciach - pierwsze kopiuje wielokrotno�ci wielko�ci bufora, za� drugie pozosta�� resztk� (dot. tylko kopiowania plik�w bez buforowania),
    • +
    • do�o�ono dodatkow� opcj� w menu - wy��czanie systemu po zako�czeniu kopiowania,
    • +
    • poprawiono obs�ug� wy�wietlania okna dialogowego informuj�cego o ilo�ci wolnego miejsca na dysku - teraz, je�li kopiowanie zostanie przerwane w po�owie a nast�pnie wznowione, to podczas obliczania potrzebnego miejsca skopiowana cz�� zostanie uwzgl�dniona,
    • +
    • poprawiono nieco okna wizualnych potwierdze� - s� nieco bardziej przejrzyste (niestety, dalej s� beznadziejne),
    • +
    • poprawiono b��d - ograniczanie ilo�ci jednocze�nie wykonywanych operacji przestawa�o dzia�a� w pewnych sytuacjach - wymaga�o to restartu programu,
    • +
    • poprawiono obs�ug� przenoszenia danych w obr�bie jednej partycji - poprzednio przenoszenie danych w ten spos�b powodowa�o generowanie b��du 'Plik ju� istnieje' je�li istnia� plik lub folder o nazwie takiej jak kopiowana,
    • +
    • poprawiono b��dne pokazywanie post�pu w przypadku kopiowania danych z wy��czonym buforowaniem (by� mo�e powodowa�o to jeszcze inne konflikty o kt�rych nie wiem),
    • +
    • drobne poprawki dot. kolejno�ci w jakiej przechodzi si� mi�dzy kontrolkami za pomoc� klawisza [TAB].
    • +
    +
+
    +
  • 1.02
  • +
      +
    • zamieniono star� wersj� BCMenu na now� (wizualna zmiana: domy�lna opcja jest pokazana pogrubion� czcionk�),
    • +
    • teraz nie pokazuje si� ju� 0% po zako�czeniu przenoszenia plik�w (nie folder�w) w obr�bie jednej partycji,
    • +
    • dodano obs�ug� kopiowania plik�w bez buforowania (przydaje si� podczas kopiowania du�ych plik�w),
    • +
        +
      • wielko�� bufora do kopiowania jest zaokr�glana do najbli�szej wielokrotno�ci 64kB,
      • +
      • je�li plik jest kopiowany bez buforowania i ma wielko��, kt�ra nie jest wielokrotno�ci� 4kB to plik wyj�ciowy w pewnym momencie b�dzie mia� wielko�� wi�ksz� ni� plik �r�d�owy. (Uwaga: Je�li w tym momencie kopiowanie zostanie przerwane, za� p�niej wznowione - program zacznie kopiowanie od pocz�tku, chyba �e opcja u�ywania wizualnych okien potwierdze� jest ustawiona na ostre),
      • +
      • pojwai�y si� dwie nowe opcje - jedna pozwala w��czy�/wy��czy� obs�ug� buforowania kopiowanych plik�w, za� druga pozwala okre�li� minimaln� wielko�� pliku, kt�ra kwalifikuje go do kopiowania bez buforowania (kopiowanie ma�ych plik�w bez buforowania spowoduje mocne obni�enie pr�dko�ci kopiowania),
      • +
      +
    • poprawiono nieco obs�ug� konfiguracji (nie powinna teraz tak mocno przyblokowywa� innych cz�ci programu),
    • +
    • poprawiono kolejno�� przechodzenia mi�dzy kontrolkami w niekt�rych oknach,
    • +
    • zmieniono nieco uk�ad menu g��wnego w programie; do�o�ono dodatkow� opcj� - teraz mo�na wybra� monitorowanie schowka r�wnie� z tego menu (a nie tylko z opcji).
    • +
    +
+
    +
  • 1.01a
  • +
      +
    • poprawiono wsp�prac� DLL'ki z wersjami ANSI starszych system�w Windows (98/Me).
    • +
    +
+
    +
  • 1.01
  • +
      +
    • poprawiono sytuacj�, gdy brak pliku �r�d�owego przy w��czonych oknach potwierdze� powodowa� "wysypanie si�" programu,
    • +
    • teraz okno r�cznego wprowadzania danych o kopiowaniu wy�wietla wreszcie rodzaj operacji (kopiowanie, przenoszenie),
    • +
    • poprawiono wsp�prac� programu z UNICODE'owymi wersjami Windows (NT/2000/XP) - teraz program (w�a�ciwie biblioteka DLL) powinien dzia�a� pod tymi systemami bez zarzutu,
    • +
    • je�li "Poka� rejestr" nie wy�wietli notatnika z plikiem log to poka�e odpowiedni komunikat o b��dzie,
    • +
    • teraz w oknie wyboru folderu docelowego (przy w��czonym monitorowaniu schowka) pojawia si� informacja o ilo�ci wolnego miejsca na dysku,
    • +
    • je�li wyst�pi b��d kopiowania, to automatyczne wznowienie odb�dzie si� po okre�lonym czasie od wyst�pienia b��du, a nie jak dotychczas od ostatniej pr�by wznowienia,
    • +
    • je�li podczas kopiowania danych program stwierdzi, �e na dysku docelowym nie ma wystarczaj�cej ilo�ci miejsca to poka�e odpowiedni komunikat,
    • +
    • poprawiono nieprawid�owo pokazywany opis komendy z menu kontekstowego Shell'a.
    • +
    +

     

    +
+
+
+
Zobacz tak�e: Znane b��dy / problemy.
+ + + Index: other/Help/Polish/installation.htm =================================================================== diff -u --- other/Help/Polish/installation.htm (revision 0) +++ other/Help/Polish/installation.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,60 @@ + + + + + + + +Instalacja + + + +
+
Instalacja
+
+ + + + + + + + +
[Exe]Uruchom plik i post�puj zgodnie z instrukcjami wy�wietlanymi na ekranie.
[Zip]

Rozpakuj zawarto�� archiwum na dysk i uruchom program 'ch.exe'. Je�eli ponadto chcesz zarejestrowa� rozszerzenie pow�oki systemowej - z menu g��wnego programu wybierz opcj� 'W��cz integracj� z pow�ok� systemow�'.

+
+ +
+
Aktualizacja (instalowanie nowszej wersji programu na istniej�c�)
+
+ + + + + + + +
[Exe]Po prostu uruchom nowy program instalacyjny i post�puj zgodnie z instrukcjami.
[Zip]Odinstaluj poprzedni� wersj� (opis - sekcja poni�ej) i zainstaluj now� (opis - sekcja powy�ej).
+
+ +
Deinstalacja
+
+ + + + + + + + +
[Exe]Uruchom program deinstaluj�cy z katalogu, w kt�rym zainstalowa�e� program, Menu Start lub poprzez aplet Panelu Sterowania 'Dodaj/Usu� Programy' i post�puj zgodnie z instrukcjami wy�wietlanymi na ekranie.
[Zip] +

#1. Przy uruchomionym programie wybierz z jego menu opcj� 'Wy��cz integracj� z pow�ok� systemow�'.
+ #2. Wyloguj si� i zaloguj ponownie albo zrestartuj komputer.
+ #3. Je�li po restarcie ikona programu b�dzie widoczna w tray'u - wybierz z menu programu opcj� 'Wyj�cie'.
+ #4. Usu� folder z wcze�niej zainstalowanym Copy Handlerem.

+
+
+
+ + + + Index: other/Help/Polish/license.htm =================================================================== diff -u --- other/Help/Polish/license.htm (revision 0) +++ other/Help/Polish/license.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,360 @@ + + + + + + + +GNU General Public License - wersja angloj�zyczna + + + +
+
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
+    Copyright (C) 19yy  NAME OF AUTHOR
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+

+
+
Zobacz tak�e: Kontakt / Wsparcie. +
+ + + Index: other/Help/Polish/mainmenu.htm =================================================================== diff -u --- other/Help/Polish/mainmenu.htm (revision 0) +++ other/Help/Polish/mainmenu.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,76 @@ + + + + + + + +Menu g��wne programu + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Poka� status...Wy�wietla okno statusu, kt�re wy�wietla szczeg�owe informacje o zadaniach (ich statusie, post�pie, szacowanym czasie, itp).
+
Poka� mini-status...Wy�wietla okno mini-statusu, kt�re wy�wietla uproszczony widok uruchomionego zadania.
+
Podaj parametry kopiowania...

Wy�wietla okno kopiowania z parametrami, kt�re zezwala u�ytkownikowi na podanie plik�w i katalog�w �r�d�owych, miejsca docelowego oraz okre�lenie dodatkowych opcji.
+
W��cz integracj� z pow�ok� systemow�Je�eli plik biblioteki DLL zosta� zainstalowany (znajduje si� w folderze, z kt�rego uruchamiony zosta� program), opcja ta zezwala na wprowadzenie odpowiednich warto�ci do rejestru systemowego, dzi�ki czemu mo�liwe jest korzystanie z dodatkowych polece� w menu kontekstowym Eksplorera.
+
Wy��cz integracj� z pow�ok� systemow�

Polecenie zezwala na wy��czenie integracji z pow�ok� systemow� (czyli usuni�cie polece� z menu kontekstowego Eksplorera).
+
Monitoruj schowek

Polecenie r�wnowa�ne opcji 'Monitoruj schowek' z okna ustawie� (sekcja 'Program'). Wybranie polecenia jest r�wnowa�ne ze zmian� ustawie� w wy�ej wymienionym oknie.
+
Wy��cz komputer po zako�czeniu

Polecenie r�wnowa�ne opcji 'Zamknij system po zako�czeniu kopiowania' z okna ustawie� (sekcja 'Program'). Wybranie polecenia jest r�wnowa�ne ze zmian� ustawie� w ww. oknie.
+
Opcje...

Pokazuje okno ustawie�, z poziomu kt�rego mo�na w pe�ni przystosowa� program do w�asnych potrzeb.
+
Pomoc...Pokazuje plik pomocy.
+
O programie...

Pokazuje okno z najwa�niejszymi informacjami dotycz�cymi programu.
+
Wyj�cie

Ko�czy dzia�anie programu.
+
+
+
+ + + + Index: other/Help/Polish/miniview.htm =================================================================== diff -u --- other/Help/Polish/miniview.htm (revision 0) +++ other/Help/Polish/miniview.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,18 @@ + + + + + + + +Okno mini-statusu + + + +
Okno w uproszczony spos�b pokazuje najwa�niejsze informacje o aktualnych zadaniach. Mo�na je konfigurowa� z poziomu okna ustawie� (sekcja 'Miniaturowy widok').
+
+
+
Zobacz tak�e: Okno statusu, Okno ustawie�.
+ + + Index: other/Help/Polish/options.htm =================================================================== diff -u --- other/Help/Polish/options.htm (revision 0) +++ other/Help/Polish/options.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,129 @@ + + + + + + + +Okno ustawie� + + + +
+
    +
  • Program - og�lne opcje dotycz�ce programu:
  • +
      +
    • Monitoruj schowek - czy schowek ma by� monitorowany (tzn. czy po wprowadzeniu do schowka pewnych nazw plik�w automatycznie ma pokaza� si� okno wyboru folderu docelowego).
    • +
    • Czas, co jaki b�dzie przeszukiwany schowek [ms] - okre�la interwa� czasu w milisekundach, co ile b�dzie sprawdzana zawarto�� schowka.
    • +
    • Uruchamiaj programu wraz ze startem systemu - czy program ma by� uruchamiany razem z systemem operacyjnym (powoduje wpisanie odpowiednich warto�ci do rejestru dopiero po zamkni�ciu okna konfiguracji).
    • +
    • Zamknij system po zako�czeniu kopiowania - je�li mamy zamiar kopiowa� co� wielkiego, to mo�na w��czy� t� opcj� i po zako�czeniu operacji wy�wietlone zostanie powiadomienie o zamykaniu systemu, po czym Windows si� wy��czy (chyba, �e wyst�pi b��d, albo co� dziwnego).
    • +
    • Czas oczekiwania przed wy��czeniem systemu [ms] - okre�la ilo�� milisekund, kt�r� program ma wy�wietla� okno z mo�liwo�ci� anulowania zamykania systemu.
    • +
    • Rodzaj zamkni�cia systemu - okre�la, czy system ma by� zamkni�ty normalnie, czy si�owo (wtedy wszystkie programy s� zamykane bez zapisywania zmian).
    • +
    • Czas, co jaki b�dzie wykonywane autozapisywanie [ms] - aby m�c wznowi� kopiowanie np. po restarcie systemu nale�y zapisywa�, co ju� zosta�o skopiowane. Ten parametr okre�la ilo�� milisekund, co kt�r� b�d� zapisywane takie informacje.
    • +
    • Priorytet aplikacji - okre�la klas� priorytetu Copy Handlera. U�ywaj tej opcji ostro�nie - wysoki priorytet mo�e spowodowa�, �e system b�dzie dzia�a� do�� wolno, za� niski priorytet mo�e obni�y� pr�dko�� kopiowania.
    • +
    • Folder z danymi tymczasowymi - folder, w kt�rym program b�dzie zapisywane tymczasowe dane.
    • +
    • Folder z wtyczkami - folder, w kt�rym program przechowuje wtyczki
    • +
    • Folder z plikami pomocy - folder, w kt�rym znajduj� si� pliki pomocy programu.
    • +
    • J�zyk - okre�la j�zyk programu i rozszerzenia pow�oki.
    • +
    • Folder z plikami t�umacze� - okre�la �cie�k� do folderu, w kt�rym znajduj� si� pliki z t�umaczeniami program�w.
    • +
      +
    +
  • Okno statusu - opcje, kt�re odnosz� si� do du�ego okna statusu:
  • +
      +
    • Czas, co jaki b�dzie od�wie�any status [ms] - czas okre�laj�cy, jak cz�sto maj� by� od�wie�ane dane w oknie statusu.
    • +
    • Poka� szczeg�y w oknie statusu - oznacza, czy ma by� pokazywana cz�� okna statusu zawieraj�ca szczeg�y (po prawej stronie).
    • +
    • Automatycznie usuwaj zako�czone zadania - je�li kopiowanie si� zako�czy, zostaj� po nim pewne dane (dok�adnie pliki tymczasowe zawieraj�ce dane o danym zadaniu), dzi�ki czemu mo�na obejrze�, ile czasu zaj�o kopiowanie, jaki by� �redni transfer, lub mamy mo�liwo�� restartu zadania, czyli przekopiowania wszystkiego od nowa. Je�li zaznaczymy t� opcj�, po zako�czeniu kopiowania zadanie zostanie usuni�te z listy zada�.
    • +
      +
    +
  • Miniaturowy widok - opcje odnosz�ce si� do okna mini-statusu:
  • +
      +
    • Pokazuj nazwy plik�w - czy w ma�ym oknie statusu maj� by� pokazywane nazwy aktualnie kopiowanych plik�w, czy tylko paski post�pu.
    • +
    • Wy�wietlaj pojedyncze zadania - czy w ma�ym oknie statusu maj� by� pokazywane wszystkie zadania, czy tylko zbiorcze, okre�laj�ce wsp�lny post�p.
    • +
    • Czas, co jaki b�dzie od�wie�any status [ms] - jak cz�sto ma by� od�wie�any ma�y status.
    • +
    • Poka� przy starcie programu - czy ma�e okno statusu ma by� pokazane podczas uruchomienia programu.
    • +
    • Ukryj, je�eli nie ma co pokaza� - je�li nie ma aktualnie �adnych zada�, powoduje ukrycie ma�ego okna statusu (je�li p�niej w��czymy jakie� kopiowanie, okno automatycznie si� poka�e).
    • +
    • U�yj p�ynnych pask�w post�pu - pozwala na ustalenie stylu pask�w post�pu w mini statusie - dla p�ynnych pask�w post�pu troch� lepiej wida� powolny post�p.
    • +
      +
    +
  • Okno wyboru folderu - opcje odnosz�ce si� do okna wyboru folderu docelowego:
  • +
      +
    • Poka� rozszerzony widok - okre�la, czy podczas wy�wietlania okna wyboru folderu docelowego ma by� pokazana lista skr�t�w.
    • +
    • Szeroko�� okna [piksele] - szeroko�� okna podawana w pikselach.
    • +
    • Wysoko�� okna [piksele] - wysoko�� okna podawana w pilkselach.
    • +
    • Styl listy skr�t�w - okre�la styl listy skr�t�w w oknie wyboru folderu docelowego.
    • +
    • Ignoruj dodatkowe okna pow�oki - okre�la, czy w oknie wyboru folderu docelowego maj� nie pojawia� si� dodatkowe okna (np. 'W�� dyskietk�', 'Dysk nie jest dost�pny', itp.).
    • +
      +
    +
  • Pow�oka systemowa - opcje odnosz�ce si� do rozszerzenia pow�oki systemowej:
  • +
      +
    • Poka� polecenie 'Kopiuj' w menu przeci�gania - w��cza komend� Kopiuj w menu przeci�gania.
    • +
    • Poka� polecenie 'Przenie�' w menu przeci�gania - w��cza komend� Przenie� w menu przeci�gania.
    • +
    • Poka� polecenie 'Kopiuj/przenie� specjalnie' w menu przeci�gania - w��cza komend� 'Kopiuj/przenie� specjalnie' w menu przeci�gania.
    • +
    • Poka� polecenie 'Wklej' w menu kontekstowym - w��cza komend� Wklej w menu kontekstowym explorera.
    • +
    • Poka� polecenie 'Wklej specjalnie' w menu kontekstowym - w��cza komend� Wklej specjalnie w menu kontekstowym explorera.
    • +
    • Poka� polecenie 'Kopiuj do' w menu kontekstowym - w��cza komend� Kopiuj do w menu kontekstowym explorera.
    • +
    • Poka� polecenie 'Przenie� do' w menu kontekstowym - w��cza komend� Przenie� do w menu kontekstowym explorera.
    • +
    • Poka� polecenie 'Kopiuj/przenie� specjalnie do' w menu kontekstowym - w��cza komend� Kopiuj/przenie� specjalnie do w menu kontekstowym explorera.
    • +
    • Wy�wietl ilo�� wolnego miejsca wraz z nazwami skr�t�w - okre�la, czy w podmenu Kopiuj do (i pochodnych) obok nazw skr�t�w podawana ma by� tak�e ilo�� wolnego miejsca).
    • +
    • Wy�wietl ikony obok skr�t�w (eksperymentalne) - okre�la, czy w podmenu Kopiuj do (i pochodnych) maj� by� rysowane ikony shellowe. Opcja eksperymentalna - rysowanie nie dzia�a na wszystkich systemach poprawnie. Je�li po wybraniu menu Kopiuj do (i pochodnych) zobaczysz puste menu o dziwnej wielko�ci - wy��cz t� opcj�.
    • +
    • Przechwytuj przeci�ganie lewym przyciskiem myszy (eksperymentalne) - okre�la, czy przeci�ganie plik�w lewym przyciskiem myszy ma by� przechwytywane przez ten program. Opcja eksperymentalna - po pierwsze nie dzia�a na wszystkich systemach (zw�aszcza na tych starszych). Po drugie powoduje r�wnie� przechwycenie komend 'Wklej' i 'Wklej skr�t' (a co za tym idzie r�wnie� kombinacj� klawiszy [CTRL]+[V]) z menu kontekstowego explorera, z czego t� drug� traktuje identycznie do pierwszej.
    • +
    • Domy�lna akcja przy przeci�ganiu lewym przyciskiem myszy - okre�la akcj�, kt�ra zostanie wykonana podczas przeci�gania plik�w/folder�w w oknach explorera je�li nie zostanie naci�ni�ty �aden klawisz modyfikuj�cy t� operacj� ([CTRL], [SHIFT], [ALT]). Autodetekcja operacji jest na razie w fazie eksperymentu - "przewiduje" ona to co jest wy�wietlone przy kursorze myszy - niekoniecznie taki jest stan faktyczny.
    • +
      +
    +
  • W�tek kopiuj�cy - opcje dotycz�ce kopiowania:
  • +
      +
    • Automatyczne dokopiuwuj pliki - okre�la, czy je�li zostanie napotkany plik o mniejszym rozmiarze ni� kopiowany, ale o tej samej nazwie domy�lnie ma by� dokopiowany, czy kopiowany od nowa.
    • +
    • Ustawiaj atrybuty plik�w docelowych - czy maj� by� ustawiane atrybuty plik�w docelowych.
    • +
    • Ustawiaj dat�/czas plik�w docelowych - j.w. tylko data/czas.
    • +
    • Chro� pliki tylko do odczytu - je�li przenosimy dane i nast�puje etap kasowania plik�w, to okre�la, czy pliki tylko do odczytu maj� by� kasowane (je�li nie - otrzymamy komunikat o b��dzie). Odnosi si� to r�wnie� do tego, czy zawarto�� plik�w docelowych, kt�re s� tylko do odczytu ma by� zast�powana now� zawarto�ci�.
    • +
    • Ilo�� jednocze�nie wykonywanych operacji - pozwala ograniczy� ilo�� przeprowadzanych jednocze�nie kopiowa� do np. 1. Podaj�c 0 usuwamy ograniczenia.
    • +
    • Odczytuj wielko�� zadania przed zablokowaniem - je�eli poprzednia opcja jest w��czona, to ta okre�li, czy wyszukiwanie plik�w (i obliczanie ich wielko�ci) ma si� odbywa� przed ('TAK'), czy po ('NIE') blokowaniu post�pu zadania.
    • +
    • Poka� wizualne potwierdzenia - czy podczas napotkania na np. niekompletnie skopiowany plik ma wy�wietla� okno z pytaniem o zast�pienie, dokopiowanie, itp.Trzy stopnie okre�laj�: Wy��czone - okna nie s� wy�wietlane, Normalne - okna s� wy�wietlane tylko w niezb�dnych przypadkach, za� Wszystkie powoduje pytanie o wszelkie szczeg�y (prawie).
    • +
    • Autowyb�r domy�lnej akcji dla okien z potwierdzeniami - czy powy�sze okna maj� zatwierdza� domy�ln� opcj� po okre�lonym czasie.
    • +
    • Czas pokazywania okna potwierdzenia - okre�la czas pokazywania okien z potwierdzeniami.
    • +
    • Wznawiaj automatycznie - ta opcja okre�la, czy program powinien ponowi� pr�b� wykonania danej operacji ponownie je�li wyst�pi b��d kopiowania .
    • +
    • Czas, co jaki operacja b�dzie automatycznie wznawiana [ms] - okre�la, co ile program b�dzie pr�bowa� wznowi� powy�sze zadania. +
    • Domy�lny priorytet w�tku - okre�la domy�lny priorytet w�tku kopiuj�cego. Warto�� ta domy�lnie przypisywana jest ka�demu rozpoczynanemu zadaniu.
    • +
    • Wy��cz podbijanie priorytetu przez system - okre�la, czy system powinien nieco podnie�� priorytet w�tku, je�li aplikacja dzia�a na pierwszym planie.
    • +
    • Kasuj pliki dopiero po zako�czeniu kopiowania (przenoszenia) - pozwala wybra� spos�b przenoszenia plik�w - albo s� one kasowane(wszystkie) dopiero po skopiowaniu wszystkich plik�w, albo pojedynczo po skopiowaniu danego pliku.
    • +
    • Tw�rz pliki .log (dziennika)- czy program ma tworzy� pliki dziennik�w dla okre�lonych zada� (dzi�ki temu np. mo�na zg�asza� do mnie b��dy), lub obejrze� z grubsza jak wygl�da� proces kopiowania, czy wyst�pi�y jakie� b�edy, jakie, itp.
    • +
      +
    +
  • Bufor - opcje zwi�zane z buforami u�ywanymi w czasie pracy programu:
  • +
      +
    • U�ywaj tylko domy�lnego bufora - je�li w��czymy t� opcj� - program automatycznie dobierze jedn� z poni�szych wielko�ci bufora (np. kopiuj�c cokolwiek z CD-ROMu na dysk twardy zostanie u�yty bufor odpowiedni dla CD-ROMu), je�li opcja ta jest wy��czona - zawsze b�dzie u�ywany bufor o domy�lnej wielko�ci.
    • +
    • Domy�lna wielko�� bufora - okre�la domy�ln� wielko�� bufora. Je�li opcja automatycznego dobierania wielko�ci bufora jest wy��czona - ta wielko�� bufora b�dzie u�ywana do wszystkich kopiowa�, je�li za� jest w��czona - bufor ten s�u�y do kopiowania plik�w, kt�re nie mieszcz� si� w kategoriach poni�szych bufor�w.
    • +
    • Wielko�� bufora kopiowania w obr�bie jednego dysku - okre�la wielko�� bufora, je�li kopiujemy dane z dysku twardego na dysk twardy, oraz je�li miejsce �r�d�owe i docelowe le�� na tym samym dysku fizycznym.
    • +
    • Wielko�� bufora kopiowania pomi�dzy dwoma r�nymi dyskami - okre�la wielko�� bufora dla kopiowania w obr�bie dw�ch r�nych dysk�w twardych.
    • +
    • Wielko�� bufora kopiowania z CD-ROMu - wielko�� bufora u�ywana w momencie, gdy kopiujemy dane z CD-ROMu na dowolny inny no�nik.
    • +
    • Wielko�� bufora kopiowania przez sie� lokaln� - wielko�� bufora u�ywana dla kopiowania z u�yciem sieci.
    • +
    • Wy��cz buforowanie dla du�ych plik�w - pozwala na wy��czenie buforowania dla plik�w o okre�lonej wielko�ci (i wi�kszych; kopiowanie du�ych plik�w bez buforowania w wielu przypadkach jest szybsze od kopiowania z buforowaniem; na moim komputerze przy w��czonej tej opcji kopiowanie danych (w�a�ciwie 1.36GB film�w) w obr�bie jednego dysku fizycznego jest szybsze o ok. 1.2MB/s).
    • +
    • Minimalna w ielko�� plik�w, dla kt�rych buforowanie ma zosta� wy��czone- okre�la minimaln� wielko�� pliku dla kt�rego buforowanie ma by� wy��czone (wg moich eksperyment�w warto�� w pobli�u 2MB jest wystarczaj�ca, ale na innych systemach warto�� ta mo�e by� inna).
    • +
      +
    +
  • D�wi�ki - okre�la opcje zwi�zane z odtwarzaniem d�wi�k�w w programie:
  • +
      +
    • Odtwarzaj d�wi�ki w programie - czy na pewne zdarzenia program ma odtworzy� d�wi�k.
    • +
    • D�wi�k przy wyst�pienie b��du - �cie�ka dost�pu do pliku .wav z d�wi�kiem, kt�ry powinien by� odtworzony, je�li wyst�pi b��d.
    • +
    • D�wi�k po zako�czenie kopiowania - �cie�ka dost�pu do pliku .wav z d�wi�kiem, kt�ry powinien by� odtworzony po zako�czeniu zadania.
    • +
      +
    +
  • Skr�ty - okre�la opcje dotycz�ce skr�t�w u�ywanych w menu kontekstowych Eksplorera i w oknie wyboru folderu docelowego:
  • +
      +
    • Ilo�� zdefiniowanych skr�t�w - okre�la ilo�� aktualnie zdefiniowanych skr�t�w. Aby edytowa� - kliknij dwukrotnie, albo naci�nij przycisk po prawej stronie.
    • +
      +
    +
  • Ostatnio u�ywane �cie�ki dost�pu - okre�la opcje dotycz�ce �cie�ek dost�pu wybranych ostatnio jako miejsce docelowe dla kopiowanych danych:
  • +
      +
    • Ilo�� zapami�tanych �cie�ek - okre�la ilo�� zapami�tanych �cie�ek, do kt�rych by�o co� ostatnio kopiowane. Aby edytowa� - kliknij dwukrotnie lub naci�nij przycisk po prawej stronie.
    • +
    +
+
+
+
+ + + + Index: other/Help/Polish/recentdlg.htm =================================================================== diff -u --- other/Help/Polish/recentdlg.htm (revision 0) +++ other/Help/Polish/recentdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,23 @@ + + + + + + + +Okno edycji ostatnio u�ywanych �cie�ek + + + +
Okno dost�pne z poziomu okna ustawie�. + Umo�liwia edycj� ostatnio u�ywanych �cie�ek. +
    +
  • Ostatnio u�ywane �cie�ki - modyfikowalna lista ostatnio u�ywanych �cie�ek.
  • +
  • �cie�ka dost�pu - dzi�ki trzem przyciskom ('Dodaj', 'Aktualizuj' i 'Usu�') mo�na modyfikowa� wy�wietlone �cie�ki, przystosowuj�c je do w�asnych potrzeb.
  • +
+
+
+ + + + Index: other/Help/Polish/replacepaths.htm =================================================================== diff -u --- other/Help/Polish/replacepaths.htm (revision 0) +++ other/Help/Polish/replacepaths.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ + + + + + + + + +Okno zamiany �cie�ek + + + +
Dzi�ki temu oknu u�ytkownik mo�e zmieni� �cie�k� �r�d�ow� zaznaczonego zadania w oknie statusu na now� warto��. +
    +
  • �cie�ka �r�d�owe - okre�la, jak� �cie�k� posiada�o zadanie na pocz�tku. Mo�na zaznaczy� jedn� z nich lub poda� je r�cznie w polu poni�ej.
  • +
  • Zamie� na - tutaj mo�na poda� now� �cie�k�. S� na to dwa sposoby: albo wpisywanie tekstu bezpo�rednio z klawiatury, albo wskazanie jej poprzez klikni�cie przycisku '...', a nast�pnie folderu w otwartym oknie.
  • +
+
+
+ + + + Index: other/Help/Polish/reporting.htm =================================================================== diff -u --- other/Help/Polish/reporting.htm (revision 0) +++ other/Help/Polish/reporting.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,35 @@ + + + + + + + +Raportowanie b��d�w + + + +
Je�eli zauwa�y�e� jaki� problem w dzia�aniu programu, kt�ry mo�e by� wynikiem b��du programistycznego, mo�esz napisa� maila na jeden z podanych adres�w: support@copyhandler.com lub copyhandler@o2.pl.

+
+ Wszystkie raporty o b��dach s� mile widziane, ale zanim napiszesz, pami�taj: +
    +
  • upewnij si�, �e masz najnowsz� wersj� programu. Mo�esz j� zaci�gn�� ze strony programu (http://www.copyhandler.prv.pl).
  • +
  • odno�nie wersji spakowanych w archiwum ZIP: upewnij si�, �e poprawnie zamieni�e� bibliotek� odpowiedzialn� za integracj� z pow�ok� systemow�. Znaczna ilo�� problem�w powstaje w�a�nie z powodu niepoprawnego zamienienia starej wersji pliku z now�. Je�eli u�ywa�e� wcze�niejsz� wersj� aplikacji - przy uruchomionym programie wybierz z jego menu opcj� 'Wy��cz integracj� z pow�ok� systemow�', nast�pnie wyloguj si� i zaloguj ponownie albo zrestartuj komputer. Wtedy usu� star� bibliotek� DLL i skopiuj now� na jej miejsce, a nast�pnie zarejestruj, u�ywaj�c do tego polecenia z g��wnego menu programu. Aby si� upewni�, czy dobrze robisz, zobacz tak�e na procedur� instalacji / deinstalacji.
  • +
+
+ Co powinien zawiera� mail z raportem b��du (nie wszystko jest wymagane, ale b�dzie pomocne przy rozwi�zywaniu problemu)? +
    +
  • szczeg�owy opis b��du (co si� sta�o; w jaki spos�b mo�na doprowadzi� do jego ponownego wyst�pienia). To jest wymagane - je�eli nie b�d� wiedzia�, jak b��d powsta�, jak b�d� go m�g� naprawi�?
  • +
  • plik konfiguracyjny Copy Handlera (ch.ini), je�eli b��d wynika� z ustawie� opcji. Je�eli nie jeste� pewien - za��cz spakowany plik konfiguracyjny do maila (preferowane s� archiwa ZIP lub RAR). Nie wymagane, ale w pewnych przypadkach mo�e okaza� si� bardzo pomocne,
  • +
  • konfiguracja systemu (wersja systemu Windows, wersja zainstalowanego Internet Eksplorera, wersja Copy Handlera, jak� u�ywasz). Nie wymagane, ale pomocne - niekt�re b��dy wynikaj� z u�ywania konkretnego systemu,
  • +
  • pr�dko�� procesora oraz ilo�� pami�ci RAM. Nie wymagane, ale czasami pomocne,
  • +
  • ka�da inna informacja (np. zrzut ekranu), kt�re mo�e okaza� si� pomocne.
  • +
+
+ Je�eli chcesz doda� jaki� za��cznik do maila - upewnij si�, �e jest on zapisany w formacie, kt�ry nie zajmuje zbyt du�o miejsca (np. zrzuty ekranu powinny by� w postaci JPG'�w lub GIF'�w. Abosultnie nie przysy�aj mi obrazk�w jako BMP albo TIFF). Ka�dy inny rodzaj za��cznika spakuj do formatu ZIP lub RAR.
+
+
+ + + + Index: other/Help/Polish/requirements.htm =================================================================== diff -u --- other/Help/Polish/requirements.htm (revision 0) +++ other/Help/Polish/requirements.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,27 @@ + + + + + + + + +Wymagania programu + + + +
Aby dzia�a� poprawnie program potrzebuje: +
    +
  • procesora klasy Pentium lub w 100% kompatybilnego (by� mo�e dzia�a tak�e na starszych jednostkach, takich jak 386 lub 486, ale nie zosta�o to przetestowane),
  • +
  • systemu operacyjnego Microsoft Windows 95/98/Me/NT4/2000/XP,
  • +
  • oko�o 1 MB wolnej przestrzeni dyskowej,
  • +
  • monitora obs�uguj�cego rozdzielczo�� co najmniej 800x600 pikseli (program b�dzie dzia�a� na ni�szych rozdzielczo�ciach, ale niekt�re okna nie b�d� w pe�ni widoczne),
  • +
  • zainstalowanych bibliotek MFC w wersji co najmniej 4.2 (zazwyczaj s� one dostarczone z systemem),
  • +
  • zainstalowanej czcionki Tahoma.
  • +
+
+
+ + + + Index: other/Help/Polish/shortcutsdlg.htm =================================================================== diff -u --- other/Help/Polish/shortcutsdlg.htm (revision 0) +++ other/Help/Polish/shortcutsdlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + + +Okno edycji skr�t�w + + + +
Okno wy�wietlane jest z poziomu okna ustawie�. S�u�y ono do edycji skr�t�w do �cie�ek u�ywanych w menu kontekstowym Eksplorera i oknie wyboru folderu docelowego. +
    +
  • Skr�ty - lista obecnie zdefiniowanych skr�t�w.
  • +
  • W g�r� / W d� - te dwa przyciski pozwalaj� zmienia� kolejno�� wy�wietlania obiekt�w z listy.
  • +
  • Dodaj - dodaje skr�t zdefiniowany przez edycj� powy�szego pola kombi do listy skr�t�w.
  • +
  • Aktualizuj - zmienia zaznaczony skr�t w li�cie na ten zdefiniowany przez edycj� powy�szego pola kombi.
  • +
  • Usu� - usuwa zaznaczony skr�t z listy.
  • +
+
+
+ + + + Index: other/Help/Polish/shutdowndlg.htm =================================================================== diff -u --- other/Help/Polish/shutdowndlg.htm (revision 0) +++ other/Help/Polish/shutdowndlg.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,19 @@ + + + + + + + + +Powiadomienie o zamykaniu systemu + + + +
Okno to jest wy�wietlane, gdy opcja 'Zamknij system po zako�czeniu kopiowania' w menu konfiguracji (sekcja 'Program') jest aktywna i wszystkie zadania zosta�y zako�czone. Aby wy��czy� w ten spos�b system, mo�na r�wnie� wybra� odpowiedni� opcj� z g��wnego menu programu.
+
+
+ + + + Index: other/Help/Polish/status.htm =================================================================== diff -u --- other/Help/Polish/status.htm (revision 0) +++ other/Help/Polish/status.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,63 @@ + + + + + + + +Okno statusu + + + +
+
    +
  • Lewa strona okna:
    + Lista operacji
    - wy�wietla list� zada� wraz z aktualnym stanem (zako�czone, anulowane, itp.). Przy ka�dym zadaniu podawany jest jego stan, plik, kt�ry jest obecnie przetwarzany, folder docelowy, do kt�rego pliki s� kopiowane oraz procentowy post�p: +
      +
    • Przycisk '<<' - zmienia widok okna z zaawansowanego na uproszczony i odwrotnie.
    • +
    • Przycisk 'Pauza' - zatrzymuje zaznaczone zadanie. Je�eli inne zadanie oczekuje na jego zako�czenie, zostanie wtedy rozpocz�te.
    • +
    • Przycisk 'Wzn�w' - wznawia prac� zaznaczonego-wstrzymanego zadania. Podobnie je�eli zadanie jest w stanie oczekiwania (oczekuje na zako�czenie innego), klikni�cie na ten przycisk spowoduje jego uruchomienie. Je�eli akcja zostanie wykonana przy tym rodzaju wznowienia, zadanie zignoruje ustawienie w opcjach pozycji 'Ilo�� jednocze�nie wykonywanych operacji' (sekcja 'W�tek kopiuj�cy') i uruchomi zadanie r�wnolegle.
    • +
    • Przycisk 'Restart' - powoduje ponowne uruchomienie zaznaczonego zadania. Zadanie zostanie uruchomione od pocz�tku (z ponownym przeszukiwaniem plik�w do skopiowania).
    • +
    • Przycisk 'Anuluj' - anuluje aktualnie zaznaczone zadanie.
    • +
    • Przycisk 'Usu�' - kiedy zadanie jest uko�czone lub anulowane, to polecenie spowoduje jego usuni�cie z listy. Je�eli zadanie jest uruchomione, program zapyta u�ytkownika, czy ma kontynuowa� przerwanie wykonywania operacji.
    • +
    • Przycisk 'Pauza/wszystkie' - dzia�a w podobny spos�b jak przycisk 'Pauza', z tym, �e odnosi si� do wszystkich zada�.
    • +
    • Przycisk 'Wzn�w/wszystkie' - dzia�a w podobny spos�b jak przycisk 'Wzn�w', ale nie powoduje ignorowania opcji 'Ilo�� jednocze�nie wykonywanych operacji' (sekcja 'W�tek kopiuj�cy').
    • +
    • Przycisk 'Anuluj/wszystkie' - anuluje wszystkie zadania.
    • +
    • Przycisk 'Usu�/wszystkie' - usuwa wszystkie anulowane i uko�czone zadania z listy.
    • +
    • Przycisk 'Restart/wszystkie' - uruchamia ponownie wszystkie zadania z listy.
    • +
    • Przycisk 'Przyklej' - powoduje 'przyklejenie' okna statusu do prawego, dolnego rogu ekranu.
    • +
    • Przycisk 'Zaawansowane >' - Pokazuje menu zaawansowane odnosz�ce si� do jednego lub kilku zada� .
    • +
      +
    +
  • +
  • Prawa strona okna:
    + Statystyki aktualnego zaznaczenia
    - statystyki dla zaznaczonego zadania z listy operacji: +
      +
    • Skojarzony plik - nazwa pliku, kt�ra zawiera informacje o aktualnym zadaniu. Kiedy uruchomisz ponownie system, Copy Handler �aduje informacje o nieuko�czonym/przerwanym zadaniu w�a�nie z tego pliku. Pliki te umieszczane s� w katalogu okre�lonym w ustawieniach, opcja 'Folder z danymi tymczasowymi' (sekcja 'Program').
    • +
    • Operacja - okre�la typ i stan zaznaczonego zadania.
    • +
    • Obiekt �r�d�owy - nazwa obecnie przetwarzanego zadania (kopiowanego lub przenoszonego do miejsca docelowego).
    • +
    • Obiekt docelowy - katalog docelowy, do kt�rego zaznaczone zadanie kopiuje pliki i foldery.
    • +
    • Wielko�� bufora - okre�la rozmiary bufora u�ywane przy obecnym zadaniu. Mo�esz zmieni� te warto�ci, klikaj�c na przycisk '...' po prawej stronie. Wy�wietlone zostanie wtedy okno ustawie� wielko�ci bufora.
    • +
    • Priorytet w�tku - priorytet zadania, z kt�rym zosta�o uruchomione. Mo�esz go zmieni�, klikaj�c na przycisk '>' po prawej stronie i wybieraj�c z menu potrzebn� warto��.
    • +
    • Dodatkowe uwagi - wy�wietla kod i opis b��du (je�eli taki wyst�pi).
    • +
    • Przycisk 'Poka� rejestr' - wy�wietla plik dziennika powi�zany z obecnym zadaniem.
    • +
    • Przetworzono - podaje informacje o ilo�ci plik�w i folder�w, kt�re zosta�y przetworzone / liczbie wszystkich plik�w i folder�w; wielko�ci danych, kt�ra zosta�a przetworzona / rozmiarze wszystkiego; ilo�ci kopii utworzonych / ilo�ci wszystkich kopii. Liczba kopii jest wi�ksza ni� jeden, je�eli okre�lisz wi�cej ni� jeden przebieg zadania.
    • +
    • Czas - wy�wietla ilo�� up�ytni�tego czasu (dla uruchomionego zadania) oraz szacowany ca�y czas zadania a� do jego zako�czenia.
    • +
    • Transfer - wy�wietla poziom transferu dla zadania (obecny i �redni). Obecna pr�dko�� kopiowania jest mierzona przez dzielenie rozmiaru pliku kopiowanego w ostatnim interwale czasu (t� warto�� mo�na okre�li� w oknie ustawie�, opcja 'Czas, co jaki b�dzie od�wie�any status' (sekcja 'Okno statusu')) przez rzeczywisty, dok�adny czas przebiegu kopiowanych danych. Warto�ci mog� by� troszk� niedok�adne, gdy u�ywamy du�ych rozmiar�w bufora lub mamy ustawiony niski czas od�wie�ania interwa��w. Wtedy transfer b�dzie si� drastycznie zmienia�, 'skaka�', od 0 B/s do - powiedzmy - 24MB/s (przy ustawionym 24MB buforze). Przeci�tna pr�dko�� jest mierzona przez dzielenie rozmiaru wszystkich kopiowanych danych przez ca�kowity czas.
    • +
    • Post�p - pasek post�pu bazuj�cy na rozmiarze przetworzonych plik�w.
    • +
    +
  • +
  • Statystyki wszystkiego: +
      +
    • Przetworzono - bardzo podobne do powy�szego pola 'Przetworzono', z tym, �e to wy�wietla informacje o wszystkich zadaniach z listy (nie ma znaczenia, czy zadanie zosta�o uko�czone, anulowane, czy jest uruchomione).
    • +
    • Transfer - wy�wietla obecny transfer dla wszystkich uruchomionych zada� z listy.
    • +
    • Post�p - pasek post�pu bazuj�cy na rozmiarze wszystkich przetworzonych plik�w z listy (ignoruje stan zadania - zlicza je wszystkie).
    • +
    +
  • +
+
+
+ + + + Index: other/Help/Polish/style.css =================================================================== diff -u --- other/Help/Polish/style.css (revision 0) +++ other/Help/Polish/style.css (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ +.footer +{ + font-weight: normal; + font-size: x-small; + color: silver; + font-family: Arial; +} +.header +{ + font-weight: normal; + font-size: x-small; + color: silver; + font-family: Arial; +} +.headertitle +{ + font-size: medium; + color: black; + font-family: Arial; +} +.section +{ + font-weight: normal; + font-size: medium; + color: black; + font-family: Arial; +} +.text +{ + font-size: x-small; + color: black; + font-family: Arial; +} +PRE +{ + font-size: x-small; +} +.seealso +{ + font-size: x-small; + color: black; + font-family: Arial; +} Index: other/Help/Polish/support.htm =================================================================== diff -u --- other/Help/Polish/support.htm (revision 0) +++ other/Help/Polish/support.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,75 @@ + + + + + + + +Kontakt / wsparcie + + + + +
Je�eli masz jakie� propozycje, spodoba�o Ci si� co� (lub te� nie) w programie - daj mi zna�:
+
+ support@copyhandler.com

+ copyhandler@o2.pl

+ Je�eli znalaz�e� b��dy (kt�rych zdecydowanie nie powinno by�) - przeczytaj, jak je zg�osi�.
+
+
+ Je�eli spodoba� Ci si� program i chcia�(a)by� wesprze� jego dalszy rozw�j, mo�esz ofiarowa� co� na:
+ BRE SA-WBE/��d�
78 1140 2004 0000 3102 3116 3975
+
+

+
Fora dyskusyjne:
+

Og�lne - mo�esz wysy�a� tam pytania, raporty o b��dach i inne... ale nie spam. +

+ + + + + + + + + + + + + + + + + +
Strona[http://groups.yahoo.com/group/copyhandler]
Wy�lij wiadomo��

[copyhandler@yahoogroups.com]

Subskrybuj[copyhandler-subscribe@yahoogroups.com]
Wypisz si�[copyhandler-unsubscribe@yahoogroups.com]
+


+ Programistyczne dla Copy Handlera - dla komentarzy odno�nie kodu, spraw zwi�zanych z pisanie CH, t�umaczenia programu i innych...

+ + + + + + + + + + + + + + + + + +
Strona[http://groups.yahoo.com/group/chdev]
Wy�lij wiadomo��[chdev@yahoogroups.com]
Subskrybuj[chdev-subscribe@yahoogroups.com]
Wypisz si�[chdev-unsubscribe@yahoogroups.com]
+


+ Je�li szukasz nowszej wersji Copy Handlera - zobacz na stronie:
+ http://www.copyhandler.com
+ http://www.copyhandler.prv.pl
+

+
+
+ + + + Index: other/Help/Polish/template.htm =================================================================== diff -u --- other/Help/Polish/template.htm (revision 0) +++ other/Help/Polish/template.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ + + + + + + +<!-- tytu� --> + + + +
+Zawarto�� +
+
+
+Zobacz tak�e: +
+ + + Index: other/Help/Polish/thanks.htm =================================================================== diff -u --- other/Help/Polish/thanks.htm (revision 0) +++ other/Help/Polish/thanks.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,49 @@ + + + + + + + +Podzi�kowania + + + +
Chcia�bym podzi�kowa� ka�demu, kto pomaga� mi w tworzeniu programu - a w szczeg�lno�ci:
+ Ludziom, kt�rzy mieli 'fizyczny' wk�ad w projekt: +
    +
  • El Magico - skrypt instalacyjny, autor wielu raport�w o b��dach, �wietne pomys�y...
  • +
  • Barnaba - zajmuje si� obecn� stron� domow� programu
  • +
  • Tomas S. Refsland - sponsor serwera i domeny
  • +
  • Kaleb - poprzedni tw�rca strony Copy Handlera
  • +
  • Marcin K�dzia & DMK Project - by�y sponsor naszej strony internetowej - http://www.dmkproject.pl
  • +

+ Autorom wersji j�zykowych dostarczonych z programem: +

+    Aktualna lista zainstalowanych wersji j�zykowych znajduje si� w oknie "O Programie".

+
+Osobom, kt�rych kod zosta� u�yty przy tworzeniu obecnej wersji programu (pozyskane z http://www.codeguru.com): +
    +
  • Antonio Tejada Lacaci - CFileInfoArray (z du�ymi modyfikacjami)
  • +
  • Keith Rule - CMemDC
  • +
  • Brett R. Mitchell - CPropertyListCtrl (z drobnymi dodatkami)
  • +

+ Ludziom / instytucjom - autorom program�w u�ytych przy tworzeniu Copy Handlera: +
    +
  • Microsoft - autorzy: Visual Studio 6.0, wszystkich system�w operacyjnych z rodziny Windows oraz niekt�rych ikon (http://www.microsoft.com)
  • +
  • Markus Oberhumer & Laszlo Molnar - UPX Software - kompresja plik�w wykonywalnych (http://upx.tsx.org)
  • +

+ Pozosta�ym osobom (za wiele r�nych rzeczy...): +
    +
  • Chis Octavian
  • +
  • Peter Bijl
  • +
  • Sebastian Schuberth

  • +
+ +Je�eli s�dzisz, �e powiniene� zosta� tu wymieniony, a nie jeste� - napisz, dlaczego tak uwa�asz.
+
+
+
Zobacz tak�e: Kontakt / wsparcie, Licencja.
+ + + Index: other/Help/Polish/using.htm =================================================================== diff -u --- other/Help/Polish/using.htm (revision 0) +++ other/Help/Polish/using.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,30 @@ + + + + + + + +Opis dzia�ania programu + + + +
Jak kopiowa� przy u�yciu Copy Handlera?

+ Je�eli w��czy�e� integracj� z pow�ok� systemow�: +
    +
  • Przeci�gnij pliki / foldery pomi�dzy oknami Eksplorera, u�ywaj�c prawego przycisku myszy, upu�� je i wybierz jedn� z opcji rozwini�tego menu kontekstowego, zaczynaj�cych si� od '(CH)'.
  • +
  • Skopiuj co� do schowka (zaznaczaj�c pliki i u�ywaj�c kombinacji klawiszy [CTRL]+[C] z klawiatury albo korzystaj�c z polecenia 'Kopiuj' z menu kontekstowego Eksplorera) i wklej skopiowane pliki do innego miejsca, wybieraj�c z tego samego menu '(CH) Wklej' lub '(CH) Wklej specjalne...'. Je�eli w��czy�e� opcj� 'Monitoruj schowek' (sekcja 'Program') - po skopiwaniu plik�w do schowka otworzy si� okno, w kt�rym mo�esz wybra� miejsce docelowe kopiowanych plik�w oraz rodzaj operacji.
  • +
  • Je�eli w��czy�e� opcj� 'Przechwytuj przeci�ganie lewym przyciskiem myszy' (sekcja 'Pow�oka systemowa') i korzystasz z raczej nowego systemu (Windows Me, 2000, XP lub 2003), mo�esz zwyczajnie przeci�gn�� i upu�ci� pliki, u�ywaj�c lewego przycisku myszy lub standardowego windowsowego polecenia 'Wklej' (albo kombinacji klawiszy [CTRL]+[V]).
  • +
+ Je�eli masz wy��czon� integracj� z pow�ok� systemow�: +
    +
  • Jedynym sposobem na rozpocz�cie kopiowania / przenoszenia danych jest zaznaczenie opcji 'Podaj parametry kopiowania...' z g��wnego menu programu, wype�nienia otwartego okna potrzebnymi parametrami (dane �r�d�owe i miejsce docelowe), a nast�pnie zaakceptowanie przyciskiem 'OK'.
  • +
+ +
+
+ + + + + Index: other/Help/Polish/welcome.htm =================================================================== diff -u --- other/Help/Polish/welcome.htm (revision 0) +++ other/Help/Polish/welcome.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,35 @@ + + + + + + + +Witamy + + + + +
Program Copy Handler jest ma�ym, u�ytecznym narz�dziem, zaprojektowanym do polepszenia kopiowania/przenoszenia plik�w i folder�w pomi�dzy r�nymi no�nikami pami�ci (dyskami twardymi, dyskietkami, sieci� lokaln�, CD-ROMami i wieloma innymi).
Ten plik pomocy zawiera informacje pomocne przy korzystaniu z Copy Handlera.
+ + +

+
!!Uwaga!!

+ Autor (Ixen Gerthannes) nie bierze na siebie �adnej odpowiedzialno�ci za jakiekolwiek szkody spowodowane dzia�aniem tego programu. Je�li uwa�asz, �e mo�esz utraci� co� bardzo wa�nego i nie ufasz temu programowi - po prostu go nie u�ywaj. (Zapoznaj si� z Licencj�, aby dowiedzie� si� wi�cej).
+ Autor oraz wiele innych os�b korzystaj� z programu na codzie� i s� z niego bardzo zadowoleni. I to nie jest �aden tani chwyt reklamowy :)
+ + + + + Index: other/Help/build_help.bat =================================================================== diff -u --- other/Help/build_help.bat (revision 0) +++ other/Help/build_help.bat (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,30 @@ +@echo off +echo ------------------------------------------------ +echo Building html help files +echo. + +rem %1 is a string with a destination path +if "%1" == "" goto default +if "%2" == "" goto default +set srcpath=%1 +set dstpath=%2 + +goto do + +:default +set srcpath=. +set dstpath=.\compiled + +:do +call %srcpath%\one_bld.bat %srcpath% English %dstpath% +call %srcpath%\one_bld.bat %srcpath% Polish %dstpath% +goto end + +:error +echo. +echo Missing parameter. +echo Usage: build.bat help_base_path destination_path +echo. +echo. + +:end \ No newline at end of file Index: other/Help/one_bld.bat =================================================================== diff -u --- other/Help/one_bld.bat (revision 0) +++ other/Help/one_bld.bat (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,18 @@ +rem @echo off +echo ---- + +if "%1" == "" goto error +if "%2" == "" goto error +if "%3" == "" goto error + +echo. + +copy %1\HTMLDefines.h %1\%2\HTMLDefines.h +hhc %1\%2\help.hhp >nul +move %1\%2\*.chm %3\ +goto end + +:error +echo one_bld.bat - missing parameters (usage: one_bld.bat helps_base_path help_folder_name dest_folder) + +:end \ No newline at end of file Index: other/Langs/English.lng =================================================================== diff -u --- other/Langs/English.lng (revision 0) +++ other/Langs/English.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,668 @@ +# Info section +[Info] +Lang Name=English +Lang Code=1033 +Base Language= +Font Face=Tahoma +Charset=1 +Size=8 +RTL reading order=0 +Help name=english.chm +Author=J�zef Starosczyk +Version=1.28 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=&Change paths... + +# Menu - IDR_POPUP_MENU +[130] +32773=Show status... +32802=&Options... +32803=Show mini-status... +32804=Enter copy parametres... +32806=Monitor clipboard +32807=Shutdown after finished +32809=&Register shell extension dll +32810=&Unregister shell extension dll +32814=&Help... +57664=About... +57665=Exit + +# Menu - IDR_PRIORITY_MENU +[135] +32774=Time critical +32775=Highest +32776=Above normal +32777=Normal +32778=Below normal +32779=Lowest +32780=Idle + +# Dialog box - IDD_BUFFERSIZE_DIALOG +[137] +0=Buffer size settings +1=&OK +2=&Cancel +1145=Use only default buffer +1219=Default +1220=For copying inside one disk boundary +1221=For copying between two different disks +1222=For copying with CD-ROM use +1223=For copying with network use +1257=&Help + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Copy handler - error opening file +2=&Cancel +1097=&Ignore +1098=I&gnore all +1099=&Wait +1100=&Retry +1220=Cannot open file for writing: +1221=Error description: + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Copy handler - error opening file +2=&Cancel +1097=&Ignore +1098=I&gnore all +1099=&Wait +1100=&Retry +1219=Cannot open source file for reading - reason: +1220=Name: +1221=Size: +1222=Created: +1223=Last modified: +1224=Expected source file: +1226=Name: +1227=Size: +1228=Created: +1229=Last modified: +1230=Source file found: +1231=What would you like to do ? + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Copy handler - smaller destination file found +2=&Cancel +1097=&Ignore +1098=I&gnore all +1103=Co&py rest +1104=R&ecopy +1106=Cop&y rest all +1107=Recopy &all +1220=Destination file exists and is smaller than source file.\nPossible reasons:\n- copying/moving source file wasn't finished (copy rest)\n- file being copied is in another version than destination file (recopy) +1221=Name: +1222=Size: +1223=Created: +1224=Last modified: +1225=Source file: +1226=Name: +1227=Size: +1228=Created: +1229=Last modified: +1230=Destination file: +1231=What would you like to do ? + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Copy handler - destination file found +2=&Cancel +1097=&Ignore +1098=I&gnore all +1104=R&ecopy +1107=Recopy &all +1220=Destination file exists and has equal or greater size than source file.\nPossible reasons:\n- file being copied is in another version than destination one (recopy/ignore)\n- source and destination files are identical (ignore) +1221=Name: +1222=Size: +1223=Created: +1224=Last modified: +1225=Source file: +1226=Name: +1227=Size: +1228=Created: +1229=Last modified: +1230=Destination file: +1231=What would you like to do ? + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=Status + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=Options +1=&OK +2=&Cancel +1218=&Apply +1257=&Help + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=Partial replace of source paths +1=OK +2=&Cancel +1064=... +1219=Source paths: +1220=Change to: +1257=&Help + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=Status +1003=List1 +1005=Progress1 +1007=Progress2 +1013=... +1016=> +1018=&Pause +1021=&Resume +1022=&Cancel +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=Resume/all +1042=&Restart +1043=&Remove +1044=Pause/all +1045=Restart/all +1046=Cancel/all +1047=Remove/all +1077=&Advanced > +1120=View log +1122= +1219=Operations list: +1220=Progress: +1221=Progress: +1222=Destination object: +1223=Source object: +1224=Buffer size: +1225=Thread priority: +1226=Comments: +1227=Operation: +1228=Transfer: +1229=Processed: +1230=Transfer: +1231=Processed: +1232=Global statistics +1233=Current selection statistics +1234= +1235= +1236= +1237= +1238=Time: +1239=Associated file: + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Copy handler - not enough free space +2=&Cancel +1097=C&ontinue +1100=&Retry +1127= +1128= +1221=Required space: +1222=Space available: +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy handler +2=&Cancel +1037= +1146=Progress1 +1220=All copy/move operations were finished. Attempt to shut down the system will be performed in: + +# Dialog box - IDD_CUSTOM_COPY_DIALOG +[149] +0=Copying/moving parameters +1=&OK +2=&Cancel +1002=Add &file(s)... +1004=&Delete +1008=... +1010=List2 +1011=Add f&older... +1014=Filtering +1015=Do not create destination directories - copy files loosely to destination folder +1017=Do not copy/move contents of files - only create it (empty) +1020=Create directory structure in destination folder (relatively to root directory) +1023=Advanced options +1024=&Change... +1025=+ +1026=- +1065=List1 +1178=Spin1 +1179= +1191=&Import... +1219=Source files/folders: +1220=Destination folder: +1221=Operation type: +1222=Priority: +1223=Count of copies: +1224=Buffer sizes: +1225=Standard options +1249= +1250= +1251= +1252= +1253= +1257=&Help + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=Filtering settings +1=&OK +2=&Cancel +1150=Include mask (separate by vertical lines ie. *.jpg|*.gif) +1151=Filtering by size +1155=Spin1 +1159=Spin1 +1160=and +1161=Filtering by date +1162=By attributes +1163=Archive +1164=Read only +1165=Hidden +1166=System +1169=DateTimePicker1 +1170=DateTimePicker2 +1171=and +1173=DateTimePicker1 +1174=DateTimePicker2 +1175=Directory +1177=Exclude mask +1219= +1257=&Help + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=Shortcuts editing +1=&OK +2=&Cancel +1043=&Delete +1060=&Add +1064=... +1180=List1 +1182= +1185=&Update +1192=Move up +1193=Move down +1219=Shortcuts: +1220=Name: +1221=Path: +1222=Shortcut properties +1257=&Help + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=Recent paths +1=&OK +2=&Cancel +1043=&Delete +1060=&Add +1064=... +1185=&Update +1190=List1 +1219=Recently used paths: +1220=Path +1257=&Help + +# Dialog box - IDD_ABOUTBOX +[100] +0=About ... +1=&OK +1199=Copyright (C) 2001-2005 J�zef Starosczyk +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=General discussion forum: +1205=Developers' discussion forum: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=Page|http://groups.yahoo.com/group/copyhandler +1209=Subscribe|mailto:copyhandler-subscribe@yahoogroups.com +1210=Unsubscribe|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=Send message|mailto:copyhandler@yahoogroups.com +1212=Page|http://groups.yahoo.com/group/chdev +1213=Subscribe|mailto:chdev-subscribe@yahoogroups.com +1214=Unsubscribe|mailto:chdev-unsubscribe@yahoogroups.com +1215=Send message|mailto:chdev@yahoogroups.com +1216=Special thanks list: +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=Home page: +1266=Contact: +1267=This program is free software and may be distributed according to the terms of the GNU General Public License. +1268=Author: +1269=Support: + +# String table +[0] +211=[Program]\r\nEl Magico\t\t\t\t\tgreat ideas, beta-tests, ...\r\n\r\n[Home page]\r\nTomas S. Refsland\t\t\tpage hosting, other help\r\nBarnaba\t\t\t\t\twebmaster\r\n\r\n[Language packs]\r\n%s\r\n\r\n[Additional software]\r\nMarkus Oberhumer & Laszlo Molnar\t\tUPX software\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[Other]\r\nThanks for anybody that helped in any way... +5000=Copy Handler +5001=Time critical +5002=Highest +5003=Above normal +5004=Normal +5005=Below normal +5006=Lowest +5007=Idle +5008=Copy of %s +5009=Copy (%d) of %s +5010=File not found (doesn't exist) +5011=B +5012=kB +5013=MB +5014=GB +5015=TB +5016=PB +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=Cannot run the second instance of this program +6001=Library chext.dll was registered successfully +6002=Encountered error while trying to register library chext.dll\nError #%lu (%s). +6003=Library chext.dll was unregistered successfully +6004=Encountered error while trying to unregister library chext.dll\nError #%lu (%s). +6005=Cannot open html help file:\n%s\n +7000=Searching for files... +7001=Source file/folder not found (clipboard) : %s +7002=Adding file/folder (clipboard) : %s ... +7003=Added folder %s +7004=Recursing folder %s +7005=Kill request while adding data to files array (RecurseDirectories) +7006=Added file %s +7007=Searching for files finished +7008=Deleting files (DeleteFiles)... +7009=Kill request while deleting files (Delete Files) +7010=Error #%lu (%s) while deleting file/folder %s +7011=Deleting files finished +7012=Cancel request while checking result of dialog before opening source file %s (CustomCopyFile) +7013=Error #%lu (%s) while opening source file %s (CustomCopyFile) +7014=Cancel request [error #%lu (%s)] while opening source file %s (CustomCopyFile) +7015=Wait request [error #%lu (%s)] while opening source file %s (CustomCopyFile) +7016=Retrying [error #%lu (%s)] to open source file %s (CustomCopyFile) +7017=Error #%lu (%s) while opening destination file %s (CustomCopyFile) +7018=Retrying [error #%lu (%s)] to open destination file %s (CustomCopyFile) +7019=Cancel request [error #%lu (%s)] while opening destination file %s (CustomCopyFile) +7020=Wait request [error #%lu (%s)] while opening destination file %s (CustomCopyFile) +7021=Error #%lu (%s) while moving file pointers of %s and %s to %I64u +7022=Error #%lu (%s) while restoring (moving to beginning) file pointers of %s and %s +7023=Error #%lu (%s) while setting size of file %s to 0 +7024=Kill request while main copying file %s -> %s +7025=Changing buffer size from [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] to [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] wile copying %s -> %s (CustomCopyFile) +7026=Error #%lu (%s) while trying to read %d bytes from source file %s (CustomCopyFile) +7027=Error #%lu (%s) while trying to write %d bytes to destination file %s (CustomCopyFile) +7028=Caught exception in CustomCopyFile [last error: #%lu (%s)] (at time %lu) +7029=Processing files/folders (ProcessFiles) +7030=Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %d\r\n\tBufferSize: [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu]\r\n\tFiles/folders count: %lu\r\n\tCopies count: %d\r\n\tIgnore Folders: %d\r\n\tDest path: %s\r\n\tCurrent pass (0-based): %d\r\n\tCurrent index (0-based): %d +7031=Kill request while processing file in ProcessFiles +7032=Error #%lu (%s) while calling MoveFile %s -> %s (ProcessFiles) +7033=Error #%lu (%s) while calling CreateDirectory %s (ProcessFiles) +7034=Finished processing in ProcessFiles +7035=\r\n# COPYING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d +7036=Finished waiting for begin permission +7037=Kill request while waiting for begin permission (wait state) +7038=Finished processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d +7039=Caught exception in ThrdProc [last error: %lu (%s), type: %d] +7040=Checking for free space on destination disk... +7041=Not enough free space on disk - needed %I64d bytes for data, available: %I64d bytes. +7042=Cancel request while checking for free space on disk. +7043=Retrying to read drive's free space... +7044=Ignored warning about not enough place on disk to copy data. +7047=Cancel request while calling MoveFileEx %s -> %s (ProcessFiles) +8000=Program +8001=Clipboard monitoring +8002=Scan clipboard every ... [ms] +8003=Run program with system +8004=Shutdown system after copying finishes +8005=Autosave every ... [ms] +8006=Folder for temporary data +8007=Status window +8008=Refresh status every ... [ms] +8009=Show details in status window +8010=Automatically remove finished tasks +8011=Miniview +8012=Show file names +8013=Show single tasks +8014=Refresh status every ... [ms] +8015=Show at program startup +8016=Hide when empty +8017=Copying/moving thread +8018=Auto "copy-rest" of files +8019=Set attributes of destination files +8020=Set date/time of destination files +8021=Protect read-only files +8022=Limit maximum operations running simultaneously ... +8023=Show visual confirmation dialogs +8024=Use timed confirmation dialogs +8025=Time of showing confirmation dialogs +8026=Auto resume on error +8027=Auto resume every ... [ms] +8028=Default thread priority +8029=Use only default buffer +8030=Default buffer size +8031=Don't delete files before copying finishes (moving) +8032=Create .log files +8033=Sounds +8034=Playing sounds +8035=Sound on error +8036=Sound on copying finished +8037=Language +8038=Read tasks size before blocking +8039=Disable buffering for large files +8040=Minimum file size for which buffering should be turned off +8041=Buffer +8042=Buffer size for copying inside one physical disk boundary +8043=Buffer size for copying between two different disks +8044=Buffer size for copying from CD-ROM +8045=Buffer size for copying over a network +8046=Wait ... [ms] before shutdown +8047=Type of shutdown +8048=Use smooth progress bars +8049=Choose folder dialog +8050=Show extended view +8051=Dialog width [pixels] +8052=Dialog height [pixels] +8053=Shortcuts' list style +8054=Ignore additional shell dialogs +8055=Show 'Copy' command in drag&drop menu +8056=Show 'Move' command in drag&drop menu +8057=Show 'Copy/move special' command in drag&drop menu +8058=Show 'Paste' command in context menu +8059=Show 'Paste special' command in context menu +8060=Show 'Copy to' command in context menu +8061=Show 'Move to' command in context menu +8062=Show 'Copy/move special to' command in context menu +8063=Show free space with shortcuts' names +8064=Show icons with shortcuts (experimental) +8065=Intercept drag&drop operation by left mouse button (experimental) +8066=Shortcuts +8067=Recently used paths +8068=Shell +8069=Defined shortcuts' count +8070=Count of recent paths +8071=Default action for dragging by left mouse button +8072=Application's priority class +8073=Disable priority boosting +8074=No!Yes +8075=!Choose temporary folder +8076=Disabled!Normal!Heavy +8077=!Sound files (.wav)|*.wav|| +8079=Normal!Force +8080=Large icons!Small icons!List!Report +8081=Idle!Normal!High!Real-time +8082=Copy!Move!Special operation!Autodetect +8083=Folder with plugins +8084=!Choose folder with plugins +8085=Main log file +8086=Enable logging +8087=Use log file size limit +8088=Maximum size of the limited log file +8089=Use precise limiting of a log file +8090=Truncate buffer size +8091=Directory with help files +8092=!Choose folder with program's help files +8093=Directory with language files +8094=!Choose folder with language files +9000=(CH) Copy here +9001=(CH) Move here +9002=(CH) Copy/move special... +9003=(CH) Paste +9004=(CH) Paste special... +9005=(CH) Copy to +9006=(CH) Move to +9007=(CH) Copy/move special to... +9008=Copies data here with Copy Handler +9009=Moves data here with Copy Handler +9010=Copies/moves data with additional settings +9011=Pastes files/folders from clipboard here +9012=Pastes files/folders from clipboard here with additional settings +9013=Copies selected data into specified folder +9014=Moves selected data into specified folder +9015=Copies/moves selected data into specified folder with additional settings +13000=Choose path +13001=Remote name: +13002=Local name: +13003=Type: +13004=Network type: +13005=Description: +13006=Free space: +13007=Capacity: +13008=&OK +13009=&Cancel +13010=Cannot create the folder +13011=Entered path doesn't exist +13012=Name +13013=Path +13014=Path: +13015=>> +13016=<< +13017=You haven't entered the path for this shortcut +13018=Create new folder +13019=Large icons +13020=Small icons +13021=List +13022=Report +13023=Details +13024=Add to shortcut's list +13025=Remove from shortcut's list +13026=Domain/Workgroup +13027=Server +13028=Share +13029=File +13030=Group +13031=Network +13032=Root +13033=Administration share +13034=Directory +13035=Tree +13036=NDS Container +13500=Copying... +13501=Moving... +13502=Unknown operation type - this shouldn't happen +13503=Enter destination path for:\n +14001=Compilation: %s +14002=Code= +14003=Version= +14500=Cannot operate with buffer of 0 size +15000=All files (*)|*|| +15001=Choose destination folder +15002=You didn't fill destination path or source file.\nProgram cannot continue +15003=Copy +15004=Move +15005=Default: %s +15006=One Disk: %s +15007=Two disks: %s +15008=CD: %s +15009=LAN: %s +15010=Include mask +15011=Size +15012=Date +15013=Attributes included +15014= and +15015=none +15016=any +15017=any +15018=Exclude mask +15019=Attributes excluded +15020=none +15021=None of filtering options were selected +15022=All files (*.*)|*.*|| +15023=Imported %lu path(s) +16500=There is not enough room in %s to copy or move: +18000=Date of creation +18001=Date of last write +18002=Date of last access +18500=All: +20000=You didn't enter source text +20500=Shortcut's name +20501=Path +21000=Cannot shutdown this operating system.\nEncountered error #%lu. +21500=Status +21501=File +21502=To: +21503=Progress +21504=None of tasks selected +21505=empty +21506=empty +21507=unknown +21508=unknown +21509=empty +21510=empty +21511=unknown +21512=00:00 / 00:00 +21513=pass: +21514=avg: +21515=Status +21516=Changed:\n%d paths primarily got from clipboard +21517=Selected task isn't paused +21518=Task not selected +21519=(waiting...) +21520= copies +21521= copies +21522=Searching +21523=Copying +21524=Moving +21525=Finished +21526=Error +21527=Paused +21528=Deleting +21529=Unknown +21530=Cancelled +21531=Waiting +21532=Only files +21533=Without contents +21534=Error #%lu calling ShellExecute for file %s +21535=Default: +21536=One disk: +21537=Two disks: +21538=CD: +21539=LAN: +21540=Error #%errnum (%errdesc) while deleting file %s +21541=Error #%errnum (%errdesc) while trying to open source file %s +21542=Error #%errnum (%errdesc) while trying to open destination file %s. Probably file has read-only attribute set, and 'Protect read-only files' flag in configuration is set (so the file cannot be open to write). +21543=Error #%errnum (%errdesc) while restoring (moving to beginning) file pointers of %s and %s +21544=Error #%errnum (%errdesc) while setting size of file %s to 0 +21545=Error #%errnum (%errdesc) while trying to read %d bytes from source file %s +21546=Error #%errnum (%errdesc) while trying to write %d bytes to destination file %s +21547=Error #%errnum (%errdesc) while calling MoveFile %s -> %s +21548=Error #%errnum (%errdesc) while calling CreateDirectory %s +21549=not associated +21550= [with filter] +21551=Selected task wasn't finished yet.\nDo you want to finish it now ? Index: other/Langs/French.lng =================================================================== diff -u --- other/Langs/French.lng (revision 0) +++ other/Langs/French.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,668 @@ +# Info section +[Info] +Lang Name=French +Lang Code=1036 +Base Language=English.lng +Font Face=Tahoma +Charset=1 +Size=8 +RTL reading order=0 +Help name=english.chm +Author=Julien (Vk) +Version=1.26 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=&Modifier les dossiers... + +# Menu - IDR_POPUP_MENU +[130] +32773=Afficher l'�tat... +32802=&Options... +32803=Afficher le mini-�tat... +32804=Entrez les param�tres de copie... +32806=Surveiller le Presse-Papier +32807=Eteindre apr�s avoir termin� +32809=&Enregistrer l'extension syst�me +32810=&D�charger l'extension syst�me +32814=&Aide... +57664=A Propos... +57665=Quitter + +# Menu - IDR_PRIORITY_MENU +[135] +32774=Temps r�el +32775=Haute +32776=Sup�rieure � la normale +32777=Normale +32778=Inf�rieure � la normale +32779=Basse +32780=Libre + +# Dialog box - IDD_BUFFERSIZE_DIALOG +[137] +0=Param�tres de la m�moire tampon +1=&OK +2=&Annuler +1145=N'utiliser que le tampon par d�faut +1219=Par d�faut +1220=Pour la copie entre le m�me disque +1221=Pour la copie entre deux disques diff�rents +1222=Pour la copie depuis un CD-ROM +1223=Pour la copie depuis le r�seau +1257=A&ide + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Gestionnaire de copie - erreur lors de l'ouverture du fichier +2=&Annuler +1097=&Ignorer +1098=I&gnorer tout +1099=&Attendre +1100=&R�essayer +1220=Impossible d'ouvrir le fichier en �criture : +1221=Description de l'erreur : + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Gestionnaire de copie - erreur lors de l'ouverture du fichier +2=&Annuler +1097=&Ignorer +1098=I&gnorer tout +1099=&Attendre +1100=&R�essayer +1219=Impossible d'ouvrir le fichier source en lecture - raison : +1220=Nom : +1221=Taille : +1222=Cr�� le : +1223=Modifi� le : +1224=Fichier source attendu : +1226=Nom : +1227=Taille : +1228=Cr�� le : +1229=Modifi� le : +1230=Fichier source trouv� : +1231=Que voulez-vous faire ? + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Gestionnaire de copie - fichier de destination plus petit +2=&Annuler +1097=&Ignorer +1098=I&gnorer tout +1103=I&gnorer tout +1104=R&ecopier +1106=Cop&ier tout le reste +1107=Recopier &tout +1220=Le fichier de destination existe et est plus petit que le fichier source.\nRaisons possibles :\n- la copie/d�placement du fichier source n'est pas termin�e (copier le reste)\n- le fichier en cours de copie est une version diff�rente de la destination(recopie) +1221=Nom : +1222=Taille : +1223=Cr�� le : +1224=Modifi� le : +1225=Source : +1226=Nom : +1227=Taille : +1228=Cr�� le : +1229=Modifi� le : +1230=Destination : +1231=Que voulez-vous faire ? + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Gestionnaire de copie - fichier de destination trouv� +2=&Annuler +1097=&Ignorer +1098=I&gnorer tout +1104=R&ecopier +1107=Recopier &tout +1220=Le fichier destination existe et est de taille �gale ou sup�rieur au fichier source.\nRaisons possibles :\n- le fichier copi� est version diff�rente de la destination (recopier/ignorer)\n- les fichiers source et destination sont identiques (ignorer) +1221=Nom : +1222=Taille : +1223=Cr�� le : +1224=Modifi� le : +1225=Source : +1226=Nom : +1227=Taille : +1228=Cr�� le : +1229=Modifi� le : +1230=Destination: +1231=Que voulez-vous faire ? + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=Etat + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=Options +1=&OK +2=&Annuler +1218=&Appliquer +1257=A&ide + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=Remplacement partiel des r�pertoires sources +1=OK +2=&Annuler +1064=... +1219=R�pertoires sources : +1220=Modifier en : +1257=A&ide + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=Etat +1003=List1 +1005=Progress1 +1007=Progress2 +1013=... +1016=> +1018=&Pause +1021=&Reprendre +1022=&Annuler +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=Reprendre/tout +1042=&Red�marrer +1043=&Enlever +1044=Pause/tout +1045=Red�marrer/tout +1046=Annuler/tout +1047=Enlever/tout +1077=&Avanc� > +1120=Journal +1122= +1219=Liste des op�rations : +1220=Progression: +1221=Progression: +1222=Objet destination: +1223=Objet source: +1224=M�moire tampon: +1225=Priorit�: +1226=Commentaires: +1227=Op�ration: +1228=Transfert: +1229=Effectu�: +1230=Transfert: +1231=Effectu�: +1232=Statistiques globales +1233=Statistiques locales +1234= +1235= +1236= +1237= +1238=Temps: +1239=Fichier associ�: + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Gestionnaire de copie - espace libre insuffisant +2=&Annuler +1097=C&ontinuer +1100=&R�essayer +1127= +1128= +1221=Espace requis: +1222=Espace n�cessaire: +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy handler +2=&Annuler +1037= +1146=Progress1 +1220=Toutes les op�rations de copie/d�pacement sont termin�es. Le syst�me tentera d'�tre arr�t� dans : + +# Dialog box - IDD_CUSTOM_COPY_DIALOG +[149] +0=Param�tres de copie/d�placement +1=&OK +2=&Annuler +1002=&Fichier(s)... +1004=&Supprimer +1008=... +1010=List2 +1011=&Dossier... +1014=Filtrage +1015=Ne pas cr�er les r�pertoires de destination - copier les fichiers brutalement +1017=Ne pas copier/d�placer le contenu des fichiers - juste le cr�er (vide) +1020=Cr�er l'arborescence dans le dossier destination (relativement � la racine) +1023=Options avanc�es +1024=&Modifier... +1025=+ +1026=- +1065=List1 +1178=Spin1 +1179= +1191=&Importer... +1219=Fichiers/dossiers sources : +1220=R�pertoire de destination : +1221=Op�ration : +1222=Priorit� : +1223=Nombre de copies : +1224=M�moires tampons : +1225=Options standards +1249= +1250= +1251= +1252= +1253= +1257=A&ide + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=Filtrage +1=&OK +2=&Annuler +1150=Masque d'inclusion (s�par� par des pipes, par exemple *.jpg|*.gif) +1151=Masque d'exclusion +1155=Spin1 +1159=Spin1 +1160=et +1161=Filtrage par date +1162=Filtrage par attributs +1163=Archive +1164=Lecture seule +1165=Cach� +1166=Syst�me +1169=DateTimePicker1 +1170=DateTimePicker2 +1171=et +1173=DateTimePicker1 +1174=DateTimePicker2 +1175=R�pertoire +1177=Masque d'exclusion +1219= +1257=A&ide + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=Modification des raccourcis +1=&OK +2=&Annuler +1043=&Supprimer +1060=&Ajouter +1064=... +1180=List1 +1182= +1185=&Mettre � jour +1192=Vers le haut +1193=Vers le bas +1219=Raccourcis : +1220=Nom : +1221=R�pertoire : +1222=Shortcut properties : +1257=A&ide + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=R�pertoires r�cents +1=&OK +2=&Annuler +1043=&Supprimer +1060=&Ajouter +1064=... +1185=&Mettre � jour +1190=List1 +1219=R�pertoires utilis�s r�cements : +1220=Path +1257=A&ide + +# Dialog box - IDD_ABOUTBOX +[100] +0=A Propos... +1=&OK +1199=Copyright (C) 2001-2005 J�zef Starosczyk +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=Forum de discussion g�n�ral: +1205=Forum des d�veloppeurs: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=Page|http://groups.yahoo.com/group/copyhandler +1209=Inscription|mailto:copyhandler-subscribe@yahoogroups.com +1210=D�sinscription|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=Ecrire|mailto:copyhandler@yahoogroups.com +1212=Page|http://groups.yahoo.com/group/chdev +1213=Inscription|mailto:chdev-subscribe@yahoogroups.com +1214=D�sinscription|mailto:chdev-unsubscribe@yahoogroups.com +1215=Ecrire|mailto:chdev@yahoogroups.com +1216=Remerciements sp�ciaux: +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=Site Internet: +1266=Contact: +1267=Ce programme est libre et doit �tre distribu� en accord avec les thermes de la GNU General Public License. +1268=Author: +1269=Support: + +# String table +[0] +211=[Program]\r\nEl Magico\t\t\t\t\tgreat ideas, beta-tests, ...\r\n\r\n[Home page]\r\nTomas S. Refsland\t\t\tpage hosting, other help\r\nBarnaba\t\t\t\t\twebmaster\r\n\r\n[Language packs]\r\n%s\r\n\r\n[Additional software]\r\nMarkus Oberhumer & Laszlo Molnar\t\tUPX software\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[Other]\r\nThanks for anybody that helped in any way... +5000=Copy Handler +5001=Temps r�el +5002=Haute +5003=Sup�rieure � la normale +5004=Normale +5005=Inf�rieure � la normale +5006=Basse +5007=Libre +5008=Copie de %s +5009=Copie (%d) de %s +5010=Fichier non truov� (n'existe pas) +5011=o +5012=Ko +5013=Mo +5014=Go +5015=To +5016=Po +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=Impossible de lancer une seconde instance de ce programme +6001=La biblioth�que CopyHandlerShellExt.dll a correctement �t� attach�e +6002=Erreur rencontr�e lors de l'attachement de la biblioth�que CopyHandlerShellExt.dll\nErreur #%lu (%s). +6003=La biblioth�que CopyHandlerShellExt.dll a �t� correctement d�tach�e +6004=Erreur rencontr�e lors du d�tachement de la biblioth�que CopyHandlerShellExt.dll\nErreur #%lu (%s). +6005=Impossible d'ouvrir le fichier d'aide html :\n%s\n +7000=Recherche des fichiers... +7001=Fichier/dossier source non trouv� (Presse-Papier) : %s +7002=Ajout d'un fichier/dossier (Presse-Papier) : %s ... +7003=Dossier %s ajout� +7004=Parcours du dossier %s +7005=Demande d'arr�t pendant l'ajout de donn�es dans le tableau (RecurseDirectories) +7006=Fichier %s ajout� +7007=Recherche des fichiers termin�e +7008=Suppression des fichiers (DeleteFiles)... +7009=Demande d'arr�t pendant la suppression des fichiers (Delete Files) +7010=Erreur #%lu (%s) pendant la suppression du fichier/dossier %s +7011=Suppression des fichiers termin�e +7012=Demande d'annulation pendant la v�rification du r�sultat de la fen�tre avant d'ouvrir le fichier source %s (CustomCopyFile) +7013=Erreur #%lu (%s) lors de l'ouverture du fichier source %s (CustomCopyFile) +7014=Demande d'annulation [erreur #%lu (%s)] lors de l'ouverture du fichier source %s (CustomCopyFile) +7015=Demande d'attente [erreur #%lu (%s)] lors de l'ouverture du fichier source %s (CustomCopyFile) +7016=R�essaye [erreur #%lu (%s)] d'ouvrir le fichier source %s (CustomCopyFile) +7017=Erreur #%lu (%s) lors de l'ouverture du fichier destination %s (CustomCopyFile) +7018=R�essaye [erreu #%lu (%s)] d'ouvrir le fichier destination %s (CustomCopyFile) +7019=Demande d'annulation [erreur #%lu (%s)] lors de l'ouverture du fichier destination %s (CustomCopyFile) +7020=Demande d'attente [erreur #%lu (%s)] lors de l'ouverture du fichier destination %s (CustomCopyFile) +7021=Erreur #%lu (%s) lors du d�placement des pointeurs des fichiers de %s et de %s vers %I64u +7022=Erreur #%lu (%s) lors de la restauration (d�placement au d�but) des pointeurs de fichiers de %s et de %s +7023=Erreur #%lu (%s) lors de lamise � z�ro de la taille de %s +7024=Demande d'arr�t lors de la copie du fichier principal %s -> %s +7025=Modification de la taille de la m�moiretampon de [Def:%lu, Un:%lu, Deux:%lu, CD:%lu, LAN:%lu] en [Def:%lu, Un:%lu, Deux:%lu, CD:%lu, LAN:%lu] lors de la copie de %s -> %s (CustomCopyFile)\\ +7026=Erreur #%lu (%s) lors de la lecture de %d octets du fichier source %s (CustomCopyFile) +7027=Erreur #%lu (%s) lors de l'�criture de %d octets du fichier destination %s (CustomCopyFile) +7028=Exception intercept�e dans CustomCopyFile [derni�re erreur : #%lu (%s)] (� l'heure %lu) +7029=Traitement des fichiers/dossiers (ProcessFiles) +7030=Traitement des fichiers/dossiers (ProcessFiles):\n\tCr�erSeulement : %d\n\tTailleTampon: [Def:%lu, Un:%lu, Deux:%lu, CD:%lu, LAN:%lu]\n\tNomber de fichiers/dossiers : %lu\n\tNombre de copies : %d\n\tIgnorer les dossiers : %d\n\tR�pertoire de destination : %s\n\tPasse courante (bas�e sur 0) : %d\n\tIndex courant (bas� sur 0) : %d +7031=Demande d'arr�t pendant le traitement du fichier dans ProcessFiles +7032=Erreur #%lu (%s) pendant l'appel de MoveFile %s -> %s (ProcessFiles) +7033=Erreur #%lu (%s) pendant l'appel de CreateDirectory %s (ProcessFiles) +7034=Traitement termin� dans ProcessFiles +7035=\r\n# THREAD DE COPIE DEMARRE #\r\n(%lu) D�but du traitement des donn�es (dd:mm:yyyy) %02d.%02d.%4d � %02d:%02d.%02d +7036=Attente pour d�finir les permissions termin�e +7037=Demande d'arr�t lors de l'attente de d�finition des permissions (�tat d'attente) +7038=Traitement des donn�es termin� (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d +7039=Exception intercept�e dans ThrdProc [type : %d, derni�re erreur : %lu (%s), type: %d] +7040=V�rification de l'espace libre sur le lecteur destination... +7041=Espace libre insuffisant sur le lecteur - %I64d octets n�cessaire pour les donn�es : %I64d octets disponibles. +7042=Demande d'annulation lors de la v�rification de l'espace libre. +7043=R�essaye de lire l'espace libre sur le lecteur... +7044=Avertissement ignor� � propos de l'espace disponible sur le lecteur pour copie les donn�es. +7047=Demande d'annulation lors de l'appel de MoveFileEx %s -> %s (ProcessFiles) +8000=Programme +8001=Surveillance du Presse-Papier +8002=Scanner le presse-papier tous les ... [ms] +8003=Lancer le programme avec le syst�me +8004=Arr�ter le syst�me une fois que la copie est termin�e +8005=Enregistrement auto tous les ... [ms] +8006=R�pertoire temporaire +8007=Fen�tre d'�tat +8008=Rafraichir l'�tat tous les ... [ms] +8009=Afficher les d�tails dans la fen�tre d'�tat +8010=Enlever automatiquement les t�ches termin�es +8011=Aper�u +8012=Afficher les noms de fichiers +8013=N'afficher qu'une t�che +8014=Rafraichir l'�tat tous les ... [ms] +8015=Afficher au d�marrage du programme +8016=Cacher si vide +8017=Thread copie/d�placement +8018="Copier le reste" des fichiers par d�faut +8019=D�finir les attributs des fichiers destination +8020=D�finir l'heure et la date des fichiers destination +8021=Prot�ger les fichiers en lecture seule +8022=Limiter le nombre d'op�rations simultan�es... +8023=Afficher les messages de confirmation +8024=Utiliser des messages de confirmation temporis�s +8025=Temps d'affichage des messages de confirmation +8026=Reprendre automatiquement en cas d'erreur +8027=Reprendre automatiquement apr�s tous les ... [ms] +8028=Priorit� par d�faut +8029=N'utiliser que le tampon par d�faut +8030=Taille par d�faut du tampon +8031=Ne pas effacer les fichiers avant la fin de la copie (d�placement) +8032=Cr�er des fichiers .log +8033=Sons +8034=Jouer des sons +8035=Son en cas d'erreur +8036=Son � la fin de la copie +8037=Langue +8038=Lecture de la taille des t�ches avant de bloquer +8039=D�sactivation du tampon pour les gros fichiers +8040=Taille de fichier minimum pour lequel le tampon doit �tre d�sactiv� +8041=Tampon +8042=Taille du tampon lors de la copie sur un m�me disque +8043=Taille du tampon lors de la copie entre deux disques diff�rents +8044=Taille du tampon lors de la copie sur un CD-ROM +8045=Taille du tampon lors de la copie sur un r�seau +8046=Attendre ... [ms] avant l'arr�t +8047=Type d'arr�t +8048=Utiliser les barre de progression adoucies +8049=Fen�tre de choix de dossier +8050=Afficher la vue �tendue +8051=Largeur de la fen�tre [pixels] +8052=Hauteur de la fen�tre [pixels] +8053=Style de liste de raccourcis +8054=Ignorer les fen�tres syst�mes suppl�mentaires +8055=Afficher 'Copier' dans le menu glisser/d�poser +8056=Afficher 'D�placer' dans le menu glisser/d�poser +8057=Afficher 'Copier/d�placer sp�cial' dans le menu glisser/d�poser +8058=Afficher 'Coller' dans le menu contextuel +8059=Afficher 'Coller sp�cial' dans le menu contextuel +8060=Afficher 'Copier vers' dans le menu contextuel +8061=Afficher 'D�placer vers' dans le menu contextuel +8062=Afficher 'Copier/d�placer sp�cial vers' dans le menu contextuel +8063=Afficher l'espace libre avec les noms des raccourcis +8064=Afficher des ic�nes avec les raccourcis (exp�rimental) +8065=Intercepter les glisser/d�poser via le menu contextuel (exp�rimental) +8066=Raccourcis +8067=Dossiers r�cements utilis�s +8068=Syst�me +8069=Compteur de raccourcis d�fini +8070=Compteur de dossiers r�cents +8071=Action par d�faut en d�posant avec le bouton gauche de la souris +8072=Priorit� de l'application +8073=D�sactiver l'amplification de priorit� +8074=Non!Oui +8075=!Choisir un dossier temporaire +8076=D�sactiver!Normal!Dur +8077=!Fichiers son (.wav)|*.wav|| +8079=Normal!Forcer +8080=Grandes ic�nes!Petites ic�nes!Liste!Rapport +8081=Basse!Normale!Haute!Temps r�el +8082=Copier!D�placer!Op�ration sp�ciale!D�tecter +8083=Dossier des plugins +8084=!Choisir le dossier des plugins +8085=Fichier journal principal +8086=Activer la journalisation +8087=Limiter la taille du journal +8088=Taille maximum du journal +8089=Utiliser une limitation pr�cise du journal +8090=Tronquer la taille de la m�moire tampon +8091=R�pertoire contenant les fichiers d'aide +8092=!S�lectionnez le dossier contenant les fichiers d'aide +8093=R�pertoire avec les fichiers de langue +8094=!Choose folder with language files +9000=(CH) Copier ici +9001=(CH) D�placer ici +9002=(CH) Copier/d�placer sp�cial... +9003=(CH) Coller +9004=(CH) Coller sp�cial... +9005=(CH) Copier vers +9006=(CH) D�placer vers +9007=(CH) Copier/d�placer sp�cial vers... +9008=Copie les donn�es ici avec Copy Handler +9009=D�place les donn�es ici avec Copy Handler +9010=Copie/d�place les donn�es avec des param�tres suppl�mentaires +9011=Colle les fichiers/dossiers depuis le presse-papier ici +9012=Colle les fichiers/dossiers depuis le presse-papier ici avec des param�tres suppl�mentaires +9013=Copie les don�nes s�lectionn�es dans le dossier sp�cifi� +9014=D�place les don�nes s�lectionn�es dans le dossier sp�cifi� +9015=Copie/d�place les donn�es sl�ectionn�es dans le dossier sp�cifi� avec des param�tres suppl�mentaires +13000=Choisir le dossier +13001=Nom distant : +13002=Nom local : +13003=Type : +13004=Type de r�seau : +13005=Description : +13006=Espace disponible : +13007=Capacit� : +13008=&OK +13009=&Annuler +13010=Impossible de cr�er ke dossier +13011=Le dossier sp�cifi� n'existe pas +13012=Nom +13013=Dossier +13014=Dossier : +13015=>> +13016=<< +13017=Vous n'avez pas sp�cifi� de r�pertoire pour ce raccourci +13018=Cr�er un nouveau dossier +13019=Grandes ic�nes +13020=Petites ic�nes +13021=Liste +13022=Rapport +13023=D�tails +13024=Ajouter � la liste des raccourcis +13025=Enlever de la liste des raccourcis +13026=Domaine/Groupe de travail +13027=Serveur +13028=Partage +13029=Fichier +13030=Groupe +13031=R�seau +13032=Racine +13033=Partage administratif +13034=R�pertoire +13035=Arborescence +13036=Container NDS +13500=Copie en cours... +13501=D�placement en cours... +13502=Type d'op�ration inconnu - ceci ne devrait jamais arriver +13503=Entrez le dossier de destination pour :\n +14001=Compilation: %s +14002=Code= +14003=Version= +14500=Impossible d'op�rer avec un m�moire tampon de taille 0 +15000=Tous les fichiers (*)|*|| +15001=Choisir le r�pertoire de destination +15002=Vous n'avez pas mentionn� le r�pertoire de destination ou le fichier source.\nLe programme ne peut pas continuer +15003=Copier +15004=D�placer +15005=Par d�faut : %s +15006=Un disque : %s +15007=Deux disques : %s +15008=CD : %s +15009=LAN : %s +15010=Masque d'inclusion +15011=Taille +15012=Date +15013=Attributs inclus +15014= et +15015=aucun +15016=n'importe +15017=n'importe +15018=Masque d'exclusion +15019=Attributs exclus +15020=aucun +15021=Aucune des options de filtrage n'a �t� s�lectionn�e +15022=Tous les fichiers (*.*)|*.*|| +15023=%lu dossier(s) import�(s) +16500=Il n'y a pas assez d'espace libre sur %s pour copier ou d�placer : +18000=Cr�ation +18001=Derni�re modification +18002=Dernier acc�s +18500=Tout : +20000=Vous n'avez pas entr� de texte source +20500=Nom du raccourci +20501=Dossier +21000=Impossible d'arr�ter le syst�me d'exploitation.\nErreur rencontr�e #%lu. +21500=Etat +21501=Fichier +21502=Vers : +21503=Progression +21504=Aucun t�che s�lectionn�e +21505=vide +21506=vide +21507=inconnu +21508=inconnu +21509=vide +21510=vide +21511=inconnu +21512=00:00 / 00:00 +21513=passe : +21514=moy : +21515=Etat +21516=Modifi� :\n%d dossiers r�cup�r�s dans le Presse-Papier +21517=La t�che s�lectionn�e n'est pas en pause +21518=T�che non s�lectionn�e +21519=(attente...) +21520= copie +21521= copie +21522=Recherche en cours +21523=Copie en cours +21524=D�placement en cours +21525=Termin� +21526=Erreur +21527=Pause +21528=Suppression en cours +21529=Inconnu +21530=Annul� +21531=Attente +21532=Fichiers seulement +21533=Sans contenu +21534=Erreur #%lu appel de ShellExecute pour le fichier %s +21535=Par d�faut : +21536=Un disque : +21537=Deux disques : +21538=CD : +21539=LAN : +21540=Erreur #%errnum (%errdesc) lors de la suppression du fichier %s +21541=Erreur #%errnum (%errdesc) lors de l'ouverture du fichier source %s +21542=Erreur #%errnum (%errdesc) lors de l'ouverture du fichier destination %s. Le fichier poss�de probablement l'attribut lecture seule, et l'option 'Prot�ger les fichiers en lecture seule' dans la configuration est d�finie (le fichier ne peut donc pas �tre ouvert en �criture). +21543=Erreur #%errnum (%errdesc) lors de la restauration (d�placement au d�but) des pointeurs des fichiers %s et %s +21544=Erreur #%errnum (%errdesc) lors de la mise � z�ro du fichier %s +21545=Erreur #%errnum (%errdesc) lors de la lecture de %d octets depuis le fichier source %s +21546=Erreur #%errnum (%errdesc) lors de l'�criture de %d octets dans le fichier destination %s +21547=Erreur #%errnum (%errdesc) lors de l'appel de MoveFile %s -> %s +21548=Erreur #%errnum (%errdesc) lors de l'appel de CreateDirectory %s +21549=non associ� +21550= [avec filtre] +21551=La t�che s�lectionn�e n'est pas encore termin�e.\nVoulez-vous l'arr�ter maintenant ? Index: other/Langs/German.lng =================================================================== diff -u --- other/Langs/German.lng (revision 0) +++ other/Langs/German.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,669 @@ +# Info section +[Info] +Lang Name=German/Switzerland +Lang Code=1031 +Base Language= +Font Face=Tahoma +Charset=1 +Size=8 +RTL reading order=0 +Help name=english.chm +Author=Marco Hochstrasser / Switzerland +Version=1.26 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=&Verzeichniss wechseln... + +# Menu - IDR_POPUP_MENU +[130] +32773=Status anzeigen... +32802=&Optionen... +32803=Minimierter Status anzeigen... +32804=Kopierparameter eintragen... +32806=Clipboard �berwachen +32807=Nach Beendung herunterfahren +32809=&Registriere Shell im Explorer +32810=&L�sche Shell im Explorer +32814=&Hilfe... +57664=�ber... +57665=Schliessen + +# Menu - IDR_PRIORITY_MENU +[135] +32774=Echtzeit +32775=Hoch +32776=H�her als Normal +32777=Normal +32778=Niedriger als Normal +32779=Niedrig +32780=Idle + +# Dialog box - IDD_BUFFERGr�sse_DIALOG +[137] +0=Puffergr�sse Einstellungen +1=&OK +2=&Abbrechen +1145=Nur den Stundard Puffer verwenden +1219=Stundard +1220=F�r die Kopie innert einer Festplatte +1221=F�r die Kopie mit mehreren Festplatten +1222=F�r die Kopie mit CD-Rom +1223=F�r die Kopie mit Netzwerk +1257=&Hilfe + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Copy Hundler - Fehler beim �ffnen der Datum +2=&Abbrechen +1097=&Ignorieren +1098=Alle I&gnorieren +1099=&Warten +1100=&Wiederholen +1220=Datum kann f�r das Schreiben nicht ge�ffnet werden: +1221=Fehler Beschreibung: + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Copy Hundler - Fehler beim �ffnen der Datum +2=&Abbrechen +1097=&Ignorieren +1098=Alle I&gnorieren +1099=&Warten +1100=&Wiederholen +1219=Kann QuellenDatum nicht f�r das Lesen �ffnen: +1220=Name: +1221=Gr�sse: +1222=Erstellt: +1223=Letzte �nderung: +1224=Erwartete Quelle: +1226=Name: +1227=Gr�sse: +1228=Erstellt: +1229=Letzte �nderung: +1230=Gefundene Quelle: +1231=Was m�chten sie tun ? + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Copy Hundler - kleinere ZielDatum gefunden +2=&Abbrechen +1097=&Ignorieren +1098=Alle I&gnorieren +1103=Restliche kopieren +1104=Erneut kopieren +1106=Alle restilchen kopieren +1107=Alle erneut kopieren +1220=ZielDatum existiert bereits und ist kleiner als die Quell-Datum.\nM�gliche Gr�nde:\n- Die Kopierte/Verschobene Datum wurde abgebrochen (erneut kopieren)\n- Die QuellDatum ist eine Version der Datum als die ZielDatum (erneut kopieren) +1221=Name: +1222=Gr�sse: +1223=Erstellt: +1224=Letzte �nderung: +1225=QuellDatum: +1226=Name: +1227=Gr�sse: +1228=Erstellt: +1229=Letzte �nderung: +1230=ZielDatum: +1231=Was m�chten sie tun ? + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Copy Hundler - ZielDatum gefunden +2=&Abbrechen +1097=&Ignorieren +1098=Alle I&gnorieren +1104=Erneut kopieren +1107=Alle neu kopieren +1220=ZielDatum existiert bereits und ist kleiner als die Quell-Datum.\nM�gliche Gr�nde:\n- Die Kopierte/Verschobene Datum wurde abgebrochen (erneut kopieren)\n- Die QuellDatum ist eine Version der Datum als die ZielDatum (erneut kopieren) +1221=Name: +1222=Gr�sse: +1223=Erstellt: +1224=Letzte �nderung: +1225=QuellDatum: +1226=Name: +1227=Gr�sse: +1228=Erstellt: +1229=Letzte �nderung: +1230=ZielDatum: +1231=Was m�chten sie tun ? + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=Status + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=Optionen +1=&OK +2=&Abbrechen +1218=&Akzeptieren +1257=&Hilfe + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=Teilweise ersetzten von QuellDatum-Pfad +1=OK +2=&Abbrechen +1064=... +1219=QuellDatum-Pfad: +1220=�ndern in: +1257=&Hilfe + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=Status +1003=Liste1 +1005=Fortschritt1 +1007=Fortschritt2 +1013=... +1016=> +1018=&Pause +1021=&Weiter +1022=&Abbrechen +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=Weiter/alle +1042=&Neustarten +1043=&L�schen +1044=Pausieren/alle +1045=Neustarten/alle +1046=Abbrechen/alle +1047=L�schen/alle +1077=&Erweitert > +1120=Report anschauen +1122= +1219=Betriebsliste: +1220=Fortschritt: +1221=Fortschritt: +1222=Ziel Datum: +1223=Quell Datum: +1224=Puffergr�sse: +1225=Priorit�t: +1226=Kommentar: +1227=Operation: +1228=Transfer: +1229=Verarbeitet: +1230=Transfer: +1231=Verarbeitet: +1232=Globale Statistik +1233=Gegenw�rtig ausgew�hlte Statistik +1234= +1235= +1236= +1237= +1238=Zeit: +1239=Dazugeh�rige Datum: + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Copy Hundler - nicht gen�gen Speicherplatz +2=&Abrechen +1097=Weiterfahren +1100=&Wiederholen +1127= +1128= +1221=Ben�tigter Speicherplatz: +1222=Freier Speicherplatz: +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy Hundler +2=&Abbrechen +1037= +1146=Fortschritt1 +1220=Alle Kopierungen/Verschiebungen sind abgeschlossen. Das System wird automatisch heruntergefahren in: + +# Dialog box - IDD_CUSTOM_Kopieren_DIALOG +[149] +0=Kopier/Verschiebe Parameter +1=&OK +2=&Abbrechen +1002=Datum(en) hinzu&f�gen... +1004=&L�schen +1008=... +1010=Liste2 +1011=&Ordner hinzuf�gen... +1014=Filtern +1015=Do not create destination directories - Kopieren files loosely to destination folder +1017=Do not Kopieren/Verschieben contents of files - only create it (leer) +1020=Create directory structure in destination folder (relatively to root directory) +1023=Erweiterte Optionen +1024=�nd&ern... +1025=+ +1026=- +1065=Liste1 +1178=Drehungen1 +1179= +1191=&Importieren... +1219=QuellDatum/ordner: +1220=Zielordner: +1221=Betriebstyp: +1222=Priorit�t: +1223=Anzahl Kopien: +1224=Puffergr�sse: +1225=Stundard Optionen +1249= +1250= +1251= +1252= +1253= +1257=&Hilfe + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=Filter Einstellungen +1=&OK +2=&Abbrechen +1150=Integrierte Maske (getrennt durch vertikale Linien ie. *.jpg|*.gif) +1151=Filterung nach gr�sse +1155=Drehung1 +1159=Drehung1 +1160=und +1161=Filterung nach Datum +1162=Nach Eigenschaften +1163=Archiv +1164=Schreibgesch�tzt +1165=Versteckt +1166=System +1169=DatumZeitPicker1 +1170=DatumZeitPicker2 +1171=und +1173=DatumZeitPicker1 +1174=DatumZeitPicker2 +1175=Ordner +1177=Nicht integrierte Masken +1219= +1257=&Hilfe + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=Shortcuts editieren +1=&OK +2=&Abbrechen +1043=&L�schen +1060=&Hinzuf�gen +1064=... +1180=Liste +1182= +1185=&UpDatumn +1192=Nach oben verschieben +1193=Nach unten verschieben +1219=Shortcuts: +1220=Name: +1221=Pfad: +1222=Shortcut properties +1257=&Hilfe + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=Recent paths +1=&OK +2=&Abbrechen +1043=&L�schen +1060=&Hinzuf�gen +1064=... +1185=&UpDatumn +1190=Liste1 +1219=Bereit benutzte Pfade: +1220=Path +1257=&Hilfe + +# Dialog box - IDD_ABOUTBOX +[100] +0=�ber ... +1=&OK +1199=Kopierenright (C) 2001-2005 J�zef Starosczyk +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=Allgemeines Diskussionsforum: +1205=Entwicklungs Diskussionsforum: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=Webseite|http://groups.yahoo.com/group/copyhandler +1209=Anmelden|mailto:copyhandler-subscribe@yahoogroups.com +1210=Abmelden|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=Nachricht zusenden|mailto:copyhandler@yahoogroups.com +1212=Webseite|http://groups.yahoo.com/group/chdev +1213=Anmelden|mailto:chdev-subscribe@yahoogroups.com +1214=Abmelden|mailto:chdev-unsubscribe@yahoogroups.com +1215=Nachricht zusenden|mailto:chdev@yahoogroups.com +1216=Spezielen Danke an: +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=Webseite: +1266=Kontakt: +1267=Dieses Programm ist Freeware und untersteht den Vereinbarungen der GNU General Public License. +1268=Author: +1269=Support: + +# String table +[0] +211=[Program]\r\nEl Magico\t\t\t\t\tgreat ideas, beta-tests, ...\r\n\r\n[Home page]\r\nTomas S. Refsland\t\t\tpage hosting, other help\r\nBarnaba\t\t\t\t\twebmaster\r\n\r\n[Language packs]\r\n%s\r\n\r\n[Additional software]\r\nMarkus Oberhumer & Laszlo Molnar\t\tUPX software\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[Other]\r\nThanks for anybody that helped in any way... +5000=Copy Hundler +5001=Echtzeit +5002=Hoch +5003=H�her als Normal +5004=Normal +5005=Niedriger als Normal +5006=Niedrig +5007=Idle +5008=Kopieren von %s +5009=Kopieren (%d) von %s +5010=Datum nicht gefunden (existiert nicht) +5011=B +5012=kB +5013=MB +5014=GB +5015=TB +5016=PB +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=Es ist nicht m�glich das Programm zwei mal nebeneinunder laufen zu lassen. +6001=Bibliothek chext.dll wurde erfolgreich registriert. +6002=Fehler, beim Versuch die Bibliothek zu registrieren chext.dll\nFehler #%lu (%s). +6003=Bibliothek chext.dll wurde erfolgreich aus der Registrierung gel�scht. +6004=Fehler, beim Versuch die Bibliothek zu l�schen chext.dll\nFehler #%lu (%s). +6005=Kann die HTML-Hilfe nicht �ffnen:\n%s\n +7000=Nach Datumen suchen... +7001=Quell Datum/Ordner nicht gefunden (clipboard) : %s +7002=Datum/Ordner hinzuf�gen (clipboard) : %s ... +7003=Hinzugef�gte Ordner %s +7004=Wiederkehrender Ordner %s +7005=L�sche Auftrag, w�hrend die Datumn hinzugef�gt wurden.(RecurseDirectories) +7006=Hinzugef�gte Datumen %s +7007=Suche nach Datumen beendet +7008=L�sche Datumen (DeleteFiles)... +7009=L�sche Auftrag, w�hrend der L�schung der Datumen (Delete Files) +7010=Fehler #%lu (%s) w�hrend dem l�schen der Datumen/Ordner %s +7011=Datumen gel�scht. +7012=Cancel request while checking result of dialog before opening source file %s (CustomKopierenFile) +7013=Fehler #%lu (%s) while opening source file %s (CustomKopierenFile) +7014=Cancel request [Fehler #%lu (%s)] while opening source file %s (CustomKopierenFile) +7015=Wait request [Fehler #%lu (%s)] while opening source file %s (CustomKopierenFile) +7016=Retrying [Fehler #%lu (%s)] to open source file %s (CustomKopierenFile) +7017=Fehler #%lu (%s) while opening destination file %s (CustomKopierenFile) +7018=Retrying [Fehler #%lu (%s)] to open destination file %s (CustomKopierenFile) +7019=Cancel request [Fehler #%lu (%s)] while opening destination file %s (CustomKopierenFile) +7020=Wait request [Fehler #%lu (%s)] while opening destination file %s (CustomKopierenFile) +7021=Fehler #%lu (%s) while moving file pointers of %s und %s to %I64u +7022=Fehler #%lu (%s) while restoring (moving to beginning) file pointers of %s und %s +7023=Fehler #%lu (%s) while setting Gr�sse of file %s to 0 +7024=Kill request while main Kopierening file %s -> %s +7025=Changing buffer Gr�sse from [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] to [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] wile Kopierening %s -> %s (CustomKopierenFile) +7026=Fehler #%lu (%s) while trying to read %d bytes from source file %s (CustomKopierenFile) +7027=Fehler #%lu (%s) while trying to write %d bytes to destination file %s (CustomKopierenFile) +7028=Caught exception in CustomKopierenFile [last Fehler: #%lu (%s)] (at time %lu) +7029=Processing files/folders (ProcessFiles) +7030=Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %d\r\n\tBufferGr�sse: [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu]\r\n\tFiles/folders count: %lu\r\n\tCopies count: %d\r\n\tIgnore Folders: %d\r\n\tDest path: %s\r\n\tCurrent pass (0-based): %d\r\n\tCurrent index (0-based): %d +7031=Kill request while processing file in ProcessFiles +7032=Fehler #%lu (%s) while calling VerschiebenFile %s -> %s (ProcessFiles) +7033=Fehler #%lu (%s) while calling CreateDirectory %s (ProcessFiles) +7034=Finished processing in ProcessFiles +7035=\r\n# KopierenING THREAD STARTED #\r\nBegan processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d +7036=Finished waiting for begin permission +7037=Kill request while waiting for begin permission (wait state) +7038=Finished processing data (dd:mm:yyyy) %02d.%02d.%4d at %02d:%02d.%02d +7039=Caught exception in ThrdProc [last Fehler: %lu (%s), type: %d] +7040=Checking for free space on destination disk... +7041=Not enough free space on disk - needed %I64d bytes for data, available: %I64d bytes. +7042=Cancel request while checking for free space on disk. +7043=Retrying to read drive's free space... +7044=Ignored warning about not enough place on disk to Kopieren data. +7047=Cancel request while calling VerschiebenFileEx %s -> %s (ProcessFiles) +8000=Program +8001=Clipboard �berwachung +8002=�berpr�fung der Ablage alle ... [ms] +8003=Start beim Systemstart +8004=System nach beenden des kopieren herunterfahren +8005=Automatisches speichern alle ... [ms] +8006=Ordner f�r Tempor�re Dateien +8007=Status Fenster +8008=Aktualisierung des Status alle ... [ms] +8009=Zeige details im Statusfenster +8010=Automatisch beendete Aufgaben verschieben +8011=Kleinansicht +8012=Zeige Dateiname +8013=Zeige einzelne Aufgabe +8014=Aktualisierung des Status alle ... [ms] +8015=Zeige Programm beim aufstarten +8016=Verstecken wenn Ablage leer +8017=Kopieren/Verschieben Aufgabe +8018=Auto "Kopieren-rest" der Dateien +8019=Erstelle Einstellungen f�r die Zieldatei +8020=Erstelle Zeit/Datum f�r die Zieldatei +8021=Sch�tze Schreibgesch�tzte Dateien +8022=Limitiere maximale anzahl laufende Aufgaben ... +8023=Zeige alle Abfragen +8024=Benutze Zeit-Dialoge +8025=Zeit des zeigens der Dialoge +8026=Automatische wiederaufnahme bei Fehler +8027=Automatische wiederaufnahme alle ... [ms] +8028=Standard Aufgaben Priorit�t +8029=Benutze nur Standard-Puffer +8030=Standard Puffergr�sse +8031=L�sche keine Dateien bevor diese kopiert sind +8032=Erstelle .log Dateien +8033=Musik +8034=Spiele Musik +8035=Musik bei Fehler +8036=Musik bei erfolgreichem kopieren +8037=Sprache +8038=Lese Aufgabengr�sse vor start. +8039=Deaktiviere das Puffern bei gr�sseren Dateien +8040=Minimale Dateigr�sse bei welcher der Puffer abgeschaltet werden soll +8041=Puffer +8042=Puffergr�sse f�r das kopieren auf der gleichen Harddisk +8043=Puffergr�sse f�r das kopieren zwischen zwei Harddisks +8044=Puffergr�sse f�r das kopieren von CD +8045=Puffergr�sse f�r das kopieren �ber das Netzwerk +8046=Warte ... [ms] vor dem Herunterfahren +8047=Art des Herunterfahren +8048=Benutze glatte Fortschrittsbalken +8049=W�hle Ordenerdialog +8050=Erweiterte Ansicht +8051=Dialog breite [pixels] +8052=Dialog h�he [pixels] +8053=Shortcuts' Style-Liste +8054=Ignoriere weitere Dialoge +8055=Show 'Kopieren' commund in drag&drop menu +8056=Show 'Verschieben' commund in drag&drop menu +8057=Show 'Kopieren/Verschieben special' commund in drag&drop menu +8058=Show 'Paste' commund in context menu +8059=Show 'Paste special' commund in context menu +8060=Show 'Kopieren to' commund in context menu +8061=Show 'Verschieben to' commund in context menu +8062=Show 'Kopieren/Verschieben special to' commund in context menu +8063=Zeige freien Speicherplatz bei den Shortguts +8064=Zeige Symbole mit Shortcuts (experimental) +8065=Abschnitt drag&drop aktion bei linksklick (experimental) +8066=Shortcuts +8067=Bereits benutzte Pfade +8068=Shell +8069=Definiere anzahl Symbole +8070=Anzahl der neuen Pfade +8071=Standartausf�hrung bei Rechtsklick +8072=Anwendungspriorit�t +8073=Priorit�ten Auswahl deaktivieren +8074=Nein!Ja +8075=!W�hlen sie dem Tempor�ren Ordner +8076=Abschalten!Normal!Hart +8077=!Sounddateien (.wav)|*.wav|| +8079=Normal!Stark +8080=Grosse Symbole!Kleine Symbole!Liste!Report +8081=Idle!Normal!Hoch!Echtzeit +8082=Kopieren!Verschieben!Spezielle Ausf�rungen!Automatisch +8083=Ordner mit den Plugins +8084=!Ordner mit den Plugins ausw�hlen +8085=Hautlog +8086=Loggen aktivieren +8087=Logfiles mit Gr�ssenlimit benutzen +8088=Maximale Gr�sse der Logfiles +8089=Verwenden Sie das exaktes Begrenzen der Logfiles +8090=Ver�ndern der Puffergr�sse +8091=Ordner mit den Hilfedateien +8092=!Bitte w�hlen sie den Ordner mit den Hilfedateien +8093=Ordner mit Sprachdateien +8094=!Bitte w�hlen sie den Ordner mit den Sprachdateien +9000=(CH) Hier kopieren +9001=(CH) Hier verschieben +9002=(CH) Auswahl verschieben/kopieren... +9003=(CH) Einf�gen +9004=(CH) Auswahl einf�gen... +9005=(CH) Kopieren nach +9006=(CH) Verschieben mach +9007=(CH) Kopieren/Verschieben der Auswahl nach... +9008=Dateien kopieren +9009=Dateien verschieben +9010=Kopieren/Verschieben der Daten mit zus�tlichen Einstellungen +9011=Dateien/Ordner vom Clipboard einf�gen +9012=Dateien vom Clipboard einf�gen +9013=Markierte Dateien in Zielordner kopieren +9014=Markierte Dateien in Zielordner verschieben +9015=Kopieren/Verschieben der ausgw�hlten Dateien in spezifizierte Ordner mit zus�tzlichen Einstellungen +13000=Pfad ausw�hlen +13001=Remote Name: +13002=Lokal Name: +13003=Typ: +13004=Netzwerk Typ: +13005=Beschreibung: +13006=Freier Speicherplatz: +13007=Kapazit�t: +13008=&OK +13009=&Abbrechen +13010=Kann keinen Ordner erstellen +13011=Eingegebener Pfad existiert nicht +13012=Name +13013=Pfad +13014=Pfad: +13015=>> +13016=<< +13017=Sie haben den Pfad f�r dieses Symbol nicht angegeben +13018=Neuen Ordner erstellen +13019=Grosse Symbole +13020=Kleine Symbole +13021=Liste +13022=Report +13023=Details +13024=Shurtcuts Liste hinzuf�gen +13025=l�schen der shortcuts Liste +13026=Dom�ne/Arbeitsgruppe +13027=Server +13028=Freigabe +13029=Datei +13030=Gruppe +13031=Netzwerk +13032=Wurzel +13033=Administrations-Freigabe +13034=Ordner +13035=Baum +13036=NDS Container +13500=Kopieren... +13501=Verschieben... +13502=unbekannt betriebs-typ - dies sollte nicht passieren +13503=Zielpfad angeben f�r:\n +14001=Kompliation: %s +14002=Code= +14003=Version= +14500=Funktionert nicht mit einem Puffer der Gr�sse 0 +15000=Alle Dateien (*)|*|| +15001=W�hlen sie ein Zielpfad +15002=Sie haben keinen Quell oder Ziel-Pfad angegeben.\nProgramm wurde abgebrochen. +15003=Kopieren +15004=Verschieben +15005=Standard: %s +15006=Eine Festplatte: %s +15007=Zwei Festplatten: %s +15008=CD: %s +15009=LAN: %s +15010=Integrierte Maske +15011=Gr�sse +15012=Datum +15013=Einstellungen integriert +15014= und +15015=keine +15016=irgendwelche +15017=irgendwelche +15018=Maske ausgeschlossen +15019=Einstellungen ausgeschlossen +15020=keine +15021=Keine Filteroptionen wurden ausgew�hlt +15022=Alle Datumen (*.*)|*.*|| +15023=Importierter %lu Pfad(e) +16500=Es befindet sich nicht gen�gend Freier Speicher in %s zu kopieren oder verschieben: +18000=Datum der Erstellung +18001=Datum der letzen Speicherung +18002=Datum des letzten Zugriffs +18500=Alle: +20000=Sie haben keinen Quellpfad eingegeben +20500=Shortcut's Name +20501=Pfad +21000=Kann das System nicht herunterfahren.\nEingetroffener Fehler #%lu. +21500=Status +21501=Datum +21502=Nach: +21503=Fortschritt +21504=Kein Task ausgew�hlt +21505=leer +21506=leer +21507=unbekannt +21508=unbekannt +21509=leer +21510=leer +21511=unbekannt +21512=00:00 / 00:00 +21513=Erledigt: +21514=Geschwindigkeit: +21515=Status +21516=Ge�ndert:\n%d Pfade Prim�r vom Clipboard +21517=Ausgew�hlter Task ist nicht pausiert! +21518=Auftrag nicht ausgew�hlt +21519=(warte...) +21520= Kopien +21521= Kopien +21522=Suche +21523=Kopiere +21524=Verschiebe +21525=Beendet +21526=Fehler +21527=Pausiert +21528=L�sche +21529=Unbekannt +21530=Abgebrochen +21531=Warte +21532=Nur Datumen +21533=Ohne Inhalt +21534=Fehler #%lu aufruf ShellExecute f�r die Datum %s +21535=Stundard: +21536=Eine Festplatte: +21537=Zwei Festplatten: +21538=CD: +21539=LAN: +21540=Fehler #%errnum (%errdesc) w�hrend dem l�schen der Datumen %s +21541=Fehler #%errnum (%errdesc) w�hrend dem Versuch die QuellDatum zu �ffnen %s +21542=Fehler #%errnum (%errdesc) w�hrend dem Versuch die ZielDatum zu �ffnen %s. M�glicherweise wurden Schreibschutzrechte gesetzt. +21543=Fehler #%errnum (%errdesc) w�hrend dem Wiederherstellen (verschieben zum Beginn) Datum Zeiger von %s und %s +21544=Fehler #%errnum (%errdesc) w�hrend dem Einstellen der Datumgr�sse %s auf 0 +21545=Fehler #%errnum (%errdesc) w�hrend dem Lesen von %d bytes von der QuellDatum %s +21546=Fehler #%errnum (%errdesc) w�hrend dem Versuch von %d Datumen nach %s zu kopieren +21547=Fehler #%errnum (%errdesc) w�hrend dem Aufruf der Verschobenen Datumen %s -> %s +21548=Fehler #%errnum (%errdesc) w�hrend dem Aufruf des Erstellten Verzeichnisses %s +21549=nicht dazugeh�rig +21550= [with filter] +21551=Ausgew�hlte Tast noch nicht fertig.\nM�chten sie es nun beenden ? + Index: other/Langs/Polish.lng =================================================================== diff -u --- other/Langs/Polish.lng (revision 0) +++ other/Langs/Polish.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,668 @@ +# Info section +[Info] +Lang Name=Polski +Lang Code=1045 +Base Language=Polish.lng +Font Face=Tahoma +Charset=238 +Size=8 +RTL reading order=0 +Help name=polish.chm +Author=J�zef Starosczyk & Damian Kr�l +Version=1.28 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=&Zamie� �cie�ki... + +# Menu - IDR_POPUP_MENU +[130] +32773=Poka� status... +32802=&Opcje... +32803=Poka� mini-status... +32804=Podaj parametry kopiowania... +32806=Monitoruj schowek +32807=Wy��cz komputer po zako�czeniu +32809=&W��cz integracj� z pow�ok� systemow� +32810=W&y��cz integracj� z pow�ok� systemow� +32814=&Pomoc... +57664=O programie... +57665=Wyj�cie + +# Menu - IDR_PRIORITY_MENU +[135] +32774=Krytyczny czasowo +32775=Najwy�szy +32776=Powy�ej normy +32777=Normalny +32778=Poni�ej normy +32779=Najni�szy +32780=W tle + +# Dialog box - IDD_BUFFERSIZE_DIALOG +[137] +0=Ustawienia wielko�ci bufora +1=&OK +2=&Anuluj +1145=U�yj tylko domy�lnego bufora +1219=Domy�lny +1220=Dla kopiowania w obr�bie jednego dysku +1221=Dla kopiowania pomi�dzy dwoma dyskami +1222=Dla kopiowania z u�yciem CD-ROMu +1223=Dla kopiowania z u�yciem sieci +1257=&Pomoc + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Copy handler - b��d otwierania pliku +2=&Anuluj +1097=P&omi� +1098=Po&mi� wszystkie +1099=&Czekaj +1100=&Pon�w pr�b� +1220=Nie mo�na otworzy� do zapisu pliku: +1221=Opis b��du: + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Copy handler - b��d otwierania pliku +2=&Anuluj +1097=P&omi� +1098=Po&mi� wszystkie +1099=&Czekaj +1100=&Pon�w pr�b� +1219=Nie mo�na otworzy� pliku do odczytu - pow�d: +1220=Nazwa: +1221=Rozmiar: +1222=Utworzony: +1223=Ostatnio zmodyfikowany: +1224=Oczekiwany plik �r�d�owy: +1226=Nazwa: +1227=Rozmiar: +1228=Utworzony: +1229=Ostatnio zmodyfikowany: +1230=Znaleziony plik �r�d�owy: +1231=Co chcesz w zwi�zku z tym zrobi� ? + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Copy handler - znaleziono mniejszy plik docelowy +2=&Anuluj +1097=P&omi� +1098=Po&mi� wszystkie +1103=&Dokopiuj +1104=&Kopiuj od nowa +1106=Dokop&iuj wszystkie +1107=Kopiu&j od nowa wszystkie +1220=Plik docelowy istnieje i jest mniejszy od pliku �r�d�owego.\nMo�liwe przyczyny:\n- nie doko�czono kopiowania/przenoszenia pliku �r�d�owego (dokopiuj)\n- kopiowany plik jest w innej wersji ni� plik docelowy (kopiuj od nowa) +1221=Nazwa: +1222=Rozmiar: +1223=Utworzony: +1224=Ostatnio zmodyfikowany: +1225=Plik �r�d�owy: +1226=Nazwa: +1227=Rozmiar: +1228=Utworzony: +1229=Ostatnio zmodyfikowany: +1230=Plik docelowy: +1231=Co chcesz w zwi�zku z tym zrobi� ? + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Copy handler - znaleziono plik docelowy +2=&Anuluj +1097=P&omi� +1098=Po&mi� wszystkie +1104=&Kopiuj od nowa +1107=Kopiu&j od nowa wszystkie +1220=Plik docelowy istnieje i ma r�wny lub wi�kszy rozmiar od pliku �r�d�owego.\nMo�liwe przyczyny:\n- kopiowany plik jest w innej wersji ni� znaleziony (kopiuj od nowa/pomi�)\n- plik �r�d�owy i docelowy s� identyczne (pomi�) +1221=Nazwa: +1222=Rozmiar: +1223=Utworzony: +1224=Ostatnio zmodyfikowany: +1225=Plik �r�d�owy: +1226=Nazwa: +1227=Rozmiar: +1228=Utworzony: +1229=Ostatnio zmodyfikowany: +1230=Plik docelowy: +1231=Co chcesz w zwi�zku z tym zrobi� ? + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=Status + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=Opcje +1=&OK +2=&Anuluj +1218=&Zastosuj +1257=&Pomoc + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=Zamiana cz�ci �cie�ek dost�pu +1=OK +2=&Anuluj +1064=... +1219=�cie�ka �r�d�owe: +1220=Zamie� na: +1257=&Pomoc + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=Status +1003=List1 +1005=Progress1 +1007=Progress2 +1013=... +1016=> +1018=&Pauza +1021=&Wzn�w +1022=&Anuluj +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=Wzn�w/wszystkie +1042=&Restart +1043=&Usu� +1044=Pauza/wszystkie +1045=Restart/wszystkie +1046=Anuluj/wszystkie +1047=Usu�/wszystkie +1077=&Zaawansowane > +1120=Poka� dziennik +1122= +1219=Lista operacji: +1220=Post�p: +1221=Post�p: +1222=Obiekt docelowy: +1223=Obiekt �r�d�owy: +1224=Wielko�� bufora: +1225=Priorytet w�tku: +1226=Dodatkowe uwagi: +1227=Operacja: +1228=Transfer: +1229=Przetworzono: +1230=Transfer: +1231=Przetworzono: +1232=Statystyki wszystkiego +1233=Statystyki aktualnego zaznaczenia +1234= +1235= +1236= +1237= +1238=Czas: +1239=Skojarzony plik: + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Copy handler - za ma�o miejsca +2=&Anuluj +1097=Ko&ntynuuj +1100=&Pon�w pr�b� +1127= +1128= +1221=Wymagane miejsce: +1222=Dost�pne miejsce: +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy handler +2=&Anuluj +1037= +1146=Progress1 +1220=Zako�czono wszystkie zaplanowane operacje kopiowania/przenoszenia. Pr�ba zamkni�cia systemu nast�pi za: + +# Dialog box - IDD_CUSTOM_COPY_DIALOG +[149] +0=Parametry kopiowania/przenoszenia +1=&OK +2=&Anuluj +1002=Dodaj &plik(i)... +1004=&Usu� +1008=... +1010=List2 +1011=Dodaj &folder... +1014=Filtrowanie +1015=Nie tw�rz katalog�w docelowych - kopiuj pliki +1017=Nie kopiuj/przeno� zawarto�ci plik�w - tylko je tw�rz (puste) +1020=Tw�rz struktur� katalog�w w folderze docelowym (wzgl�dem katalogu g��wnego dysku) +1023=Opcje zaawansowane +1024=&Zmie�... +1025=+ +1026=- +1065=List1 +1178=Spin1 +1179= +1191=&Importuj... +1219=Lista plik�w/folder�w �r�d�owych: +1220=Folder docelowy: +1221=Rodzaj operacji: +1222=Priorytet: +1223=Ilo�� kopii: +1224=Wielko�ci bufor�w: +1225=Opcje standardowe +1249= +1250= +1251= +1252= +1253= +1257=&Pomoc + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=Ustawienia filtrowania +1=&OK +2=&Anuluj +1150=Filtr w��czaj�cy (oddzielaj pionowymi kreskami, np. *.jpg|*.gif) +1151=Filtrowanie wg rozmiaru +1155=Spin1 +1159=Spin1 +1160=oraz +1161=Filtrowanie wg daty +1162=Wg atrybut�w +1163=Archiwalny +1164=Tylko do odczytu +1165=Ukryty +1166=Systemowy +1169=DateTimePicker1 +1170=DateTimePicker2 +1171=oraz +1173=DateTimePicker1 +1174=DateTimePicker2 +1175=Katalog +1177=Filtr wy��czaj�cy +1219= +1257=&Pomoc + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=Edycja skr�t�w +1=&OK +2=&Anuluj +1043=&Usu� +1060=&Dodaj +1064=... +1180=List1 +1182= +1185=&Aktualizuj +1192=W g�r� +1193=W d� +1219=Skr�ty: +1220=Nazwa: +1221=�cie�ka dost�pu: +1222=W�a�ciwo�ci skr�tu +1257=&Pomoc + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=Edycja ostatnio u�ywanych �cie�ek +1=&OK +2=&Anuluj +1043=&Usu� +1060=&Dodaj +1064=... +1185=&Aktualizuj +1190=List1 +1219=Ostatnio u�ywane �cie�ki: +1220=�cie�ka +1257=&Pomoc + +# Dialog box - IDD_ABOUTBOX +[100] +0=O programie ... +1=&OK +1199=Copyright (C) 2001-2005 J�zef Starosczyk +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=G��wne forum dyskusyjne: +1205=Forum programistyczne: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=Strona|http://groups.yahoo.com/group/copyhandler +1209=Zapisz si�|mailto:copyhandler-subscribe@yahoogroups.com +1210=Wypisz si�|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=Wy�lij wiadomo��|mailto:copyhandler@yahoogroups.com +1212=Strona|http://groups.yahoo.com/group/chdev +1213=Zapisz si�|mailto:chdev-subscribe@yahoogroups.com +1214=Wypisz si�|mailto:chdev-unsubscribe@yahoogroups.com +1215=Wy�lij wiadomo��|mailto:chdev@yahoogroups.com +1216=Specjalne podzi�kowania: +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=Strona domowa: +1266=Kontakt: +1267=Ten produkt jest oprogramowaniem darmowym i mo�e by� rozpowszechniany zgodnie z warunkami licencji GNU General Public License. +1268=Autor: +1269=Obs�uga: + +# String table +[0] +211=[Program]\r\nEl Magico\t\t\t\t\tciekawe pomys�y,\r\n\t\t\t\t\tbeta-testy, ...\r\n\r\n[Strona domowa]\r\nTomas S. Refsland\tsponsor strony domowej programu \r\nBarnaba\t\t\t\t\tadministrator strony\r\n\r\n[T�umaczenia]\r\n%s\r\n\r\n[Dodatkowe oprogramowanie]\r\nMarkus Oberhumer & Laszlo Molnar\t\toprogramowanie UPX\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[Inne]\r\nWielkie dzi�ki dla wszystkich, kt�rzy pomogli w tworzeniu tego programu... +5000=Copy handler +5001=Krytyczny czasowo +5002=Najwy�szy +5003=Powy�ej normy +5004=Normalny +5005=Poni�ej normy +5006=Najni�szy +5007=W tle +5008=Kopia %s +5009=Kopia (%d) %s +5010=Pliku nie znaleziono (nie istnieje) +5011=B +5012=kB +5013=MB +5014=GB +5015=TB +5016=PB +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=Na jednym komputerze mo�e by� uruchomiona co najwy�ej jedna kopia tego programu +6001=Biblioteka chext.dll zosta�a pomy�lnie zarejestrowana +6002=Wyst�pi� b��d podczas rejestrowania biblioteki chext.dll\nB��d #%lu (%s). +6003=Biblioteka chext.dll zosta�a pomy�lnie wyrejestrowana +6004=Wyst�pi� b��d podczas wyrejestrowywania biblioteki chext.dll\nB��d #%lu (%s). +6005=Nie mo�na otworzy� pliku pomocy:\n%s\n +7000=Wyszukiwanie plik�w... +7001=Nie znaleziono pliku/folderu wej�ciowego (schowek) : %s +7002=Dodawanie pliku/folderu (schowek) : %s ... +7003=Dodano folder %s +7004=Przeszukiwanie wg��b folderu %s +7005=��danie zabicia podczas dodawania danych do tablicy plik�w (RecurseDirectories) +7006=Dodano plik %s +7007=Zako�czono wyszukiwanie plik�w +7008=Rozpocz�cie kasowania plik�w (DeleteFiles) +7009=��danie zabicia podczas kasowania plik�w (DeleteFiles) +7010=B��d #%lu (%s) podczas usuwania pliku/folderu %s +7011=Zako�czono kasowanie plik�w +7012=��danie anulowania podczas sprawdzania wyniku dialogu przed otwarciem pliku �r�d�owego %s (CustomCopyFile) +7013=B��d #%lu (%s) podczas pr�by otwarcia pliku �r�d�owego %s (CustomCopyFile) +7014=��danie anulowania [b��d #%lu (%s)] podczas otwierania pliku �r�d�owego %s (CustomCopyFile) +7015=��danie oczekiwania [b��d #%lu (%s)] podczas otwierania pliku �r�d�owego %s (CustomCopyFile) +7016=Ponawianie pr�by [b��d #%lu (%s)] otwarcia pliku �r�d�owego %s (CustomCopyFile) +7017=B��d #%lu (%s) podczas otwierania pliku docelowego %s (CustomCopyFile) +7018=Ponawianie pr�by [b��d #%lu (%s)] otwarcia pliku docelowego %s (CustomCopyFile) +7019=��danie anulowania [b��d #%lu (%s)] podczas otwierania pliku docelowego %s (CustomCopyFile) +7020=��danie oczekiwania [b��d #%lu (%s)] podczas otwierania pliku docelowego %s (CustomCopyFile) +7021=B��d #%lu (%s) podczas przesuwania wska�nik�w plik�w %s i %s do %I64u +7022=B��d #%lu (%s) podczas odtwarzania (przesuwania na pocz�tek) wska�nik�w do plik�w %s i %s +7023=B��d #%lu (%s) podczas ustawiania wielko�ci pliku docelowego %s na 0 +7024=��danie zabicia podczas w�a�ciwego kopiowania pliku %s -> %s +7025=Zmiana wielko�ci bufora z [Domy�lny:%lu, Jeden dysk:%lu, Dwa dyski:%lu, CD:%lu, LAN:%lu] na [Domy�lny:%lu, Jeden dysk:%lu, Dwa dyski:%lu, CD:%lu, LAN:%lu] podczas kopiowania %s -> %s (CustomCopyFile) +7026=B��d #%lu (%s) podczas pr�by odczytu %d bajt�w danych z pliku �r�d�owego %s (CustomCopyFile) +7027=B��d #%lu (%s) podczas pr�by zapisu %d bajt�w danych do pliku docelowego %s (CustomCopyFile) +7028=Przechwycono wyj�tek w CustomCopyFile [ostatni b��d: #%lu (%s)] +7029=Rozpocz�cie przetwarzania plik�w/folder�w (ProcessFiles) +7030=Przetwarzanie plik�w/folder�w (ProcessFiles) - zawarto�� struktury danych:\r\n\tOnlyCreate: %d\r\n\tRozmiar bufora: [Def:%lu, Jeden dysk:%lu, Dwa dyski:%lu, CD:%lu, LAN:%lu]\r\n\tIlo�� plik�w/folder�w: %lu\r\n\tCopies count: %d\r\n\tFoldery zignorowane: %d\r\n\tDest path: %s\r\n\tObecnie przetworzonych (0-bazowych): %d\r\n\tObecny wska�nik (0-bazowych): %d +7031=��danie zabicia podczas przetwarzania pliku w ProcessFiles +7032=B��d #%lu (%s) podczas wywo�ania MoveFile %s -> %s (ProcessFiles) +7033=B��d #%lu (%s) podczas wywo�ania CreateDirectory %s (ProcessFiles) +7034=Zako�czono przetwarzanie w ProcessFiles +7035=\r\n# ROZPOCZ�CIE W�TKU KOPIUJ�CEGO #\r\nRozpocz�to przetwarzanie danych %02d.%02d.%4d godz.%02d:%02d.%02d +7036=Zako�czono oczekiwanie na zezwolenie rozpocz�cia +7037=��danie zabicia podczas oczekiwania na pozwolenie kontynuacji (wait state) +7038=Zako�czono przetwarzanie danych %02d.%02d.%4d godz.%02d:%02d.%02d +7039=Przechwycono wyj�tek w ThrdProc [ostatni b��d: %lu (%s), typ: %d] +7040=Sprawdzanie ilo�ci wolnego miejsca na dysku docelowym... +7041=Jest za ma�o miejsca na dysku - potrzeba %I64d bajt�w miejsca na dane, a dost�pnych jest jedynie %I64d bajt�w. +7042=��danie anulowania podczas sprawdzania ilo�ci wolnego miejsca na dysku. +7043=Ponawianie pr�by odczytu wolnego miejsca... +7044=Zignorowano ostrze�enie o braku wystarczaj�cej ilo�ci miejsca na skopiowanie danych. +7047=��danie anulowania przed wywo�aniem MoveFileEx %s -> %s (ProcessFiles) +8000=Program +8001=Monitoruj schowek +8002=Czas, co jaki b�dzie przeszukiwany schowek [ms] +8003=Uruchamiaj program wraz ze startem systemu +8004=Zamknij system po zako�czeniu kopiowania +8005=Czas, co jaki b�dzie wykonywane autozapisywanie [ms] +8006=Folder z danymi tymczasowymi +8007=Okno statusu +8008=Czas, co jaki b�dzie od�wie�any status [ms] +8009=Poka� szczeg�y w oknie statusu +8010=Automatycznie usuwaj zako�czone zadania +8011=Miniaturowy widok +8012=Pokazuj nazwy plik�w +8013=Wy�wietlaj pojedyncze zadania +8014=Czas, co jaki b�dzie od�wie�any status [ms] +8015=Poka� przy starcie programu +8016=Ukrywaj, je�eli nie ma co pokaza� +8017=W�tek kopiuj�cy +8018=Automatyczne dokopiowuj pliki +8019=Ustawiaj atrybuty plik�w docelowych +8020=Ustawiaj dat�/czas plik�w docelowych +8021=Chro� pliki tylko do odczytu +8022=Ilo�� jednocze�nie wykonywanych operacji +8023=Poka� wizualne potwierdzenia +8024=Autowyb�r domy�lnej akcji dla okien z potwierdzeniami +8025=Czas pokazywania okna potwierdzenia [ms] +8026=Wznawiaj automatycznie +8027=Czas, co jaki operacja b�dzie automatycznie wznawiana [ms] +8028=Domy�lny priorytet w�tku +8029=U�ywaj tylko domy�lnego bufora +8030=Domy�lna wielko�� bufora +8031=Kasuj pliki dopiero po zako�czeniu kopiowania (przenoszenia) +8032=Tw�rz pliki .log (dziennika) +8033=D�wi�ki +8034=Odtwarzaj d�wi�ki w programie +8035=D�wi�k przy wyst�pienie b��du +8036=D�wi�k po zako�czenie kopiowania +8037=J�zyk +8038=Odczytuj wielko�� zadania przed zablokowaniem +8039=Wy��cz buforowanie dla du�ych plik�w +8040=Minimalna wielko�� plik�w, dla kt�rych buforowanie ma zosta� wy��czone +8041=Bufor +8042=Wielko�� bufora kopiowania w obr�bie jednego dysku +8043=Wielko�� bufora kopiowania pomi�dzy dwoma r�nymi dyskami +8044=Wielko�� bufora kopiowania z CD-ROMu +8045=Wielko�� bufora kopiowania przez sie� lokaln� +8046=Czas oczekiwania przed wy��czeniem systemu [ms] +8047=Rodzaj zamkni�cia systemu +8048=U�yj p�ynnych pask�w post�pu +8049=Okno wyboru folderu +8050=Poka� rozszerzony widok +8051=Szeroko�� okna [piksele] +8052=Wysoko�� okna [piksele] +8053=Styl listy skr�t�w +8054=Ignoruj dodatkowe okna pow�oki +8055=Poka� polecenie 'Kopiuj' w menu przeci�gania +8056=Poka� polecenie 'Przenie�' w menu przeci�gania +8057=Poka� polecenie 'Kopiuj/przenie� specjalnie' w menu przeci�gania +8058=Poka� polecenie 'Wklej' w menu kontekstowym +8059=Poka� polecenie 'Wklej specjalnie' w menu kontekstowym +8060=Poka� polecenie 'Kopiuj do' w menu kontekstowym +8061=Poka� polecenie 'Przenie� do' w menu kontekstowym +8062=Poka� polecenie 'Kopiuj/przenie� specjalnie do' w menu kontekstowym +8063=Wy�wietl ilo�� wolnego miejsca wraz z nazwami skr�t�w +8064=Wy�wietl ikony obok skr�t�w (eksperymentalne) +8065=Przechwytuj przeci�ganie lewym przyciskiem myszy (eksperymentalne) +8066=Skr�ty +8067=Ostatnio u�ywane �cie�ki dost�pu +8068=Pow�oka systemowa +8069=Ilo�� zdefiniowanych skr�t�w +8070=Ilo�� zapami�tanych �cie�ek +8071=Domy�lna akcja przy przeci�ganiu lewym przyciskiem myszy +8072=Priorytet aplikacji +8073=Wy��cz podbijanie priorytetu przez system +8074=Nie!Tak +8075=!Wybierz folder tymczasowy +8076=Wy��czone!Normalne!Wszystkie +8077=!Pliki .wav|*.wav|| +8079=Normalny!Wymuszony +8080=Du�e ikony!Ma�e ikony!Lista!Raport +8081=W tle!Normalny!Wysoki!Czasu rzeczywistego +8082=Kopiowanie!Przenoszenie!Operacja specjalna!Autodetekcja +8083=Folder z wtyczkami +8084=!Wybierz folder, w kt�rym znajduj� si� wtyczki +8085=Plik dziennika +8086=Aktywacja dziennika +8087=Limit wielko�ci pliku .log (dziennika) +8088=Maksymalna wielko�� pliku .log (dziennika) +8089=Precyzyjne ogranicz wielko�� +8090=Wielko�� bufora u�ywana przy ucinaniu pliku +8091=Folder z plikami pomocy +8092=!Wybierz folder, w kt�rym znajduj� si� pliki pomocy +8093=Folder z plikami t�umacze� +8094=!Wybierz folder, w kt�rym znajduj� si� pliki t�umacze� +9000=(CH) Kopiuj tutaj +9001=(CH) Przenie� tutaj +9002=(CH) Kopiuj/przenie� specjalnie... +9003=(CH) Wklej +9004=(CH) Wklej specjalnie... +9005=(CH) Kopiuj do +9006=(CH) Przenie� do +9007=(CH) Kopiuj/przenie� specjalnie do... +9008=Kopiuje dane w to miejsce za pomoc� Copy Handlera +9009=Przenosi dane w to miejsce za pomoc� Copy Handlera +9010=Kopiuje/przenosi dane z dodatkowymi ustawieniami +9011=Wkleja pliki/foldery ze schowka w to miejsce +9012=Wkleja pliki/foldery ze schowka w to miejsce z dodatkowymi ustawieniami +9013=Kopiuje zaznaczone dane do okre�lonej lokalizacji +9014=Przenosi zaznaczone dane do okre�lonej lokalizacji +9015=Kopiuje/przenosi zaznaczone dane do okre�lonej lokalizacji z dodatkowymi opcjami +13000=Podaj �cie�k� dost�pu +13001=Nazwa zdalna: +13002=Nazwa lokalna: +13003=Typ: +13004=Rodzaj sieci: +13005=Opis: +13006=Wolne miejsce: +13007=Pojemno��: +13008=&OK +13009=&Anuluj +13010=Nie mo�na utworzy� folderu +13011=Podana �cie�ka dost�pu nie istnieje +13012=Nazwa +13013=�cie�ka dost�pu +13014=�cie�ka dost�pu: +13015=>> +13016=<< +13017=Nie wprowadzono �cie�ki dost�pu dla tworzonego skr�tu +13018=Utw�rz nowy folder +13019=Du�e ikony +13020=Ma�e ikony +13021=Lista +13022=Raport +13023=Szczeg�y +13024=Dodaj do listy skr�t�w +13025=Usu� z listy skr�t�w +13026=Domena/Grupa robocza +13027=Serwer +13028=Udzia� +13029=Plik +13030=Grupa +13031=Sie� +13032=Root +13033=Udzia� administracyjny +13034=Katalog +13035=Drzewo +13036=Kontener NDS +13500=Kopiowanie... +13501=Przenoszenie... +13502=Nieznany typ operacji - to si� nigdy nie powinno zdarzy� +13503=Podaj �cie�k� docelow� dla:\n +14001=Kompilacja: %s +14002=Kod= +14003=Wersja= +14500=Nie mo�na operowa� przy wielko�ci bufora r�wnej 0 +15000=Wszystkie pliki (*)|*|| +15001=Wska� folder docelowy +15002=Nie uzupe�niono �cie�ki docelowej lub nie podano pliku �r�d�owego.\nNie mo�na kontynuowa� operacji +15003=Kopiowanie +15004=Przenoszenie +15005=Domy�lny: %s +15006=Jeden dysk: %s +15007=Dwa dyski: %s +15008=CD: %s +15009=LAN: %s +15010=Maska +15011=Wielko�� +15012=Data +15013=Atrybuty w��czone +15014= i +15015=brak +15016=ka�da +15017=dowolna +15018=Wy��cz +15019=Atrybuty wy��czone +15020=brak +15021=Nie w��czono �adnego typu filtrowania +15022=Wszystkie pliki (*.*)|*.*|| +15023=Zaimportowano %lu �cie�ek +16500=Nie ma wystarczaj�cej ilo�ci miejsca w lokalizacji %s aby skopiowa� lub przenie��: +18000=Data utworzenia +18001=Data ostatniej modyfikacji +18002=Data ostatniego otwarcia +18500=Wszystko: +20000=Nie podano tekstu �r�d�owego +20500=Nazwa skr�tu +20501=�cie�ka dost�pu +21000=Nie mo�na zamkn�� systemu operacyjnego.\nWyst�pi� b��d #%lu. +21500=Status +21501=Plik +21502=Do: +21503=Post�p +21504=Nie zaznaczono elementu +21505=brak +21506=brak +21507=nieznana +21508=nieznany +21509=brak +21510=brak +21511=nieznany +21512=00:00 / 00:00 +21513=kopia: +21514=�r: +21515=Status +21516=Zamieniono:\n%d �cie�ek pobranych pocz�tkowo ze schowka +21517=Zaznaczone zadanie nie jest wstrzymane +21518=Nie zaznaczono zadania +21519=(oczekiwanie...) +21520= kopie +21521= kopii +21522=Wyszukiwanie +21523=Kopiowanie +21524=Przenoszenie +21525=Zako�czono +21526=B��d +21527=Pauza +21528=Usuwanie +21529=Nieznany +21530=Anulowano +21531=Oczekiwanie +21532=Tylko pliki +21533=Bez zawarto�ci +21534=B��d #%lu wywo�ywania ShellExecute dla pliku %s +21535=Domy�lny: +21536=Jeden dysk: +21537=Dwa dyski: +21538=CD: +21539=LAN: +21540=B��d #%errnum (%errdesc) podczas kasowania pliku %s +21541=B��d #%errnum (%errdesc) podczas otwierania pliku �r�d�owego %s +21542=B��d #%errnum (%errdesc) podczas otwierania pliku docelowego %s.\nPrawdopodobna przyczyna: plik docelowy ma ustawiony atrybut tylko do odczytu oraz w��czona jest ochrona plik�w z tym atrybutem w konfiguracji (co powoduje, �e plik nie mo�e by� otwarty do zapisu). +21543=B��d #%errnum (%errdesc) podczas odtwarzania (przesuwania na pocz�tek) wska�nik�w do plik�w %s i %s +21544=B��d #%errnum (%errdesc) podczas ustawiania wielko�ci pliku docelowego %s na 0 +21545=B��d #%errnum (%errdesc) podczas pr�by odczytu %d bajt�w danych z pliku �r�d�owego %s +21546=B��d #%errnum (%errdesc) podczas pr�by zapisu %d bajt�w danych do pliku docelowego %s +21547=B��d #%errnum (%errdesc) podczas wywo�ania MoveFile %s -> %s +21548=B��d #%errnum (%errdesc) podczas wywo�ania CreateDirectory %s +21549=nie skojarzono +21550= [z filtrem] +21551=Zaznaczone zadanie nie zosta�o jeszcze zako�czone.\nCzy chcesz je zako�czy� teraz ? Index: other/Langs/chinese.lng =================================================================== diff -u --- other/Langs/chinese.lng (revision 0) +++ other/Langs/chinese.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,668 @@ +# Info section +[Info] +Lang Name=�������� +Lang Code=2052 +Base Language=english.lng +Font Face=���� +Charset=1 +Size=9 +RTL reading order=0 +Help name=chinese.chm +Author=���� +Version=1.28 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=[&C]����·��... + +# Menu - IDR_POPUP_MENU +[130] +32773=��ʾ״̬... +32802=[&O]ѡ��... +32803=��ʾ���㴰��... +32804=�Զ��帴��... +32806=���Ӽ����� +32807=��ɺ�رռ���� +32809=[&R]ע���Ҽ��˵� +32810=[&U]ȡ���Ҽ��˵� +32814=[&H]����... +57664=����... +57665=�˳� + +# Menu - IDR_PRIORITY_MENU +[135] +32774=ʵʱ +32775=�� +32776=���ڱ�׼ +32777=��׼ +32778=���ڱ�׼ +32779=�� +32780=���� + +# Dialog box - IDD_BUFFERSIZE_DIALOG +[137] +0=�����С���� +1=[&O]ȷ�� +2=[&C]ȡ�� +1145=��ʹ��Ĭ�ϻ��� +1219=Ĭ��ֵ +1220=ͬһӲ�̷����临���ļ� +1221=�ڶ���Ӳ�̼临���ļ� +1222=�ӹ����и����ļ� +1223=�ھ������ϸ����ļ� +1257=[&H]���� + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Copy handler - ���ļ�ʱ���� +2=[&C]ȡ�� +1097=[&I]���� +1098=[&G]����ȫ�� +1099=[&W]�ȴ� +1100=[&R]���� +1220=�޷��򿪲�д���ļ��� +1221=����˵���� + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Copy handler - ���ļ�ʱ���� +2=[&C]ȡ�� +1097=[&I]���� +1098=[&G]����ȫ�� +1099=[&W]�ȴ� +1100=[&R]���� +1219=�޷��򿪲�����Դ�ļ� - ԭ���ǣ� +1220=�ļ����� +1221=�ļ���С�� +1222=����ʱ�䣺 +1223=����޸�ʱ�䣺 +1224=ԭ����Դ�ļ��� +1226=�ļ����� +1227=�ļ���С�� +1228=����ʱ�䣺 +1229=����޸�ʱ�䣺 +1230=�ҵ���Դ�ļ��� +1231=�������ʲô������ + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Copy handler - Ŀ���ļ��Ѿ�����(����С��Դ�ļ�С) +2=[&C]ȡ�� +1097=[&I]���� +1098=[&G]����ȫ�� +1103=[&P]���� +1104=[&E]���¸��� +1106=[&Y]ȫ������ +1107=[&A]ȫ�����¸��� +1220=Ŀ���ļ��Ѿ����ڶ��ұ�Դ�ļ�С��\n���ܳ��ִ������ԭ��\n- Դ�ļ��� ����/�ƶ� ����û����ɾͱ��жϣ���ѡ��������\n- Դ�ļ���Ŀ���ļ��Ƕ�����ͬ�İ汾�����ѡ�����¸��ơ��� +1221=�ļ����� +1222=�ļ���С�� +1223=����ʱ�䣺 +1224=����޸�ʱ�䣺 +1225=Դ�ļ��� +1226=�ļ����� +1227=�ļ���С�� +1228=����ʱ�䣺 +1229=����޸�ʱ�䣺 +1230=Ŀ���ļ��� +1231=�������ʲô������ + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Copy handler - Ŀ���ļ��Ѿ����� +2=[&C]ȡ�� +1097=[&I]���� +1098=[&G]����ȫ�� +1104=[&E]���¸��� +1107=[&A]ȫ�����¸��� +1220=Ŀ���ļ��Ѿ����ڣ�����С����Դ�ļ���ͬ���Դ�ļ���\n���ܳ��ִ������ԭ��\n- Դ�ļ���Ŀ���ļ��������İ汾����ѡ�񡾺��ԡ������¸��ơ���\n- Դ�ļ���Ŀ���ļ��Ƕ�����ͬ�ļ���ֻ��ͬ�����ѣ����ѡ�񡾺��ԡ��� +1221=�ļ����� +1222=�ļ���С�� +1223=����ʱ�䣺 +1224=����޸�ʱ�䣺 +1225=Դ�ļ��� +1226=�ļ����� +1227=�ļ���С�� +1228=����ʱ�䣺 +1229=����޸�ʱ�䣺 +1230=Ŀ���ļ��� +1231=�������ʲô������ + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=״̬ + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=ѡ�� +1=[&O]ȷ�� +2=[&C]ȡ�� +1218=[&A]Ӧ�� +1257=[&H]���� + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=���ָ���Դ�ļ�·�� +1=ȷ�� +2=[&C]ȡ�� +1064=... +1219=Դ�ļ�·���� +1220=����Ϊ�� +1257=[&H]���� + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=״̬ +1003=�б�1 +1005=����1 +1007=����2 +1013=... +1016=> +1018=[&P]��ͣ +1021=[&R]���� +1022=[&C]ȡ�� +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=����/ȫ�� +1042=[&S]���¿�ʼ +1043=[&V]�Ƴ� +1044=��ͣ/ȫ�� +1045=���¿�ʼ/ȫ�� +1046=ȡ��/ȫ�� +1047=�Ƴ�/ȫ�� +1077=[&A]�߼� > +1120=�鿴��־ +1122= +1219=�����б� +1220=�������� +1221=�������� +1222=Ŀ��λ�ã� +1223=Դ�ļ�λ�ã� +1224=�����С�� +1225=�߳����ȼ� +1226=ע�ͣ� +1227=����״̬�� +1228=�����ٶȣ� +1229=���̣� +1230=�����ٶȣ� +1231=���̣� +1232=ȫ��״̬�� +1233=��ǰ��ѡ����״̬ͳ����Ϣ +1234= +1235= +1236= +1237= +1238=ʱ�䣺 +1239=��¼�ļ��� + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Copy handler - û���㹻�Ŀռ� +2=[&C]ȡ�� +1097=[&O]���� +1100=[&R]���� +1127= +1128= +1221=��Ҫ�ռ䣺 +1222=���ÿռ䣺 +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy handler - �رռ���� +2=[&C]ȡ�� +1037= +1146=Progress1 +1220=����/�ƶ�������ȫ����ɡ�ϵͳ��������ʱ���ڹرգ� + +# Dialog box - IDD_CUSTOM_COPY_DIALOG +[149] +0=����/�ƶ� �������� +1=[&O]ȷ�� +2=[&C]ȡ�� +1002=[&F]����ļ� +1004=[&D]ɾ�� +1008=... +1010=List2 +1011=[&O]����ļ��� +1014=���� +1015=��Ŀ���ļ����в������ṹ-������Դ�ļ��е�Ŀ¼�ṹ��ֻ����Դ�ļ����е������ļ���Ŀ���ļ����� +1017=������/�ƶ�Ŀ¼�е��ļ�-������(�յ�)Ŀ¼�ṹ�� +1020=��Ŀ���ļ����д�������·��(Դ�ļ���������Ŀ¼��·��) +1023=�߼�ѡ�� +1024=[&C]����... +1025=+ +1026=- +1065=List1 +1178=Spin1 +1179= +1191=[&I]����... +1219=Դ�ļ�/�У� +1220=Ŀ���ļ��У� +1221=�������ͣ� +1222=���ȼ��� +1223=���Ʒ����� +1224=�����С�� +1225=��׼ѡ�� +1249= +1250= +1251= +1252= +1253= +1257=[&H]���� + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=�������� +1=[&O]ȷ�� +2=[&C]ȡ�� +1150=����(������|�ֿ���ʾ�����磺*.jpg|*.gif) +1151=���ļ���С���� +1155=Spin1 +1159=Spin1 +1160=�� +1161=�����ڹ��� +1162=���ļ����Թ��� +1163=�浵 +1164=ֻ�� +1165=���� +1166=ϵͳ +1169=DateTimePicker1 +1170=DateTimePicker2 +1171=�� +1173=DateTimePicker1 +1174=DateTimePicker2 +1175=Directory +1177=�ų� +1219= +1257=[&H]���� + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=�༭����Ŀ¼ +1=[&O]ȷ�� +2=[&C]ȡ�� +1043=[&D]ɾ�� +1060=[&A]��� +1064=... +1180=List1 +1182= +1185=[&U]���� +1192=���� +1193=���� +1219=����Ŀ¼�� +1220=Ŀ¼���ƣ� +1221=·���� +1222=��ݹ��� +1257=[&H]���� + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=���ʹ���·�� +1=[&O]ȷ�� +2=[&C]ȡ�� +1043=[&D]ɾ�� +1060=[&A]��� +1064=... +1185=[&U]���� +1190=List1 +1220=·�� +1219=���ʹ�ù���·���� +1257=[&H]���� + +# Dialog box - IDD_ABOUTBOX +[100] +0=���� ... +1=[&O]ȷ�� +1199=��Ȩ (C) 2001-2005 Jozef Starosczyk(�������ĺ���������) +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=��̳: +1205=Developers' ��̳: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=��ҳ|http://groups.yahoo.com/group/copyhandler +1209=����|mailto:copyhandler-subscribe@yahoogroups.com +1210=ȡ������|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=E-mail��ϵ|mailto:copyhandler@yahoogroups.com +1212=��ҳ|http://groups.yahoo.com/group/chdev +1213=����|mailto:chdev-subscribe@yahoogroups.com +1214=ȡ������|mailto:chdev-unsubscribe@yahoogroups.com +1215=E-mail��ϵ|mailto:chdev@yahoogroups.com +1216=�ر��л�� +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=��ҳ�� +1266=��ϵ��ʽ�� +1267=������Ϊ���������û����԰�GNU(General Public License���ڳ�������)������д����� +1268=���ߣ� +1269=֧�֣� + +# String table +[0] +211=[����]\r\nEl Magico\t\t\t��װ�ű����ۺ���Ʒ�����beta�����...\r\n\r\n[��ҳ]\r\nTomas S. Refsland\t�����ռ�\r\nBarnaba\t\t\t\t\t��վ����\r\n\r\n[���԰�]\r\n%s\r\n\r\n[��չ���]\r\nMarkus Oberhumer & Laszlo Molnar\t\tUPX software\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[����]\r\n��л����ͨ������;���Դ�����ṩ��������... +5000=Copy Handler +5001=���� +5002=���� +5003=���ڱ�׼ +5004=��׼ +5005=���ڱ�׼ +5006=���� +5007=���� +5008=������� %s +5009=���� (%d) �� %s +5010=�ļ�û���ҵ�(�������Ͳ�����!) +5011=B +5012=kB +5013=MB +5014=GB +5015=TB +5016=PB +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=ͬһʱ����ֻ������һ��Copy Handler +6001=chext.dll���ļ��Ѿ�ע��ɹ�������ʹ���Ҽ��˵��ˡ� +6002=chext.dll���ļ�ע��ʱ���ִ���\n������� #%lu (%s)�� +6003=�ɹ���ȡ����chext.dll���ļ���ע�ᣬ����ʹ���Ҽ��˵��ˡ� +6004=ȡ��chext.dll���ļ���ע��ʱ�����˴���\n������� #%lu (%s)�� +6005=���ܴ�html�����ļ���\n%s\n +7000=����ͳ���ļ�����... +7001=(������)��û��Դ�ļ�/�� : %s +7002=��(������)����ļ�/�У� %s ... +7003=����ļ��� %s +7004=��� %s �ļ����е����� +7005=���ļ��б��������ʱ��ֹ����������(�������ļ���) +7006=����ļ� %s +7007=�ļ�����ͳ����� +7008=����ɾ���ļ�(ɾ���ļ�)... +7009=ɾ���ļ�ʱ��ֹ���������� (ɾ���ļ�) +7010=ɾ���ļ�/�� %s ʱ�����˴��� #%lu (%s)�� +7011=�ļ�ȫ��ɾ�� +7012=��Դ�ļ� %s ��ʾ������Ի���֮ǰȡ����������(�Զ��帴��) +7013=��Դ�ļ� %s ʱ���ִ��� #%lu (%s)��(�Զ��帴��) +7014=��Դ�ļ� %s ʱȡ���������� [������� #%lu (%s)] (�Զ��帴��) +7015=��Դ�ļ� %s ʱ�ȴ��������� [������� #%lu (%s)] (�Զ��帴��) +7016=�������Դ�Դ�ļ� %s [������� #%lu (%s)] (�Զ��帴��) +7017=��Ŀ���ļ� %s ʱ���ִ��� #%lu (%s)��(�Զ��帴��) +7018=�������Դ�Ŀ���ļ� %s [������� #%lu (%s)] (�Զ��帴��) +7019=��Ŀ���ļ� %s ʱȡ����������[������� #%lu (%s)] (�Զ��帴��) +7020=��Ŀ���ļ� %s ʱ�ȴ��������� [������� #%lu (%s)] (�Զ��帴��) +7021=�ƶ��ļ� %s ��ָ�� %s ��%I64u ʱ����[������� #%lu (%s)] +7022=�ָ�(�ƶ����ļ�ͷ)�ļ� %s ��ָ��ʱ����[������� #%lu (%s)] +7023=���ļ� %s �Ĵ�С����Ϊ0ʱ����[������� #%lu (%s)] +7024=ȡ�������ļ� %s �� %s ������ +7025=������Ĵ�С��[Ĭ��ֵ��%lu, ͬһӲ�̷����䣺%lu,����Ӳ�̼䣺%lu, �ӹ��̸��ƣ�%lu, ��������%lu] ��Ϊ [Ĭ��ֵ��%lu, ͬһӲ�̷�����%lu, ����Ӳ�̼䣺%lu, �ӹ��̸��ƣ�%lu, ��������%lu] Ȼ���ļ� %s ���Ƶ� %s (�Զ��帴��) +7026=��Դ�ļ� %s ��ȡ %d bytesʱ����[������� #%lu (%s)](�Զ��帴��) +7027=��Ŀ���ļ� %s д�� %d bytesʱ����[������� #%lu (%s)](�Զ��帴��) +7028=�Զ��帴�� ʱ�����쳣 [��������룺 #%lu (%s)] (ʱ�䣺 %lu) +7029=����(�������ļ��б�)�ļ�/�� +7030=����(�������ļ��б�)���ļ�/��:\r\n\t�������� %d\r\n\t�����С��[Ĭ��ֵ��%lu, ͬһӲ�̷����䣺%lu, ����Ӳ�̼䣺%lu, �ӹ��̣�%lu, ��������%lu]\r\n\t�ļ�/�и�����%lu\r\n\t���Ƶķ����� %d\r\n\t���Ե��ļ��и����� %d\r\n\tĿ��·���� %s\r\n\t��ǰͨ�� (0-based): %d\r\n\t��ǰ���� (0-based): %d +7031=ȡ���������ļ��б��еĴ������� +7032=�ƶ��ļ� %s �� %s ʱ���ִ���[������� #%lu (%s)](�������ļ��б�) +7033=�����ļ��� %s ʱ���ִ���[������� #%lu (%s)](�������ļ��б�) +7034=��ɴ������ļ��б��еĴ������� +7035=\r\n# ���ƽ��������� #\r\n��ʼ��������(��:��:��) %02d.%02d.%4d �� %02d:%02d.%02d +7036=���Կ�ʼ���� +7037=�ȴ���ʼ�����ʱȡ������(�ȴ�״̬) +7038=������ݴ�����(��:��:��) %02d.%02d.%4d %02d:%02d.%02d +7039=�̹߳����쳣 [��������룺 %lu (%s), ���ͣ� %d] +7040=���Ŀ�����ϵ�ʣ��ռ�... +7041=���̿ռ䲻�� - Դ�ļ���СΪ %I64d bytes���ô��̿��ÿռ�Ϊ�� %I64d bytes�� +7042=������ʣ��ռ�ʱȡ���������� +7043=���ڳ��Զ�ȡ���̵�ʣ��ռ�... +7044=����Ŀ����̿ռ䲻��ľ��档 +7047=�ƶ��ļ� %s �� %s ʱȡ������(�������ļ��б�) +8000=���� +8001=���Ӽ����� +8002=ɨ�������ļ��ʱ��... [����] +8003=�����Զ����� +8004=������ɺ��Զ��رռ���� +8005=�Զ�����ļ��ʱ��... [����] +8006=ѡ������ʱ�ļ����ļ��� +8007=״̬���� +8008=ˢ��״̬�ļ��ʱ��... [����] +8009=��״̬��������ʾ��ϸ���� +8010=�Զ��Ƴ�����ɵ����� +8011=���㴰�� +8012=��ʾ�ļ��� +8013=��ʾ����������� +8014=ˢ��״̬�ļ��ʱ��... [����] +8015=��������ʱ��ʾ�˴��� +8016=������ʱ���� +8017=����/�ƶ��߳� +8018=�Զ����������ļ� +8019=Ŀ���ļ�����Դ�ļ������� +8020=Ŀ���ļ�����Դ�ļ�������/ʱ�� +8021=��������ֻ�����Ե��ļ� +8022=ͬʱ�����еĽ����� +8023=��ʾȷ�϶Ի��� +8024=ȷ�϶Ի�����ʾ����Ĭ��ʱ����Զ�ȷ�� +8025=��ʾȷ�϶Ի����ʱ�� +8026=������Զ����� +8027=�Զ������ļ��ʱ��... [����] +8028=Ĭ���߳����ȼ� +8029=ֻʹ��Ĭ�ϻ��� +8030=Ĭ�ϻ����С +8031=�������֮ǰ��ɾ���ļ�(�ƶ�ʱ����) +8032=����.log��־�ļ� +8033=���� +8034=�������� +8035=������ʱ������ +8036=������ɺ󲥷ŵ����� +8037=���� +8038=���̷ֿ�ǰ��ȡ����Ĵ�С +8039=���ƽϴ��ļ�ʱ���û��� +8040=�ļ����ʱ���û��� +8041=���� +8042=��һ������Ӳ�̸������临���ļ�ʱ����Ĵ�С +8043=�ڶ���Ӳ�̼临���ļ�ʱ����Ĵ�С +8044=�ӹ����ϸ����ļ�ʱ����Ĵ�С +8045=ͨ�����縴���ļ�ʱ����Ĵ�С +8046=�ػ�ǰ�ӳ�ʱ��[����]... +8047=�ػ����� +8048=ѡ��ƽ��������ʹ�ÿ�״���Ľ����� +8049=ѡ���ļ��жԻ��� +8050=��ʾ��չ������� +8051=�Ի�����[����] +8052=�Ի���߶�[����] +8053=����·���б�ķ�� +8054=����ϵͳ���ӶԻ��� +8055=���Ҽ���ק�˵�����ʾ�����ơ����� +8056=���Ҽ���ק�˵�����ʾ���ƶ������� +8057=���Ҽ���ק�˵�����ʾ��ѡ���Ը���/�ƶ������� +8058=���Ҽ��˵�����ʾ��ճ�������� +8059=���Ҽ��˵�����ʾ��ѡ����ճ�������� +8060=���Ҽ��˵�����ʾ�����Ƶ������� +8061=���Ҽ��˵�����ʾ���ƶ��������� +8062=���Ҽ��˵�����ʾ��ѡ���Ը���/�ƶ������� +8063=�ڿ�ݷ�ʽ������ʾʣ��ռ� +8064=�ڿ�ݷ�ʽǰ��ʾͼ��(���ڲ�����) +8065=�������ϵͳ�е���������ק����(���ڲ�����) +8066=�����ļ��п�ݷ�ʽ +8067=·�����ʼ�¼ +8068=�����˵� +8069=�Ѷ���ij����ļ��еĸ��� +8070=������ʵ�·������ +8071=��������ק��Ĭ�ϲ��� +8072=��������ȼ� +8073=��ֹ�������ȼ� +8074=��!�� +8075=!ѡ����ʱ�ļ��� +8076=��ֹ!��ͨ!��ϸ +8077=!�����ļ�(.wav)|*.wav|| +8079=����!ǿ�� +8080=��ͼ��!Сͼ��!�б�!��ϸ���� +8081=����!��׼!��!ʵʱ +8082=����!�ƶ�!ѡ���Բ���!�Զ�ѡ�� +8083=ѡ���Ų�����ļ��� +8084=!ѡ�����ļ��� +8085=����־�ļ�(log�ļ�) +8086=�����¼��־ +8087=������־�ļ��Ĵ�С +8088=��־�ļ����Ϊ +8089=��ȷ������־�ļ��Ĵ�С +8090=ʹ�ò��ֻ��� +8091=ѡ���Ű����ļ����ļ��� +8092=!ѡ���Ű����ļ����ļ��� +8093=ѡ���������ļ����ļ��� +8094=!ѡ���������ļ����ļ��� +9000=(CH)���Ƶ����� +9001=(CH)�ƶ������� +9002=(CH)ѡ���Ը���/�ƶ�... +9003=(CH)ճ�� +9004=(CH)ѡ����ճ��... +9005=(CH)���Ƶ� +9006=(CH)�ƶ��� +9007=(CH)ѡ���Ը���/�ƶ���... +9008=ʹ��Copy Handler�������ݵ���� +9009=ʹ��Copy Handler�ƶ����ݵ���� +9010=����չ�����е��趨����/�ƶ����� +9011=�Ӽ�������ճ���ļ�/�е���� +9012=����չ�����е��趨�Ӽ�������ճ���ļ�/�е���� +9013=������ѡ���ݵ�ָ�����ļ��� +9014=�ƶ���ѡ���ݵ�ָ�����ļ��� +9015=����չ�����е��趨����/�ƶ���ѡ���ݵ�ָ�����ļ��� +13000=ѡ��·�� +13001=Զ���ļ����� +13002=�����ļ����� +13003=���ͣ� +13004=�������ͣ� +13005=˵���� +13006=ʣ��ռ䣺 +13007=������ +13008=[&O]ȷ�� +13009=[&C]ȡ�� +13010=�޷������ļ��� +13011=�������·�������� +13012=���� +13013=·�� +13014=·���� +13015=>> +13016=<< +13017=û�������ļ��п�ݷ�ʽ��·�� +13018=�½��ļ��� +13019=��ͼ�� +13020=Сͼ�� +13021=�б� +13022=��ϸ���� +13023=��չ��� +13024=��ӵ�����·���б� +13025=�Ƴ�����·���б� +13026=��/������ +13027=������ +13028=���� +13029=�ļ� +13030=������ +13031=���� +13032=�� +13033=Administration���� +13034=Ŀ¼ +13035=Ŀ¼�� +13036=NDS Container +13500=���ڸ���... +13501=�����ƶ�... +13502=δ֪�������� - ��һ������ +13503=����Ŀ���ļ��У�\n +14001=������: %s +14002=����= +14003=�汾= +14500=����Ϊ0ʱ���ܲ��� +15000=ȫ���ļ�(*)|*|| +15001=ѡ��Ŀ���ļ��� +15002=û�и���Ŀ��·����Դ�ļ���\n�����޷����� +15003=���� +15004=�ƶ� +15005=Ĭ�ϣ�%s +15006=ͬһӲ�̷����䣺 %s +15007=����Ӳ�̼䣺 %s +15008=�ӹ��̣� %s +15009=�������� %s +15010=���� +15011=��С +15012=���� +15013=�������� +15014=�� +15015=�� +15016=�κ� +15017=�κ� +15018=�ų� +15019=�ų����� +15020=�� +15021=û��ѡ���κι���ѡ�� +15022=ȫ������ (*.*)|*.*|| +15023=����%lu ·�� +16500=û���㹻�Ŀռ����ڸ��ƻ��ƶ���%s +18000=�������� +18001=����޸����� +18002=���������� +18500=ȫ���� +20000=û������Դ�ļ� +20500=����Ŀ¼���� +20501=·�� +21000=�˲���ϵͳ��֧���Զ��رա�\n���ִ��󣬴������ #%lu. +21500=״̬ +21501=�ļ� +21502=���� +21503=���� +21504=û��ѡ������ +21505=�� +21506=�� +21507=δ֪ +21508=δ֪ +21509=�� +21510=�� +21511=δ֪ +21512=00:00 / 00:00 +21513=����ɣ� +21514=ƽ���ٶȣ� +21515=״̬ +21516=���ģ�\n �Ӽ�������ԭ·��%d +21517=��ѡ����������ͣ״̬ +21518=û��ѡ������ +21519=(���Ժ�...) +21520= copies +21521= copies +21522=���� +21523=���� +21524=�ƶ� +21525=��� +21526=���� +21527=��ͣ +21528=����ɾ�� +21529=δ֪ +21530=�Ѿ�ȡ�� +21531=�ȴ� +21532=���ļ� +21533=������ +21534=����˵�������ļ� %sʱ����������룺#%lu�� +21535=Ĭ��ֵ�� +21536=ͬһӲ�̣� +21537=����Ӳ�̼䣺 +21538=���̣� +21539=���磺 +21540=ɾ���ļ� %s ʱ����������룺 #%errnum (%errdesc) +21541=���Դ�Դ�ļ� %s ʱ����������룺 #%errnum (%errdesc) +21542=���Դ�Ŀ���ļ� %s ʱ����������룺 #%errnum (%errdesc)�������ļ�����ֻ�����ԣ�����ѡ���н�����������ֻ�����Ե��ļ���������Ϊ���ǡ���(�����ļ��޷���) +21543=�ָ��ļ� %s ָ�뵽 %s ʱ����(��ָ���Ƶ���ͷ)��������룺 #%errnum (%errdesc) +21544=���ļ� %s �Ĵ�С��Ϊ0ʱ����������룺 #%errnum (%errdesc) +21545=���Դ�Դ�ļ� %s ��ȡ %d bytes ʱ����������룺 #%errnum (%errdesc) +21546=����д��Ŀ���ļ� %s %d bytes ʱ����������룺 #%errnum (%errdesc) +21547=�ƶ��ļ� %s �� %s ʱ����������룺 #%errnum (%errdesc) +21548=�����ļ���ʱ %s ����������룺 #%errnum (%errdesc) +21549=�����޼�¼�ļ� +21550= [ʹ�ù�����] +21551=ѡ�������û����ɡ�\n���ڣ�����Ȼ�����������ô�� Index: other/Langs/german2.lng =================================================================== diff -u --- other/Langs/german2.lng (revision 0) +++ other/Langs/german2.lng (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,668 @@ +# Info section +[Info] +Lang Name=Deutsch (standard) +Lang Code=1031 +Base Language=English.lng +Font Face=Tahoma +Charset=1 +Size=8 +RTL reading order=0 +Help name=english.chm +Author=Semmi (DS) +Version=1.26 + +# Menu - IDR_ADVANCED_MENU +[160] +32805=Pfad we&chseln... + +# Menu - IDR_POPUP_MENU +[130] +32773=Zeige Status... +32802=&Optionen... +32803=Zeige Mini-Status... +32804=Kopiereinstellungen eintragen... +32806=Zwischenablage �berwachen +32807=Runterfahren nach beenden +32809=&Registriere Shell Erweiterung dll +32810=&Unregistriere Shell Erweiterung dll +32814=&Hilfe(Englisch)... +57664=�ber... +57665=Beenden + +# Menu - IDR_PRIORITY_MENU +[135] +32774=Zeit kritisch +32775=H�chste +32776=�ber normal +32777=Normal +32778=Unter normal +32779=Niedrigste +32780=Unt�tig + +# Dialog box - IDD_BUFFERSIZE_DIALOG +[137] +0=Einstellung Puffergr��e +1=&OK +2=Abbru&ch +1145=Nur voreingestellten Puffer benutzen +1219=Voreinstellung +1220=F�r kopieren innerhalb eines Laufwerkes +1221=F�r kopieren zwischen 2 Laufwerken +1222=F�r kopieren mit CD-Rom +1223=F�r kopieren mit Netzwerk +1257=&Hilfe + +# Dialog box - IDD_FEEDBACK_DSTFILE_DIALOG +[167] +0=Copy handler - Fehler: Datei �ffnen +2=Abbr&ch +1097=&Ignorieren +1098=I&gnoriere alle +1099=&Warte +1100=Nochmal Ve&rsuchen +1220=Kann die Datei zum Schreiben nicht �ffen: +1221=Fehler: Beschreibung: + +# Dialog box - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG +[162] +0=Copy handler - Fehler: Datei �ffnen +2=Abbru&ch +1097=&Ignoriere +1098=I&gnoriere alle +1099=&Warte +1100=Nochmal Ve&rsuchen +1219=Kann die Datei zum lesen nicht �ffen - Grund: +1220=Name: +1221=Gr��e: +1222=Erstellt am: +1223=Letzte Ver�nderung: +1224=Erwartete Quelldatei: +1226=Name: +1227=Gr��e: +1228=Erstellt am: +1229=Letzte Ver�nderung: +1230=Gefundene Quelldatei: +1231=Was m�chtest Du tun ? + +# Dialog box - IDD_FEEDBACK_REPLACE_FILES_DIALOG +[164] +0=Copy handler - Kleinere Zieldatei gefunden +2=Abbru&ch +1097=&Ignoriere +1098=I&gnoriere alle +1103=Ko&piere den Rest +1104=N&eu kopieren +1106=Cop&y rest all +1107=&Alle nochmal kopieren +1220=Zieldatei existiert bereits und ist kleiner als Quelldatei.\nPossible Gr�nde:\n- kopieren/verschieben von Quelldatei war nicht abgeschlossen (Rest kopieren)\n- Dies zu kopierende Datei ist eine andere als die Zieldatei (kopieren wiederholen) +1221=Name: +1222=Gr��e: +1223=Erstellt am: +1224=Letzte Ver�nderung: +1225=Quelldatei: +1226=Name: +1227=Gr��e: +1228=Erstellt am: +1229=Letzte Ver�nderung: +1230=Zieldatei: +1231=Was m�chtest Du tun ? + +# Dialog box - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG +[165] +0=Copy handler - Zieldatei gefunden +2=Abbru&ch +1097=&Ignorieren +1098=I&gnoriere alle +1104=&Erneut kopieren +1107=&Alle erneut kopieren +1220=Zieldatei existiert und ist >= wie die Quelldatei.\nPossible Gr�nde:\n- DIe Quelldatei ist eine andere Version als die Zieldatei (erneut kopieren/ignorieren)\n- Quell- und Zieldatei sind identisch (ignorieren) +1221=Name: +1222=Gr��e: +1223=Erstellt am: +1224=Letzte Ver�nderung: +1225=Quelldatei: +1226=Name: +1227=Gr��e: +1228=Erstellt am: +1229=Letzte Ver�nderung: +1230=Zieldatei: +1231=Was m�chtest Du tun ? + +# Dialog box - IDD_MINIVIEW_DIALOG +[145] +0=Status + +# Dialog box - IDD_OPTIONS_DIALOG +[144] +0=Optionen +1=&OK +2=Abbru&ch +1218=�bern&ahme +1257=&Hilfe + +# Dialog box - IDD_REPLACE_PATHS_DIALOG +[161] +0=Teilweise Ersetzen des Quellpfades +1=OK +2=Abbru&ch +1064=... +1219=Quellpfad: +1220=�ndere zu: +1257=&Hilfe + +# Dialog box - IDD_STATUS_DIALOG +[131] +0=Status +1003=Liste1 +1005=Besch�ftigt1 +1007=Besch�ftigt2 +1013=... +1016=> +1018=&Pause +1021=Zu&r�ckstellen +1022=Abbru&ch +1027= +1028= +1029= +1030= +1031= +1033= +1034= +1035= +1036= +1037= +1038=&<< +1040= +1041=Alles Zur�ckstellen +1042=Neusta&rt +1043=Entfe&rnen +1044=Alles pausieren +1045=Alles neu starten +1046=Alles abbrechen +1047=Alles entfernen +1077=&Fortgeschritten > +1120=Zeige Logdatei +1122= +1219=Operationsliste: +1220=Besch�ftigt: +1221=Besch�ftigt: +1222=Zielobjekt: +1223=Quellobjekt: +1224=Puffergr��e: +1225=System Priorit�t: +1226=Kommentare: +1227=Operation:en +1228=�bertragung: +1229=Bereits erledigt: +1230=�bertragung: +1231=Bereits erledigt: +1232=Gesamtstatistik +1233=Statistik: Aktueller Prozess +1234= +1235= +1236= +1237= +1238=Zeit: +1239=Betreffende Datei: + +# Dialog box - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG +[173] +0=Copy handler - Nicht genug Speicherplatz +2=Abbr&ch +1097=F&ortsetzen +1100=Wiede&rholen +1127= +1128= +1221=Ben�tigter Speicherplatz: +1222=Verf�gbarer Speicherplatz: +1254= + +# Dialog box - IDD_SHUTDOWN_DIALOG +[182] +0=Copy handler +2=Abbru&ch +1037= +1146=Besch�ftigt1 +1220=Alle Kopier- und Verschiebeaktionen wurde beendet. Versuch das System herunterzufahren wird beginnen in: + +# Dialog box - IDD_CUSTOM_COPY_DIALOG +[149] +0=Parameter Kopieren/Verschieben +1=&OK +2=Abbru&ch +1002=+ Dateien +1004=&L�schen +1008=... +1010=Liste2 +1011=+ Verzeichnis +1014=Filtern +1015=Keine Zielverzeichnisse anlegen - Pfad der Quelldatei wird nicht �bernommen. +1017=Keinen Datei-Inhalte kopieren/verschieben - Nur Anlegen (leer) +1020=Lege Verzeichnisstruktur im Zielverzeichnis an (relativ zum Basisverzeichnis) +1023=Erweiterte Optionen +1024=We&chseln... +1025=+ +1026=- +1065=Liste1 +1178=Drehung1 +1179= +1191=&Import... +1219=Quelldatei/Verzeichnis: +1220=Zielverzeichnis: +1221=Vorgangs-Typ: +1222=Priorit�t: +1223=Anzahl der Kopien: +1224=Puffergr��en: +1225=Standard Optionen +1249= +1250= +1251= +1252= +1253= +1257=&Hilfe + +# Dialog box - IDD_FILTER_DIALOG +[195] +0=Filter Einstellungen +1=&OK +2=Abbru&ch +1150=Inclusive Maske (Getrennt durch vertikale Linien z.B. *.jpg|*.gif) +1151=Filtern nach Gr��e +1155=Drehung1 +1159=Drehung1 +1160=und +1161=Filtern nach Datum +1162=Durch Attribute +1163=Archive +1164=Nur lesen +1165=Versteckt +1166=System +1169=DatumZeitPicker1 +1170=DatumZeitPicker2 +1171=und +1173=DatumZeitPicker1 +1174=DatumZeitPicker2 +1175=Verzeichnis +1177=Exclusive Maske +1219= +1257=&Hilfe + +# Dialog box - IDD_SHORTCUTEDIT_DIALOG +[208] +0=Einstellung Shortcut-Tasten +1=&OK +2=Abbru&ch +1043=&L�schen +1060=&Hinzuf�gen +1064=... +1180=Liste1 +1182= +1185=&Update +1192=Hoch +1193=Runter +1219=Shortcuts: +1220=Name: +1221=Pfad: +1222=Shortcut properties +1257=&Hilfe + +# Dialog box - IDD_RECENTEDIT_DIALOG +[209] +0=Aktueller Pfad +1=&OK +2=Abbru&ch +1043=&L�schen +1060=&Hinzuf�gen +1064=... +1185=&Update +1190=Liste1 +1219=Aktuell benutzter Pfad: +1220=Path +1257=&Hilfe + +# Dialog box - IDD_ABOUTBOX +[100] +0=�ber ... +1=&OK +1199=Copyright (C) 2001-2005 J�zef Starosczyk +1202=http://www.copyhandler.com|http://www.copyhandler.com +1203=http://www.copyhandler.prv.pl|http://www.copyhandler.prv.pl +1204=Hauptdiskussionsforum: +1205=Entwickler' Diskussionsforum: +1206=ixen@copyhandler.com|mailto:ixen@copyhandler.com +1207=support@copyhandler.com|mailto:support@copyhandler.com +1208=Seite|http://groups.yahoo.com/group/copyhandler +1209=Eintragen|mailto:copyhandler-subscribe@yahoogroups.com +1210=Austragen|mailto:copyhandler-unsubscribe@yahoogroups.com +1211=Sende Mail an|mailto:copyhandler@yahoogroups.com +1212=Seite|http://groups.yahoo.com/group/chdev +1213=Eintragen|mailto:chdev-subscribe@yahoogroups.com +1214=Austragen|mailto:chdev-unsubscribe@yahoogroups.com +1215=Sende Mail an|mailto:chdev@yahoogroups.com +1216=Besonderer Dank an: +1217=copyhandler@o2.pl|mailto:copyhandler@o2.pl +1263= +1264= +1265=HomePage: +1266=Kontakt: +1267=Dieses Programm ist Freeware und darf unter Ber�cksichtigung der GNU (General Public License) weitergegeben werden. +1268=Author: +1269=Support: + +# String table +[0] +211=[Program]\r\nEl Magico\t\t\t\t\tgreat ideas, beta-tests, ...\r\n\r\n[Home page]\r\nTomas S. Refsland\t\t\tpage hosting, other help\r\nBarnaba\t\t\t\t\twebmaster\r\n\r\n[Language packs]\r\n%s\r\n\r\n[Additional software]\r\nMarkus Oberhumer & Laszlo Molnar\t\tUPX software\r\nAntonio Tejada Lacaci\t\t\tCFileInfoArray\r\nKeith Rule\t\t\t\tCMemDC\r\nBrett R. Mitchell\t\t\t\tCPropertyListCtrl\r\n\r\n[Other]\r\nThanks for anybody that helped in any way... +5000=Copy Handler +5001=Zeit kritisch +5002=H�chste +5003=�ber Normal +5004=Normal +5005=Unter Normal +5006=Niedrigste +5007=Unt�tig +5008=%s bereits kopiert +5009=(%d) kopiert von %s +5010=Datei nicht gefunden (Existiert nicht) +5011=B +5012=kB +5013=MB +5014=GB +5015=TB +5016=PB +5017=< +5018=<= +5019== +5020=>= +5021=> +6000=Kann die zweite Instanz des Programmes nicht starten. +6001=Library chext.dll wurde erfolgreich registriert +6002=Es ist ein Fehler bei der Libraryregistrierung aufgetreten chext.dll\nError #%lu (%s). +6003=Library chext.dll wurde erfolgreich unregistriert +6004=Es ist ein Fehler bei der Libraryunegistrierung aufgetreten chext.dll\nError #%lu (%s). +6005=Kann html Hilfe Datei nicht �ffnen:\n%s\n +7000=Suche nach Dateien... +7001=Quelldatei/Verzeichnis nicht gefunden (Zwischenablage) : %s +7002=Hinzuf�gen von Datei/Verzeichnis (Zwischenablage) : %s ... +7003=Hinzugef�gtes Verzeichnis %s +7004=Zugriffsverzeichnis %s +7005=Anfrage unterbinden w�rend dem hinzuf�gen von Daten in das Dateifeld (Zugriffsverzeichnisse) +7006=Hinzugef�gte Datei %s +7007=Suche nach Dateien beendet +7008=L�sche Dateien (L�scheDateien)... +7009=W�rend dem l�schen von Dateien, Anfragen unterbindet (L�sche Dateien) +7010=Fehler #%lu (%s) aufgetreten w�rend dem L�schen von Datei/Verzeichnis %s +7011=Datenl�schung beendet +7012=Cancel request while checking result of dialog before opening source file %s (CustomCopyFile) +7013=Error #%lu (%s) while opening source file %s (CustomCopyFile) +7014=Cancel request [error #%lu (%s)] while opening source file %s (CustomCopyFile) +7015=Wait request [error #%lu (%s)] while opening source file %s (CustomCopyFile) +7016=Retrying [error #%lu (%s)] to open source file %s (CustomCopyFile) +7017=Error #%lu (%s) while opening destination file %s (CustomCopyFile) +7018=Retrying [error #%lu (%s)] to open destination file %s (CustomCopyFile) +7019=Cancel request [error #%lu (%s)] while opening destination file %s (CustomCopyFile) +7020=Wait request [error #%lu (%s)] while opening destination file %s (CustomCopyFile) +7021=Error #%lu (%s) while moving file pointers of %s and %s to %I64u +7022=Error #%lu (%s) while restoring (moving to beginning) file pointers of %s and %s +7023=Error #%lu (%s) while setting size of file %s to 0 +7024=Kill request while main copying file %s -> %s +7025=Changing buffer size from [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] to [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu] wile copying %s -> %s (CustomCopyFile) +7026=Error #%lu (%s) while trying to read %d bytes from source file %s (CustomCopyFile) +7027=Error #%lu (%s) while trying to write %d bytes to destination file %s (CustomCopyFile) +7028=Caught exception in CustomCopyFile [last error: #%lu (%s)] (at time %lu) +7029=Processing files/folders (ProcessFiles) +7030=Processing files/folders (ProcessFiles):\r\n\tOnlyCreate: %d\r\n\tBufferSize: [Def:%lu, One:%lu, Two:%lu, CD:%lu, LAN:%lu]\r\n\tFiles/folders count: %lu\r\n\tCopies count: %d\r\n\tIgnore Folders: %d\r\n\tDest path: %s\r\n\tCurrent pass (0-based): %d\r\n\tCurrent index (0-based): %d +7031=Kill request while processing file in ProcessFiles +7032=Error #%lu (%s) while calling MoveFile %s -> %s (ProcessFiles) +7033=Error #%lu (%s) while calling CreateDirectory %s (ProcessFiles) +7034=Finished processing in ProcessFiles +7035=\r\n# Kopiervorgang gestartet #\r\nBeginne Daten abzuarbeiten (tt:mm:jjjj) %02d.%02d.%4d bei %02d:%02d.%02d +7036=Zustand: Warten auf Erlaubnis beendet +7037=Unterbinde Anfrage w�rend auf Erlaubnis gewartet wird (Wartezustand) +7038=Datenprozess abgeschlossen (tt:mm:jjjj) %02d.%02d.%4d bei %02d:%02d.%02d +7039=Erfasste Einw�nde bei ThrdProc [Letzter Fehler: %lu (%s), Typ: %d] +7040=�berpr�fe freien Speicherplatz auf dem Ziellaufwerk... +7041=Nicht genug freier Speicherplatz auf der Festplatte - ben�tigt wird %I64d Bytes f�r Daten, verf�gbar sind: %I64d Bytes. +7042=Abfrage abbrechen w�rend der freie Speicherplatz auf der Festplatte �berpr�ft wird. +7043=Erneut versuchen Speicherplatz von Festplatten auszulesen... +7044=Warnungen bei Kopieraktionen �ber zu niedrigen Speicherplatz auf der Festplatte ignorieren. +7047=Anfrage abbrechen w�rend MoveFileEx %s -> %s aufgerufen werden (ProzessDateien) +8000=Programm +8001=Zwischenablage �berwachen +8002=�berpr�fe Ziwschenablage alle ... [ms] +8003=Starte Programm COPY HANDLER bei Hochfahren des Betriebssystems +8004=Betriebssystem herunterfahren nach Beendigung des Kopiervorganges +8005=Auto-Speichern alle ... [ms] +8006=Verzeichnis f�r tempor�re Dateien +8007=Status Fenster +8008=Statusanzeige alle ... [ms] erneuern +8009=Zeige Details im Status-Fenster +8010=Beendete Vorg�nge automatisch entfernen +8011=Mini-Ansicht +8012=Zeige Dateinamen +8013=Zeige Einzelzugriffe +8014=Erneuere Status alle ... [ms] +8015=Anzeigen bei Programmstart +8016=Wenn leer ausblenden +8017=Kopieren/Verschieben Vorgang +8018=Auto "Rest kopieren" von Dateien +8019=Attribute von Zieldateien festlegen +8020=Datum/Zeit von Zieldateien festlegen +8021="Nur-Lese-Dateien"sch�tzen +8022=Limitierung der maximal Anzahl von parallel laufenden Prozessen... +8023=Zeige grafische Best�tigungs-Dialoge +8024=Benutze zeitgesteuerte Best�tigungsdialoge +8025=Anzeigedauer von Best�tigungsdialogen +8026=Automatische R�cksetzung bei Fehlern +8027=Automatisches R�cksetzen alle ... [ms] +8028=Voreingestellte Prozess Priorot�t +8029=Nur voreingestellten Puffer verwenden +8030=Voreingestellte Puffergr��e +8031=Vor Beendigung des Kopiervorganges keine Dateien l�schen (Verschieben) +8032=Log Datei anlegen +8033=Kl�nge +8034=Kl�nge abspielen +8035=Klang bei Fehlerauftritt +8036=Klang bei Beendigung der Kopieraktion +8037=Sprache +8038=Aktuelle Aufgabengr��e feststellen, bevor blockiert wird. +8039=Pufferung f�r gro�e Dateien abschalten +8040=Minimale Dateigr��e, bei welcher die Pufferung abgeschaltet werden soll +8041=Puffer +8042=Puffergr��e f�r Kopiervorg�nge innerhalb eines Laufwerkes +8043=Puffergr��e f�r Kopiervorg�nge zwischen 2 verschiedenen Laufwerken +8044=Puffergr��e f�r Kopiervorg�nge vom CD-Laufwerk +8045=Puffergr��e f�r Kopiervorg�nge im Netzwerk +8046=Warte ... [ms] bevor der Computer heruntergefahren wird +8047=Wie soll das System heruntergefahren werden +8048=Benutze fein strukturiertere Stausbalken-Anzeige +8049=W�hle Verzeichnis Dialog +8050=Zeige erweiterte Ansicht +8051=Dialogfenster Breite [Pixel] +8052=Dialogfenster H�he [Pixel] +8053=Shortcut Listenstil +8054=Ignoriere zus�tzliche System-Dialoganzeigen +8055=Zeige 'Kopieren' Befehl im drag&drop Men� +8056=Zeige 'Verschieben' Befehl im drag&drop Men� +8057=Zeige 'Kopieren/verschieben spezial' Befehl im drag&drop Men� +8058=Zeige 'Einf�gen' Befehl im Kontext Men� +8059=Zeige 'Einf�gen spezial' Befehl im Kontext Men� +8060=Zeige 'Kopiere nach' Befehl im Kontext Men� +8061=Zeige 'Verschieben nach' Befehl im Kontext Men� +8062=Zeige 'Kopieren/Verschieben spezial nach' Befehl im Kontext Men� +8063=Zeige freien Speicher bei shortcuts' Namen +8064=Zeige Icons mit shortcuts (Experimentell) +8065=Fange drag&drop Operationen durch linke Maustaste ab (Experimentell) +8066=Shortcuts +8067=k�rzlich benutzte Pfade +8068=Shell +8069=Definierter shortcuts' Z�hler +8070=Anzahl der k�rzlich benutzte Pfade +8071=Voreingestellte Aktion bei Festhalten mit linker Maustaste +8072=Priorit�tsklasse der Anwendung +8073=Priorit�tserh�hung abschalten +8074=Nein!Ja +8075=!W�hle tempor�res Verzeichnis +8076=Abgeschaltet!Normal!Heftig +8077=!Klang-Dateien (.wav)|*.wav|| +8079=Normal!Erzwinge +8080=Gro�e Icons!Kleine Icons!Liste!Bericht +8081=Unt�tig!Normal!Hoch!Echtzeit +8082=Kopieren!Verschieben!Spezialoperation!Automatisch +8083=Verzeichnis f�r PlugIns +8084=!W�hle Verzeichnis mit PlugIns +8085=Haupt Log-Datei +8086=Aufzeichnen(loggen) aktivieren +8087=Benutze Log-Datei Gr��en-Limit +8088=Maximum Gr��e der Log-Datei +8089=Benutze pr�zise Begrenzung der Log-Datei +8090=Truncate buffer size +8091=Verzeichnis der Hilfe-Dateien +8092=!W�hle Verzeichnis f�r Hilfe-Dateien +8093=Verzeichnis f�r Sprach-Dateien +8094=!W�hle Verzeichnis mit Sprach-Dateien +9000=(CH) hierher kopieren +9001=(CH) hierher verschieben +9002=(CH) kopieren/verschieben spezial... +9003=(CH) Einf�gen +9004=(CH) Einf�gen spezial... +9005=(CH) Kopiere nach.... +9006=(CH) Verschiebe nach... +9007=(CH) Kopieren/verschieben spezial nach... +9008=Dateien mit Copy Handler hierher kopieren +9009=Dateien mit Copy Handler hierher verschieben +9010=Kopiere/verschiebe Dateien mit zus�tzlichen Einstellungen +9011=F�ge Dateien/Verzeichnisse von der Ziwschenablage hier ein +9012=F�ge Dateien/Verzeichnisse mit zus�tzlichen Einstellungen von der Ziwschenablage hier ein +9013=Kopiere ausgew�hlte Dateien in festgelegtes Verzeichnis +9014=Verschiebe ausgew�hlte Dateien in festgelegtes Verzeichnis +9015=Kopiere/verschiebe ausgew�hlte Dateien mit zus�tzlichen Einstellungen in festgelegtes Verzeichnis +13000=W�hle Pfad +13001=Voreingestellter Name: +13002=Lokaler Name: +13003=Typ: +13004=Netzwerk typ: +13005=Beschreibung: +13006=Freier Speicherplatz: +13007=Kapazit�t: +13008=&OK +13009=Abbru&ch +13010=Kann Verzeichnis nicht anlegen +13011=Ausgew�hlter Pfad existiert nicht +13012=Name +13013=Pfad +13014=Pfad: +13015=>> +13016=<< +13017=Sie haben f�r diesen shortcut keinen Pfad eingetragen +13018=Lege neues Verzeichnis an +13019=Gro�e Icons +13020=Kleine Icons +13021=Liste +13022=Bericht +13023=Details +13024=Hinzuf�gen zu shortcut Liste +13025=Entferne von der shortcut Liste +13026=Dom�ne/Arbeitsgruppe +13027=Server +13028=Geteilter Zugriff +13029=Datei +13030=Gruppe +13031=Netzwerk +13032=Basisverzeichnis +13033=Geteilter Administrationszugriff +13034=Verzeichnis +13035=Baumstruktur +13036=NDS Kontainer +13500=Kopiere... +13501=Verschiebe... +13502=Unbekannter Operationstyp - Dies sollte nicht passieren +13503=Trage Zielpfad ein f�r:\n +14001=Kompilierung: %s +14002=Code= +14003=Version= +14500=Kann mit einer Puffergr��e von 0 nichts durchf�hren +15000=Alle Dateien (*)|*|| +15001=W�hle Zielverzeichnis +15002=Du hast den Zielpfad oder die Quelldatei nicht eingetragen.\nDas Programm kann nicht weitermachen +15003=Kopiere +15004=Verschiebe +15005=Voreingestellt: %s +15006=Eine Festplatte: %s +15007=Zwei Festplatten: %s +15008=CD: %s +15009=LAN: %s +15010=Inklusiv Maske +15011=Gr��e +15012=Datum +15013=Attribute mit eingeschlossen +15014= und +15015=keine +15016=irgendeine +15017=irgendeine +15018=Exklusiv Maske +15019=Attribute ausgeschlossen +15020=keine +15021=Es wurde keine Filteroptionen ausgew�hlt +15022=Alle Dateien (*.*)|*.*|| +15023=Importierte(r) %lu Pfad(e) +16500=Es gibt nicht genug Platz in %s f�r kopieren oder verschieben: +18000=Erstelldatum +18001=Letztes Schreibdatum +18002=Letztes Zugriffdatum +18500=Alles: +20000=Du hast keinen Quell-Text eingetragen +20500=Shortcut Name +20501=Pfad +21000=Kann das Betriebssystem nicht herunterfahren.\nFehler aufgetreten #%lu. +21500=Status +21501=Datei +21502=Nach: +21503=Bearbeitung +21504=Keinen Vorgang gew�hlt +21505=leer +21506=leer +21507=unbekannt +21508=unbekannt +21509=leer +21510=leer +21511=unbekannt +21512=00:00 / 00:00 +21513=erledigt: +21514=Durchschnitt: +21515=Status +21516=Gewechselt:\n%d Prim�rpfad von Zwischenablage erhalten +21517=Gew�hlter Vorgang ist nicht im Pause-Modus +21518=Vorgang nicht gew�hlt +21519=(warte...) +21520= Kopien +21521= Kopien +21522=Suche +21523=kopiere +21524=verschiebe +21525=Beendet +21526=Fehler +21527=Pausiert +21528=l�schen +21529=unbekannt +21530=abgebrochen +21531=Warte +21532=nur Dateien +21533=Ohne Betreff +21534=Fehler #%lu ShellExecute Aufruf f�r Datei %s +21535=Voreingestellt: +21536=Eine Festplatte: +21537=Zwei Festplatten: +21538=CD: +21539=LAN: +21540=Fehler #%errnum (%errdesc) w�rend Dateil�schung %s +21541=Fehler #%errnum (%errdesc) w�rend Versuch die Quelldatei zu �ffnen %s +21542=Fehler #%errnum (%errdesc) w�rend Versuch die Zieldatei %s zu �ffnen. Warscheinlich ist der "nur-lese-Status" gesetzt und 'Schutz: nur-lese-Status' ist in der Konfiguration als aktiv gesetzt (Dadurch kann die Datei zum schreiben nicht ge�ffnet werden). +21543=Fehler #%errnum (%errdesc) w�rend Rucksicherung der (Bewegung zum Anfang) Dateizeiger von %s und %s +21544=Fehler #%errnum (%errdesc) w�rend dem Setzen der Dateigr��e von der Datei %s auf 0 +21545=Fehler #%errnum (%errdesc) w�rend dem Versuch %d Bytes von der Quelldatei %s zu lesen +21546=Fehler #%errnum (%errdesc) w�rend dem Versuch %d Bytes von der Zieldatei %s zu schreiben +21547=Fehler #%errnum (%errdesc) w�rend dem Aufruf von Dateiverschiebung von %s nach %s +21548=Fehler #%errnum (%errdesc) w�ren dem Aufruf von Anlegen des folgenden Verzeichnisses %s +21549=nicht verbunden +21550= [mit Filter] +21551=Gew�hlter Vorgang war noch nicht abgeschlossen.\nM�chtest Du trotzdem beenden ? Index: other/NEW_ENGINE_PROJECT.TXT =================================================================== diff -u --- other/NEW_ENGINE_PROJECT.TXT (revision 0) +++ other/NEW_ENGINE_PROJECT.TXT (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,3 @@ +Potrzebne klasy: +CPath, CBasePath - zarz�dzanie �cie�kami +CPathContainer ? - Index: other/Scripts/BUILD HELP SYSTEM.lnk =================================================================== diff -u Binary files differ Index: other/Scripts/MAKE INST.BAT =================================================================== diff -u --- other/Scripts/MAKE INST.BAT (revision 0) +++ other/Scripts/MAKE INST.BAT (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ +@echo off +echo Copying program, languages and help systems to output directory. +md ..\..\out\prog +md ..\..\out\prog\langs +md ..\..\out\prog\help + +del ..\..\out\prog\*.* /F /Q +del ..\..\out\prog\langs\*.* /F /Q +del ..\..\out\prog\help\*.* /F /Q + +rem copy the program +copy ..\..\bin\release\* ..\..\out\prog\ + +rem copy langs +copy ..\langs\* ..\..\out\prog\langs\ + +rem copy help systems +copy ..\help\compiled\* ..\..\out\prog\help\ + +pause \ No newline at end of file Index: other/Scripts/MAKE LDK.BAT =================================================================== diff -u --- other/Scripts/MAKE LDK.BAT (revision 0) +++ other/Scripts/MAKE LDK.BAT (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,19 @@ +@echo off +md ..\..\out\LDK +md ..\..\out\LDK\res +md ..\..\out\LDK\res\help +del ..\..\out\LDK\*.* /F /Q +del ..\..\out\LDK\res\*.* /F /Q +del ..\..\out\LDK\res\Help\*.* /F /Q + +rem copy the current language +copy ..\Langs\English.lng ..\..\out\LDK\res\program.lng + +rem help files +copy ..\Help\English\* ..\..\out\LDK\res\help\ + +rem build the documentation and copy +hhc "..\SDK\CH SDK.hhp" >nul +copy "..\SDK\CH SDK.chm" ..\..\out\LDK\ + +pause \ No newline at end of file Index: other/TODO.txt =================================================================== diff -u --- other/TODO.txt (revision 0) +++ other/TODO.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,1048 @@ +CURRENT STATS: +- 20566 net code lines (only h, hpp, hxx, c, cpp, cxx files). +************************************************************************************************** +TODO: +- bug: problems with paths longer than MAX_PATH. Allow skipping files. +- bug: problems with saving folder shortcuts ;/ Sometimes they're saved sometimes not. +- BUG: explorer toolbar buttons Copy To & MoveTo does not check the operation type + (at me it does copying and someone reports that it moves) +- BUG: when moving data and in the dst directory some of the files exist and we skip copying + the files then program after moving should not delete the source files that has not + been copied (currently it erases every file in the src dir). +- BUG: some errors (ie. deleting files) does not allow user to skip or sth. +- ADD: when cancelling the task - ask if the user would like to keep the unfinished files. +- ADD: replace the shutdown after finished with executing programs/scripts/commands/... on a specific events (copying finished, copying started, all finished, ...). +- BUG: in custom copy dialog the arrows up/down in the count of copies edit disappears. +- BUG: problems with directories being locked by the program +- MOD: problems with detecting if the mapped drive is network one or local one. +- MOD?: change the file rating from size-based to filedate-based ? +- ADD: additonal options: delete, secure delete. +- MOD: change the way the help is being handled - f1, shift+f1, ... +- MOD: change the way the configuration items are added to the options dialog - they should be autmatically + added , so the registering properties would be the only step needed to view a new config option + - allow headers to be registered too. + - auto adding the config items to the options list +- BUG: program hangs up when trying to pause the task while the feedback dialog is being shown +- ADD: Log strings for main log file +- MOD: optimization of sending cfg property change notifications +- ADD: add new w32 based component as a replacement for lists in status dialog, miniview and options dlg +- ADD: program auto-update +- ADD: profiles handling in options dlg +- ADD: Log file - if the strings should begin with a [ms] +- MOD: change the way data is being kept in CPluginContainer - add the vector (ordering) +- ADD: dialog for managing plugins +- MOD: status i ministatus dialogs redesign. +- MOD: get rid of MFC +- MOD: obs�uga dodatkowych stream�w w NTFS - BackupRead/BackupWrite/BackupSeek(?) +- MOD: je�li rozpoczyna si� nowe zadanie i jest otwarty du�y status i nie jest zaznaczone �adne zadanie, + to nowe zadanie ma si� zaznaczy�. +- ADD: pe�na obs�uga windowego ctrl+z +- MOD: konfigurowalne nazwy nast�pnych kopii plik�w (czyli np. 'kopia (%c) %p') +- ADD: opcja cofania o bufor przy dokopiowywaniu (jak w SRECopy) +- ADD?MOD - optymalizacja dost�pu do no�nik�w danych (je�li co� korzysta z cd'ka, to inny w�tek nie powinien). +- ADVANCED: spr�bowa� zaimplementowa� samo 'core' kopiowania jako interfejs dost�pny z ka�dej aplikacji. + Trzeba si� zastanowi�, czy dialogi potwierdze� powinny si� pojawia� wewn�trz dllki z interfejsem, czy + w programie. To samo dotyczy dialog�w kopiowania... ??? + OG�LNE ZA�O�ENIA: + - ma umo�liwia� kopiowanie ca�ego dysku (np. kopiuj dysk C:\ na E:\ co spowoduje skopiowanie wszystkiego + z c na e) + - obs�uga wielku �cie�ek docelowych - kolejno/r�wnocze�nie + - ftp/net support - download/upload + - multistream read/write (konfigurowalna ilo�� stream�w)+multisource reading (wiele kopii tego samego �r�d�a) + - obs�uga skr�t�w + - pobieranie maksymalnej ilo�ci informacji ju� z dll'ki + - zaznaczanie (flag�) plik�w, kt�re z pewnych wzgl�d�w nie zosta�y przetworzone (do wykorzystania przy + ko�cowym kasowaniu/tworzeniu raportu) + - automatyczna korekacja wielko�ci pliku podczas kopiowania (z aktualizacj� wszystkich licznik�w) + - synchronizacja dw�ch lub wi�cej folder�w (jedno- lub wielostronnie) + - command-line/script support + - ograniczenie transferu + - zmiana �cie�ek �r�d�owych w locie + - rozpocz�cie przetwarzania ju� w momencie otrzymania cz�stkowych danych o operacji - np. wyszukiwanie + plik�w w momencie otrzymania pierwszej �cie�ki �r�d�owej) + - wy�adowanie danych po zako�czeniu operacji + - mo�liwo�� weryfikacji skopiowanych danych + - swobodna regulacja wielko�ci bufor�w w locie (w zale�no�ci od aktualnie przetwarzanej �cie�ki + �r�d�owej/docelowej) + - konkretne operacje (kopiowanie/przenoszenie/synchronizacja) tworzone na bazie skryptowej np. przenoszenie + = wyszukiwanie+kopiowanie+usuwanie + - ograniczenie ilo�ci jednocze�nie wykonywanych zada� (z mo�liwo�ci� prze��czenia aktywnego zadania + /niezale�nego wznowienia) + - rejestrowanie callback�w - info o zmianach status�w zada� (pojedynczych/zbiorowych) + - identyfikacja wolumin�w �r�d�owych przez jaki� rodzaj identyfikatora + - opcja wype�niania b��dnych obszar�w pliku np. zerami (je�li napotkano np. bad sektor) + - bezpieczna obs�uga save-state'�w - kody CRC (przeciwdzia�anie wychrzanianiu si� podczas �adowania save'a) + - konfigurowanie domy�lnej akcji dla kopiowa� +- ADD: jesli zabraknie miejsca na kopiowane pliki - ma sie pojawiac opcja zmiany folderu docelowego. +- CHANGE: spr�bowa� zmieni� wszystkie dialogi wyboru folderu na ten "porz�dny" +- VISUAL APPEARANCE: przeprowadzi� do�� radykalne zmiany wygl�du CStatusDlg - aktualnie jest do wy�wietlenia + za du�o danych, za� na dialogu jest za ma�o miejsca. Zmieni� widok zaawansowanych albo poprzez dorzucenie + tooltip�w do aktualnie istniej�cych kontrolek (�atwiejsze, ale zdecydowanie gorszy efekt), lub zamieni� + ca�� praw� stron� okna w jedn� wielk� w pe�ni konfigurowaln� list� (CListCtrl), kt�ra b�dzie wy�wietla� + tylko to, czego b�dize �yczy� sobie u�ytkownik (co� a'la w�a�ciwo�ci w Delphi ?) + - advanced view po prawej stronie bazowany na clistview lub czym� podobnym + - kolumny w CListView po lewej stronie statusu w pe�ni konfigurowalne +- FEATURE EXPAND: miniview zawiera na razie jedynie minimum danych - dane dodatkowe typu transfer, ..., + powinny zosta� pokazane w tooltipie(w pe�ni konfigurowalnym) od�wie�aj�cym si� razem z ca�ym miniview. +- ADV. FEATURE - u�ywanie skrypt�w do kopiowania, ew. obs�uga z linii polece�... +- FEATURE: uwzglednianie wszystkich zadan(tych z listy) przy obliczaniu miejsca wolnego. +- FEATURE: wykrywanie nowych wersji CH'a, auto-update +- FEATURE: linki w aboutboxie maj� by� linkami... +- FEATURE: je�li mo�liwe - zmieni� obs�ug� na unikod +- NEW FEATURE: obs�uga ftp'a ? +- BUG: podczas przenoszenia po sieci r�wnie� mo�na u�ywa� MoveFile (nie tylko lokalnie) - jak + okre�li� ? +- ADVANCED: kopiowanie b.malych plikow w b.duzych ilosciach trwa b.dlugo. gdyby udalo sie przetwarzac dane + na niskim poziomie (aby zachowac transfer nominalny dysku) byloby lepiej. + +DONE: +- poprawi� wy�wietlanie nazwy pliku �r�d�owego i �cie�ki docelowej na tzw. ellipsis + (tak aby by�y widoczne pocz�tki i ko�ce �cie�ki - patrz help lub codeguru-static controls) +- napisa� usuwanie folder�w dla ST_MOVE +- roz�o�y� ThrdProc na co� mniejszego - �atwiejszego do analizy +- napisa� kawa�ek kodu kopiuj�cego atrybuty pliku/folderu �r�d�owego +- napisa� obs�ug� b��d�w +- zmieni� obs�ug� CConfig - nie odczytywa� warto�ci za ka�dym razem z pliku +- zmiana w configu i nie tylko - interwa�y podawa� w ms zamiast w s +- przerobi� okno statusu na mniejsze z przyciskiem rozszerzaj�cym dialog o praw� stron� +- pokazywanie ilo�ci skopiowanych/przeniesionych megabajt�w (ile zosta�o) +- zabezpieczy� program przed wielokrotnym poklazywaniem okna statusu +- zmieni� texty operacji np. na Kopiowanie - b��d +- niech po�o�enie okna statusu b�dzie sta�e - w prawym dolnym rogu ekranu +- zabezpieczy� program przed uruchamianiem jego wielu kopii na jednym komputerze +- zaimplementowa� obs�ug� Auto-retry +- zoptymalizowa� wy�wietlanie post�pu w CStatusDlg - migotanie, CStaticFilespec 2krotnie zmienia + stan +- uwzgl�dni� przenoszenie w obr�bie jednej partycji - omin�� niepotrzebne wyszukiwanie, MoveFile, ... +- wrzuci� do ka�dego CTaska oznaczenie, z jakich dysk�w logicznych (a co za tym idzie r�wnie� + fizycznych) korzysta dane kopiowanie +- je�li plik zosta� ju� skopiowany (i zosta�y zmienione jego atrybuty (pliku docelowego)) + i nast�puje pr�ba ponownego kopiowania - na plik ze zmienionymi atrybutami (np. Read only) + pliki nie maj� by� nawet otwierane. +- FLAGA W KONFIGURACJI - je�li u�ytkownik chce (flaga) nale�y odtworzy� d�wi�k po zako�czeniu + kopiowania (string) i przy wyst�pieniu b��du +- FLAGA W KONFIGURACJI - czy chroni� pliki z atrybutami read-only przed usuni�ciem i nadpisaniem + (odno�nie SetFileAttributes przed skasowaniem pliku, przed kopiowaniem pliku) +- obs�uga auto-complete files w CustomCopy - tylko na �yczenie - FLAGA W KONFIGURACJI +- dodatkowa FLAGA W KONFIGURACJI oznaczaj�ca potrzeb� ustawiania atrybut�w +- zaimplementowa� ustawianie czasu dla skopiowanego w�a�nie pliku (dla katalogu si� nie da) + wg czasu �r�d�owego pliku - dodatkowa FLAGA W KONFIGURACJI okre�laj�ca konieczno�� kopiowania tych + atrybut�w +- spos�b na implementacj� 8/10 funkcji - (pauza/wzn�w, anuluj, usu�, restart) dla zaznaczenia + i wszystkich +- auto-retry nie powinno wznawia� zako�czonych element�w +- do poni�szego - zabezpieczy� przed wywalaniem si� programu - je�li wywalany element jest w�a�nie + zaznaczony w StatusDlg/listctrl i nast�pi par� innych czynnik�w - program si� wysypuje. + Dok�adnie w ApplyButtonsState, ... +- wywali� automatyczne wywalanie zako�czonych zada� z CStatusDlg - przenie�� do CMainFrame - + tylko na wyra�ne �yczenie u�ytkownika - FLAGA W KONFIGURACJI +- w tooltipie w trayu ma si� pojawia� og�lny post�p - tak samo jak w nag��wku okna statusu +- w onpopupshowstatus krzaczy si�, je�li podczas wy��czania aplikacji jest pokazane okno statusu +- porz�dna obs�uga CListCtrl - klikni�cie na danym elemencie nie b�dzie powodowa�o zaznaczenia + tylko na chwil�, obs�uga przycisk�w up/down, spacja (pause/resume), delete (delete) - + klawiatura +- w CListCtrl doda� (zamiast LP) "ikonki" oznaczaj�ce stan danego itemu (pauza, b��d, + processing, ...) +- zmieni� size'owanie dialogu statusu na zale�ne od wielko�ci czcionki +- do�o�y� edycj� konfiguracji z automatycznym od�wie�eniem (po zmianie ustawienia program ma + korzysta� z nowych ustawie�) - implementowa� auto restart programu po uruchomieniu + systemu (rejestr, okre�lenie �cie�ki do programu) +- zmniejszy� ilo�� danych przechowywanych w pami�ci podczas dzia�ania programu - relPath +- sprawdzi�, jak wygl�da sprawa transferu kompresji kompresji w stosunku do ci�gni�cia po sieci + - nie op�aca si� - dla filmu wsp. kompresji wynosi ok.99%, wi�c overhead spowodowany kompresj� + i dekompresj� jest zbyt du�y i nie op�aca si� (dla innych plik�w mo�e by� inaczej, ale to + zn�w oznacza dodatkowy overhead na wykrywanie rozszerze� plik�w, kt�re nadaj� si� do kompresji + , program zwi�ksza swoj� obj�to�� - konieczno�� obs�ugi sieci - TCP/IP, jest bardziej + zawodny...) +- poprawi� tzw open shared files +- w zwi�zku ze zmian� current indexu po zako�czonym kopiowaniu na wielko�� tablicy z plikami + poprawi� DeleteFiles tak, aby nie chrzani�a si� - aktualnie korzysta z current indexu + jako pierwszego elementu do usuni�cia +- poprawi� z�e zliczanie wielko�ci - foldery maj� wielko�� +- zrobi� co� z OnCopyData +- podczas kreacji MainFrame'a zarejestrowa� klas� okna z okre�lon� nazw� + - aby pewniej identyfikowa� okno +- autorejestracja .dll podczas uruchomienia (zapis do rejestru + HKCU\JFS Application Factory\Copy Handler\Registered=1 je�li zarejestrowano) +- dodatkowe komendy do shell context menu i drag&drop context menu - napisa� bibliotek� DLL + (tzw. in-process server) +- dodatkowy licznik czasu og�lnego i pozosta�ego +- poprawi�: je�li item w li�cie zada� traci focus, a po d�u�szej chwili go odzyskuje - transfer + mo�e si�ga� bardzo wysoko (kilkaset MB/s) - poprawi� aby wy�wietla� 0 +- po reloadzie danych z plik�w - powinny by� odczytywane r�wnie� ostatnie po�o�enia post�pu +- je�li transfer po pobraniu focusu przez item w li�cie zada� wynosi 0 - zmie� go na �redni + transfer, kt�ry wyst�powa� do tej pory (estetyka) +- b��d zliczania wielko�ci (podczas odczytu danych z pliku progressu nie jest update'owana + zmienna m_uhPosition w CTaskArray) +- poprawi� b��d wyst�puj�cy przy zamykaniu programu (mo�e procedura okna (AfxWndProc) ma co� + wsp�lnego +- poprawi� usuwanie zako�czonych zada� z listy nie usuwa wszystkich od razu (dziwne) + - dodatkowo wyst�puje Access Violation, je�li podczas usuwania wszystkich zako�czonych + by� zaznaczony jaki� element z listy (pojedyncze usuwanie tego nie powoduje) +- BUG: program wywali� si� raz przy usuwaniu element�w z listctrl w status dialogu - dok�adnie w + procedurze obs�ugi OnTimer, przy ApplyButtonsState - przy GetStatus - klasa CTask zosta�a + usuni�ta - poprawi� - wstawi� TRACE na we i wy OnTimer w StatusDlg i w CMainFrame na usuwanie + automatyczne element�w z tablicy (chyba te� timer) i zobaczy�, czy nachodz� na siebie - je�li + tak, zastosowa� blokowanie (jaki� bool ?), je�li nie - problem znika (sprawdzono - ok) +- wymy�li� co�, aby na zmian� selekcji w status li�cie natychmiast od�wie�a� si� status + - aktualnie od�wie�a si� co okre�lony interwa� oraz na l-click +- poprawi� zapis konfiguracji na "od razu" - inaczej na sypni�cie si� systemu konfiguracja + nie jest zapisywana +- dodatek - malutkie okno wywo�ywane z poziomu okna statusu (zamiast zmiany ikony w tray'u + na pasek post�pu oraz zamiast - oznaczy� sygna�ami wizualnymi rozpocz�cie i zako�czenie + kopiowania) + - pokazuj�ce progress bar dla ka�dego kopiowania (odpowiednim kolorem) oraz progress + dla wszystkiego + - OPCJE KONFIGURACJI - [mini view] - show filenames, show single tasks, + display refresh interval +- przer�bka miniview tak, aby nie u�ywa�o kontrolek CProgressCtrl (rysowanie r�czne) +- OPCJA konfiguracji - ograniczenie ilo�ci kopiowanych element�w +- zmieni� cmainframe tak, aby pokazywa� tylko jedno okno miniview +- przerobi� funkcje kontroluj�ce w�tek z CTask tak, aby nie nast�powa�o w nich zerowanie + - powinno si� ono odbywa� w w�tku (za tzw. oczekiwaniem) +- doda� dodatkowy kolor itemu w StatusDlg (np. szary) dla oczekiwania (niebieski) +- OPCJA konfiguracji - shutdown after copying all (sprawdzi�, czy ilo�� aktualnie przetwarzanych + operacji w ctaskarray != 0 oraz czy nie ma ju� operacji ze statusem ST_WAITING - je�li te + warunki s� spe�nione - wy��czamy sprz�t + (wymy�li� co� z ST_ERROR ??? - aktualnie poza kolejno�ci� - je�li error + - system zostanie wy��czony) +- poprawi� - je�li u�ytkownik zapu�ci kopiowanie, ale nie w��czy status dialogu - nie jest + od�wie�any czas kopiowania (i tym samym og�lny transfer) +- wy��czy� mo�liwo�� rezise'u miniview +- FLAGA - auto show miniview (po w��czeniu programu) +- FLAGA - autoukrywanie miniview je�li nie ma nic ciekawego do pokazania +- program zakleszcza si� na sekcji krytycznej - w�tek koliduje z funkcj� CMainFrame usuwaj�c� + zako�czone zadania - w�tek ustawia flag� zako�czenia, cmainframe wykrywaj�c zako�czenie + pr�buje zako�czy� w�tek i wszystko si� blokuje +- tymczasowo w cmainframe w oncopydata dorzuci� informowanie o otrzymanych z dll'ki pustych + stringach +- wywali� TEMP command z menu trayowego +- quick access listbox ma by� wype�niany danymi z quick acces file.ini z folderu, gdzie jest + uruchamiany program, lub z c:\windows ? +- zapis quick data na wyj�cie z formy CFolderDlg +- przer�bka okna wyboru folderu na 'bardzej' - do�o�y� dodatkowe "zak�adki" (domy�lne "filmy", + "instalki", ...), always on top, w nag��wku - list plik�w +- dodatek - okno dialogowe w kt�rym mo�na poda� �cie�k� �r�d�ow� i docelow� jako stringi + a nie tylko z explorera. Je�li oka�e si�, �e mo�na programu u�ywa� do ci�gni�cia + z NET'u - rozbudowa� dialog obs�uguj�cy, oraz napisa� co�, co pozwala� b�dzie ci�gn�� + pliki z NET'u wielostrumieniowo. Je�li *nie* - to nie. +- przechwytywanie ctrl-v, r-drag, i innych tego typu w explorerze - przekierowane do copy handlera + NIE MA PO CO - u�ytkownik musi mie� mo�liwo�� wyboru kopiowiania - explorer lub CH +- ulepszy� aboutbox'a +- uzupe�ni� dialog r�cznego podawania danych tak, aby akceptowa� maski plik�w, i wiele innych ... +- kopiowanie/przenoszenie z mask� (np. *.jpg), w�asciwie to chodzi o kopiownie 'specjalne' z duza + iloscia opcji :) - poprawka w onCopyData w CMainFrame - przechwyci� rodzaj kopiowania. + Je�li 'specjalne' - wy�wietl uzupe�niony dialog r�cznego podawania danych. +- GetSnapshot ma pobiera� r�wnie� mask� +- modyfikacja CCustomCopyDlg tak, aby uwzgl�dnia�o chceckboxy opcji specjalnych + ustawianie flag + specjalnych przy wychodzeniu z CCustomCopyDlg + modyfikacja string�w okre�laj�cych rodzaj + kopiowania +- dodatek - implementacja kopiowania danych do jednego folderu (modyfikacja przy okreslaniu + sciezki docelowej dla danego pliku - ju� podczas w�a�ciwego kopiowania - chyba w ProcessFiles) +- dodatek - implementacja kopiowania pustych plik�w - modyfikacja CustomCopyFile - kopiowanie + zawartosci tylko je�li flaga nie b�dzie podana +- usuwanie plik�w przy przenoszeniu ma by� realizowane w trakcie kopiowania (lub nie, je�li podamy + odpowiedni� flag�) +- wychrzania si� miniviewdlg podczas wychodzenia z programu - CMainFrame ju� nie istnieje, wiele + innych element�w te�, a podczas wychodzenia z tzw. Modal Loop nast�puje wychrzanienie - + spr�bowa� modeless dialogs +- poprawi� chrzani�c� si� czcionk� w CPropertyListCtrl - doda� Init (niekt�re np. OnCreate nie + s� w og�le wywo�ywane) +- zabezpieczy� modeless dialogs przed wielokrotnym w��czaniem (np. 30 okien statusu) +- zmieni� nieco tekst okre�laj�cy operacj� tak, aby wy�wietla� mask� +- dodatkowy przycisk ADVANCED - z list� funkcji zaawansowanych - zamiana cz�ci (np. pocz�tk�w) + �cie�ek �r�d�owych na inne stringi - np. je�li zmieni�a si� nazwa udzia�u siecowego w czasie + kopiowania nale�y zmieni� we wszystkich znalezionych plikach kawa�ek �cie�ki kt�ry okre�la + udzia� +- wy��czanie programu przy w��czonym oknie specjalnego kopiowania chrzani si� - parent skasowany + a dialog pr�buje wywo�a� CFrameWnd::OnCopyData +- upewni� si�, �e wszystkie wy�wietlane dialogi s� wy�wietlane na wierzchu wszystkich okien + bez stylu wndtopmost (za wyj�tkiem jednego) - chodzi zw�aszcza o dialog specjalnego kopiowania +- przerobi� okno miniview tak, aby nie miga�o przy w��czaniu, je�li pokazywanie nie jest potrzebne +- w zwi�zku z poprzedni� poprawk� pojawi� si� problem braku wndTopMost w przypadku pojawiania si� + okna miniview za spraw� pojawienia si� dodatkowych wpis�w w tablicy task�w (np.dane + z explorera) - poprawi� +beta4: +- czasem co� si� chrzani przy kopiowaniu danych (puste �cie�ki) + - poprawiono b��d CopyHandlerShellExt.dll - dane pobierane ze schowka (oraz z IDataObject) + by�y przesy�ane bez ko�cz�cego znaku '\0', przez co niekt�re kopiowania chrzani�y si� (puste + pliki) +- poprawiono w dll-ce wpisy do rejestru - aktualnie dll-ka jest rejestrowana pod 'Folder'-em, co + - pozwala u�ywa� opcji kopiowania r�wnie� dla moich dokument�w i innych specjalnych folder�w +beta 5: +- NEW FEATURE: dokopiowywanie powinno sprawdza� dat� pliku �r�d�owego i docelowego ???: + +===================+========================================+===================================+==============================+==============================+ + | WE | WY | 0 | 1 | 2 | + +-------------------+----------------------------------------+-----------------------------------+------------------------------+------------------------------+ +* |brak (folder/plik) | brak | b��d |Pomi�/czekaj/pon�w pr�b�* |Pomi�/czekaj/pon�w pr�b�* | + |brak (folder) | jest | pomi� |pomi� |pomi� | +* |brak (plik) | jest (odpowiada zapami�tanemu stanowi) | pomi� |pomi� |pomi�/kopiuj od nowa | +* |brak (plik) | jest (r�ne od zapami�tanego stanu) | b��d |pomi�/czekaj/pon�w pr�b�* |pomi�/czekaj/pon�w pr�b�* | +* |jest (folder/plik) | brak | kopiuj od nowa |kopiuj od nowa |kopiuj od nowa | + |jest (folder) | jest | pomi� |pomi� |pomi� | +* |jest (plik) | jest (odpowiada zapami�tanemu stanowi) | pomi� |pomi� |pomi�/kopiuj od nowa | +* |jest (plik) | jest (mniejszy od zapami�tanego stanu) | dokopiuj (kopiuj od nowa - flaga) |dokopiuj/pomi�/kopiuj od nowa*|dokopiuj/pomi�/kopiuj od nowa*| +* |jest (plik) | jest (wi�kszy od zapami�tanego stanu) | kopiuj od nowa |kopiuj od nowa |pomi�/kopiuj od nowa | + +===================+========================================+===================================+==============================+==============================+ + - rozbudowa� flag� wizualnych potwierdze� (nie zaimplementowan�) tak, aby akceptowa�a trzy + stopnie szczeg�owo�ci (ok) + - dodatkowe dwie FLAGI - czy dialogi potwierdze� maj� wybiera� okre�lon� opcj� po pewnym + czasie (bool) i odpowiednio czas oczekiwania (UINT) (ok) + - utworzy� dialog odpowiedzialny za wy�wietlanie potwierdze�: + - Pomi�/Pomi� wszystkie/czekaj/pon�w pr�b� (ok) + - dokopiuj/dokopiuj wszystkie/pomi�/pomi� wszystkie/kopiuj od nowa/kopiuj od nowa (wszystkie) (ok) + - pomi�/pomi� wszystkie/kopiuj od nowa/kopiuj od nowa (wszystkie) (ok) + - zastanowi� si� nad implementacj� Kopiuj od nowa wszystko, ... wszystko - czy b�dzie to flaga + wewn�trz CTask'a (*tak*) (i czy ew. b�dzie zapisywana (*nie*)), mo�e tylko lokalna flaga + dotycz�ca tylko aktualnego uruchomienia programu +- BUG: Czas wykonywania operacji przy >kilku operacjach jest pokazywany �le (warto�ci ujemne oraz + obejmuj�ce conajmniej par� lat (np 17000 dni) - pow�d - po przechwyceniu wyj�tku jest + wykonywany update czasu bez rozpatrywania, czy powinien by� wykonany +- BUG: ka�dy dialog u�ywa jednego identyfikatora timera - sprawdzi�, czy nie b�d� ze sob� + kolidowa� (prawdopodobnie b�d�) - nie chrzani� si� (dziwne) - na razie dzia�aj� +- BUG: oczekiwanie nie spe�nia ca�kowicie wymaga� - zajmuje za du�o czasu procesora (ka�de + oczekiwanie to w�tek, kt�ry u�ywa czasu (wprowadzono wi�c op�nienie 100 ms mi�dzy + sprawdzeniami flagi kill) - transfer mo�e spa�� np. 10-krotnie) i nie jest niezawodne - dla + ograniczenia do 1 kopiowania w��czaj� si� czasem 2. Poza tym bardzo cz�sto �aden nie chce si� + za��czy� (???). (poprawiono) +- BUG: zmiana opcji konfiguracji dot. usuwania zako�czonych zada� oraz tzw. autoretry on error + dzia�a dopiero po restarcie programu +- PERFORMANCE FIX: obs�uga wpisywania danych do CProgressListBox'a ma si� odbywa� na wska�nikach do + struktur danych, zamiast przepisywania za ka�dym razem danych ze struktury do tablicy +- FEATURE: do�o�y� w miniview troch� przycisk�w kontroluj�cych - pauza, resume, ... +beta6: +- ADDITION: doda� obs�ug� pause all, resume all, ... w miniview +- FEATURE: dopisa� klas� obs�uguj�c� bufor u�ywany do kopiowania (z operatorem void*, + unsigned char*, ...) tak, aby mo�na by�o bez problemu zmienia� typ alokacji (np. na + VirtualAlloc) +- PERFORMANCE FIX: poprawi� GetFileName i GetFileRoot w CFileInfo tak, aby nie wywo�ywa� dwa razy + _tsplitpath. +- CHANGE: zmiana wielko�ci bufora dla danego taska nie ma powodowa� bezsensownego wpisywania + warto�ci nowego bufora do edit'a w szczeg�ach okna statusu - ma by� od�wie�one po zmianie + tak, aby b��d podczas realokowania bufora (i tym samym jego odtworzenie do poprzedniej + warto�ci, lub alokowanie bezpiecznej warto�ci 64kB) powodowa� pokazanie prawid�owej warto�ci +- PERFORMANCE FIX: wywali� zb�dne resource - menu, string table, accel table +- USER EXPERIENCE: podczas kopiowania w CStatusDlg pokazuje si� chwilowy transfer - warto�� + transferu nie jest dok�adna - pomi�dzy kolejnymi update'ami nie jest mierzony czas, a jedynie + pobierana jest warto�� op�nienia timera od�wie�aj�cego - poprawi� +beta7: +- VISUAL APPEARANCE: wywali� 'Schowek' jako okre�lenie pliku (ok) +- BUG: u�ycie CFileInfo::Exist poci�gn�o za sob� brak wykrywania dysk�w - brak folderu dla c:\ + poprawi� (ok) +- OPTIMIZATION: zmieni� spos�b zapisu danych (nie progressu) w pami�ci (i jednocze�nie w pliku) + aktualnie dla ka�dego pojedynczego pliku zapisywana jest pe�na �cie�ka dost�pu (co przy + kopiowaniu 1000 plik�w spod �cie�ki c:\program files oznacza strat� ok.15kB miejsca). Zmieni� + tak, aby ka�dy plik zapisany w tablicy plik�w mia� odno�nik do �cie�ki znajduj�cej si� + w m_clipboard (ZMIANA FORMATU PLIK�W ATP i ATD). + - zmieni� sk�ad klas CFileInfo, CFileInfoArray, dopisa� CClipboardEntry i CClipboardArray (ok) + - dopisa� funkcj� wyszukuj�c� dla danego katalogu lub pliku substytut (zamienn� nazw� - np. + dla c:\windows -> c:\ zmieniamy 'windows' na np. 'kopia windows' lub co� w tym stylu) (ok) + - dopisa� w CFileInfo funkcj� GetDstPath(LPCTSTR dstFolder, iCopy) generuj�c� stringa z nazw� + elementu docelowego (do u�ycia bezpo�rednio w CreateFile) (ok) + - implementacja obs�ugi m_ucCurrentCopy w CTasku - CalcSize, CalcProcessed maj� zwraca� + odpowiednie warto�ci (powi�kszone o aktualn� ilo�� wykonanych ju� kopii), ilo�� plik�w + nie ma by� mno�ona + +FEATURE: kopiowanie w to samo miejsce ma zmienia� nazw� na Kopia (tylko przy drag&dropie?)+ + +FEATURE: dodatkowa opcja specjalnego kopiowania - robienie kilku kopii �r�d�a w miejscu + docelowym: + - doda� unsigned char'a w CTask'u oznaczaj�cego ilo�� kopii do wykonania (standardowo 1, + mo�na zmieni� w ccustomcopydlg) (+Store/Load w sekcji danych) (ok.) + - edit w oknie ccustomcopy okre�laj�ce ilo�� kopii + implementacja wpisu do ctask'a (ok) + - implementacja getstatusstring i getsnapshot w ctask'u tak, aby przy wi�kszej ilo�ci + kopii (>1) pokazywa�y odpowiedni string. (ok) +- SMALL BUG: podczas kopiowania plik�w bez zawarto�ci nie jest update'owany licznik wielko�ci + plik�w +- FEATURE: je�li podczas kopiowania naci�niemy pauz�, po czym wznowimy taska, oraz jest w��czona + opcja wizualnych potwierdze� b�dziemy zapytani o kontynuacj�. Nale�y to naprawi� poprzez + zapami�tanie indeksu pliku podczas w��czania pauzy i je�li b�dziemy rozpatrywa� dany index + to pomijamy wszelkie okna kopiowania (po restarcie programu pytanie b�dzie si� pojawia�). +- SMALL BUG: podczas sprawdzania atrybut�w pliku docelowego (aby por�wna� ze �r�d�owymi) nast�puje + b��dne odczytanie atrybut�w (na =0), przez co por�wnanie wypada niepomy�lnie i plik jest + kopiowany od nowa (g�upota - najpierw s� kasowane atrybuty, a p�niej odczytywane) +- GREAT BUG (tylko wersja Release): podczas kopiowania w konfiguracji Release (w Debugu nie !!!) + nast�puje b��dne kopiowanie plik�w (w te�cie kopiowania plik�w o wielko�ci 1B pliki docelowe + by�y puste). Prawdopodobnie ma to r�wnie� zwi�zek z b��dnym wy�wietlaniem transferu + i wielko�ci� danych wej�ciowych w stosunku do oczekiwanych (kopiowanie zako�czy�o si� + dok�adnie na 2500 %) - SIMPLE SOLUTION: okaza�o si�, �e program nie sprawdza�, czy pr�ba + pobrania danych dotycz�cych pliku wyj�ciowego (og�lnie czy istnieje) zako�czy�a si� sukcesem + Je�li nie zako�czy�a si� sukcesem - opis pliku zawiera� przypadkowe dane (m.in. wielko�� na + podstawie kt�rej program pr�bowa� przenie�� wska�nik pliku do jakiej� kosmicznej warto�ci) +- FEATURE: dorzuci� LOGI - lista dzia�a� podj�tych podczas kopiowania plik�w - nazwa taka jak + dla plik�w .atp i .atd, tylko z rozszerzeniem .log (lub .txt) + - dodatkowa opcja - tworzenie log�w + - dodatkowa opcja w CStatusDlg - ViewLogFile (pewnie gdzie� w szczeg�ach jako button) +- SMALL BUG: je�li program podczas kopiowania napotka ju� plik i zdecyduje si� go dokopiowa� + przesuwa wska�niki plik�w �r�d�owego i docelowego do warto�ci 'wielko�� pliku docelowego'. + Seek odbywa si� tylko na warto�ciach 32-bitowych, co ogranicza wielko�� pomini�tego kawa�ka + do 2GB - poprawi� na pe�n� 64-bitow� obs�ug�. +- APPEARANCE: po naci�ni�ciu w statusDlg jednego z przycisk�w pauza, wznowienie, ... nale�y + natychmiast od�wie�y� list� zada�, tak samo jak podczas usuwania zako�czonych zada�, + aby nikomu nie przysz�o do g�owy naciska� jakiego� przycisku i natychmiast innego tak aby + wychrzani� program +- VISUAL APPEARANCE: okre�lanie post�pu procentowego przy braku jakiejkolwiek wielko�ci + (size all == 0), lub przy tworzeniu pustych plik�w wyj�ciowych powinno okre�la� post�p + na podstawie indexu (a nie jak do tej pory albo ustawiano na 0 % albo na podstawie + wielko�ci plik�w wej�ciowych (II przypadek)) - niestety przerobienie wy�wietlania procent�w + dla ca�o�ci mija si� nieco z celem. Aby to zrobi�, za ka�dym sprawdzeniem procent�w trzebaby + przeszuka� wszystkie zadania z listy, sprawdzi� w ka�dym stopie� zaawansowania w stosunku + do innych zada�, ... co niepotrzebnie obci��y�oby procesor - mo�e kiedy� ... +- BUG ? - podczas kopiowania po sieci w oknie statusu w transferze pojawia si� co jaki� czas + co� w stylu 1#.J (lub co� podobnego) - DZIELENIE double PRZEZ 0 daje takie rezultaty +beta 8: +- SMALL BUG: podczas wyst�pienia b��du pokazywane jest operacja zako�czona pomy�lnie, + czy�by GetLastError() kasowa� kod b��du po pierwszym wywo�aniu i ka�de nast�pne + zwraca 0 ? (nie - OTF ze swoim CreateFile i SetFilePointer zmianiaj�) +- VISUAL APPEARANCE: okre�lanie chwilowego transferu powinno by� dok�adniejsze. Aktualnie jest + sprawdzany co okre�lony w opcjach interwa� czasu, ale r�nica czasu pomi�dzy ostatnim + od�wie�eniem statusu a aktualnym jest podawana w sekundach (za� w opcjach podaje si� + milisekundy), wi�c mo�e wynosi� 0. W takim przypdaku pobierany jest czas z opcji i przeliczany + transfer (przewa�nie �le, poniewa� mo�na poda� 1 ms op�nienia a w rzeczywisto�ci + minie np. 55 ms przez co wyliczony transfer wzro�nie 55 razy) - przerzuci� obliczanie + interwa�u na GetTickCount() zamiast time() (w milisekundach) +- SMALL BUG: Od�wie�anie statusu w StatusDlg odbywa si� przypadkowo za cz�sto (mo�e ma na to wp�yw + message wysy�any z ListView, kt�ry powoduje automatyczne od�wie�enie) - w�a�ciwie listview + nie mia� z tym nic wsp�lnego - winne by�y dwie opcje: automatyczne wznawianie i automatyczne + usuwanie zako�czonych, kt�re to wysy�a�y do StatusDlg message o update statusu - niestety + w przypadku Automatycznego usuwania nie by�o sprawdzane, czy co� usuni�to, a w przypadku + wznawiania - trzeba by�o do�o�y� parametr okre�laj�cy, czy wznawia� tylko itemy z b��dem + czy te� wszystkie mo�liwe. +beta 8a: +- BUG ?: Pojawi�y si� sygna�y, �e pod systemem Windows 98 nie dzia�a poprawnie dialog wyboru + folderu docelowego (a poza tym i tak nie jest w pe�ni sprawne - np. podanie adresu sieciowego + nie powoduje wyszukania, a tylko zaznaczenie otoczenia sieciowego) - teraz pod Win98 dzia�a, + ale tylko wyszukiwanie w obr�bie Mojego komputera, po sieci mija si� to z celem - przewa�nie + jest ona tak wolna, �e przywiesza�oby to komputer +- FEATURE: przerobi� wizualny interfejs u�ytkownika (niech to wygl�da profesjonalnie, ale niech + nie b�dzie przepakowane bitmapami i innym �mieciem) - dot. g�. przycisk�w w status dialogu. + Chwilowo nie wygl�da profesjonalnie i mam wra�enie, �e jeszcze d�ugo nie b�dzie (nie mam + zdolno�ci graficznych) + - na pocz�tek menu z alternatywnym rysowaniem (a'la XP) (ok) + - poprawi� wy�wietlanie przycisk�w w miniview (znikanie przy LButtonDown, zrobi� p�askie) (ok) + - wyp�aszczy� elementy GUI (listview w statusdialogu nie - g�upio wygl�da) (ok) +- FEATURE: w StatusDialogu do�o�y� co� w PD rogu - umieszczanie w PD rogu ekranu (mo�e w miniview + tez ? - chyba raczej nie) +- SMALL BUG: podczas w��czonego usuwania zako�czonych zada� (mo�e nie dlatego) program po + zako�czeniu kopiowania wysypuje si� - nie zawsze - (???) - pow�d: Autousuwanie zako�czonych + zada� wykrywa zako�czone zadanie poprzez sprawdzenie flagi ST_FINISHED. Niestety po ustawieniu + tej flagi w�tek wykonuje jeszcze par� operacji - m.in. zapis do pliku .log, odegranie d�wi�ku. +- VISUAL APPEARANCE: wywali� # przy nazwach plik�w do kopiowania (oznaczenie wyswietlania danych + z tablicy schowka zamiast z tablicy plik�w). +- VISUAL APPEAANCE: poprawi� wy�wietlanie tekstu w statusDlg - aktualnie jest za blisko brzegu +Initial release 1.0 (internal release #9): +- FEATURE: dorzuci� obs�ug� r�nych j�zyk�w (g��wnie angielskiego) + - wywali� wszystkie u�ywane stringi z kodu do STRING TABLE'a (niestety LoadString jest oko�o + 6 razy wolniejszy ni� zwyk�e przypisanie stringa, ale nie jest to warto�� du�a + (w debugu: 100000 przypisa� zajmuje ok. 222 ms, za� 100000 �adowa� string resource'a + ok 1450 ms, w po��czeniu z od�wie�aniem np. miniview co 55 ms daje to strat� ok 1.2 s na + ponad 1.5 godziny, wi�c nie warto wczytywa� tekstu wcze�niej do bufora). (ok) + - wrzuci� po dodatkowej kopii dialog�w, menu i string table'a jako j�zyk angielski (ok) + - przerobi� kod programu tak, aby wczytywa� zasoby (dialogi, menu...) poprzez FindResourceEx + i LoadResource, zamiast np. LoadMenu. (ok) + - przet�umaczy� wszystkie zasoby angielskie na angielski (ok) + - poprawi� OTF - funkcja u�ywana do prowadzenia LOG�w tak, aby wczytywa�a stringi wg aktualnie + ustawionego j�zyka (ok) +- BUG: w zwi�zku z dodawaniem obs�ugi j�zyk�w do optionsDlg nie jest dodawana opcja priorytetu +- VISUAL APPEARANCE: je�li wybrano jakie� zadanie w CStatusDlg, ale w konfiguracji wy��czyli�my + kreowanie log�w - przycisk poka� dziennik jest dalej aktywny, ale i tak nie mo�na nic zrobi� + - poprawi� stan w takim przypadku na disabled. +## internal release #10 ## +- BUG: poprawi� "kopia (33) ..." - ten string nie zosta� wrzucony do string table, tylko jest + w kodzie programu - wyrzuci� do ST, przerobi� funkcj� wykorzystuj�c� tak, aby z niego �adowa�a. +- OVERHEAD: funkcja GetConfig() w CTask'u u�ywa sekcji krytycznej, a nie powinna (wska�nik do + klasy z konfiguracj� jest ustawiany tylko raz, za� odczytywany cz�sto, co aktualnie powoduje + "blokowanie" na kr�tki czas wi�kszo�ci operacji na CTasku - wywali� sekcj� krytyczn�. +- OPTION: podczas ograniczania ilo�ci kopiowa� np. do 1 i w��czeniu kilku task�w - nie s� one + doliczane do og�lnej puli wielko�ci plik�w do skopiowania - flaga ma okre�la�, czy tak w�a�nie + ma sprawa wygl�da�, czy maj� by� przed blokowaniem zada� zliczane wielko�ci. +- DLL UPDATE: w�a�ciwie ju� w internal release #9 zmieni� si� spos�b dzia�ania DLL'ki - elementy + menu kontekstowego shella pojawiaj� si� tylko i wy��cznie je�li jest uruchomiony Copy handler + (wi��e si� to z odczytywaniem aktualnie ustawionego j�zyka w Copy handlerze). Usun��em r�wnie� + mo�liwo�� ponowienia pr�by kopiowania (je�li wcze�niej nie by�o uruchomionego CH). Nie ma to + teraz sensu - uruchomienie komendy menu kontekstowego jest mo�liwe tylko je�li jest uruchomiony + copy handler. +Version 1.01 (Internal release #11) +- BUG: pokazywanie dialogu z b��dem otwierania pliku �r�d�owego powoduje wychrzanienie si� + programu (w wersji debug pokazuje okno z dziwn� wielko�ci� znalezionego pliku �r�d�owego, za� + w Release po prostu wyst�puje nieprawid�owa operacja - poprawi�. +- STRANGE BUG ?: Na Duronie 800 z myszk� A4Tech'a podczas kopiowania danych po sieci przycina si� + kursor myszy. (zawsze m�wi�em �e nie ma to jak P100 :) ), na innych komputerach tego nie + zanotowano (tzn. na Celeronie 450 i Duronie 1000). - brak dost�pu do �rodowiska w kt�rym + program zwalnia - (???) - co� z sieci� - ustawienie bufora na 1kB usuwa problemy +- BUG: Custom Copy dialog nie wy�wietla tekstu w rodzaju operacji +- BUG: pod systemem Windows XP nie dzia�a poprawnie DLL'ka (pod NT i 2000 r�wnie�). Powodem jest + specyficzne przetwarzanie przez ni� zawarto�ci schowka (CF_HDROP). Nie stosuje ona + DragQueryFile, tylko zwyk�ego kopiowania zawarto�ci bloku pami�ci (HGLOBAL), przez co stringi + w formacie UNICODE nie s� przekszta�cane na posta� ANSI, tak jak to robi DragQueryFile. +- BUG: nie dzia�a pokazywanie log files'�w (teraz zn�w dzia�a, wprowadzi� wy�wietlanie b��du, + je�li ShellExecute zako�czy�o si� b��dem). +- BUG: nie zlokalizowany string w CStatusDlg::OnShowLogButton() - zmieni� +- FEATURE: W oknie wyboru folderu docelowego powinna pokazywa� si� pojemno�� dysku. +- APPEARANCE: je�li wyst�pi b��d kopiowania, nale�y odlicza� ustalony czas do automatycznego + wznowienia od momentu jego wyst�pienia, a nie jak dotychczas tak sobie (nie musi by� zbyt + dok�adne) +- FEATURE: Sprawdza�, czy jest wystarczaj�ca ilo�� miejsca na dysku na skopiowanie danej rzeczy, + wy�wietla� dialog w zale�no�ci od ustawie� wizualnych potwierdze� (Normal+) + - wywali� funkcje formatuj�ce wielko�� (xxx GB/kB/...) do globalnych funkcji dost�pnych dla + kilku r�nych miejsc w programie. (ok) + - dorzuci� dialog wy�wietlaj�cy info o braku miejsca + - pomija� sytuacj�, gdy co� jest przenoszone w obr�bie jednej partycji (nie trzeba, gdy� dla + takiego przenoszenia wielko�� plik�w ��cznie wynosi 0, wi�c nie zajmuje to miejsca). +- BUG: w explorerze jako opis komend z context menu pokazywane s� chi�skie (chyba) znaki zamiast + normalnych (kr�tko m�wi�c trzeba obs�u�y� osobno GCS_HELPTEXTA i GCS_HELPTEXTW). +1.01a (internal #12): +- poprawiono wsp�prac� z wersjami ANSI Windows (98/Me) +1.02 (internal #13): +- wprowadzono do programu wersj� 3.02 BCMenu (niestety, nie b�dzie w tej chwili cieniowania bitmap + w menu, bo jest ich troch� za ma�o, a po drugie itemy menu robi� si� troch� za wysokie + (pr�bowa�em to zmodyfikowa�, ale zmniejszaj�c wysoko�� itemu psuje si� efekt cieniowania). +- BUG: przenoszenie plik�w(nie folder�w) w obr�bie jednej partycji (MoveFile) powoduje + wy�wietlanie po zako�czeniu 0% post�pu, poniewa� wielko�ci plik�w nie s� doliczane do og�lej + puli wykonanych ju� zada�. (np.: 2/2 (0 B/59.00 MB)) (ok - je�li zwyk�e przenoszenie - + zerowanie zawarto�ci pliku (tylko jako dane, nie rzeczywi�cie). +- FEATURE: do�o�y� do programu kopiowanie z flag� FILE_FLAG_NOBUFFERING: + - przerobi� CDataBuffer tak, aby dla danej wielko�ci alokacji alokowa�o bufor o wielko�ci + b�d�cej najbli�sz� (w g�r�) wielokrotno�ci� 64kB. Napisa� makro, kt�ra zwraca najbli�sz� + warto�� zaokr�glon� w g�r� do najbli�szych 64kB. (ok) + - w CustomCopyFile do�o�y� seek na 4096 boundary, a na ko�cu obcinanie nadwy�ki (zaokr�glanie + do 4096 (najwi�ksza dozwolona wielko�� sektora)) (ok) + - opcje dostosowania - czy i dla jakich plik�w nie buforowa� (ok) +- FEATURE: w menu g��wnym programu wrzuci� item oznaczony jako 'monitoruj schowek' z check boxem +- OPTIMIZATION: w CConfig ka�da funkcja Get... stosuje sekcj� krytyczna w celu zabezpieczenia + danych. Nie jest to potrzebne (wr�cz zb�dne), gdy� mo�e lekko przyblokowywa� kopiowanie (gdy + np. okno statusu pr�buje u�yska� dost�p do jednej zmiennej - w�tek kopiuj�cy (je�li nie by� + pierwszy) zostanie na ma�� chwilk� zblokowany. Zostawi� sekcje krytyczne w funkcjach Set... + oraz w funkcjach Get..., kt�re zwracaj� CString'a. +- APPEARANCE: poprawi� tab order w niekt�rych oknach +1.03 (Internal #14): +- BUG: tekst w CStaticFilespec w trybie czeni wysokokontrastowej jest niewidzialny (czarny) + - poprawi� +- IMPROVEMENT: poprawi� obs�ug� FILE_FLAG_NO_BUFFERING tak, aby nie by� tworzony plik docelowy + o wielko�ci wi�kszej od �r�d�owego, a dopiero w p�niejszej fazie obcinany, ale tak aby + resztka pliku �r�d�owego, kt�ra nie zajmuje ca�ego sektora (czy klastra,...) by�a + dokopiowywana osobno. +- FEATURE: w g��wnym menu do�o�y� wy��czanie komputera po zako�czeniu kopiowania +- BUG: je�li jakie� pliki zostan� skopiowane do miejsca docelowego tak, �e po przerwaniu w po�owie + pozostanie na dysku docelowym mniej miejsca ni� wynosi CA�O�� kopiowanych plik�w powoduje, �e + pokazywany jest dialog braku miejsca na dysku, a nie powinien - poprawi� +- APPEARANCE: okna wizualnych potwierdze� s� do bani - przeprojektowa� (teraz dalej wygl�daj� do + bani, ale s� nieco lepsze ni� poprzednie) +- BUG: poprawi� chzanienie si� opcji ograniczania max ilo�ci operacji - w niekt�rych przypadkach + pomimo, �e w�tek kopiuj�cy dzia�a nie jest zwi�kszana ilo�� aktualnie przeprowadzanych + operacji. Zatem przerwanie dzia�ania w�tku w tym miejscu i wygenerowanie wyj�tku powoduje + zmniejszenie ilo�ci operacji o 1 (czyli do warto�ci ponad 4 mld - (unsigned long)(-1)) +- STRANGE BUG: kopiowanie jakiego� folderu (np. c:\windows) do innego katalogu, w kt�rym istnieje + ju� katalog o nazwie takiej jak kopiowana powoduje wygenerowanie b��du, �e katalog ju� + istnieje (a powinno po prostu pomin�� b��d i kontunuowa� kopiowanie) - nie zawsze + - teoretycznie zabezpieczona jest powy�sza sytuacja (kiedy pr�bujemy utworzy� istniej�cy ju� + folder, po prostu pomijamy tworzenie)(???) (#183 - prawdopodobnie odnosi si� tylko do folder�w + kopiowanych w obr�bie jednej partycji tak, �e jest u�ywane MoveFile zamiast CustomCopyFile). + (Nawet na pewno. Przenoszenie za pomoc� MoveFile jest wadliwe, za� MoveFileEx nie istnieje + na zwyk�ych Windowsach) - poprawiono poprzez sprawdzenie w fazie wyszukiwania plik�w, czy + istnieje plik/folder docelowy - je�li tak, to blokuje si� dzia�anie MoveFile i zamiast niego + wywo�ywana jest standardowa obs�uga - CustomCopyFile i Delete). +- BUG: przy w��czonym czarno-bia�ym schemacie kolor�w z wysokim kontrastem w miniview nie + pokazuj� si� napisy okre�laj�ce nazwy plik�w. +- BUG: poprawi� wy�wietlanie button�w w miniview - je�li w��czony jest jaki� du�y schemat ekranu + przyciski wystaj� poza okno - s� niewidoczne, poprawi� te� ich rysowanie. +- BUG: przy ustawieniu wi�kszego rozmiaru czcionki we w�a�ciwo�ciach ekranu (tzn. np 200% normy, + to tekst w opcjach i w miniview jest obci�ty, zmieni� kod rysuj�cy captiona dla miniview tak + aby u�ywa� czcionki przeznaczonej do rysowania captiona (a nie czcionki dialogu). Dodatkowo + w opcjach otwarcie combobox'a powoduje pokazanie troch� dziwnego widoku jego zawarto�ci. +- BUG: poprawiono z�e wykazywanie procent�w (a kto wie co jeszcze w zwi�zku z tym) wprowadzone + w poprzedniej wersji razem z FFNB (drugie przej�cie kopiowania pliku nie odczytywa�o ponownie + wielko�ci pliku docelowego i w zwi�zku z tym by�y kredki). +- APPEARANCE: kolejne poprawki tab orderu + +1.1 (Internal #15) +- BUG: poprawiono wsp�prac� programu z WinXP/NT/2000 - podczas odczytu resztki danych z pliku, + kt�ry nie by� wielokrotno�ci� czego� program wykazywa� b��d 'Nieprawid�owy parametr'. Pow�d + - odczyt wska�nika pliku dla pliku otwartego z flag� FFNB za pomoc� SetFilePointer (tak jak to + opisano w MSDNie) jest nierealny. +- APPEARANCE: header w listview w CStatusDlg nie jest rozmieszczany r�wnomiernie, je�li + zwi�kszy si� np. wielko�� czcionki (na 200 %) - cz�� miejsca jest nieu�ywana. +- UNIQUE: dorzuci� w kodzie programu informacj� o autorze (niezbyt �atw� do zdekodowania), kt�ra + b�dzie jednoznacznie identyfikowa�. +- BUG: pod WinXP program dziwnie zwalnia, a kopiuje z tak� pr�dko�ci�, �e a� strach (dla kopiowania + w obr�bie jednego dysku fizycznego) (ju� nie), je�li u�ywa si� wy��czonego buforowania dla + du�ych plik�w, to efekt zwalniania nie ma ju� miejsca. (Ale pauza, ... dalej chodzi dziwnie) +- BUG: ustawianie folderu tymczasowego - brak odpowiedniego do��czenia '\\' na ko�cu je�li nie ma +- FEATURE: w IDD_CUSTOM_COPY_DIALOG zmieni� atrybut listbox'a na multiselect, oraz przerobi� + usuwanie (mo�e co� jeszcze) +- VISUAL APPEARANCE: zmieni� wielko�ci bufor�w w menu wyboru - status dialog - do�o�y� 8MB + i jeszcze co� (512k) +- FEATURE: zrobi� co� w zwi�zku z kopiowaniem dysk-dysk; dysk-inny dysk, dysk lokalny-sie�, ... + tzw.autodetect buffer size (co ?) - wykrywa� typ kopiowania i odpowiednio ustawia� bufor + (wg DODATKOWYCH OPCJI okre�laj�cych wielko�� bufora dla kopiownia CD-dysk, siec-dysk, ...) + - zreorganizowa� konfiguracj� - wyrzuci� bufor z W�tku kopiuj�cego (ok) + - do�o�y� dodatkowe opcje w konfiguracji - buffer size for: (OK) + - kopiowanie w obr�bie jednego dysku fizycznego + - kopiowanie pomi�dzy dwoma r�nymi dyskami fizycznymi + - kopiowanie CD->dysk (w drug� stron� te�, ale normalnie si� nie da) + - kopiowanie sie�<->co� innego + - inny domy�lny bufor + - zmieni� spos�b przechowywania �cie�ki docelowej - klasa CDestPath, kt�ra b�dzie zawiera� + info o miejscu docelowym (numer dysku, typ �cie�ki(dysku), ...) (ok) + - zmieni� nieco CClipboardEntry tak, aby przechowywa�y r�wnie� info o dysku fizycznym, + z kt�rego pochodzi dana �cie�ka, typ dysku (sie�, ...), tak, aby odwo�ania w CFileInfo + po��czonego z CClipboardEntry powodowa�y odwo�anie w�a�nie do klasy CCE (jak np. + ustalanie numeru dysku na kt�rym znajduje si� dany plik). (dodatkowo poprawa konstruktora + kopiuj�cego - pomija podczas kopiowania m_bMove) (ok) + - zmodyfikowa� funkcj� getdrivetypeex - ma ona ustala� rodzaj podanej �cie�ki: (ok) + - je�li wykryto numer dysku (0...27?) wywo�a� GetDriveType (sie�, dysk, ...) + - je�li nie wykryto numeru dysku - za pomoc� PathIsUNC sprawdzi�, czy jest to sie�. Je�li + tak - wiadomo, je�li nie - rodzaj �cie�ki nieznany (bufor domy�lny) + - przenie�� obs�ug� CDataBuffer z \MODULES do katalogu programu i zmieni� - do�o�y� kilka + dodatkowych zmiennych - wielko�� bufora (dla kopiowania dysk-dysk, dysk-cd, ...) (ok) + - co� podobnego zrobi� w CTask'u - kilka r�nych wielko�ci bufor�w (+funkcje obs�uguj�ce), + update Serialize, zmieni� funkcj� Set(Get)BufferSizes. (ok) + - zmieni� okno podawania wielko�ci bufora tak, aby zawiera�o kilka wielko�ci bufora, razem + z mo�liwo�ci� podawania wielko�ci w kB i MB. (ok) + - zmieni� spos�b wy�wietlania wielko�ci bufora w CustomCopyDlg - zamiast jednego edita + waln�� tylko przycisk 'ustawienia bufora', lub opr�cz przycisku w edicie umie�ci� + wszystkie wielko�ci. Ustawienia bufora ma wywo�a� dialog wyboru bufora. (ok) + - poprawi� obs�ug� OnCopyData i OnPopupCustomCopy aby uwzgl�dnia�y wielko�� bufora ustawion� + w powy�szym dialogu. (ok) + - zmieni� obs�ug� wielko�ci bufora w CStatusDlg - zamiast menu ma by� wy�wietlany dialog + wyboru wielko�ci bufora (w�a�ciwie sze�ciu) - wywali� menu z zasob�w, obs�ug� z CStatusDlg + (OnCommand) (ok) +- FEATURE: w oknie wyboru wielko�ci bufor�w, je�li wielko�� bufora jest wielokrotno�ci� 1024 lub 1024*1024, + to pokazana wielko�� powinna by� w kB lub MB zamiast w B, dodatkowo nale�y zmodyfikowa� dialog tak, + aby mo�na by�o wskaza� kt�ry edit ma by� aktywny (wa�ne w konfiguracji i w CStatusDlg) +- FEATURE: zmodyfikowa� CStatusDlg tak, aby przesy�a�o do CBufferSizeDlg dane o aktualnie u�ywanym + indexie bufora (aby ten m�g� zaznaczy� go) +- BUG: Win2000 ma problemy z �adowaniem ikon z 16.8M kolor�w (pluje si� o stos i nadpisywanie + danych poza dozwolony obszar) - wina bibliotek WinNT5 lub struktury ikon (pod WinXP i Win98/Me + problem nie wyst�puje) - przerobiono ikony na 256 kolor�w z indexowaniem (zwi�kszy�y wielko�� + o ok. 100% - trudno) +- BUG: podanie zbyt wysokiego bufora (64MB) nie generuje wyj�tku a powoduje wygenerowanie + b��du (GetLastError) dopiero podczas odczytu - za ma�o zasob�w systemowych (#1450) - poprawiono + b��d odtwarzania bufora, je�li nowa wielko�� jest za du�a. +- FEATURE: w g��wnym menu programu do�o�y� opcje rejestracji/derejestracji dll'ki +- BUG: je�li pokazane jest okno miniview i w��czymy normalny status - ma�e okno powinno + zosta� ukryte - zas�ania cz�� widoku. +- FEATURE: w wyborze wielko�ci bufora powinna istnie� mo�liwo�� podawania wielko�ci w kB i MB + (w konfiguracji oraz w oknie wyboru custom buffer size) - jeszcze tylko konfig. +- FEATURE: w konfiguracji (w�a�ciwie wsz�dzie, gdzie jest potrzebne ustawianie �cie�ki + dost�pu) ustawianie �cie�ek powinno interpretowa� co� w stylu . Doda� funkcj� + ExpandPath, kt�ra zamieni co� na prawid�ow� �cie�k�: + - - GetWindowsDirectory + - - GetTempPath + - - GetSystemDirectory + - - CSIDL_APPDATA + - - CSIDL_DESKTOPDIRECTORY + - - CSIDL_PERSONAL + - Funkcja, ze wzgl�du na szybko�� dzia�a na razie tylko dla folderu docelowego + dla tymczasowych danych programu oraz dla nazw plik�w z d�wi�kami (jedyne 3 + �cie�ki w konfiguracji) + - Opcja jest traktowana jako zaawansowana, wi�c jest dost�pna tylko poprzez edycj� + r�czn� pliku .ini. + - zamieniona w powy�szy spos�b �cie�ka nie zawiera ko�cowego '\\', wi�c �cie�ka + podana za pomoc� powy�szych skr�t�w powinna mie� posta� np. \media\chord.wav +- BUG: wy��czanie programu trwa za d�ugo pod NT, 2000, XP - co� z cs'ami - spr�bowa� w p�tlach + wy��czaj�cych thready wrzuci� nieznaczne op�nienie (10-100 ms). - Zmieniono nieco obs�ug� + monitorowania schowka i wy��czania systemu po zako�czeniu koopiowa� (co przyspieszy�o wy��czanie + w�tku monitoruj�cego, w ka�dym punkcie programu, gdzie nast�powa�a pr�ba killni�cia taska + w while'u dodano op�nienie pomi�dzy sprawdzaniami ok. 10ms - przyspieszy�o to operacje pauzy, + anulowania, ... oraz w znacz�cy spos�b wy��czanie programu (w debugu z ok. 4s. na <1s.) +- FEATURE: poprawi� nieco estetyk� log'a - na pocz�tku threada ma by� dorzucone co� w stylu + nowa linia/------------ przed wypisaniem rozpocz�cia +- FEATURE FIX: aktualnie nie dzia�a wy��czanie autodetekcji bufora - je�li ta opcja jest wy��czona, + to program powinien korzysta� tylko z bufora domy�lnego. +- BUG: shutdown systemu nie dzia�a pod seri� NT +- FEATURE FIX: je�li zaznaczymy opcj� automatycznego shutdownu po zako�czeniu wszystkich zada� + a �adne zadanie nie jest uruchomione, to nast�puje automatyczne zamkni�cie systemu. Powinno + poczeka�, a� przynajmniej jedno z nich zostanie cho� troch� skopiowane. +- FEATURE: podczas zamykania systemu (z opcji automatycznego zamykania systemu po zako�czeniu + wszystkich zada�) powinien na jaki� czas pokaza� si� dialog z mo�liwo�ci� anulowania. + - Dodatkowe opcje - czas pokazywania okna oraz wyb�r rodzaju (force/nie force) +- VISUAL APPEARANCE: dodatkowe poprawki UI +- BUG: problem z wygaszaniem edit�w w CBufferDlg - w konfiguracji pojawiaj� si� zaciemnione + edity, mimo i� nie powinny - skleroza - zapomnia�em wpisa� bOnlyDefault w COptionsDlg + do nowo otwieranego CBufferDlg. +- BUG: pod Win2000 nie dzia�a poprawnie miniview - caption bar nie zmienia si� po klikni�ciu,..., + wi��e si� to z nieco odmiennym rysowaniem w 2000 i 9x - 2000 ma bardziaj zoptymalizowane + wykorzystanie grafiki +- FEATURE: je�li chcemy forsowa� kontynuowanie zadania, pomimo, i� przez to b�dzie przekroczona + max. ilo�� jednocze�nie wykonywanych zada� to powinno by� to mo�liwe. + - zmieni� nieco uk�ad przycisk�w w CStatusDlg tak, aby dla ST_WAITING by�a mo�liwo�� pauzowania + oraz wznowienia +- FEATURE FIX: wywali� napis NOT IMPLEMENTED z konfiguracji +- FEATURE FIX: zadania (przy ograniczeniu max ilo�ci jednocze�nie wykonywanych zada�) powinny + za��cza� si� w kolejno�ci, w jakiej zosta�y wpisane do tablicy. (???) + - do�o�y� dodatkow� flag� do CTaska zezwalaj�c� na kontynuacj� z WaitState (force || ta flaga) (ok) + - zmieni� funkcj� CanBegin tak, aby uwzgl�dnia�a flag� force oraz now� flag�, za� sprawdzanie + czy ilo�� aktualnie wykonywanych zada�wznowienie) - poprawi� +- BUG: je�li wyst�pi sytuacja typu read-only - program powinien wy�wietli� dodatkow� informacj� + o atrybucie read-only. (najlepiej przerobi� kod CProcessingException tak, aby od razu formatowa�o + stringa z opisem b��du - w zwi�zku z tym - zmiana formatu pliku .atp). + - przerobi� wszystkie throw new CPE oznaczaj�ce error na nowe + - do angielskiego strtable do�o�y� t�umaczone stringi z polskiego + - w CStatusDlg przerobi� wy�wietlanie b��du do edit'a zamiast CStaticFilespec (z mo�liwo�ci� + przewijania ...) - to jeszcze nie jest to, ale na razie nie mam pomys�u, wi�c musi zosta� +- BUG: poprawiono b��d zwi�zany z automatycznym wy��czeniem systemu po zako�czeniu kopiowania, + (oczywi�cie nie uwzgl�dni�em oczywistego przypadku zako�czenia zadania w spos�b normalny, + a jedynie poprzez naci�ni�cie pauzy, ...). +- BUG: je�li miniview jest ukryty (ale w��czony) i jest umiejscowiony w RB rogu, a zostanie zmieniona + rozdzielczo��, miniview po odkryciu pojawia sie na miejscu odpowiadaj�cemu starej rozdzielczosci + ekranu. Zmieni� - przy odkrywaniu miniview ma on by� automatycznie przesuwany do RB rogu. +- FEATURE: trzeba w jaki� spos�b da� u�ytkownikowi zna�, jakie pliki s� skojarzone z okre�lonym + zadaniem +- OPTIMIZATION: miniview korzysta z funkcji GetSnapshot, z kt�rej korzysta r�wnie� normalny + status (tylko �e on korzysta z wielu zmiennych, kt�re nie s� potrzebne w miniview). Zrobi� + GetMiniSnapshot() i struktur� TASK_MINI_DISPLAY_DATA. (Dzi�ki temu odpada ka�dorazowe + (std 5xsekund�) przetwarzanie �a�cuch�w znak�w (okre�lenie s�owne statusu), kopiowanie stringa + z opisem b��du i ponad 10 innych zmiennych) (w Debugu przyspieszy�o ok 15 razy z 750ms dla 10000 + wywo�a� GetSnapshot() do 50ms dla 10000 wywo�a� GetMiniSnapshot()) - w sumie jest to i tak + niezauwa�alne, ale zawsze powoduje mniejsze obci��enie pami�ci daj�c innym programom wi�ksz� + przepustowo��. +- BUG: najprawdopodobniej nie jest zapisywany stan bufora. Po zakonczeniu i przeladowaniu access + violation (getcurrentbufferindex korzysta z indexu cfileinfo spoza zakresu - nale�y + w takim przypadku skorzysta� z '0' zamiast ???) +1.10 Final (#16?) +- BUG: poprawi� detekcj� partycji le��cych na jednym dysku fizycznym - aktualnie partycje s� + wykrywane jako jeden dysk fizyczny tylko pod warunkiem, �e maj� t� sam� liter� dysku (musi + istnie�) oraz oba s� dyskami typu fixed - rozwiazanie troche dziwne - pod 9x i NT dziala + na innej zasadzie, nie wiem, czy dziala w 100% przypadkow - nie wiem, czy obsluguje poprawnie + SCSI, ... - u mnie dziala +- NEW FEATURE: doda� instalatora i deinstalatora do programu. Instalacja ma pozwala� na + rejestrowanie rozszerze� shella, kopiowanie readme, programu (required), naprawianie + instalacji (niestety nie), doinstalowywanie(niestety nie), za� deinstalacja - kompletne lub cz�ciowe + odinstalowywanie. +- VA: w aboutboxie dolozyc info o mailu - ok. +- REMOVE CODE: wywalono kod odpowiadaj�cy za automatyczne rejestrowanie dll'ki - dzi�ki temu nie b�dzie + zb�dnych wpis�w w rejestrze, a rejestracj� zajmie si� setup. +- SMALL BUG: je�li w opcjach ustawiona jest warto�� 1 przy reloadzie after restart, to zostanie to + uwzgl�dnione dopiero po otwarciu i zamkni�ciu okna konfiguracji - poprawi� (teraz przy odczytywaniu + konfiguracji r�wnie� b�dzie aplikowany stan). +1.11 (#20) +- NF: dodano opcj� pozwalaj�c� wybra� rodzaj progressu w miniview (p�ynny/kostkowy) + +1.12 (#21) beta 1 +- FE: w oknie wyboru �cie�ki docelowej (CFolderDlg) w listboxie quick access - podczas usuwania ma by� + zaznaczany kolejny item +- FEATURE EXPAND: w oknie zaawansowaniego kopiowania w miejscu podawania filtra (np. *.jpg) zaznaczy�, �e + mo�na u�ywa� wi�kszej ilo�ci filtr�w - np. *.jp*;*.bm*, oraz zastosowa� to w kodzie. Funkcja sprawdzaj�ca + czy plik zgadza si� z mask� jest zawarta gdzie� w �r�d�ach Visuala. Rozszerzy� te� mo�liwo�ci filtrowania: + np. wg daty, rozmiaru, atrybut�w (mo�e co� w stylu wyra�e� regularnych, czego� w stylu linuxowego (0-9). + (Wild.c)) + - wg daty(?), rozmiaru (?), atrybut�w (tri-state checks), maski (edit/combo) + - nowa klasa CFileFilter s�u��ca do sprawdzania, czy dany CFileInfo jest zgodny z zawart� mask�, dat�, ... (ok) + - doda� do typu daty dodatkowe wpisy (<=, <, =, >, >=) zamiast (przed, po) (ok) + - dopisa� reszt� kodu odpowiedzialn� za wy�wietlanie w lisctrl danych o filtrze - jeszcze data i atrybuty (ok) +- VA: po l-clicku na ikonie trayowej programu powinno nast�pi� pokazanie wszystkich pkazanych okien)-bringtofront +- CODE: zmieniono nieco obs�ug� dialog�w - teraz s� bazowane na CLanguageDialog, wi�c mo�na by�o pozby� + si� paru linii zb�dnego kodu +- BUG: je�li w czasie wy�wietlania okna wyboru wielko�ci bufor�w zadanie si� sko�czy - to po zamkni�ciu + okna bufor�w program si� wychrzania - po prostu sprawdzi�, czy po zamkni�ciu okna bufor�w dalej jest + zaznaczony dany item. +- FE: w dialogu statusu przy przycisku usu� doda� informacj� o anulowaniu zadania, je�li nie jest + w stanie pozwalaj�cym na normalne usuni�cie - pami�ta�, aby po zamkni�ciu dialogu sprawdzi�, czy + dany item jest dalej zaznaczony. +1.12 beta 2 (#22) +- DATA: napisa� od nowa (ca�kowicie) CListView wy�wietlaj�cy drzewo katalog�w, oraz od nowa dialog + CFolderDlg - niezale�ne od g��wnego projektu + - wywali� zb�dne pliki: + - ShellTree.h/cpp + - QuickAccessDlg.h/cpp + - FolderDlg.h/cpp + - NewFolderDlg.h/cpp + - co� si� wywala podczas kreowania dialogu wyboru folderu docelowego- zbada�... - wina dwukrotnego + wywo�ania InitControl w CDirTreeCtrl ?? + - do�o�y� opcje konfiguracyjne dla folder dialogu - to co w BROWSEDATASTRUCT + recent paths + - dodatkowa sekcja w konfigu - [Shortcuts] - b�dzie u�ywana w folder dialogu i w shell ext. +- BUG: nie dzia�a pod NTkiem ze wzgl�du na SHGetSpecialFolderPath - zamieni� zgodnie ze wzkaz�wkami + z codeguru (dodatkowo sprawdzi� eksporty). +1.12 beta3 (#23): +- BUG: poprawi� ma�y drobiazg - obs�uga dysk�w nieaktywnych (np. podmapowany dysk sieciowy ale nie pod��czony) + powoduje wy�wietlenie po kilka razy komunikatu systemowego 'w�� plyte do napedu' albo 'nie znaleziono + udzia�u sieciowego' +- BUG: okno wyboru folderu docelowego nie wy�wietla si� na wierzchu. +- ABOUT: dopisa� greetings dla Venkata Sundaram za modeless dialogs that behave like modal ??, jednocze�nie + wywali� Seloma Ofori, poniewa� ju� nie korzystam z jego kodu. +- BUG: poprawi� obs�ug� them�w - wywala si� w cfolderdialog w wersji debug, wi�c w release zrobi jeszcze + wi�ksze szkody +- CORRECTION: poprawi� wsp�prac� z win95 (nie osr) poprzez eliminacj� GetDiskFreeSpaceEx +- BUG: poprawi� polski tekst na polski a nie pl-en - teraz wygl�da dopiero g�upio +- OVERDATA: wywalic niepotrzebne texty z resource'�w - zaledwie kilka sztuk, ale zawsze + +1.12 beta 4 (#24) +- CHANGE: spr�bowa� zmieni� wpisy w structs.h - CConfig handling - zmieni� na makra pobieraj�ce set parametr�w + i zawieraj�ce odpowiednie funkcje (uda�o si�, ale aby standaryzacji sta�o si� zado�� nale�a�o zmiani� opcj� + automatyczny wyb�r wielko�ci bufora na u�ywaj tylko domy�lnego bufora) +- DEVELOPER NEED: po��czy� oba projekty (dll i program w jeden workspace), dodatkowo dorzuci� folder Common + gdzie b�d� si� znajdowa� wsp�dzielone pliki (np def. struktur u�ywanych do przesy�u danych mi�dzy programem + a dll'k�. + +1.12 beta 5 (#25) +- FEATURE EXPAND: dodatki w .dll - pobieranie danych z programu, wy�wietlenie odpowiednio skonfigurowanych + komend w explorers' context menus. + - *komendy - drag&drop: + - Kopiuj Copy Handlerem + - Przenie� Copy handlerem + - Kopiuj/Przenie� specjalnie Copy Handlerem + - *komendy - explorers' context menus: + - Wklej Copy Handlerem (folder&background) + - Wklej specjalnie Copy Handlerem (folder&background) + - Kopiuj do > (folder only&all files) + - Przenie� do > (folder only&all files) + - Kopiuj/przenie� specjalnie do > (folder only&all files) + - *opcje: + - po jednym checku dla ka�dej komendy + - check - kaskadowe menu - dla obu menu na raz + - check - czy pokazywa� wolne miejsce przy nazwie skr�tu + - uint - max. liczba skr�t�w do umieszczenia w menu + - *texty wypisywane w menu maj� by� pobierane za po�rednictwem WM_COPYDATA i innych message'y z aktualnie + uruchomionej instancji programu + - i tu zaczynaj� sie schodki - komunikacja exe->dll (z�o�ona - dynamiczna wielkosc danych, gdyz inaczej + trzeba by by�o zastosowa� bufory o kosmicznych wielko�ciach). + - *w ka�dym z podmenu '... >' nale�y zawrze� wszystkie (cho� to mo�e przesada) shortcuty pobrane z programu + - *struktura COPYDATASTRUCT::dwData : + - warto�� okre�la ID komendy wybranej z menu - paste/paste special/kopiuj do/przenie� do/kopiuj-przenie� + do specjanie - okre�lone podczas przekazywania danych z programu do dll'ki; dodatkowo w przypadku + paste i paste special najstarszy bit b�dzie zawiera� info o rodzaju wklejania - kopiowanie czy + przenoszenie - tak jak dotychczas. + - *przenie�� sprawdzanie wolnego miejsca w inne miejsce (once per initialize ?). + - *zmieni� measureItem tak aby uwzgl�dnia�o szeroko�� textu - skorzysta� z czcionki parenta - je�li si� + da - je�li nie - trzeba kombinowa� jak obliczy� szeroko�� textu. (NONCLIENTMETRICS) + - *wywali� wszystkie niepotrzebne texty z resource'�w dllki, jak r�wnie� do��czanie obs�ugi j�zyk�w +- BUG: wy�wietlanie komend w explorer.ctx.menu jest dziwne - czasem wszystko znika - efekt pami�ciowy - + w�a�ciwie moje niedopatrzenie - trzeba wyzerowa� m_bGroupFiles. +- CORRECTION: doprowadzi� do porz�dku przesy� danych program->DLL (pobieranie danych z konfiga a nie tylko + sta�ych/wymy�lonych). + - *dorzuci� dodatkowe texty do string table - nazwy komend +- CODE: wywali� z dllki otf'y - s� w sumie ca�kowicie niepotrzebne (teraz) +- FEATURE: dll'ka, a w�a�ciwie drag'n'drop handler (sk�adowa dllki) mo�e przechwytywa� domy�ln� operacj� z menu + (oznacza to jednocze�nie mo�liwo�� przechwycenia przeci�gania l-buttonem !!!) ale jest to sztuczka, o kt�rej + pisze i� 'nie wolno' + - wprowadzi� dodatkow� flag� w konfigu okre�laj�c� przechwytywanie kopiowania + - przyciski ctrl, alt i shift b�d� okre�la� domy�lny rodzaj operacji (odpowiednio kopiowanie, + kopiowanie/przenoszenie specjalne, przenoszenie), jako zamiennik alta mo�na zastosowa� ctrl+shift + - jedyny problem stanowi standardowa obs�uga (tzn. bez naci�nietego �adnego przycisku z klawiatury), nie + chodzi tu o problem z implementacj�, ale o wykrycie domy�lnej akcji jak� przyjmuje explorer - czasem + jest to kopiowanie, czasem przenoszenie, a czasem tworzenie skr�tu; aktualnie bez wzgl�du na to co + wy�wietli explorer, je�li nie naci�niemy �adnego buttona na klawiaturze domy�ln� akcj� b�dzie kopiowanie +- CHANGE: zmieni� numeracj� wersji dla programu i dllki - (major.minor.release.build) +- CHANGE: przenie�� recent paths do osobnej sekcji - b�d� si� odnosi� nie tylko do folder dialogu, ale tez + do dialog�w typu podaj parametry kopiowania/przenoszenia. + +1.12 beta 6 (release #26) +- OPTION: dodatkowa flaga w FileDialogu - czy pokazywa� dodatkowe okna shellowe + - *dodatkowa opcja konfiguracji - ignoreshelldialogs + - *dodatkowa flaga w BROWSESTRUCT + - *zaaplikowa� flag� w momencie wywo�ania okna + - *zaaplikowa� flag� do tree ctrl'a + - *zaaplikowa� przeniesienie flagi z dialogu do kontrolki + +1.12 beta 7 (release #27), (dll release #10) +- BUGS: sprawdzi� dzia�anie ::InsertMenuItem - jak zachowuje si� w w95 - wyst�puje b��d podczas dodawania + item�w do g��wnego explorerowego menu - sprawdzi� co zwraca GetLastError po wywo�aniu tej funkcji, + mo�e da si� temu zaradzi� - w sumie g�upio, �eby w explorer ctx menu nie pojawai�y si� �adne itemy, + pomimo, �e w d&d si� pojawiaj� - poprawiono poprzez zmian� na InsertMenu. Dzi�ki temu najprawdopodobniej + po W95 zaczn� si� wreszcie pokazywa� itemy w expl.ctx.menu - poprzednio te� by�o to zrealizowane na nie + do ko�ca dzia�aj�cych funkcjach, wi�c mo�e wreszcie zadzia�a. +- BUG INFO: przechwytywanie przeci�gania lewym przyciskiem dzia�a tylko na wybranych systemach - nie dzia�a na + w98, w95, za� dzia�a na pewno na w2000. Podobnie sprawa ma si� z ikonami przy skr�tach - rysowanie dzia�a + w w2000, nie dzia�a w NT4, W95, za� na W98 dzi��a po�owicznie - dzia�a dla wszystkich obiekt�w za wyj�tkiem + skr�t�w, dla kt�rych nie wyst�puje rysowanie. + +1.12 Final (release #28) +- ADDITION: w oknie CFolderDialog doda� obs�ug� buttona delete jako kasowania skr�tu +- CHANGE: zmieni� obs�ug� �cie�ki docelowej w dialogu 'podaj parametry kopiowania/przenoszenia' - combobox + zamiast edita, z kt�rego mo�na wybra� jedn� z poprzednio zatwierdzonych �cie�ek. +- FEATURE: dbl click w miniview ma rozwija� du�y status +- STD CHANGE: zmieni� pocz�tkow� �cie�k� dost�pu do plik�w tymczasowych z c:\ na \ co spowoduje zapis + danych w c:\windows\temp (zak�adaj�c ANSI Windows version i instalacj� w standardowym katalogu) +- FEATURE EXCHANGE: zmieni� obs�ug� dialogu konfiguracji - najlepiej full dynamika - sterowanie wszystkim + za pomoc� ustandaryzowanych makr tak, aby dodawanie kolejnych opcji konfiguracyjnych wymaga�o pojedynczych + linii kodu zamiast kilkunastu/kilkudzisi�ciu w kt�rych mog� pojawi� si� setki b��d�w (dodatkowo nie b�dzie + trzeba powi�ksza� resource'�w programu zn�w o kolejne kilogramy zwi�zane z dialog template'ami) + - na razie zast�pcze rozwi�zanie - rozbudowa aktualnie wykorzystywanej konfiguracji + - doda� obs�ug� skr�t�w i recent paths w oknie opcji - dodatkowe dialogi do obs�ugi tego i wykorzysta� + opcj� callbacka wy�wietlaj�cego dialogi do edycji + +1.13 (release #29) (dll release #11) +- CHANGE: zmieni� spos�b zapisywania danych tymczasowych - pliki zako�czone, kt�rych stan zosta� ju� zapisany + nie musz� by� zapisywane (tak samo spauzowane i cancelled). Dodatkowo przy zmianie priorytetu i buf sizes + wy��czonego zadania nale�y w��czy� jednokrotny zapis. +- BUG: poprawiono bug zwi�zany z wy�wietlaniem komend w menu 'Plik' explorera - wi�za� si� z poprawkami + wprowadzonymi w celu poprawy wsp�pracy ze starszymi wersjami Windows (prawdopodobnie wi��e si� to + z niemo�no�ci� wprowadzenia ID dla itemu menu, kt�ry zawiera submenu). + +1.13b (release #30) (dll release #12) +- BUG: poprawic angielski tekst menu kontekstowych - brak 'special'... +- BUG: eksperymentalna opcja przechwytywania l-mouse drag&drop powoduje przechwytywanie r�nie� ctrl+c/v. + Niestety dzia�anie jest zawsze takie samo (kopiowanie) bez wzgl�du na to, czy naci�ni�to ctrl+c czy ctrl+x + - poprawi� +- BUG: w dialogu statusu submenu z warto�ciami priorytetu jest wy�wietlane po angielsku (czy�by pomy�ka PL<->EN ?) + +1.13c (release #31) (dll release #13) +- ADDITION: doda� mo�liwo�� importowania �cie�ek z plik�w tekstowych - opcja importuj w dialogu custom copy dlg + +1.13d (release #32) (dll release #14) +- ADD: wykrywanie restartu explorera i autoumieszczanie nowej ikony w trayu (je�li zniknie) + +1.13e (release #33) (dll release #15) +- ADD: dodatkowa opcja do wyboru domy�lnej akcji podczas przeci�gania lewym buttonem mychy (aktualnie tylko + kopiuj) albo prawdziwe wykrywanie operacji pod kursorem +- ADD: opcja forsownego tworzenia katalog�w - wzgl�dem roota dysku �r�d�owego + +1.13f (release #34) (dll release #16) +- CHG: zmieni� rok w about-boxie na 2003 i wpis autorski z JFS na Ixen Gerthannes +- BUG: funkcja Kopiuj do (i pochodne) nie dzia�a - poprawi� +- ADD: regulacja priorytetu aplikacji - setpriorityclass +- CHANGE: zmieni� nieco obs�ug� threada z zadaniem - �adnej dynamicznej zmiany priorytetu przez wind� + - setthreadpriorityboost +- BUG!!!: program wychrzania si� je�li data+czas pliku mie�ci si� poza zakresem 1970...2038 +- BUG: przy obliczaniu wolnego miejsca wyst�puje b��d off by 1B. + +1.13g (release #35) (dll release #16) +- MOD: okna definiowania skr�t�w i �cie�ek docelowych - po pierwsze - powinno da� si� definiowa� kolejno�� + w jakiej pojawiaj� si� w menu kontekstowym +- MOD: je�li po kompresji programu UPX'em dzia�a pod XP'kiem manifest - skompresowa� exe'ka i dll'ke. + +1.13h (release #36) (dll release #16) +- BUG: b��dne wykrywanie identyczno�ci dysku pod RAIDem... - zbyt ma�y bufor na urz�dzenia - zwi�kszy� +- MOD: lekkie zmiany textu - np. w angielskim one disk zamiast OD +- BUG: w dialogu wyboru foldera docelowego niepoprawnie jest wykrywana obecno�� stacji/�cie�ki dost�pu + do dyskietki. + +1.13i (release #37) (dll release #16) +- MOD: poprawiono niekt�re okna dialogowe tak, aby wy�wietla�y si� w taskbarze +- BUG: w oknie wyboru folderu docelowego podczas wpisywania r�cznego �cie�ki dost�pu w comboboxex ilo�� + wprowadzonego textu zale�y od wielko�ci okna - poprawi�. +- NEW: added french language resources thanx to Julien xxx ? +- MOD: change string table entries to be sorted in sections + Sections: + - INTERNAL PLUGIN ENTRIES (5000) 0...4999 + - MAIN STRINGS - UNIVERSAL (1000) 5000...5999 + - FREE MSG BOX SECTION (1000) 6000...6999 + - LOG ENTRIES (1000) 7000...7999 + - CONFIG NAMES/DESCRIPTIONS (1000) 8000...8999 + - SHELL EXTENSION SECTION (1000) 9000...9999 + - RESERVED (3000) 10000...12999 + - DIALOG SECTION (500/dialog) 13000...??? + // DIALOG - Browse for folder dialog 13000...13499 + // DIALOG - Folder Dialog (wo resource template) 13500...13999 + // DIALOG - AboutBox dialog 14000-14499 + // DIALOG - Buffer size dialog 14500-14999 + // DIALOG - Custom copy dialog 15000-15499 + // DIALOG - IDD_FEEDBACK_DSTFILE_DIALOG 15500-15999 + // DIALOG - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 16000-16499 + // DIALOG - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 16500-16999 + // DIALOG - IDD_FEEDBACK_REPLACE_FILES_DIALOG 17000-17499 + // DIALOG - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 17500-17999 + // DIALOG - Filter Dialog (IDD_FILTER_DIALOG) 18000-18499 + // DIALOG - MiniView 18500-18999 + // DIALOG - Options dialog 19000-19499 + // DIALOG - Recent paths editing (IDD_RECENTEDIT_DIALOG) 19500-19999 + // DIALOG - Replace Paths dialog 20000-20499 + // DIALOG - Shortcut edit dialog (IDD_SHORTCUTEDIT_DIALOG) 20500-20999 + // DIALOG - Shutdown dialog (IDD_SHUTDOWN_DIALOG) 21000-21499 + // DIALOG - Status dialog 21500-21999 + +1.20 (release #38) (dll release #17) +- ADD: Integrate v2 modules into v1: + * integrate config manager, res manager, log file, ... + * corrent some strings in string table - unneeded \r\n and incorrect formatting + * saving configuration in places where it should be saved +- ADD/MOD: introduce plugin-system - ie. with external languages handling +- PROJECT: copy the language dll into the right place in release builds +- OPT: optimized tray restart detection +- MOD: modify the about dialog to display version based on VERSION resource instad of static data entered + manually. +- PROJECT: change the program for building count-automodify of resources +- PROJECT: reorganize pleacement of readme's, todo's and other common files +- PROJECT: add a header for each file used in program - gnu gpl +- MOD: modify the about dialog to make it smaller (but to display more information). +- MOD: replace CStaticFilespec and CHyperlinkStatic to a new combined w32 component +- MOD: modify GetSizeSTring to get the kB strings from resources and not from code +- MOD: modify the CLanguageDialog - when dynamically changing language it calculates width and height of + a window&font bad way. +- MOD: correct the configuration work (+apply button) +- MOD: correct all dialogs to properly refresh after language has been changed. +- MOD: change all the comments to the english +- BUG: removed nasty gdi leak in staticex +- MOD: FRENCH - ABOUTBOX MODIFICATIONS, ADDITIONAL STRINGS INSERTED AT 5014 (GB, TB, PB) +- MOD: modify clanguagedialog or miniview to properly count the height of a new dialogs +- MOD: returning error code when (un)registering dll +- OPT: change RegisterShellExtDll and unregister funcs into one with a param. +- MOD: when there's no clipboard monitoring enabled the clipboard shouldn't be cleared from within dll +- BUG: there was a bug when using error Log functions +- CHANGE: zmieni� installera/uninstallera na co� 'bardziej' ? Albo poprawi� usuwanie dll'ki... +- BUG: when icon has been dbl-clicked more than once then status dialog appear more than once!!! + +1.25 (release #39) (dll release #17) +- BUG: corrected missing tooltip for page sponsor +- BUG: changed size of static texts components in status dialog - some letters were not visible. +- ADD: options dialog - option for html help file dir +- BUG: when in help mode (arrow with an '?') the hyperlinks in aboutbox are being activated + on clicking. +- OPT: add DisableThreadLibraryCalls to the dlls (look at func description). +- TEXT: + - ADDED: Main Menu->Help (command in menu to translate) + - ADDED: IDS_CFGHELPDIR_STRING, IDS_CFGHELPDIRCHOOSE_STRING, IDS_HELPERR_STRING + - ADDED: in Dialogs - Help buttons (IDC_HELP_BUTTON) + - STYLES: added many styles Help ID for controls with the help (and context help for dialogs) +- BUG: the entry in registry (run with system) does not have the '\\' before the program name. +- ADD: add the help files to the project + * when the help file is opened and the language changes - help file should be closed + * help is invoked for the progress bars in the status dialog - it shouldn't +- STRINGS: IDS_ABOUTVERSION_STRING, +- BUG: in folder dialog the shortcuts added to the list are not being saved + +1.26 (release #40) (dll release #18) +- MOD: add the new style to the static ex control - "use multiline", enable only if needed (about dlg) +- MOD: changed the style of the staticex control in the aboutbox (license note) (0x50000010 to 0x50000090) +- BUG: ctrl+drag causes bad explorer option to be selected. +- BUG: ctrl+V causes file to be copied even if there was ctrl+x before it (ctrl and drag problem) +- BUG: error updating header in task list (status dialog) +- MOD: languages has to be isolated to text-based files + * add config option - languages directory (added IDS_LANGUAGESFOLDER_STRING, IDS_LANGSFOLDERCHOOSE_STRING) + * mod config option - current language - has to be file(string)-based + * current language distinguishing by language file name + * interpreting path of type for language directory + * remove all references to a resource plugin + * modify the CIniFile to handle properly '#' signs (partial - read only support) + * interpretation on escape sequences + * modification of CLanguageDialog + * change loading the thanx text from resources (remove the IDS_ABTNOTHANX_STRING/14000 string - unused) + * help handling (name got from lng file) + * status dialog - resize controls to give the maximum size needed + * translation of \r, \n and \t +- BUG: selecting folder for use in options dialog doesn't append the '\\' to the path +- BUG: Drawing text in property listbox causes & to be trated as underline +- TEXT: change "" to " in string table in all languages +- BUG: thanks text is not being translated (\r\n\t) +- ADD: when not enough room dialog appears and in some moment there is enough place the dialog should + disappear with continue effect +- MOD: status dialog modification not worth mentioning +- TEXT: button id 1122 - erased text +- BUG: when no language is available - program displays info and then crashes +- MOD: change the names of the program and the of files to the 8.3 standard (changed strings 6001-6004) +- MOD: when selecting the new language - make it relative to a program dir (if possible) +- PROJECT: change the names of the build counter files to something shorter +- MOD: make help managing a bit simpler +- STRINGS: 14002, 14003 added, modified the external text-based string +- MOD: do sth with the translations/thanx stuff +- MOD: modify the documentation (history, options, mainmenu, thanx, [a]faq, keyword faq, added faq to index) + +1.27 (release #41) +- MOD: isolated the internal stuff of CWinApp to CAppHelper +- MOD: make the CLanguageDialog separate module for use in other applications + * remove replacing STATICEX with value 0x0086 + * replace MESSAGE MAP with WindowProc handling + - make the STATICEX change the value when needed +- MOD: many changes to exception modules C...Exception(Ex), macros support, ... +- MOD: added serialization support for CFileEx (with crc checking) - not used in program +- BUG: problem with copying folders with a dot as a first char of name +- MOD: changed stl to the stlPort from http://www.stlport.com \ No newline at end of file Index: other/readme.txt =================================================================== diff -u --- other/readme.txt (revision 0) +++ other/readme.txt (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,18 @@ +THIS CODE IS NOT A MASTERPIECE, SO DON'T EXPECT THAT IT'S FULLY OPTIMIZED OR STH. +IT'S VERY INEFFECTIVE, SLOW AND BUGGY, SO IF YOU HAVE ANY COMMENTS - SEND ME A MAIL TO copyhandler@o2.pl, +OR BETTER - SUBSCRIBE THE DISCUSSION FORUM CHDEV (AS STATED IN README FILE OF THE PROGRAM). +ANY HELP OR COMMENTS WOULD BE HIGHLY APPRECIATED. + +How to build it ? +----------------- +You have to change some paths in the files included in the project - which one ? Try to build it and you'll know. +Add the App framework folder and folder where debug.h is placed to the include directories in tools->options->directories. I do not include "build manager.exe" - it's the program for counting builds. Just remove all references to it. If something is missing - please let me know. + +What do you need to build it ? (This is the minimum to build a program) +------------------------------ +- Visual Studio 6.0. + +But I suggest to use the following: +- Service Pack 5 for Visual Studio 6.0 +- Platform SDK February 2003 +- UPX Software for executable compression Index: other/sdk/CH SDK.hhc =================================================================== diff -u --- other/sdk/CH SDK.hhc (revision 0) +++ other/sdk/CH SDK.hhc (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,43 @@ + + + + + + + + + +
    +
  • + + + +
  • + + +
      +
    • + + + +
    +
  • + + + +
      +
    • + + + +
    • + + + +
    • + + + +
    +
+ Index: other/sdk/CH SDK.hhk =================================================================== diff -u --- other/sdk/CH SDK.hhk (revision 0) +++ other/sdk/CH SDK.hhk (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,9 @@ + + + + + + +
    +
+ Index: other/sdk/CH SDK.hhp =================================================================== diff -u --- other/sdk/CH SDK.hhp (revision 0) +++ other/sdk/CH SDK.hhp (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,27 @@ +[OPTIONS] +Auto Index=Yes +Binary TOC=Yes +Compatibility=1.1 or later +Compiled file=CH SDK.chm +Contents file=CH SDK.hhc +Default topic=welcome.htm +Display compile progress=Yes +Full-text search=Yes +Index file=CH SDK.hhk +Language=0x409 English (United States) +Title=Copy Handler Software Development Kit + + +[FILES] +generating plugin id.html +welcome.htm +ldk_main.htm +ldk_program.htm +ldk_help.htm +ldk_remarks.htm +ch.gif +headfoot.js +style.css + +[INFOTYPES] + Index: other/sdk/ch.gif =================================================================== diff -u Binary files differ Index: other/sdk/generating plugin id.html =================================================================== diff -u --- other/sdk/generating plugin id.html (revision 0) +++ other/sdk/generating plugin id.html (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,28 @@ + + + + + + +Generating plugin ID + + + + + +
+Each plugin has its associated unique 64-bit value. This is the structure of this number and a way to generate it: +
+
+ + + + + + +
BitsSize (in bits)Description
63...568Reserved for program internal usage (for messaging purposes). Must be 0.
55...488Reserved for program internal plugins. For external plugins must be 0.
47...408Specifies the plugin type. It it only a suggestion - program will NOT distinguish plugin types through this member. Copy Handler treat this value as a part of the next member.
39...040This the unique plugin ID. You should generate it by yourself (as a randomize integer). To reserve a number for official purposes (ie. when you want to write your own plugin and share it through the web site) write to me
+ + + + + Index: other/sdk/headfoot.js =================================================================== diff -u --- other/sdk/headfoot.js (revision 0) +++ other/sdk/headfoot.js (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,24 @@ +function header(text) +{ + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write(""); + document.write("
"); + document.write("\"CH"); + document.write("
Copy Handler Software Development Kit Documentation
"); + document.write("
"); + document.write( text ); + document.write("
"); + document.write("

"); +} + +function footer() +{ + document.write("
"); + document.write("
"); + document.write("
Copyright � 2004 Ixen Gerthannes.
"); + document.write("
"); + document.write("
"); +} \ No newline at end of file Index: other/sdk/ldk_help.htm =================================================================== diff -u --- other/sdk/ldk_help.htm (revision 0) +++ other/sdk/ldk_help.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,47 @@ + + + + + + + + + + + +
+The help source contains a lot of files: +
    +
  • the <number>.txt files - they contains the tool tips for the buttons, lists, ... on the dialog boxes.
    +The are in the form of: +
    +.topic 0x00
    +No topic has been associated with this item.
    +
    +.topic 1
    +Closes this window.
    +
    +.topic IDH_HOMEPAGELINK_STATIC
    +Link to this program's home page.
    +
    +.topic IDH_HOSTLINK_STATIC
    +Link to the web page of our web page sponsor.
    +
    + +The lines that begins with '.topic <something>' specifies the combined identifier of the dialog box/control id for which there is the tool tip text.
    +Below there is a text that will be shown for the control in the dialog box. +
  • +
  • +file headfoot.js - javascript used to display the header and footer of each page. You can change the footer to enter you as the author or to change anything else. +
  • +
  • +<something>.htm - these files are the html pages that describes some topics. You shouldn't have any problem with translating it if you are a bit familiar with the html. +
  • +
  • +files help.hhc, help.hhk and help.hhp are the MS Html Help Workshop files used to build the compiled .chm help files. You can either use the MS tool (easier way) or edit the files manually (do this if you know what you are doing). They contains the keywords, the topic names and some other info. +
  • +
+ + + + Index: other/sdk/ldk_main.htm =================================================================== diff -u --- other/sdk/ldk_main.htm (revision 0) +++ other/sdk/ldk_main.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,25 @@ + + + + + + + + + + + +
+This section describes the language development kit - what it contains, what needs to be done if you want to translate the program and/or help system to your language and other things you should generally know.

+ + + +
+ + + + Index: other/sdk/ldk_program.htm =================================================================== diff -u --- other/sdk/ldk_program.htm (revision 0) +++ other/sdk/ldk_program.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,84 @@ + + + + + + + + + + + +
+To translate a program to your native language you need to edit the file program.lng.
+This file is divided into sections: +
    +
  • Info section - it looks like this: +
    +[Info]
    +Lang Name=English
    +Lang Code=1033
    +Base Language=
    +Font Face=Tahoma
    +Charset=1
    +Size=8
    +RTL reading order=0
    +Help name=english.chm
    +Author=Ixen Gerthannes
    +Version=1.26
    +
    + + + + + + + + + + + +
    FieldDescription
    Lang namethe name of your language.
    Lang codethe language ID of your language.
    Base languagethe name of the other language file that will be used if there are some missing strings in your file. You would probably put here 'english.lng'.
    Font FaceName of the font that will be used to display dialog boxes. The standard font for dialog boxes is 'Tahoma' - change it when the standard font does not properly display the text in your language.
    Charsetcharset code of the font you are using
    SizePoint size of the font
    RTL reading orderspecifies if the language should be read in right-to-left (some Arabic languages) order or left-to right (most of the European languages).
    Authorthe name of the person that has translated this file
    Versionversion of this translation file - it should be the version of program for which the file has been prepared.
    +
  • +
    +
  • Menus, dialog boxes and string table - all of them are in the form of: +
    +[135]
    +32774=Time critical
    +32775=Highest
    +32776=Above normal
    +32777=Normal
    +32778=Below normal
    +
    + +The number in square brackets contains the identifier of the main resource. The '[0]' section is the one that contains the string table. The strings are in the form 'id=text'. The id is either control id (in the dialog boxes) or menu item id (in menus) or the string id (in the string table).

    + +When translating the menus make sure: +
      +
    • that you change the ampersands chars ('&') in the way that in the each menu there are not the same two combinations of ampersand and the letter forward to it. (ie. the shouldn't be '&Exit' and 'Chang&e' strings in one menu because the '&' sign precedes two times the 'e' letter.
    • +
    +

    +When translating the dialog boxes make sure: +
      +
    • that you leave the spaces ' ' one the beginning and at the end of a string if there were any in the source translation. They are needed by the program to properly display some things.
    • +
    + +

    + +When translating the string table make sure: +
      +
    • that you do not change the order of the formatting strings (they begins with the '%' sign - ie. %s, %lu, ...) nor delete them. It could cause the program to work unstable or to crash.
    • +
    • that you leave the space characters at the beginning and at the end of the line if there are any (just liku in dialog boxes).
    • +
    • that you properly modify the strings - there are some character pairs that has a special meaning (they are translated before showing the text in program) - '\t' is translated to a tab, '\r' to a carriage-return and '\n' to new-line.
    • +
    + +
  • +
+
+And do not forget to change the file program.lng to something like arabic.lng or russian.lng so anybody would know what language it is. + +
+ + + + Index: other/sdk/ldk_remarks.htm =================================================================== diff -u --- other/sdk/ldk_remarks.htm (revision 0) +++ other/sdk/ldk_remarks.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,30 @@ + + + + + + + + + + + +
+Because many people have been writing recently about the translation stuff - I have made this Language Development Kit.

+To get rid of many other problems - there are some rules about the translation process (regarding only the people that wants their translation to be shipped with program or put on our web page): +
    +
  • Send me the finished translation. No partially finished, but fully (either a program translation or program+help translation)
  • +
  • If you do not want to be surprised that someone else has finished the translation (in your native language) before you - please inform me (by sending mail to copyhandler@o2.pl) that you will translate the stuff. In the situation where some other person already have started doing the job (or has volunteered to do so before you) - let me know if you want me to give that person your e-mail address (and vice versa) or just to inform you that someone is doing the stuff.
  • +
  • You can always do the parallel translation so there would be two of them ;-]
  • +
  • You have to agree that if someone else will volunteer to do the same job as you and want the mail exchange (look @above) - I will give him/her your e-mail address (and I will send his/her e-mail address to you).
  • +
  • You definitely have to sign in to the discussion group 'chdev' (the current mail addresses are in the program's about box). I will send there any modifications that has been made by me to the original file(s).
  • +
  • When I will be about to release the new version of program I will send the info about his plans to this group so anyone would get to work and incorporate the changes to the translation. When this fact occurs I will wait full week (7 days) for your translations to appear on my e-mail account (copyhandler@o2.pl). After this time I will release the program only with the translations that has been updated (maybe I will wait a few additional days - but not always).
  • +
+ +
+I you have any questions - send it to me or post on the discussion list (copyhandler or chdev - depends on the topic) - the current addresses are in the about box in the program. +
+ + + + Index: other/sdk/style.css =================================================================== diff -u --- other/sdk/style.css (revision 0) +++ other/sdk/style.css (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,47 @@ + Index: other/sdk/template.htm =================================================================== diff -u --- other/sdk/template.htm (revision 0) +++ other/sdk/template.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,16 @@ + + + + + + + + + + + + Contents + + + + Index: other/sdk/welcome.htm =================================================================== diff -u --- other/sdk/welcome.htm (revision 0) +++ other/sdk/welcome.htm (revision 3e1186252ab31f63d86d86c4b0ff593cfffbefde) @@ -0,0 +1,20 @@ + + + + + + +Welcome + + + + + +
+This is the small documentation (or rather a set of a few documents) about the things you can do to extend the functionality of Copy Handler. +If you have any questions - ask me. +
+ + + +