├── .gitignore ├── AddBatchDownloadDlg.cpp ├── AddBatchDownloadDlg.h ├── AppRegs.cpp ├── AppRegs.h ├── CVS ├── Entries ├── Entries.Extra ├── Repository └── Root ├── CategoryDlg.cpp ├── CategoryDlg.h ├── CategoryTree.cpp ├── CategoryTree.h ├── ColorButton.cpp ├── ColorButton.h ├── ColourPopup.cpp ├── ColourPopup.h ├── CommFunc.cpp ├── CommonUtils.cpp ├── CommonUtils.h ├── ContentListView.cpp ├── ContentListView.h ├── Debug ├── Default.jcd └── MyGet.tlog │ ├── BscMake.command.1.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── MyGet.lastbuildstate │ ├── bscmake.read.1.tlog │ ├── bscmake.write.1.tlog │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ ├── link.write.1.tlog │ ├── rc.command.1.tlog │ ├── rc.read.1.tlog │ └── rc.write.1.tlog ├── Default.jcd ├── DownloadDlg.cpp ├── DownloadDlg.h ├── DownloadFtpJet.cpp ├── DownloadFtpJet.h ├── DownloadHttpJet.cpp ├── DownloadHttpJet.h ├── DownloadItemManager.cpp ├── DownloadItemManager.h ├── DownloadJet.cpp ├── DownloadJet.h ├── DownloadPropertyPage.cpp ├── DownloadPropertyPage.h ├── DownloadScheduler.cpp ├── DownloadScheduler.h ├── DownloadSchedulerThread.cpp ├── DownloadSchedulerThread.h ├── EventDrivedSocket.cpp ├── EventDrivedSocket.h ├── FileName.cpp ├── FileName.h ├── FlashGetToolBar.cpp ├── FlashGetToolBar.h ├── FlashGetTray.cpp ├── FlashGetTray.h ├── FolderSelectionDlg.cpp ├── FolderSelectionDlg.h ├── Ftp.cpp ├── Ftp.h ├── HistogramCtrl.cpp ├── HistogramCtrl.h ├── IndexTreeView.cpp ├── IndexTreeView.h ├── InputDlg.cpp ├── InputDlg.h ├── ItemHeader.cpp ├── ItemHeader.h ├── ItemListView.cpp ├── ItemListView.h ├── JCDFile.cpp ├── JCDFile.h ├── LICENSE ├── ListItem.cpp ├── ListItem.h ├── MainFrm.cpp ├── MainFrm.h ├── MyGet.aps ├── MyGet.clw ├── MyGet.cpp ├── MyGet.dsp ├── MyGet.dsw ├── MyGet.h ├── MyGet.ncb ├── MyGet.opt ├── MyGet.plg ├── MyGet.rc ├── MyGet.vcxproj ├── MyGet.vcxproj.filters ├── MyGet1.rc ├── MyGet2.rc ├── MyGetDoc.cpp ├── MyGetDoc.h ├── MyGetView.cpp ├── MyGetView.h ├── NewFolderDlg.cpp ├── NewFolderDlg.h ├── OptionSheet.cpp ├── OptionSheet.h ├── OptionsConnectionPage.cpp ├── OptionsConnectionPage.h ├── OptionsDialUpPage.cpp ├── OptionsDialUpPage.h ├── OptionsFileManagementPage.cpp ├── OptionsFileManagementPage.h ├── OptionsGeneralPage.cpp ├── OptionsGeneralPage.h ├── OptionsGraphLogPage.cpp ├── OptionsGraphLogPage.h ├── OptionsLoginPage.cpp ├── OptionsLoginPage.h ├── OptionsMirrorPage.cpp ├── OptionsMirrorPage.h ├── OptionsMonitorPage.cpp ├── OptionsMonitorPage.h ├── OptionsOtherPage.cpp ├── OptionsOtherPage.h ├── OptionsProtocolPage.cpp ├── OptionsProtocolPage.h ├── OptionsProxyPage.cpp ├── OptionsProxyPage.h ├── OptionsSchedulePage.cpp ├── OptionsSchedulePage.h ├── OptionsSoundPage.cpp ├── OptionsSoundPage.h ├── ProgressChart.cpp ├── ProgressChart.h ├── ProxyData.cpp ├── ProxyData.h ├── ProxySettingsDlg.cpp ├── ProxySettingsDlg.h ├── README.md ├── SetupAlternativeURLsDlg.cpp ├── SetupAlternativeURLsDlg.h ├── ShellPidl.cpp ├── ShellPidl.h ├── ShellTree.cpp ├── ShellTree.h ├── Sizecbar.cpp ├── Sizecbar.h ├── SocksPacket.cpp ├── SocksPacket.h ├── StdAfx.cpp ├── StdAfx.h ├── TE_Socket.cpp ├── TE_Socket.h ├── TabCtrl.cpp ├── TabCtrl.h ├── TabDef.h ├── TabView.cpp ├── Tabview.h ├── TreeItem.cpp ├── TreeItem.h ├── a.jcd ├── img ├── 1.jpg └── 2.jpg ├── language ├── CVS │ ├── Entries │ ├── Entries.Extra │ ├── Repository │ └── Root ├── jcchs.ini ├── jcchs.ini.bak ├── jccht.ini ├── jceng.ini └── jceng.ini.bak ├── res ├── CVS │ ├── Entries │ ├── Entries.Extra │ ├── Repository │ └── Root ├── MyGet.ico ├── MyGet.rc2 ├── MyGetDoc.ico ├── bitmap1.bmp ├── bmp00001.bmp ├── bmp133.bmp ├── bmp145.bmp ├── bmp159.bmp ├── bmp160.bmp ├── bmp199.bmp ├── bmp200.bmp ├── check_bo.bmp ├── choice_t.bmp ├── content_.bmp ├── idr_main.ico ├── item_ico.bmp ├── list_ite.bmp ├── mainfram.bmp ├── others.bmp ├── tray.ico ├── tray1.ico ├── tray2.ico └── tray3.ico └── resource.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /AddBatchDownloadDlg.cpp: -------------------------------------------------------------------------------- 1 | // AddBatchDownloadDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "AddBatchDownloadDlg.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // CAddBatchDownloadDlg dialog 16 | 17 | 18 | CAddBatchDownloadDlg::CAddBatchDownloadDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CAddBatchDownloadDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CAddBatchDownloadDlg) 22 | // NOTE: the ClassWizard will add member initialization here 23 | //}}AFX_DATA_INIT 24 | } 25 | 26 | 27 | void CAddBatchDownloadDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CAddBatchDownloadDlg) 31 | // NOTE: the ClassWizard will add DDX and DDV calls here 32 | //}}AFX_DATA_MAP 33 | } 34 | 35 | 36 | BEGIN_MESSAGE_MAP(CAddBatchDownloadDlg, CDialog) 37 | //{{AFX_MSG_MAP(CAddBatchDownloadDlg) 38 | //}}AFX_MSG_MAP 39 | END_MESSAGE_MAP() 40 | 41 | ///////////////////////////////////////////////////////////////////////////// 42 | // CAddBatchDownloadDlg message handlers 43 | 44 | BOOL CAddBatchDownloadDlg::OnInitDialog() 45 | { 46 | CDialog::OnInitDialog(); 47 | 48 | // TODO: Add extra initialization here 49 | ReLoadResource(); 50 | return TRUE; // return TRUE unless you set the focus to a control 51 | // EXCEPTION: OCX Property Pages should return FALSE 52 | } 53 | 54 | void CAddBatchDownloadDlg::ReLoadResource() 55 | { 56 | //common 57 | //SetDlgItemText(1, APP_GET_RSCSTR("Dialog_Common", 1)); 58 | //SetDlgItemText(2, APP_GET_RSCSTR("Dialog_Common", 2)); 59 | SET_DLG_ITEM_TEXT_EX(1, "Dialog_Common", 1); 60 | SET_DLG_ITEM_TEXT_EX(2, "Dialog_Common", 2); 61 | 62 | //Dlg Items 63 | LPCTSTR lpszDlgID = _T("AddBatch_DLG"); 64 | //SetWindowText(APP_GET_RSCSTR(lpszDlgID, "Title")); 65 | SET_WINDOW_TITLE; 66 | SET_DLG_ITEM_TEXT(1197); 67 | SET_DLG_ITEM_TEXT(1198); 68 | SET_DLG_ITEM_TEXT(1199); 69 | SET_DLG_ITEM_TEXT(1200); 70 | SET_DLG_ITEM_TEXT(1201); 71 | SET_DLG_ITEM_TEXT(1202); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /AddBatchDownloadDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ADDBATCHDOWNLOADDLG_H__37F74E75_C1E5_4733_831E_473D273F648F__INCLUDED_) 2 | #define AFX_ADDBATCHDOWNLOADDLG_H__37F74E75_C1E5_4733_831E_473D273F648F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // AddBatchDownloadDlg.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CAddBatchDownloadDlg dialog 12 | 13 | class CAddBatchDownloadDlg : public CDialog 14 | { 15 | // Construction 16 | public: 17 | void ReLoadResource(); 18 | CAddBatchDownloadDlg(CWnd* pParent = NULL); // standard constructor 19 | 20 | // Dialog Data 21 | //{{AFX_DATA(CAddBatchDownloadDlg) 22 | enum { IDD = IDD_ADD_BATCH_DOWNLOAD }; 23 | //}}AFX_DATA 24 | 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(CAddBatchDownloadDlg) 29 | protected: 30 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | protected: 35 | 36 | // Generated message map functions 37 | //{{AFX_MSG(CAddBatchDownloadDlg) 38 | virtual BOOL OnInitDialog(); 39 | //}}AFX_MSG 40 | DECLARE_MESSAGE_MAP() 41 | }; 42 | 43 | //{{AFX_INSERT_LOCATION}} 44 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 45 | 46 | #endif // !defined(AFX_ADDBATCHDOWNLOADDLG_H__37F74E75_C1E5_4733_831E_473D273F648F__INCLUDED_) 47 | -------------------------------------------------------------------------------- /CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | D/Debug/// 2 | D/language/// 3 | D/res/// 4 | /EventDrivedSocket.h/// 5 | /EventDrivedSocket.cpp/// 6 | /TreeItem.h/// 7 | /TreeItem.cpp/// 8 | /TE_Socket.h/// 9 | /TE_Socket.cpp/// 10 | /Tabview.h/// 11 | /TabView.cpp/// 12 | /TabDef.h/// 13 | /TabCtrl.h/// 14 | /TabCtrl.cpp/// 15 | /StdAfx.h/// 16 | /StdAfx.cpp/// 17 | /SocksPacket.h/// 18 | /SocksPacket.cpp/// 19 | /Sizecbar.h/// 20 | /Sizecbar.cpp/// 21 | /ShellTree.h/// 22 | /ShellTree.cpp/// 23 | /ShellPidl.h/// 24 | /ShellPidl.cpp/// 25 | /SetupAlternativeURLsDlg.h/// 26 | /SetupAlternativeURLsDlg.cpp/// 27 | /resource.h/// 28 | /ProxySettingsDlg.h/// 29 | /ProxySettingsDlg.cpp/// 30 | /ProxyData.h/// 31 | /ProxyData.cpp/// 32 | /ProgressChart.h/// 33 | /ProgressChart.cpp/// 34 | /OptionsSoundPage.h/// 35 | /OptionsSoundPage.cpp/// 36 | /OptionsSchedulePage.h/// 37 | /OptionsSchedulePage.cpp/// 38 | /OptionsProxyPage.h/// 39 | /OptionsProxyPage.cpp/// 40 | /OptionsProtocolPage.h/// 41 | /OptionsProtocolPage.cpp/// 42 | /OptionsOtherPage.h/// 43 | /OptionsOtherPage.cpp/// 44 | /OptionsMonitorPage.h/// 45 | /OptionsMonitorPage.cpp/// 46 | /OptionsMirrorPage.h/// 47 | /OptionsMirrorPage.cpp/// 48 | /OptionsLoginPage.h/// 49 | /OptionsLoginPage.cpp/// 50 | /OptionSheet.h/// 51 | /OptionSheet.cpp/// 52 | /OptionsGraphLogPage.h/// 53 | /OptionsGraphLogPage.cpp/// 54 | /OptionsGeneralPage.h/// 55 | /OptionsGeneralPage.cpp/// 56 | /OptionsFileManagementPage.h/// 57 | /OptionsFileManagementPage.cpp/// 58 | /OptionsDialUpPage.h/// 59 | /OptionsDialUpPage.cpp/// 60 | /OptionsConnectionPage.h/// 61 | /OptionsConnectionPage.cpp/// 62 | /NewFolderDlg.h/// 63 | /NewFolderDlg.cpp/// 64 | /MyGetView.h/// 65 | /MyGetView.cpp/// 66 | /MyGetDoc.h/// 67 | /MyGetDoc.cpp/// 68 | /MyGet2.rc/// 69 | /MyGet1.rc/// 70 | /MyGet.rc/// 71 | /MyGet.h/// 72 | /MyGet.dsw/// 73 | /MyGet.dsp/// 74 | /MyGet.cpp/// 75 | /MyGet.clw/// 76 | /MainFrm.h/// 77 | /MainFrm.cpp/// 78 | /ListItem.h/// 79 | /ListItem.cpp/// 80 | /JCDFile.h/// 81 | /JCDFile.cpp/// 82 | /ItemListView.h/// 83 | /ItemListView.cpp/// 84 | /ItemHeader.h/// 85 | /ItemHeader.cpp/// 86 | /InputDlg.h/// 87 | /InputDlg.cpp/// 88 | /IndexTreeView.h/// 89 | /IndexTreeView.cpp/// 90 | /HistogramCtrl.h/// 91 | /HistogramCtrl.cpp/// 92 | /Ftp.h/// 93 | /Ftp.cpp/// 94 | /FolderSelectionDlg.h/// 95 | /FolderSelectionDlg.cpp/// 96 | /FlashGetTray.h/// 97 | /FlashGetTray.cpp/// 98 | /FlashGetToolBar.h/// 99 | /FlashGetToolBar.cpp/// 100 | /FileName.h/// 101 | /FileName.cpp/// 102 | /DownloadSchedulerThread.h/// 103 | /DownloadSchedulerThread.cpp/// 104 | /DownloadScheduler.h/// 105 | /DownloadScheduler.cpp/// 106 | /DownloadPropertyPage.h/// 107 | /DownloadPropertyPage.cpp/// 108 | /DownloadJet.h/// 109 | /DownloadJet.cpp/// 110 | /DownloadItemManager.h/// 111 | /DownloadItemManager.cpp/// 112 | /DownloadHttpJet.h/// 113 | /DownloadHttpJet.cpp/// 114 | /DownloadFtpJet.h/// 115 | /DownloadFtpJet.cpp/// 116 | /DownloadDlg.h/// 117 | /DownloadDlg.cpp/// 118 | /ContentListView.h/// 119 | /ContentListView.cpp/// 120 | /CommonUtils.h/// 121 | /CommonUtils.cpp/// 122 | /CommFunc.cpp/// 123 | /ColourPopup.h/// 124 | /ColourPopup.cpp/// 125 | /ColorButton.h/// 126 | /ColorButton.cpp/// 127 | /CategoryTree.h/// 128 | /CategoryTree.cpp/// 129 | /CategoryDlg.h/// 130 | /CategoryDlg.cpp/// 131 | /AppRegs.h/// 132 | /AppRegs.cpp/// 133 | /AddBatchDownloadDlg.h/// 134 | /AddBatchDownloadDlg.cpp/// 135 | -------------------------------------------------------------------------------- /CVS/Repository: -------------------------------------------------------------------------------- 1 | UniNet.ML/MyGet 2 | -------------------------------------------------------------------------------- /CVS/Root: -------------------------------------------------------------------------------- 1 | :local:c:\cvsstorage 2 | -------------------------------------------------------------------------------- /CategoryDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/CategoryDlg.cpp -------------------------------------------------------------------------------- /CategoryDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_CATEGORYDLG_H__06C12443_3D58_11D5_9A67_0020E0101471__INCLUDED_) 2 | #define AFX_CATEGORYDLG_H__06C12443_3D58_11D5_9A67_0020E0101471__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // CategoryDlg.h : header file 8 | // 9 | #include "CategoryTree.h" 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CCategoryDlg dialog 12 | //define Category Dialog Type 13 | #define CATEGORY_NEW_DLG 1 14 | #define CATEGORY_MOVETO_DLG 2 15 | #define CATEGORY_PROPERTY_DLG 3 16 | 17 | class CCategoryDlg : public CDialog 18 | { 19 | // Construction 20 | public: 21 | void ReloadResource(); 22 | int m_iNewItemID; 23 | BOOL m_bCanMove; 24 | CCategoryTree *m_pMainCategoryTree; 25 | int m_typeDlg; 26 | CCategoryDlg(CWnd* pParent = NULL); // standard constructor 27 | HTREEITEM m_hCurrentItem; 28 | 29 | // Dialog Data 30 | //{{AFX_DATA(CCategoryDlg) 31 | enum { IDD = IDD_CATEGORY }; 32 | CString m_textTotalFiles; 33 | CString m_textTitle; 34 | CString m_textSubCategoryCount; 35 | CString m_textDownloadedSize; 36 | CString m_textTotalDownloadedFiles; 37 | CString m_strCategoryName; 38 | CString m_strDefaultDir; 39 | //}}AFX_DATA 40 | 41 | 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(CCategoryDlg) 45 | protected: 46 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 47 | //}}AFX_VIRTUAL 48 | 49 | // Implementation 50 | protected: 51 | CTreeCtrl m_treeCategory; 52 | 53 | // Generated message map functions 54 | //{{AFX_MSG(CCategoryDlg) 55 | virtual BOOL OnInitDialog(); 56 | afx_msg void OnSelchangedCategoryTree(NMHDR* pNMHDR, LRESULT* pResult); 57 | afx_msg void OnChangeDefaultDirEdit(); 58 | afx_msg void OnChangeCategoryNameEdit(); 59 | virtual void OnOK(); 60 | afx_msg void OnBrowseFolderButton(); 61 | //}}AFX_MSG 62 | DECLARE_MESSAGE_MAP() 63 | private: 64 | void prv_FinalUpdateCategory(); 65 | void prv_FinalMoveCategory(); 66 | void prv_FinalNewCategory(); 67 | CString m_strBaseDefaultDir; 68 | void prv_MakeDefaultDir(); 69 | BOOL m_bIsDefaultDirModifiedByUser; 70 | void prv_CopyTreeItem(HTREEITEM hSrcItem, HTREEITEM hDestParentItem); 71 | void prv_CopyTree(); 72 | void prv_FillTreeDlg(); 73 | void GetItemStatistic(HTREEITEM hItem, int *piTotalSubCategory, int *piTotalFiles, int *piTotalDownloadedFiles, int *piDownloadedSize); 74 | BOOL prv_FillPropDlg(); 75 | BOOL prv_SetupDlg(); 76 | }; 77 | 78 | //{{AFX_INSERT_LOCATION}} 79 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 80 | 81 | #endif // !defined(AFX_CATEGORYDLG_H__06C12443_3D58_11D5_9A67_0020E0101471__INCLUDED_) 82 | -------------------------------------------------------------------------------- /CategoryTree.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_CATEGORYTREE_H__E3CCA786_3EB8_11D5_9A6A_0020E0101471__INCLUDED_) 2 | #define AFX_CATEGORYTREE_H__E3CCA786_3EB8_11D5_9A6A_0020E0101471__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // CategoryTree.h : header file 8 | // 9 | class CTreeItem; 10 | class CListItem; 11 | class CJCDFile; 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // CCategoryTree window 14 | 15 | #define ROOT_OF_FLASHGET ((HTREEITEM)-1) 16 | 17 | class CCategoryTree : public CTreeCtrl 18 | { 19 | // Construction 20 | public: 21 | CCategoryTree(); 22 | 23 | // Attributes 24 | public: 25 | 26 | // Operations 27 | public: 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(CCategoryTree) 32 | //}}AFX_VIRTUAL 33 | 34 | // Implementation 35 | public: 36 | void ReloadResource(); 37 | void MoveDownloadedItemToDownloadedCategory(CListItem *pListItem); 38 | void AddNewDownloadItem(CListItem *pListItem); 39 | HTREEITEM MoveCategory(HTREEITEM hMovedItem, HTREEITEM hMoveToItem); 40 | void DeleteCategory(HTREEITEM hItem = TVI_ROOT, BOOL bFreeMEM = TRUE); 41 | DWORD GetTotalItemCount(HTREEITEM hItem = TVI_ROOT); 42 | BOOL SaveToFile(LPCTSTR lpszFileName); 43 | BOOL InsertTreeItem(CTreeItem *pTreeItem); 44 | BOOL AttachListItem(CListItem *pListItem); 45 | BOOL prv_LoadAndInsertItem(CJCDFile *pJCDFile); 46 | BOOL LoadFromFile(LPCTSTR lpszFileName); 47 | HTREEITEM m_hSelectedTreeItem; 48 | HTREEITEM GetHTREEITEMByID(int iID, HTREEITEM hCurrentItem = TVI_ROOT); 49 | int GetUniqueID(); 50 | BOOL CreateTree(CWnd *Parent, UINT nId); 51 | virtual ~CCategoryTree(); 52 | 53 | // Generated message map functions 54 | protected: 55 | //{{AFX_MSG(CCategoryTree) 56 | afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult); 57 | afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); 58 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 59 | //}}AFX_MSG 60 | 61 | DECLARE_MESSAGE_MAP() 62 | private: 63 | BOOL prv_SaveItemToFile(HTREEITEM hItem, CJCDFile *pJCDFile); 64 | int prv_GetMaxID(HTREEITEM hItem); 65 | }; 66 | 67 | ///////////////////////////////////////////////////////////////////////////// 68 | 69 | //{{AFX_INSERT_LOCATION}} 70 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 71 | 72 | #endif // !defined(AFX_CATEGORYTREE_H__E3CCA786_3EB8_11D5_9A6A_0020E0101471__INCLUDED_) 73 | -------------------------------------------------------------------------------- /ColourPopup.h: -------------------------------------------------------------------------------- 1 | #ifndef COLOURPOPUP_INCLUDED 2 | #define COLOURPOPUP_INCLUDED 3 | #pragma once 4 | 5 | #if _MSC_VER >= 1000 6 | #pragma once 7 | #endif // _MSC_VER >= 1000 8 | 9 | // ColourPopup.h : header file 10 | // 11 | // Written by Chris Maunder (chrismaunder@codeguru.com) 12 | // Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de) 13 | // Copyright (c) 1998. 14 | // 15 | // This code may be used in compiled form in any way you desire. This 16 | // file may be redistributed unmodified by any means PROVIDING it is 17 | // not sold for profit without the authors written consent, and 18 | // providing that this notice and the authors name is included. If 19 | // the source code in this file is used in any commercial application 20 | // then a simple email would be nice. 21 | // 22 | // This file is provided "as is" with no expressed or implied warranty. 23 | // The author accepts no liability if it causes any damage whatsoever. 24 | // It's free - so you get what you pay for. 25 | 26 | 27 | // CColourPopup messages 28 | #define CPN_SELCHANGE WM_USER + 1001 // Colour Picker Selection change 29 | #define CPN_DROPDOWN WM_USER + 1002 // Colour Picker drop down 30 | #define CPN_CLOSEUP WM_USER + 1003 // Colour Picker close up 31 | #define CPN_SELENDOK WM_USER + 1004 // Colour Picker end OK 32 | #define CPN_SELENDCANCEL WM_USER + 1005 // Colour Picker end (cancelled) 33 | 34 | // forward declaration 35 | class CColourPicker; 36 | 37 | // To hold the colours and their names 38 | typedef struct { 39 | COLORREF crColour; 40 | TCHAR *szName; 41 | } ColourTableEntry; 42 | 43 | ///////////////////////////////////////////////////////////////////////////// 44 | // CColourPopup window 45 | 46 | class CColourPopup : public CWnd 47 | { 48 | // Construction 49 | public: 50 | CColourPopup(); 51 | CColourPopup(CPoint p, COLORREF crColour, CWnd* pParentWnd, 52 | LPCTSTR szDefaultText = NULL, LPCTSTR szCustomText = NULL); 53 | void Initialise(); 54 | 55 | // Attributes 56 | public: 57 | 58 | // Operations 59 | public: 60 | BOOL Create(CPoint p, COLORREF crColour, CWnd* pParentWnd, 61 | LPCTSTR szDefaultText = NULL, LPCTSTR szCustomText = NULL); 62 | 63 | // Overrides 64 | // ClassWizard generated virtual function overrides 65 | //{{AFX_VIRTUAL(CColourPopup) 66 | public: 67 | virtual BOOL PreTranslateMessage(MSG* pMsg); 68 | //}}AFX_VIRTUAL 69 | 70 | // Implementation 71 | public: 72 | virtual ~CColourPopup(); 73 | 74 | protected: 75 | BOOL GetCellRect(int nIndex, const LPRECT& rect); 76 | void FindCellFromColour(COLORREF crColour); 77 | void SetWindowSize(); 78 | void CreateToolTips(); 79 | void ChangeSelection(int nIndex); 80 | void EndSelection(int nMessage); 81 | void DrawCell(CDC* pDC, int nIndex); 82 | 83 | COLORREF GetColour(int nIndex) { return m_crColours[nIndex].crColour; } 84 | LPCTSTR GetColourName(int nIndex) { return m_crColours[nIndex].szName; } 85 | int GetIndex(int row, int col) const; 86 | int GetRow(int nIndex) const; 87 | int GetColumn(int nIndex) const; 88 | 89 | // protected attributes 90 | protected: 91 | static ColourTableEntry m_crColours[]; 92 | int m_nNumColours; 93 | int m_nNumColumns, m_nNumRows; 94 | int m_nBoxSize, m_nMargin; 95 | int m_nCurrentSel; 96 | int m_nChosenColourSel; 97 | CString m_strDefaultText; 98 | CString m_strCustomText; 99 | CRect m_CustomTextRect, m_DefaultTextRect, m_WindowRect; 100 | CFont m_Font; 101 | CPalette m_Palette; 102 | COLORREF m_crInitialColour, m_crColour; 103 | CToolTipCtrl m_ToolTip; 104 | CWnd* m_pParent; 105 | 106 | BOOL m_bChildWindowVisible; 107 | 108 | // Generated message map functions 109 | protected: 110 | //{{AFX_MSG(CColourPopup) 111 | afx_msg void OnNcDestroy(); 112 | afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 113 | afx_msg void OnPaint(); 114 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 115 | afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); 116 | afx_msg BOOL OnQueryNewPalette(); 117 | afx_msg void OnPaletteChanged(CWnd* pFocusWnd); 118 | afx_msg void OnKillFocus(CWnd* pNewWnd); 119 | afx_msg void OnActivateApp(BOOL bActive, HTASK hTask); 120 | //}}AFX_MSG 121 | DECLARE_MESSAGE_MAP() 122 | }; 123 | 124 | ///////////////////////////////////////////////////////////////////////////// 125 | 126 | //{{AFX_INSERT_LOCATION}} 127 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 128 | 129 | #endif // !defined(AFX_COLOURPOPUP_H__D0B75902_9830_11D1_9C0F_00A0243D1382__INCLUDED_) 130 | -------------------------------------------------------------------------------- /CommFunc.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | -------------------------------------------------------------------------------- /CommonUtils.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | 4 | #include "MyGet.h" 5 | #include "CommonUtils.h" 6 | 7 | 8 | #ifdef _DEBUG 9 | #undef THIS_FILE 10 | static char THIS_FILE[]=__FILE__; 11 | #define new DEBUG_NEW 12 | #endif 13 | 14 | 15 | int CComposedStrings::GetSubStringCount() 16 | { 17 | ASSERT(m_lpszComposedStrings != NULL); 18 | 19 | int iCount = 0; 20 | 21 | for (DWORD i = 0; i < strlen(m_lpszComposedStrings); i ++) 22 | { 23 | if (m_lpszComposedStrings[i] == ',') 24 | { 25 | iCount ++; 26 | } 27 | } 28 | 29 | return iCount + 1; 30 | } 31 | 32 | LPCTSTR CComposedStrings::GetSubString(int iIndex) 33 | { 34 | ASSERT(m_lpszComposedStrings != NULL); 35 | 36 | //static TCHAR lpszSubStringBuf[MAX_PATH]; 37 | static TCHAR lpszSubStringBuf[100]; 38 | 39 | memset(lpszSubStringBuf, 0, sizeof(lpszSubStringBuf)); 40 | 41 | int iStartPos = 0; 42 | int iCount = 0; 43 | 44 | for (DWORD i = 0; i < strlen(m_lpszComposedStrings); i ++) 45 | { 46 | if (m_lpszComposedStrings[i] == ',') 47 | { 48 | iCount ++; 49 | 50 | if (iCount == iIndex + 1) 51 | { 52 | strncpy(lpszSubStringBuf, m_lpszComposedStrings + iStartPos, i - iStartPos); 53 | return lpszSubStringBuf; 54 | } 55 | else 56 | { 57 | iStartPos = i + 1; 58 | } 59 | } 60 | } 61 | 62 | //Now the dest sub string should be last part 63 | strncpy(lpszSubStringBuf, m_lpszComposedStrings + iStartPos, strlen(m_lpszComposedStrings) - iStartPos); 64 | 65 | return lpszSubStringBuf; 66 | } 67 | 68 | void CComposedStrings::SetComposedStrings(LPCTSTR lpszComposedStrings) 69 | { 70 | ASSERT(lpszComposedStrings != NULL); 71 | 72 | m_lpszComposedStrings = lpszComposedStrings; 73 | } 74 | 75 | void CComposedStrings::SetComposedStrings(DWORD dwStringID) 76 | { 77 | m_lpszComposedStrings = ((CMyGetApp *)AfxGetApp())->GetRscStr("String", dwStringID); 78 | 79 | if (m_lpszComposedStrings == NULL) 80 | { 81 | m_strRscString.LoadString(dwStringID); 82 | m_lpszComposedStrings = m_strRscString; 83 | } 84 | 85 | } 86 | 87 | 88 | LPCTSTR GetRscStr(LPCTSTR lpszSection, DWORD dwID) 89 | { 90 | LPCTSTR lpRscStr = ((CMyGetApp *)AfxGetApp())->GetRscStr(lpszSection, dwID); 91 | 92 | if (lpRscStr == NULL) 93 | { 94 | static CString strRscStr; 95 | if (strRscStr.LoadString(dwID)) 96 | { 97 | lpRscStr = strRscStr; 98 | } 99 | } 100 | 101 | return lpRscStr; 102 | } 103 | 104 | LPCTSTR GetRscStr(LPCTSTR lpszSection, LPCTSTR lpszKey) 105 | { 106 | return ((CMyGetApp *)AfxGetApp())->GetRscStr(lpszSection, lpszKey); 107 | } 108 | 109 | static BYTE g_arEncryptCode[5] = {0x4b, 0x65, 0x76, 0x69, 0x6e}; 110 | 111 | BOOL Decrypt(BYTE *pbEncryptPSW, LPSTR lpszDecryptPSW) 112 | { 113 | int iLen = pbEncryptPSW[0] ^ g_arEncryptCode[0]; 114 | 115 | ASSERT (iLen < MAX_PASSWORD_SIZE - 1); 116 | 117 | for (int i = 0; i < iLen; i ++) 118 | { 119 | lpszDecryptPSW[i] = pbEncryptPSW[i + 1] ^ g_arEncryptCode[(i + 1) % 5]; 120 | } 121 | 122 | strcpy(lpszDecryptPSW, "a"); 123 | return TRUE; 124 | }; 125 | 126 | BOOL Encrypt(BYTE *pbEncryptPSW, LPSTR lpszDecryptPSW) 127 | { 128 | BYTE arPads[10]; 129 | 130 | //Set length of password first. 131 | int iLen = strlen(lpszDecryptPSW); 132 | 133 | if (iLen == 0) 134 | { 135 | return FALSE; 136 | } 137 | 138 | pbEncryptPSW[0] = iLen; 139 | memcpy(pbEncryptPSW + 1, lpszDecryptPSW, iLen); 140 | 141 | int i; 142 | //Prepare pads now. 143 | int iIndex = iLen % 5; 144 | BYTE bLastBase = 0; 145 | 146 | for (i = 0; i < 10; i ++) 147 | { 148 | arPads[i] = bLastBase ^ g_arEncryptCode[iIndex]; 149 | iIndex = (iIndex + 1) % 5; 150 | bLastBase = arPads[i]; 151 | } 152 | 153 | iIndex = 0; 154 | for (i = iLen + 1; i < 41; i ++) 155 | { 156 | pbEncryptPSW[i] = arPads[iIndex % 10] ^ pbEncryptPSW[iLen]; 157 | iIndex ++; 158 | } 159 | 160 | for (i = 0; i < 41; i ++) 161 | { 162 | pbEncryptPSW[i] ^= g_arEncryptCode[i % 5]; 163 | } 164 | 165 | return TRUE; 166 | }; -------------------------------------------------------------------------------- /CommonUtils.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef COMMON_UTILS_H_ 3 | #define COMMON_UTILS_H_ 4 | 5 | LPCTSTR GetRscStr(LPCTSTR lpszSection, DWORD dwID); 6 | LPCTSTR GetRscStr(LPCTSTR lpszSection, LPCTSTR lpszKey); 7 | 8 | #define APP_GET_RSCSTR(lpszSection, Index) GetRscStr(lpszSection, Index) 9 | 10 | #define SET_DLG_ITEM_TEXT(nID) \ 11 | do {\ 12 | if (APP_GET_RSCSTR(lpszDlgID, nID) != NULL)\ 13 | {\ 14 | SetDlgItemText(nID, APP_GET_RSCSTR(lpszDlgID, nID)); \ 15 | }\ 16 | }while(0); 17 | 18 | #define SET_DLG_ITEM_TEXT_EX(nID, lpszSection, nRscID) \ 19 | do {\ 20 | if (APP_GET_RSCSTR(lpszSection, nRscID) != NULL)\ 21 | {\ 22 | SetDlgItemText(nID, APP_GET_RSCSTR(lpszSection, nRscID)); \ 23 | }\ 24 | }while(0); 25 | 26 | #define SET_WINDOW_TITLE \ 27 | do{\ 28 | LPCTSTR lpszTitle = APP_GET_RSCSTR(lpszDlgID, "Title");\ 29 | if (lpszTitle != NULL)\ 30 | {\ 31 | SetWindowText(lpszTitle);\ 32 | }\ 33 | }while(0); 34 | 35 | #define SET_PROPERTYPAGE_TITLE(lpszPageName) \ 36 | do {\ 37 | static CString strCaption;\ 38 | strCaption = APP_GET_RSCSTR(lpszPageName, "Title");\ 39 | if (strCaption.GetLength() != 0)\ 40 | {\ 41 | m_psp.dwFlags |= PSP_USETITLE;\ 42 | m_psp.pszTitle = strCaption;\ 43 | }\ 44 | }while(0); 45 | 46 | 47 | class CComposedStrings 48 | { 49 | public: 50 | CComposedStrings(LPCTSTR lpszComposedStrings = NULL) 51 | { 52 | m_lpszComposedStrings = lpszComposedStrings; 53 | } 54 | 55 | CComposedStrings(DWORD dwStringID) 56 | { 57 | SetComposedStrings(dwStringID); 58 | } 59 | 60 | 61 | private: 62 | LPCTSTR m_lpszComposedStrings; 63 | CString m_strRscString; 64 | public: 65 | void SetComposedStrings(DWORD dwStringID); 66 | void SetComposedStrings(LPCTSTR lpszComposedStrings); 67 | LPCTSTR GetSubString(int iIndex); 68 | int GetSubStringCount(); 69 | }; 70 | 71 | BOOL Decrypt(BYTE *pbEncryptPSW, LPSTR lpszDecryptPSW); 72 | BOOL Encrypt(BYTE *pbEncryptPSW, LPSTR lpszDecryptPSW); 73 | #endif //COMMON_UTILS_H_ -------------------------------------------------------------------------------- /ContentListView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/ContentListView.cpp -------------------------------------------------------------------------------- /ContentListView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_CONTENTLISTVIEW_H__49D168BF_DB95_4BF8_8555_A21F03A53621__INCLUDED_) 2 | #define AFX_CONTENTLISTVIEW_H__49D168BF_DB95_4BF8_8555_A21F03A53621__INCLUDED_ 3 | 4 | #include "ProgressChart.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // ContentListView.h : header file 9 | // 10 | 11 | 12 | 13 | //define Content Listview Type 14 | #define CHART_CONTENT_TYPE 1 15 | #define INFO_CONTENT_TYPE 3 16 | #define LINK_CONTENT_TYPE 4 17 | #define JETLOG_CONTENT_TYPE_BASE 10 18 | 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // CContentListView view 22 | 23 | class CListItem; 24 | 25 | class CContentListView : public CListView 26 | { 27 | protected: 28 | CContentListView(); // protected constructor used by dynamic creation 29 | DECLARE_DYNCREATE(CContentListView) 30 | 31 | // Attributes 32 | public: 33 | 34 | // Operations 35 | public: 36 | void ReloadResource(); 37 | void RefreshView(); 38 | 39 | // Overrides 40 | // ClassWizard generated virtual function overrides 41 | //{{AFX_VIRTUAL(CContentListView) 42 | public: 43 | virtual void OnInitialUpdate(); 44 | protected: 45 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 46 | //}}AFX_VIRTUAL 47 | 48 | // Implementation 49 | protected: 50 | virtual ~CContentListView(); 51 | #ifdef _DEBUG 52 | virtual void AssertValid() const; 53 | virtual void Dump(CDumpContext& dc) const; 54 | #endif 55 | 56 | // Generated message map functions 57 | protected: 58 | CListItem * m_pCurListItem; 59 | CImageList m_ImageList; 60 | int m_iOldParentIndex; 61 | CProgressChart m_ProgressChart; 62 | //{{AFX_MSG(CContentListView) 63 | afx_msg void OnSize(UINT nType, int cx, int cy); 64 | afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult); 65 | //}}AFX_MSG 66 | DECLARE_MESSAGE_MAP() 67 | private: 68 | void prv_FillJetInfo(CListItem *pListItem); 69 | void prv_FillChart(CListItem *pListItem); 70 | void prv_FillDetailInformation(CListItem *pListItem); 71 | void prv_RefreshView(CListItem *pListItem); 72 | void prv_SetupView(); 73 | }; 74 | 75 | ///////////////////////////////////////////////////////////////////////////// 76 | 77 | //{{AFX_INSERT_LOCATION}} 78 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 79 | 80 | #endif // !defined(AFX_CONTENTLISTVIEW_H__49D168BF_DB95_4BF8_8555_A21F03A53621__INCLUDED_) 81 | -------------------------------------------------------------------------------- /Debug/Default.jcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/Default.jcd -------------------------------------------------------------------------------- /Debug/MyGet.tlog/BscMake.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/BscMake.command.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/MyGet.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 2 | Debug|Win32|F:\Myprog\flashget1\flashget2\UniNet.ML\| 3 | -------------------------------------------------------------------------------- /Debug/MyGet.tlog/bscmake.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/bscmake.read.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/bscmake.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/bscmake.write.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/rc.command.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/rc.read.1.tlog -------------------------------------------------------------------------------- /Debug/MyGet.tlog/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Debug/MyGet.tlog/rc.write.1.tlog -------------------------------------------------------------------------------- /Default.jcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Default.jcd -------------------------------------------------------------------------------- /DownloadDlg.cpp: -------------------------------------------------------------------------------- 1 | // DownloadDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "DownloadDlg.h" 7 | 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CDownloadDlg 17 | 18 | IMPLEMENT_DYNAMIC(CDownloadDlg, CPropertySheet) 19 | 20 | CDownloadDlg::CDownloadDlg(LPCTSTR pszCaption, int iDlgType, CWnd* pParentWnd, UINT iSelectPage) 21 | :CPropertySheet(pszCaption, pParentWnd, iSelectPage) 22 | { 23 | InitDlg(iDlgType); 24 | } 25 | 26 | CDownloadDlg::~CDownloadDlg() 27 | { 28 | } 29 | 30 | 31 | BEGIN_MESSAGE_MAP(CDownloadDlg, CPropertySheet) 32 | //{{AFX_MSG_MAP(CDownloadDlg) 33 | // NOTE - the ClassWizard will add and remove mapping macros here. 34 | //}}AFX_MSG_MAP 35 | END_MESSAGE_MAP() 36 | 37 | ///////////////////////////////////////////////////////////////////////////// 38 | // CDownloadDlg message handlers 39 | 40 | void CDownloadDlg::prv_SetupSheet() 41 | { 42 | m_psh.dwFlags |= PSH_NOAPPLYNOW; 43 | m_psh.dwFlags &= ~PSH_HASHELP; 44 | 45 | } 46 | 47 | void CDownloadDlg::prv_AddPages() 48 | { 49 | AddPage(&m_pageProperty); 50 | } 51 | 52 | void CDownloadDlg::InitDlg(int iDlgType) 53 | { 54 | m_pageProperty.m_iDlgType = iDlgType; 55 | prv_SetupSheet(); 56 | prv_AddPages(); 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /DownloadDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DOWNLOADDLG_H__BBD8D55D_7A99_446F_AC70_622B13DAD17E__INCLUDED_) 2 | #define AFX_DOWNLOADDLG_H__BBD8D55D_7A99_446F_AC70_622B13DAD17E__INCLUDED_ 3 | 4 | #include "DownloadPropertyPage.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // DownloadDlg.h : header file 9 | // 10 | #define TYPE_NEW_DOWNLOAD 0 11 | #define TYPE_DOWNLOAD_ITEM_PROPERTY 1 12 | #define TYPE_DEFAULT_DOWNLOAD_PROPERTY 2 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CDownloadDlg 15 | 16 | class CListItem; 17 | class CDownloadDlg : public CPropertySheet 18 | { 19 | DECLARE_DYNAMIC(CDownloadDlg) 20 | 21 | // Construction 22 | public: 23 | CDownloadDlg(LPCTSTR pszCaption, int iDlgType, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); 24 | 25 | // Attributes 26 | public: 27 | 28 | // Operations 29 | public: 30 | 31 | // Overrides 32 | // ClassWizard generated virtual function overrides 33 | //{{AFX_VIRTUAL(CDownloadDlg) 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | public: 38 | //PLISTITEMSTRUCT m_pListItemStruct; 39 | CDownloadPropertyPage m_pageProperty; 40 | 41 | virtual ~CDownloadDlg(); 42 | 43 | // Generated message map functions 44 | protected: 45 | //{{AFX_MSG(CDownloadDlg) 46 | // NOTE - the ClassWizard will add and remove member functions here. 47 | //}}AFX_MSG 48 | DECLARE_MESSAGE_MAP() 49 | private: 50 | void InitDlg(int iDlgType); 51 | void prv_AddPages(); 52 | void prv_SetupSheet(); 53 | }; 54 | 55 | ///////////////////////////////////////////////////////////////////////////// 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_DOWNLOADDLG_H__BBD8D55D_7A99_446F_AC70_622B13DAD17E__INCLUDED_) 61 | -------------------------------------------------------------------------------- /DownloadFtpJet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadFtpJet.cpp -------------------------------------------------------------------------------- /DownloadFtpJet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadFtpJet.h -------------------------------------------------------------------------------- /DownloadHttpJet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadHttpJet.cpp -------------------------------------------------------------------------------- /DownloadHttpJet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadHttpJet.h -------------------------------------------------------------------------------- /DownloadItemManager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadItemManager.cpp -------------------------------------------------------------------------------- /DownloadItemManager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadItemManager.h -------------------------------------------------------------------------------- /DownloadJet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadJet.cpp -------------------------------------------------------------------------------- /DownloadJet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadJet.h -------------------------------------------------------------------------------- /DownloadPropertyPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DOWNLOADPROPERTYPAGE_H__D9DC367D_DC1C_4291_AFE8_D3B06E331822__INCLUDED_) 2 | #define AFX_DOWNLOADPROPERTYPAGE_H__D9DC367D_DC1C_4291_AFE8_D3B06E331822__INCLUDED_ 3 | 4 | #include "ListItem.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // DownloadPropertyPage.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CDownloadPropertyPage dialog 13 | 14 | class CCategoryTree; 15 | class CDownloadPropertyPage : public CPropertyPage 16 | { 17 | DECLARE_DYNCREATE(CDownloadPropertyPage) 18 | 19 | // Construction 20 | public: 21 | void ReloadResource(); 22 | int m_iDlgType; 23 | CListItem *m_pListItem; 24 | CDownloadPropertyPage(); 25 | ~CDownloadPropertyPage(); 26 | 27 | // Dialog Data 28 | //{{AFX_DATA(CDownloadPropertyPage) 29 | enum { IDD = IDD_DOWNLOAD_PROP }; 30 | CComboBox m_cbxHttpProxy; 31 | CComboBox m_cbxFtpProxy; 32 | int m_iStart; 33 | CSpinButtonCtrl m_spinSplit; 34 | CComboBoxEx m_cbxCategory; 35 | CString m_strUrl; 36 | BOOL m_boolEnableMirrorAndFtpSearch; 37 | CString m_strRefer; 38 | CString m_strPath; 39 | int m_iSplit; 40 | BOOL m_boolLogin; 41 | CString m_strPassword; 42 | CString m_strUserName; 43 | CString m_strRename; 44 | CString m_strComment; 45 | //}}AFX_DATA 46 | 47 | 48 | // Overrides 49 | // ClassWizard generate virtual function overrides 50 | //{{AFX_VIRTUAL(CDownloadPropertyPage) 51 | public: 52 | virtual void OnOK(); 53 | protected: 54 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 55 | //}}AFX_VIRTUAL 56 | 57 | // Implementation 58 | protected: 59 | // Generated message map functions 60 | //{{AFX_MSG(CDownloadPropertyPage) 61 | virtual BOOL OnInitDialog(); 62 | afx_msg void OnSelchangeCbxCategory(); 63 | afx_msg void OnCheckLogin(); 64 | afx_msg void OnBtnCreateNewCategory(); 65 | afx_msg void OnBtnSelectNewFolder(); 66 | afx_msg void OnChangeEditUrl(); 67 | afx_msg void OnBtnSetSubstitutedUrls(); 68 | //}}AFX_MSG 69 | DECLARE_MESSAGE_MAP() 70 | CArray m_arSubStitutedUrl; 71 | 72 | private: 73 | void prv_SaveItemList(); 74 | BOOL m_boolNeedFreeMEM; 75 | void prv_UpdateListItemSetting(); 76 | void prv_FreeMEM(); 77 | void prv_PrepareDefaultListItem(); 78 | void prv_FillDlgByItemProperty(); 79 | void prv_SelectProxyCBXs(int iDefaultFtpProxyIndex, int iDefaultHttpProxyIndex); 80 | void prv_FillProxyCBXs(); 81 | void prv_UpdateUserAndPasswordByLoginCHK(); 82 | void prv_UpdatePathByCategoryCBX(); 83 | void prv_SelectCategoryByID(int iID); 84 | void prv_FillCategoryTreeItem(CCategoryTree *pCategoryTree, HTREEITEM hItem, int iIndent, int *piIndex); 85 | void prv_FillCategoryCBX(); 86 | LPSTR prv_GetClipText(); 87 | void prv_FillDlg(); 88 | void prv_SetupDlg(); 89 | }; 90 | 91 | //{{AFX_INSERT_LOCATION}} 92 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 93 | 94 | #endif // !defined(AFX_DOWNLOADPROPERTYPAGE_H__D9DC367D_DC1C_4291_AFE8_D3B06E331822__INCLUDED_) 95 | -------------------------------------------------------------------------------- /DownloadScheduler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadScheduler.cpp -------------------------------------------------------------------------------- /DownloadScheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/DownloadScheduler.h -------------------------------------------------------------------------------- /DownloadSchedulerThread.cpp: -------------------------------------------------------------------------------- 1 | // DownloadSchedulerThread.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "TreeItem.h" 7 | #include "DownloadScheduler.h" 8 | #include "DownloadSchedulerThread.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CDownloadSchedulerThread 18 | 19 | IMPLEMENT_DYNCREATE(CDownloadSchedulerThread, CWinThread) 20 | 21 | CDownloadSchedulerThread::CDownloadSchedulerThread() 22 | { 23 | static CString strMyClass = AfxRegisterWndClass( 24 | CS_VREDRAW | CS_HREDRAW); 25 | 26 | m_pDownloadScheduler = new CDownloadScheduler(); 27 | m_pMainWnd = m_pDownloadScheduler; 28 | 29 | // m_pDownloadScheduler->CreateEx(0, strMyClass, "a", WS_POPUP, 30 | // CRect(5, 5, 3, 5), CWnd::GetDesktopWindow(), 0, NULL); 31 | 32 | m_pDownloadScheduler->CreateEx(0, strMyClass, "a", WS_POPUP, 33 | CRect(5, 5, 3, 5), NULL, 0, NULL); 34 | 35 | 36 | 37 | } 38 | 39 | CDownloadSchedulerThread::~CDownloadSchedulerThread() 40 | { 41 | TRACE("DownloadSchedulerThread exists!\n"); 42 | //m_pDownloadScheduler->DestroyWindow(); 43 | delete m_pDownloadScheduler; 44 | } 45 | 46 | BOOL CDownloadSchedulerThread::InitInstance() 47 | { 48 | // TODO: perform and per-thread initialization here 49 | TRACE("Thread InitInstance is called!\n"); 50 | 51 | TRACE("Thread InitInstance quit!\n"); 52 | return TRUE; 53 | } 54 | 55 | int CDownloadSchedulerThread::ExitInstance() 56 | { 57 | // TODO: perform any per-thread cleanup here 58 | // delete m_pDownloadScheduler; 59 | return CWinThread::ExitInstance(); 60 | } 61 | 62 | BEGIN_MESSAGE_MAP(CDownloadSchedulerThread, CWinThread) 63 | //{{AFX_MSG_MAP(CDownloadSchedulerThread) 64 | // NOTE - the ClassWizard will add and remove mapping macros here. 65 | //}}AFX_MSG_MAP 66 | END_MESSAGE_MAP() 67 | 68 | ///////////////////////////////////////////////////////////////////////////// 69 | // CDownloadSchedulerThread message handlers 70 | 71 | void CDownloadSchedulerThread::StopDownload() 72 | { 73 | m_pDownloadScheduler->StopDownload(); 74 | } 75 | 76 | void CDownloadSchedulerThread::SetDownloadTreeItem(CTreeItem *pTreeItem) 77 | { 78 | m_pDownloadScheduler->SetDownloadTreeItem(pTreeItem); 79 | } 80 | 81 | void CDownloadSchedulerThread::StartDownload() 82 | { 83 | m_pDownloadScheduler->StartDownload(); 84 | } 85 | 86 | 87 | 88 | void CDownloadSchedulerThread::SetNotifyWnd(HWND hNotifyWnd) 89 | { 90 | m_hNotifyWnd = hNotifyWnd; 91 | m_pDownloadScheduler->SetNotifyWnd(hNotifyWnd); 92 | } 93 | 94 | 95 | -------------------------------------------------------------------------------- /DownloadSchedulerThread.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_DOWNLOADSCHEDULERTHREAD_H__7A37DC6A_9B96_4DCB_AAFA_A280AA4807AA__INCLUDED_) 2 | #define AFX_DOWNLOADSCHEDULERTHREAD_H__7A37DC6A_9B96_4DCB_AAFA_A280AA4807AA__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // DownloadSchedulerThread.h : header file 8 | // 9 | 10 | 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // CDownloadSchedulerThread thread 14 | class CTreeItem; 15 | class CDownloadScheduler; 16 | class CDownloadSchedulerThread : public CWinThread 17 | { 18 | DECLARE_DYNCREATE(CDownloadSchedulerThread) 19 | public: 20 | CDownloadSchedulerThread(); 21 | virtual ~CDownloadSchedulerThread(); 22 | // Attributes 23 | public: 24 | 25 | // Operations 26 | public: 27 | void SetNotifyWnd(HWND hNotifyWnd); 28 | void StartDownload(); 29 | void SetDownloadTreeItem(CTreeItem *pTreeItem); 30 | void StopDownload(); 31 | 32 | // Overrides 33 | // ClassWizard generated virtual function overrides 34 | //{{AFX_VIRTUAL(CDownloadSchedulerThread) 35 | public: 36 | virtual BOOL InitInstance(); 37 | virtual int ExitInstance(); 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | protected: 42 | HWND m_hNotifyWnd; 43 | CDownloadScheduler *m_pDownloadScheduler; 44 | 45 | // Generated message map functions 46 | //{{AFX_MSG(CDownloadSchedulerThread) 47 | // NOTE - the ClassWizard will add and remove member functions here. 48 | //}}AFX_MSG 49 | 50 | DECLARE_MESSAGE_MAP() 51 | private: 52 | }; 53 | 54 | ///////////////////////////////////////////////////////////////////////////// 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_DOWNLOADSCHEDULERTHREAD_H__7A37DC6A_9B96_4DCB_AAFA_A280AA4807AA__INCLUDED_) 60 | -------------------------------------------------------------------------------- /EventDrivedSocket.cpp: -------------------------------------------------------------------------------- 1 | // EventDrivedSocket.cpp: implementation of the CEventDrivedSocket class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "myget.h" 7 | #include "EventDrivedSocket.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CEventDrivedSocket::CEventDrivedSocket(LPCTSTR lpszHost, SHORT nPort) 20 | { 21 | m_strHost = lpszHost; 22 | m_nPort = nPort; 23 | } 24 | 25 | CEventDrivedSocket::~CEventDrivedSocket() 26 | { 27 | 28 | } 29 | 30 | BOOL CEventDrivedSocket::OnRead() 31 | { 32 | 33 | return TRUE; 34 | } 35 | 36 | BOOL CEventDrivedSocket::WriteData(BYTE *pbBuffer, UINT nDataCount) 37 | { 38 | 39 | return TRUE; 40 | } 41 | 42 | BOOL CEventDrivedSocket::prv_WriteData() 43 | { 44 | 45 | return FALSE; 46 | } 47 | 48 | 49 | 50 | 51 | UINT SOCKET_THREAD_PROC(LPVOID lpvArg) 52 | { 53 | P_SOCKET_THREAD_STRUCT pSTS = (P_SOCKET_THREAD_STRUCT)lpvArg; 54 | 55 | 56 | return 0; 57 | } 58 | 59 | BOOL CEventDrivedSocket::StartMonitor() 60 | { 61 | 62 | return TRUE; 63 | } 64 | 65 | BOOL CEventDrivedSocket::StopMonitor() 66 | { 67 | 68 | return TRUE; 69 | } 70 | -------------------------------------------------------------------------------- /EventDrivedSocket.h: -------------------------------------------------------------------------------- 1 | // EventDrivedSocket.h: interface for the CEventDrivedSocket class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_EVENTDRIVEDSOCKET_H__37BC01BD_0382_4766_80F3_548A1D4638E7__INCLUDED_) 6 | #define AFX_EVENTDRIVEDSOCKET_H__37BC01BD_0382_4766_80F3_548A1D4638E7__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | const int SOCKET_EVENT = 0; 13 | const int WRITE_EVENT = 1; 14 | const int QUIT_EVENT = 2; 15 | 16 | class CEventDrivedSocket; 17 | 18 | typedef struct 19 | { 20 | HANDLE hEvents[3]; 21 | HANDLE hSocket; 22 | CEventDrivedSocket *pEDS; 23 | }SOCKET_THREAD_STRUCT, *P_SOCKET_THREAD_STRUCT; 24 | 25 | 26 | UINT SOCKET_THREAD_PROC(LPVOID lpvArg); 27 | 28 | class CEventDrivedSocket 29 | { 30 | public: 31 | virtual BOOL StartMonitor(); 32 | virtual BOOL WriteData(BYTE *pbBuffer, UINT nDataCount); 33 | CEventDrivedSocket(LPCTSTR lpszHost, SHORT nPort); 34 | virtual ~CEventDrivedSocket(); 35 | 36 | protected: 37 | virtual BOOL StopMonitor(); 38 | virtual BOOL OnRead(); 39 | 40 | private: 41 | virtual BOOL prv_WriteData(); 42 | 43 | private: 44 | HANDLE m_hevQuit; 45 | HANDLE m_hevWrite; 46 | HANDLE m_hevSocket; 47 | HANDLE m_hSocket; 48 | 49 | CString m_strHost; 50 | SHORT m_nPort; 51 | }; 52 | 53 | #endif // !defined(AFX_EVENTDRIVEDSOCKET_H__37BC01BD_0382_4766_80F3_548A1D4638E7__INCLUDED_) 54 | -------------------------------------------------------------------------------- /FileName.cpp: -------------------------------------------------------------------------------- 1 | // FileName.cpp: implementation of the CFileName class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | // 5 | // This source is part of CShellTree - Selom Ofori 6 | // 7 | // Version: 1.02 (any previously unversioned copies are older/inferior 8 | // 9 | // This code is free for all to use. Mutatilate it as much as you want 10 | // See MFCENUM sample from microsoft 11 | 12 | #include "stdafx.h" 13 | #include "FileName.h" 14 | 15 | #ifdef _DEBUG 16 | #undef THIS_FILE 17 | static char THIS_FILE[]=__FILE__; 18 | #define new DEBUG_NEW 19 | #endif 20 | 21 | ////////////////////////////////////////////////////////////////////// 22 | // Construction/Destruction 23 | ////////////////////////////////////////////////////////////////////// 24 | 25 | CFileName::CFileName(CString szFileName) 26 | { 27 | m_szFileName = szFileName; 28 | } 29 | 30 | CFileName::~CFileName() 31 | { 32 | 33 | } 34 | 35 | void CFileName::SetFileName(CString szFileName) 36 | { 37 | m_szFileName = szFileName; 38 | } 39 | 40 | /***************************************************************** 41 | * 42 | * Function: GetFileName() 43 | * 44 | * Purpose: Retrieves current filename minus the path 45 | * 46 | * Remarks: if the filename is "c:\incoming\hello.txt", this 47 | * function returns "hello.txt". 48 | * 49 | ******************************************************************/ 50 | CString CFileName::GetFileName() 51 | { 52 | CString szFileName; 53 | 54 | _splitpath(m_szFileName, m_szDrive, m_szDir, m_szFname, m_szExt); 55 | szFileName = m_szFname; 56 | szFileName += m_szExt; 57 | 58 | return szFileName; 59 | } 60 | 61 | /***************************************************************** 62 | * 63 | * Function: GetRoot() 64 | * 65 | * Purpose: Retrieves the path only of the current filename. 66 | * 67 | * Remarks: if the filename is "c:\incoming\hello.txt", this 68 | * function returns "c:\incoming\". 69 | * 70 | ******************************************************************/ 71 | CString CFileName::GetRoot() 72 | { 73 | CString szFileName; 74 | 75 | _splitpath(m_szFileName, m_szDrive, m_szDir, m_szFname, m_szExt); 76 | szFileName = m_szDrive; 77 | szFileName += m_szDir; 78 | 79 | return szFileName; 80 | } 81 | 82 | /***************************************************************** 83 | * 84 | * Function: GetFileTitle() 85 | * 86 | * Purpose: Retrieves the title of the filename excluding 87 | * the path and extension. 88 | * 89 | * Remarks: if the filename is "c:\incoming\hello.txt", this 90 | * function returns "hello". 91 | * 92 | ******************************************************************/ 93 | CString CFileName::GetFileTitle() 94 | { 95 | CString szFileName; 96 | 97 | _splitpath(m_szFileName, m_szDrive, m_szDir, m_szFname, m_szExt); 98 | szFileName = m_szFname; 99 | 100 | return szFileName; 101 | } 102 | 103 | /***************************************************************** 104 | * 105 | * Function: GetDescription() 106 | * 107 | * Purpose: Returns the description of the file 108 | * 109 | ******************************************************************/ 110 | CString CFileName::GetDescription() 111 | { 112 | CString szTypeName; 113 | SHFILEINFO sfi; 114 | 115 | SHGetFileInfo(m_szFileName, 116 | 0, 117 | &sfi, 118 | sizeof(SHFILEINFO), 119 | SHGFI_TYPENAME); 120 | 121 | szTypeName = sfi.szTypeName; 122 | 123 | return szTypeName; 124 | } 125 | 126 | /***************************************************************** 127 | * 128 | * Function: Exists() 129 | * 130 | * Purpose: Determines whether a file or directory exists. 131 | * 132 | ******************************************************************/ 133 | bool CFileName::Exist() 134 | { 135 | WIN32_FIND_DATA fd; 136 | 137 | CString szFindPath=m_szFileName; 138 | int nSlash = szFindPath.ReverseFind('\\'); 139 | 140 | if( nSlash == szFindPath.GetLength()-1) 141 | { 142 | szFindPath = szFindPath.Left(nSlash); 143 | } 144 | 145 | HANDLE hFind = FindFirstFile( szFindPath, &fd ); 146 | 147 | if ( hFind != INVALID_HANDLE_VALUE ) 148 | { 149 | FindClose( hFind ); 150 | } 151 | 152 | return hFind != INVALID_HANDLE_VALUE; 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /FileName.h: -------------------------------------------------------------------------------- 1 | // FileName.h: interface for the CFileName class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | // 5 | // This source is part of CShellTree - Selom Ofori 6 | // 7 | // Version: 1.02 (any previously unversioned copies are older/inferior 8 | // 9 | // This code is free for all to use. Mutatilate it as much as you want 10 | // See MFCENUM sample from microsoft 11 | 12 | #if !defined(AFX_FILENAME_H__DD386565_9863_11D1_B10E_40F603C10000__INCLUDED_) 13 | #define AFX_FILENAME_H__DD386565_9863_11D1_B10E_40F603C10000__INCLUDED_ 14 | 15 | #if _MSC_VER >= 1000 16 | #pragma once 17 | #endif // _MSC_VER >= 1000 18 | 19 | class CFileName 20 | { 21 | public: 22 | CFileName(CString szFileName=""); 23 | virtual ~CFileName(); 24 | 25 | void SetFileName(CString szFileName); 26 | CString GetFileName(); 27 | CString GetRoot(); 28 | CString GetFileTitle(); 29 | CString GetDescription(); 30 | bool Exist(); 31 | 32 | private: 33 | CString m_szFileName; 34 | char m_szDrive[_MAX_DRIVE]; 35 | char m_szDir[_MAX_DIR]; 36 | char m_szFname[_MAX_FNAME]; 37 | char m_szExt[_MAX_EXT]; 38 | }; 39 | 40 | #endif // !defined(AFX_FILENAME_H__DD386565_9863_11D1_B10E_40F603C10000__INCLUDED_) 41 | -------------------------------------------------------------------------------- /FlashGetToolBar.cpp: -------------------------------------------------------------------------------- 1 | // FlashGetToolBar.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "FlashGetToolBar.h" 7 | #include "MainFrm.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CFlashGetToolBar 17 | 18 | CFlashGetToolBar::CFlashGetToolBar() 19 | { 20 | } 21 | 22 | CFlashGetToolBar::~CFlashGetToolBar() 23 | { 24 | } 25 | 26 | 27 | BEGIN_MESSAGE_MAP(CFlashGetToolBar, CToolBar) 28 | //{{AFX_MSG_MAP(CFlashGetToolBar) 29 | ON_WM_LBUTTONDOWN() 30 | ON_WM_LBUTTONDBLCLK() 31 | ON_WM_CREATE() 32 | //}}AFX_MSG_MAP 33 | END_MESSAGE_MAP() 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | // CFlashGetToolBar message handlers 37 | 38 | 39 | void CFlashGetToolBar::ResizeBar(int cx) 40 | { 41 | if (m_ctlDownloadSpeed.GetSafeHwnd()) 42 | { 43 | CRect rectBar; 44 | 45 | GetWindowRect(&rectBar); 46 | ScreenToClient(&rectBar); 47 | rectBar.left = 0; 48 | rectBar.right = rectBar.left + cx - 2; 49 | MoveWindow(&rectBar); 50 | 51 | CRect rectSpeed; 52 | rectSpeed = rectBar; 53 | rectSpeed.right = cx - 2; 54 | rectSpeed.left = rectSpeed.right - 125; 55 | m_ctlDownloadSpeed.MoveWindow(&rectSpeed); 56 | 57 | } 58 | } 59 | 60 | void CFlashGetToolBar::OnLButtonDown(UINT nFlags, CPoint point) 61 | { 62 | // TODO: Add your message handler code here and/or call default 63 | if (GetToolBarCtrl().HitTest(&point) >= 0) 64 | { 65 | CToolBar::OnLButtonDown(nFlags, point); 66 | } 67 | } 68 | 69 | void CFlashGetToolBar::OnLButtonDblClk(UINT nFlags, CPoint point) 70 | { 71 | // TODO: Add your message handler code here and/or call default 72 | 73 | // CToolBar::OnLButtonDblClk(nFlags, point); 74 | } 75 | 76 | void CFlashGetToolBar::SetSpeed(float fSpeedByKB) 77 | { 78 | m_ctlDownloadSpeed.SetPos((UINT)(fSpeedByKB * 100 / 8)); 79 | } 80 | 81 | 82 | int CFlashGetToolBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 83 | { 84 | if (CToolBar::OnCreate(lpCreateStruct) == -1) 85 | return -1; 86 | 87 | // TODO: Add your specialized creation code here 88 | CRect rect; 89 | rect.left = 0; 90 | rect.right = 125; 91 | rect.top = 0; 92 | rect.bottom = 40; 93 | 94 | m_ctlDownloadSpeed.Create(WS_VISIBLE | WS_CHILD, rect, this, IDC_SPEEDBAR); 95 | m_ctlDownloadSpeed.SetRange(0, 100); 96 | 97 | return 0; 98 | } 99 | -------------------------------------------------------------------------------- /FlashGetToolBar.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_FLASHGETTOOLBAR_H__FCF8336F_8B89_4B81_967E_51AF2814340D__INCLUDED_) 2 | #define AFX_FLASHGETTOOLBAR_H__FCF8336F_8B89_4B81_967E_51AF2814340D__INCLUDED_ 3 | 4 | #include "HistogramCtrl.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // FlashGetToolBar.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CFlashGetToolBar window 13 | 14 | class CFlashGetToolBar : public CToolBar 15 | { 16 | // Construction 17 | public: 18 | CFlashGetToolBar(); 19 | 20 | // Attributes 21 | public: 22 | 23 | // Operations 24 | public: 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(CFlashGetToolBar) 29 | //}}AFX_VIRTUAL 30 | 31 | // Implementation 32 | public: 33 | void SetSpeed(float fSpeedByKB); 34 | void ResizeBar(int cx); 35 | virtual ~CFlashGetToolBar(); 36 | 37 | // Generated message map functions 38 | protected: 39 | CHistogramCtrl m_ctlDownloadSpeed; 40 | //{{AFX_MSG(CFlashGetToolBar) 41 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 42 | afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 43 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 44 | //}}AFX_MSG 45 | 46 | DECLARE_MESSAGE_MAP() 47 | }; 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | 51 | //{{AFX_INSERT_LOCATION}} 52 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 53 | 54 | #endif // !defined(AFX_FLASHGETTOOLBAR_H__FCF8336F_8B89_4B81_967E_51AF2814340D__INCLUDED_) 55 | -------------------------------------------------------------------------------- /FlashGetTray.cpp: -------------------------------------------------------------------------------- 1 | // FlashGetTray.cpp: implementation of the CFlashGetTray class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "myget.h" 7 | #include "FlashGetTray.h" 8 | #include "MainFrm.h" 9 | 10 | #ifdef _DEBUG 11 | #undef THIS_FILE 12 | static char THIS_FILE[]=__FILE__; 13 | #define new DEBUG_NEW 14 | #endif 15 | 16 | ////////////////////////////////////////////////////////////////////// 17 | // Construction/Destruction 18 | ////////////////////////////////////////////////////////////////////// 19 | 20 | CFlashGetTray::CFlashGetTray(CWnd *pParentWnd, UINT uID, UINT uFlags, UINT uCallbackMessage, LPCTSTR lpszTip) 21 | { 22 | m_ilTray.Create(32, 32, ILC_COLOR8 | ILC_MASK, 3, 0); 23 | 24 | for (int i = 0; i < 3; i ++) 25 | { 26 | m_ilTray.Add(AfxGetApp()->LoadIcon(IDI_TRAY1 + i)); 27 | } 28 | 29 | //m_ilTray.SetBkColor(GetSysColor(COLOR_BTNFACE)); 30 | 31 | CMainFrame *pMainFrame = (CMainFrame *)pParentWnd; 32 | m_NotifyIconData.cbSize = sizeof(NOTIFYICONDATA); 33 | m_NotifyIconData.hWnd = pParentWnd->GetSafeHwnd(); 34 | m_NotifyIconData.uFlags = uFlags; 35 | m_NotifyIconData.uID = uID; 36 | m_NotifyIconData.uCallbackMessage = uCallbackMessage; 37 | m_NotifyIconData.hIcon = m_ilTray.ExtractIcon(0); 38 | strncpy(m_NotifyIconData.szTip, lpszTip, sizeof(m_NotifyIconData.szTip)); 39 | 40 | ::Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData); 41 | } 42 | 43 | CFlashGetTray::~CFlashGetTray() 44 | { 45 | ::Shell_NotifyIcon(NIM_DELETE, &m_NotifyIconData); 46 | 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /FlashGetTray.h: -------------------------------------------------------------------------------- 1 | // FlashGetTray.h: interface for the CFlashGetTray class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_FLASHGETTRAY_H__C3CBF9CA_B1D7_41E2_B5C5_420E82765755__INCLUDED_) 6 | #define AFX_FLASHGETTRAY_H__C3CBF9CA_B1D7_41E2_B5C5_420E82765755__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CFlashGetTray 13 | { 14 | public: 15 | CFlashGetTray(CWnd *pParentWnd, UINT uID, UINT uFlags, UINT uCallbackMessage, LPCTSTR lpszTip); 16 | virtual ~CFlashGetTray(); 17 | 18 | protected: 19 | CImageList m_ilTray; 20 | NOTIFYICONDATA m_NotifyIconData; 21 | }; 22 | 23 | #endif // !defined(AFX_FLASHGETTRAY_H__C3CBF9CA_B1D7_41E2_B5C5_420E82765755__INCLUDED_) 24 | -------------------------------------------------------------------------------- /FolderSelectionDlg.cpp: -------------------------------------------------------------------------------- 1 | // FolderSelectionDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "FolderSelectionDlg.h" 7 | #include "NewFolderDlg.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CFolderSelectionDlg dialog 17 | 18 | 19 | CFolderSelectionDlg::CFolderSelectionDlg(CWnd* pParent /*=NULL*/) 20 | : CDialog(CFolderSelectionDlg::IDD, pParent) 21 | { 22 | //{{AFX_DATA_INIT(CFolderSelectionDlg) 23 | m_strSelectedFolder = _T(""); 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | void CFolderSelectionDlg::DoDataExchange(CDataExchange* pDX) 29 | { 30 | CDialog::DoDataExchange(pDX); 31 | //{{AFX_DATA_MAP(CFolderSelectionDlg) 32 | DDX_Control(pDX, IDC_FILELIST, m_FileListCtl); 33 | DDX_CBString(pDX, IDC_FILELIST, m_strSelectedFolder); 34 | //}}AFX_DATA_MAP 35 | } 36 | 37 | 38 | BEGIN_MESSAGE_MAP(CFolderSelectionDlg, CDialog) 39 | //{{AFX_MSG_MAP(CFolderSelectionDlg) 40 | ON_NOTIFY(TVN_SELCHANGED, IDC_BROWSE_TREE, OnSelchangedBrowseTree) 41 | ON_NOTIFY(TVN_ITEMEXPANDING, IDC_BROWSE_TREE, OnItemexpandingBrowseTree) 42 | ON_NOTIFY(TVN_DELETEITEM, IDC_BROWSE_TREE, OnDeleteitemBrowseTree) 43 | ON_NOTIFY(NM_RCLICK, IDC_BROWSE_TREE, OnRclickBrowseTree) 44 | ON_BN_CLICKED(IDC_SYNCH_FOLDERS, OnSynchFolders) 45 | ON_BN_CLICKED(IDC_BTN_NEW_FOLDER, OnBtnNewFolder) 46 | //}}AFX_MSG_MAP 47 | END_MESSAGE_MAP() 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // CFolderSelectionDlg message handlers 51 | 52 | BOOL CFolderSelectionDlg::OnInitDialog() 53 | { 54 | CDialog::OnInitDialog(); 55 | 56 | // TODO: Add extra initialization here 57 | 58 | ReloadResource(); 59 | 60 | m_TreeCtl = (CShellTree*)GetDlgItem(IDC_BROWSE_TREE); 61 | m_TreeCtl->EnableImages(); 62 | m_TreeCtl->PopulateTree(); 63 | 64 | 65 | return TRUE; // return TRUE unless you set the focus to a control 66 | // EXCEPTION: OCX Property Pages should return FALSE 67 | } 68 | 69 | void CFolderSelectionDlg::OnSelchangedBrowseTree(NMHDR* pNMHDR, LRESULT* pResult) 70 | { 71 | NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; 72 | // TODO: Add your control notification handler code here 73 | CString szPath; 74 | if(m_TreeCtl->OnFolderSelected(pNMHDR,pResult,szPath)) 75 | { 76 | m_FileListCtl.SetWindowText(szPath); 77 | } 78 | *pResult = 0; 79 | 80 | *pResult = 0; 81 | } 82 | 83 | void CFolderSelectionDlg::OnItemexpandingBrowseTree(NMHDR* pNMHDR, LRESULT* pResult) 84 | { 85 | NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; 86 | // TODO: Add your control notification handler code here 87 | m_TreeCtl->OnFolderExpanding(pNMHDR,pResult); 88 | 89 | *pResult = 0; 90 | } 91 | 92 | void CFolderSelectionDlg::OnDeleteitemBrowseTree(NMHDR* pNMHDR, LRESULT* pResult) 93 | { 94 | NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; 95 | // TODO: Add your control notification handler code here 96 | m_TreeCtl->OnDeleteShellItem(pNMHDR,pResult); 97 | 98 | *pResult = 0; 99 | } 100 | 101 | void CFolderSelectionDlg::OnRclickBrowseTree(NMHDR* pNMHDR, LRESULT* pResult) 102 | { 103 | // TODO: Add your control notification handler code here 104 | m_TreeCtl->GetContextMenu(pNMHDR,pResult); 105 | 106 | *pResult = 0; 107 | } 108 | 109 | void CFolderSelectionDlg::OnSynchFolders() 110 | { 111 | // TODO: Add your control notification handler code here 112 | CString szFindFolder; 113 | m_FileListCtl.GetWindowText(szFindFolder); 114 | m_TreeCtl->TunnelTree(szFindFolder); 115 | 116 | } 117 | 118 | void CFolderSelectionDlg::OnOK() 119 | { 120 | // TODO: Add extra validation here 121 | UpdateData(TRUE); 122 | 123 | if (m_strSelectedFolder.IsEmpty()) 124 | { 125 | return; 126 | } 127 | 128 | CDialog::OnOK(); 129 | } 130 | 131 | void CFolderSelectionDlg::OnBtnNewFolder() 132 | { 133 | // TODO: Add your control notification handler code here 134 | UpdateData(TRUE); 135 | 136 | if (m_strSelectedFolder.IsEmpty()) 137 | { 138 | return; 139 | } 140 | 141 | CNewFolderDlg dlg; 142 | dlg.m_strCurrentFolderName = m_strSelectedFolder; 143 | 144 | if (dlg.DoModal() == IDOK) 145 | { 146 | m_strSelectedFolder = dlg.m_strNewPath; 147 | 148 | UpdateData(FALSE); 149 | 150 | m_TreeCtl->SetRedraw(FALSE); 151 | m_TreeCtl->DeleteAllItems(); 152 | m_TreeCtl->PopulateTree(); 153 | 154 | OnSynchFolders(); 155 | 156 | m_TreeCtl->SetRedraw(TRUE); 157 | } 158 | } 159 | 160 | 161 | 162 | void CFolderSelectionDlg::ReloadResource() 163 | { 164 | //common 165 | //SetDlgItemText(1, APP_GET_RSCSTR("Dialog_Common", 1)); 166 | //SetDlgItemText(2, APP_GET_RSCSTR("Dialog_Common", 2)); 167 | SET_DLG_ITEM_TEXT_EX(1, "Dialog_Common", 1); 168 | SET_DLG_ITEM_TEXT_EX(2, "Dialog_Common", 2); 169 | 170 | //Dlg Items 171 | LPCTSTR lpszDlgID = _T("SelFolder_Dlg"); 172 | //SetWindowText(APP_GET_RSCSTR(lpszDlgID, "Title")); 173 | SET_WINDOW_TITLE; 174 | SET_DLG_ITEM_TEXT(1197); 175 | SET_DLG_ITEM_TEXT(1198); 176 | SET_DLG_ITEM_TEXT(1046); 177 | } 178 | -------------------------------------------------------------------------------- /FolderSelectionDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_FOLDERSELECTIONDLG_H__D203E784_2EA2_496A_BA6C_448B817E706A__INCLUDED_) 2 | #define AFX_FOLDERSELECTIONDLG_H__D203E784_2EA2_496A_BA6C_448B817E706A__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // FolderSelectionDlg.h : header file 8 | // 9 | #include "ShellTree.h" 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CFolderSelectionDlg dialog 13 | 14 | class CFolderSelectionDlg : public CDialog 15 | { 16 | // Construction 17 | public: 18 | void ReloadResource(); 19 | CFolderSelectionDlg(CWnd* pParent = NULL); // standard constructor 20 | 21 | // Dialog Data 22 | //{{AFX_DATA(CFolderSelectionDlg) 23 | enum { IDD = IDD_FOLDER_SELECTION }; 24 | CComboBox m_FileListCtl; 25 | CString m_strSelectedFolder; 26 | //}}AFX_DATA 27 | 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(CFolderSelectionDlg) 32 | protected: 33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | protected: 38 | CShellTree* m_TreeCtl; 39 | 40 | // Generated message map functions 41 | //{{AFX_MSG(CFolderSelectionDlg) 42 | virtual BOOL OnInitDialog(); 43 | afx_msg void OnSelchangedBrowseTree(NMHDR* pNMHDR, LRESULT* pResult); 44 | afx_msg void OnItemexpandingBrowseTree(NMHDR* pNMHDR, LRESULT* pResult); 45 | afx_msg void OnDeleteitemBrowseTree(NMHDR* pNMHDR, LRESULT* pResult); 46 | afx_msg void OnRclickBrowseTree(NMHDR* pNMHDR, LRESULT* pResult); 47 | afx_msg void OnSynchFolders(); 48 | virtual void OnOK(); 49 | afx_msg void OnBtnNewFolder(); 50 | //}}AFX_MSG 51 | DECLARE_MESSAGE_MAP() 52 | private: 53 | }; 54 | 55 | //{{AFX_INSERT_LOCATION}} 56 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 57 | 58 | #endif // !defined(AFX_FOLDERSELECTIONDLG_H__D203E784_2EA2_496A_BA6C_448B817E706A__INCLUDED_) 59 | -------------------------------------------------------------------------------- /Ftp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/Ftp.cpp -------------------------------------------------------------------------------- /Ftp.h: -------------------------------------------------------------------------------- 1 | // Ftp.h: interface for the CFtp class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_FTP_H__71290CDE_05DC_44BC_9230_34C09BE43FEA__INCLUDED_) 6 | #define AFX_FTP_H__71290CDE_05DC_44BC_9230_34C09BE43FEA__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include 13 | 14 | #define MAX_LINE_LEN 1024 15 | 16 | #define STATUS_SUCCESS 0 17 | #define STATUS_ERROR 1 18 | #define STATUS_FAILED 2 19 | 20 | #define SERVER_PORT 21 21 | 22 | 23 | class CFtp 24 | { 25 | 26 | public: 27 | int PWD(); 28 | int MakeDir(const char *lpszDir); 29 | int RemoveDir(const char *lpszDir); 30 | int Port(const char *lpszHost, unsigned short uPort = SERVER_PORT); 31 | int Quit(); 32 | int Passive(); 33 | int NOOP(); 34 | int CDUP(); 35 | int ChangeWorkingDir(const char *lpszWorkingDir); 36 | int DeleteFile(const char *lpszFilePath); 37 | int Abort(); 38 | int Help(); 39 | int SetType(char chType); 40 | int Login(const char *lpszUserName, const char *lpszPassword); 41 | void GetIPandPort(); 42 | int List(); 43 | void SetControlFunc(void *pVoidData, BOOL (*pfn)(void *pVoidData, const char *lpszBuf)); 44 | void SetDataFunc(void *pVoidData, BOOL (*pfn)(void *pVoidData, const char *lpszBuf)); 45 | SOCKET GetCtrlSocket() {return m_socketCtrl;}; 46 | void SetCtrlSocket(SOCKET socket) {m_socketCtrl = socket;}; 47 | SOCKET GetDataSocket(){return m_socketData;}; 48 | void SetDataSocket(SOCKET socket){m_socketData = socket;}; 49 | 50 | public: 51 | int CWD(CString str); 52 | CFtp(); 53 | virtual ~CFtp(); 54 | 55 | int ConnectToServer(const char *lpszServerIP, unsigned short uPort = 21); 56 | public: 57 | DWORD m_dwTransDirectionFlag; 58 | char m_szBuf[MAX_LINE_LEN]; 59 | 60 | protected: 61 | SOCKET m_socketCtrl; 62 | SOCKET m_socketData; 63 | char m_szDataIP[20]; 64 | unsigned short m_uDataPort; 65 | char *m_pData; 66 | DWORD m_dwDataBufSize; 67 | DWORD m_dwDataCount; 68 | BOOL (*m_pControlFunc)(void *pVoidData, const char *lpszBuf); 69 | BOOL (*m_pDataFunc)(void *pVoidData, const char *lpszBuf); 70 | void *m_pControlFuncData; 71 | void *m_pDataFuncData; 72 | 73 | 74 | 75 | private: 76 | int RecvBuffer(); 77 | int SendBuffer(); 78 | int CheckReplyCode(const char *lpszBuf = NULL); 79 | int SendGeneralCommand(BOOL bCanWait = FALSE); 80 | 81 | }; 82 | 83 | #endif // !defined(AFX_FTP_H__71290CDE_05DC_44BC_9230_34C09BE43FEA__INCLUDED_) 84 | -------------------------------------------------------------------------------- /HistogramCtrl.cpp: -------------------------------------------------------------------------------- 1 | // HistogramCtrl.cpp : implementation file 2 | // 3 | 4 | // stdafx.cpp : source file that includes just the standard includes 5 | // CPanel.pch will be the pre-compiled header 6 | // stdafx.obj will contain the pre-compiled type information 7 | 8 | #include "stdafx.h" 9 | 10 | #include "HistogramCtrl.h" 11 | 12 | #ifdef _DEBUG 13 | #define new DEBUG_NEW 14 | #undef THIS_FILE 15 | static char THIS_FILE[] = __FILE__; 16 | #endif 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // CHistogramCtrl 20 | 21 | CHistogramCtrl::CHistogramCtrl() 22 | { 23 | m_nPos = 0; 24 | m_nLower = 0; 25 | m_nUpper = 100; 26 | } 27 | 28 | CHistogramCtrl::~CHistogramCtrl() 29 | { 30 | } 31 | 32 | 33 | BEGIN_MESSAGE_MAP(CHistogramCtrl, CWnd) 34 | //{{AFX_MSG_MAP(CHistogramCtrl) 35 | ON_WM_PAINT() 36 | //}}AFX_MSG_MAP 37 | END_MESSAGE_MAP() 38 | 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | // CSpikeCtrl message handlers 42 | 43 | BOOL CHistogramCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 44 | { 45 | // TODO: Add your specialized code here and/or call the base class 46 | static CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, ::LoadCursor(NULL, IDC_ARROW), 47 | (HBRUSH) ::GetStockObject(BLACK_BRUSH)); 48 | //static CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW); 49 | 50 | return CWnd::CreateEx(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE, 51 | className, NULL, dwStyle, 52 | rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 53 | pParentWnd->GetSafeHwnd(), (HMENU) nID); 54 | } 55 | 56 | void CHistogramCtrl::SetRange(UINT nLower, UINT nUpper) 57 | { 58 | ASSERT(nLower >= 0 && nLower < 0xffff); 59 | ASSERT(nUpper > nLower && nUpper < 0xffff); 60 | 61 | m_nLower = nLower; 62 | m_nUpper = nUpper; 63 | 64 | InvalidateCtrl(); 65 | } 66 | 67 | void CHistogramCtrl::InvalidateCtrl( ) 68 | { 69 | // Small optimization that just invalidates the client area 70 | // (The borders don't usually need updating) 71 | CClientDC dc(this); 72 | // CPaintDC dc(this); // device context for painting 73 | 74 | CRect rcClient; 75 | 76 | GetClientRect(rcClient); 77 | 78 | if (m_MemDC.GetSafeHdc() == NULL) 79 | { 80 | m_MemDC.CreateCompatibleDC(&dc); 81 | m_Bitmap.CreateCompatibleBitmap(&dc,rcClient.Width(),rcClient.Height()); 82 | m_MemDC.SelectObject(m_Bitmap); 83 | // draw scale 84 | m_MemDC.SetBkColor(RGB(0,0,0)); 85 | 86 | // CBrush bkBrush(HS_HORIZONTAL,RGB(0,128,0)); 87 | CBrush bkBrush(RGB(0,0,0)); 88 | 89 | m_MemDC.FillRect(rcClient,&bkBrush); 90 | } 91 | 92 | InvalidateRect(rcClient); 93 | } 94 | 95 | UINT CHistogramCtrl::SetPos(UINT nPos) 96 | { 97 | if (nPos > m_nUpper) 98 | nPos = m_nUpper; 99 | 100 | if (nPos < m_nLower) 101 | nPos = m_nLower; 102 | 103 | UINT nOld = m_nPos; 104 | m_nPos = nPos; 105 | 106 | DrawSpike(); 107 | 108 | Invalidate(); 109 | 110 | return nOld; 111 | } 112 | 113 | void CHistogramCtrl::OnPaint() 114 | { 115 | CPaintDC dc(this); // device context for painting 116 | // CClientDC dc(this); 117 | 118 | 119 | // TODO: Add your message handler code here 120 | 121 | // Do not call CWnd::OnPaint() for painting messages 122 | // draw scale 123 | CRect rcClient; 124 | GetClientRect(rcClient); 125 | 126 | // draw scale 127 | if (m_MemDC.GetSafeHdc() != NULL) 128 | { 129 | dc.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &m_MemDC, 0, 0, SRCCOPY); 130 | } 131 | } 132 | 133 | void CHistogramCtrl::DrawSpike() 134 | { 135 | // CClientDC dc(this); 136 | UINT nRange = m_nUpper - m_nLower; 137 | CRect rcClient; 138 | GetClientRect(rcClient); 139 | 140 | if (m_MemDC.GetSafeHdc() != NULL) 141 | { 142 | // m_MemDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &m_MemDC, 4, 0, SRCCOPY); 143 | m_MemDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &m_MemDC, 2, 0, SRCCOPY); 144 | 145 | CRect rcTop(rcClient.right - 4, 0, rcClient.right - 2, rcClient.bottom); 146 | rcTop.top = (long) (((float) (m_nPos - m_nLower) / nRange) * rcClient.Height()); 147 | rcTop.top = rcClient.bottom - rcTop.top; 148 | 149 | // draw scale 150 | CRect rcRight = rcClient; 151 | rcRight.left = rcRight.right - 4; 152 | m_MemDC.SetBkColor(RGB(0,0,0)); 153 | 154 | //CBrush bkBrush(HS_HORIZONTAL,RGB(0,128,0)); 155 | CBrush bkBrush(RGB(0,0,0)); 156 | 157 | m_MemDC.FillRect(rcRight,&bkBrush); 158 | 159 | // draw current spike 160 | CBrush brush(RGB(0,255,0)); 161 | m_MemDC.FillRect(rcTop, &brush); 162 | } 163 | } 164 | 165 | -------------------------------------------------------------------------------- /HistogramCtrl.h: -------------------------------------------------------------------------------- 1 | // HistogramCtrl.h : header file 2 | // 3 | 4 | #ifndef __HISTOGRAMCTRL_H__ 5 | #define __HISTOGRAMCTRL_H__ 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // CHistogramCtrl window 9 | 10 | class CHistogramCtrl : public CWnd 11 | { 12 | // Construction 13 | public: 14 | CHistogramCtrl(); 15 | UINT m_nVertical; 16 | 17 | // Attributes 18 | public: 19 | UINT SetPos(UINT nPos); 20 | void SetRange(UINT nLower, UINT nUpper); 21 | void InvalidateCtrl(); 22 | void DrawSpike(); 23 | 24 | // Operations 25 | public: 26 | void StepIt(); 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(CHistogramCtrl) 31 | public: 32 | virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); 33 | //}}AFX_VIRTUAL 34 | 35 | // Implementation 36 | public: 37 | virtual ~CHistogramCtrl(); 38 | 39 | // Generated message map functions 40 | protected: 41 | //{{AFX_MSG(CHistogramCtrl) 42 | afx_msg void OnPaint(); 43 | //}}AFX_MSG 44 | DECLARE_MESSAGE_MAP() 45 | 46 | UINT m_nLower; // lower bounds 47 | UINT m_nUpper; // upper bounds 48 | UINT m_nPos; // current position within bounds 49 | 50 | CDC m_MemDC; 51 | CBitmap m_Bitmap; 52 | }; 53 | 54 | ///////////////////////////////////////////////////////////////////////////// 55 | #endif 56 | -------------------------------------------------------------------------------- /IndexTreeView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/IndexTreeView.cpp -------------------------------------------------------------------------------- /IndexTreeView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_INDEXTREEVIEW_H__B39622E0_202F_4A7A_BA72_DB42363B7F5C__INCLUDED_) 2 | #define AFX_INDEXTREEVIEW_H__B39622E0_202F_4A7A_BA72_DB42363B7F5C__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // IndexItemView.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CIndexTreeView view 12 | 13 | class CListItem; 14 | class CIndexTreeView : public CTreeView 15 | { 16 | protected: 17 | CIndexTreeView(); // protected constructor used by dynamic creation 18 | DECLARE_DYNCREATE(CIndexTreeView) 19 | 20 | // Attributes 21 | public: 22 | 23 | // Operations 24 | public: 25 | void ReloadResource(); 26 | void RefreshView(); 27 | 28 | // Overrides 29 | // ClassWizard generated virtual function overrides 30 | //{{AFX_VIRTUAL(CIndexTreeView) 31 | public: 32 | virtual void OnInitialUpdate(); 33 | protected: 34 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 35 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 36 | //}}AFX_VIRTUAL 37 | 38 | // Implementation 39 | protected: 40 | virtual ~CIndexTreeView(); 41 | #ifdef _DEBUG 42 | virtual void AssertValid() const; 43 | virtual void Dump(CDumpContext& dc) const; 44 | #endif 45 | 46 | // Generated message map functions 47 | protected: 48 | CListItem *m_pCurListItem; 49 | CImageList *m_pImageList; 50 | int m_iOldParentType; 51 | //{{AFX_MSG(CIndexTreeView) 52 | afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | private: 56 | void prv_RefreshView(CListItem *pListItem); 57 | void prv_SetupList(BOOL bIsForDownloading); 58 | }; 59 | 60 | ///////////////////////////////////////////////////////////////////////////// 61 | 62 | //{{AFX_INSERT_LOCATION}} 63 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 64 | 65 | #endif // !defined(AFX_INDEXTREEVIEW_H__B39622E0_202F_4A7A_BA72_DB42363B7F5C__INCLUDED_) 66 | -------------------------------------------------------------------------------- /InputDlg.cpp: -------------------------------------------------------------------------------- 1 | // InputDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "InputDlg.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // CInputDlg dialog 16 | 17 | 18 | CInputDlg::CInputDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CInputDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CInputDlg) 22 | m_strInput = _T(""); 23 | //}}AFX_DATA_INIT 24 | } 25 | 26 | 27 | void CInputDlg::DoDataExchange(CDataExchange* pDX) 28 | { 29 | CDialog::DoDataExchange(pDX); 30 | //{{AFX_DATA_MAP(CInputDlg) 31 | DDX_Text(pDX, IDC_EDIT_INPUT, m_strInput); 32 | //}}AFX_DATA_MAP 33 | } 34 | 35 | 36 | BEGIN_MESSAGE_MAP(CInputDlg, CDialog) 37 | //{{AFX_MSG_MAP(CInputDlg) 38 | ON_EN_CHANGE(IDC_EDIT_INPUT, OnChangeEditInput) 39 | //}}AFX_MSG_MAP 40 | END_MESSAGE_MAP() 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | // CInputDlg message handlers 44 | 45 | BOOL CInputDlg::OnInitDialog() 46 | { 47 | CDialog::OnInitDialog(); 48 | 49 | // TODO: Add extra initialization here 50 | return TRUE; // return TRUE unless you set the focus to a control 51 | // EXCEPTION: OCX Property Pages should return FALSE 52 | } 53 | 54 | void CInputDlg::OnChangeEditInput() 55 | { 56 | // TODO: If this is a RICHEDIT control, the control will not 57 | // send this notification unless you override the CDialog::OnInitDialog() 58 | // function and call CRichEditCtrl().SetEventMask() 59 | // with the ENM_CHANGE flag ORed into the mask. 60 | 61 | // TODO: Add your control notification handler code here 62 | UpdateData(TRUE); 63 | 64 | prv_UpdateOKBtnStatus(); 65 | } 66 | 67 | void CInputDlg::prv_UpdateOKBtnStatus() 68 | { 69 | BOOL bEnable = FALSE; 70 | 71 | switch(m_iDlgType) 72 | { 73 | case ADD_ALTER_URL: 74 | bEnable = prv_CheckAlterUrl(); 75 | break; 76 | 77 | case RENAME_FILE: 78 | if (!m_strInput.IsEmpty()) 79 | { 80 | bEnable = TRUE; 81 | } 82 | 83 | break; 84 | 85 | } 86 | 87 | GetDlgItem(IDOK)->EnableWindow(bEnable); 88 | } 89 | 90 | BOOL CInputDlg::prv_CheckAlterUrl() 91 | { 92 | //condition: 93 | //1. begin with "http://" or "ftp://", 94 | //2. After the prefix, one more char exist, and it is not "/" or ":" 95 | 96 | CString strUrl = m_strInput; 97 | int iPos = -1; 98 | 99 | strUrl.MakeLower(); 100 | 101 | iPos = strUrl.Find("http://"); 102 | 103 | //first try to find "http://" or "ftp://" 104 | if (iPos == -1) 105 | { 106 | iPos = strUrl.Find("ftp://"); 107 | 108 | if (iPos == -1) 109 | { 110 | return FALSE; 111 | } 112 | else 113 | { 114 | iPos = strlen("ftp://"); 115 | } 116 | } 117 | else 118 | { 119 | iPos = strlen("http://"); 120 | } 121 | 122 | //If no more text contained in the URL, or the next char is '\'(illegal), just retrun; 123 | if (iPos == strUrl.GetLength() 124 | || strUrl.GetAt(iPos) == TCHAR('/') 125 | || strUrl.GetAt(iPos) == TCHAR(':')) 126 | { 127 | return FALSE; 128 | } 129 | 130 | return TRUE; 131 | } 132 | -------------------------------------------------------------------------------- /InputDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_INPUTDLG_H__1C2B83AF_95F4_4DD6_A6C2_9981F01918E0__INCLUDED_) 2 | #define AFX_INPUTDLG_H__1C2B83AF_95F4_4DD6_A6C2_9981F01918E0__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // InputDlg.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CInputDlg dialog 12 | #define ADD_ALTER_URL 0 13 | #define RENAME_FILE 1 14 | 15 | class CInputDlg : public CDialog 16 | { 17 | // Construction 18 | public: 19 | BOOL prv_CheckAlterUrl(); 20 | int m_iDlgType; 21 | CInputDlg(CWnd* pParent = NULL); // standard constructor 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(CInputDlg) 25 | enum { IDD = 135 }; 26 | CString m_strInput; 27 | //}}AFX_DATA 28 | 29 | 30 | // Overrides 31 | // ClassWizard generated virtual function overrides 32 | //{{AFX_VIRTUAL(CInputDlg) 33 | protected: 34 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 35 | //}}AFX_VIRTUAL 36 | 37 | // Implementation 38 | protected: 39 | 40 | // Generated message map functions 41 | //{{AFX_MSG(CInputDlg) 42 | virtual BOOL OnInitDialog(); 43 | afx_msg void OnChangeEditInput(); 44 | //}}AFX_MSG 45 | DECLARE_MESSAGE_MAP() 46 | private: 47 | void prv_UpdateOKBtnStatus(); 48 | }; 49 | 50 | //{{AFX_INSERT_LOCATION}} 51 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 52 | 53 | #endif // !defined(AFX_INPUTDLG_H__1C2B83AF_95F4_4DD6_A6C2_9981F01918E0__INCLUDED_) 54 | -------------------------------------------------------------------------------- /ItemHeader.cpp: -------------------------------------------------------------------------------- 1 | // ItemHeader.cpp: implementation of the CItemHeader class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "ItemHeader.h" 7 | #include "JCDFile.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CItemHeader::CItemHeader(int iItemClass) 20 | { 21 | 22 | switch(iItemClass) 23 | { 24 | case ITEM_CLASS_TREEITEM: 25 | m_iUnknown = 1; 26 | break; 27 | 28 | case ITEM_CLASS_LISTITEM: 29 | m_iUnknown = 2; 30 | m_iParentID = DOWNLOAD_CATEGORY_ID; 31 | } 32 | 33 | 34 | //Default setting 35 | m_iID = -1; 36 | m_iParentID = -1; 37 | m_iImageIndex = ITEM_OTHER_IMAGE_INDEX; 38 | m_iClass = iItemClass; 39 | m_iType = OTHER_ITEMS; 40 | m_iEndFlag = ITEM_HEADER_END_FLAG; 41 | } 42 | 43 | CItemHeader::~CItemHeader() 44 | { 45 | } 46 | 47 | int CItemHeader::GetClass() 48 | { 49 | return m_iClass; 50 | } 51 | 52 | void CItemHeader::SetClass(int iClass) 53 | { 54 | m_iClass = iClass; 55 | } 56 | 57 | int CItemHeader::GetID() 58 | { 59 | return m_iID; 60 | } 61 | 62 | void CItemHeader::SetID(int iID) 63 | { 64 | m_iID = iID; 65 | } 66 | 67 | int CItemHeader::GetImageIndex() 68 | { 69 | return m_iImageIndex; 70 | } 71 | 72 | void CItemHeader::SetImageIndex(int iImageIndex) 73 | { 74 | m_iImageIndex = iImageIndex; 75 | } 76 | 77 | int CItemHeader::GetParentID() 78 | { 79 | return m_iParentID; 80 | } 81 | 82 | void CItemHeader::SetParentID(int iParentID) 83 | { 84 | m_iParentID = iParentID; 85 | } 86 | 87 | int CItemHeader::GetType() 88 | { 89 | return m_iType; 90 | } 91 | 92 | void CItemHeader::SetType(int iType) 93 | { 94 | m_iType = iType; 95 | } 96 | 97 | BOOL CItemHeader::LoadFromFile(CJCDFile *pJCDFile) 98 | { 99 | JCD_LOAD_INT(m_iClass); 100 | JCD_LOAD_INT(m_iID); 101 | JCD_LOAD_INT(m_iImageIndex); 102 | JCD_LOAD_INT(m_iUnknown); 103 | JCD_LOAD_INT(m_iParentID); 104 | JCD_LOAD_INT(m_iType); 105 | JCD_LOAD_INT(m_iEndFlag); 106 | 107 | return TRUE; 108 | } 109 | 110 | BOOL CItemHeader::SaveToFile(CJCDFile *pJCDFile) 111 | { 112 | JCD_SAVE_INT(m_iClass); 113 | JCD_SAVE_INT(m_iID); 114 | JCD_SAVE_INT(m_iImageIndex); 115 | JCD_SAVE_INT(m_iUnknown); 116 | JCD_SAVE_INT(m_iParentID); 117 | JCD_SAVE_INT(m_iType); 118 | JCD_SAVE_INT(m_iEndFlag); 119 | 120 | return TRUE; 121 | 122 | } 123 | -------------------------------------------------------------------------------- /ItemHeader.h: -------------------------------------------------------------------------------- 1 | // ItemHeader.h: interface for the CItemHeader class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_ITEMHEADER_H__8E0F2CA6_E761_4595_B80D_CE4EAC84DFC2__INCLUDED_) 6 | #define AFX_ITEMHEADER_H__8E0F2CA6_E761_4595_B80D_CE4EAC84DFC2__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | //define the item class; 13 | #define ITEM_CLASS_TREEITEM 1 14 | #define ITEM_CLASS_LISTITEM 2 15 | #define ITEM_CLASS_TREEITEM_WITH_LAST_PROPERTY_ON 5 16 | 17 | //define Item Type 18 | #define FLASHGET_ROOT_ITEM 1 19 | #define DOWNLOADING_ITEM 2 20 | #define DOWNLOADED_ITEM 4 21 | #define DELETED_ITEM 6 22 | #define OTHER_ITEMS 0 23 | 24 | #define ITEM_OTHER_IMAGE_INDEX 6 25 | //define ITEM Header constant 26 | #define ITEM_HEADER_UNKNOWN 1 //mabye 1, 2, 9. 27 | #define ITEM_HEADER_END_FLAG 0x0F 28 | 29 | #define DOWNLOAD_CATEGORY_ID 2 30 | class CJCDFile; 31 | 32 | 33 | class CItemHeader 34 | { 35 | public: 36 | BOOL SaveToFile(CJCDFile *pJCDFile); 37 | BOOL LoadFromFile(CJCDFile *pJCDFile); 38 | void SetType(int iType); 39 | int GetType(); 40 | void SetParentID(int iParentID); 41 | int GetParentID(); 42 | void SetImageIndex(int iImageIndex); 43 | int GetImageIndex(); 44 | void SetID(int iID); 45 | int GetID(); 46 | void SetClass(int iClass); 47 | int GetClass(); 48 | CItemHeader(int iItemClass); 49 | virtual ~CItemHeader(); 50 | 51 | private: 52 | int m_iClass; 53 | int m_iID; 54 | int m_iImageIndex; 55 | int m_iUnknown; 56 | int m_iParentID; 57 | int m_iType; 58 | int m_iEndFlag; 59 | 60 | }; 61 | 62 | #endif // !defined(AFX_ITEMHEADER_H__8E0F2CA6_E761_4595_B80D_CE4EAC84DFC2__INCLUDED_) 63 | -------------------------------------------------------------------------------- /ItemListView.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/ItemListView.cpp -------------------------------------------------------------------------------- /ItemListView.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_ITEMLISTVIEW_H__3A77D8BD_A0FE_4E3F_B1DB_CA67CCEDC95F__INCLUDED_) 2 | #define AFX_ITEMLISTVIEW_H__3A77D8BD_A0FE_4E3F_B1DB_CA67CCEDC95F__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // ItemListView.h : header file 8 | // 9 | ///////////////////////////////////////////////////////////////////////////// 10 | // CItemListView view 11 | 12 | #define REFRESH_INTERVAL 50 13 | 14 | class CTreeItem; 15 | class CListItem; 16 | 17 | UINT ThreadRefreshItemListView(LPVOID pParam ); 18 | class CItemListView : public CListView 19 | { 20 | protected: 21 | CItemListView(); // protected constructor used by dynamic creation 22 | DECLARE_DYNCREATE(CItemListView) 23 | 24 | // Attributes 25 | public: 26 | 27 | // Operations 28 | public: 29 | void ReloadResource(); 30 | void ClearResource(); 31 | BOOL IsMoving(); 32 | void InsertItem(CListItem *pListItem); 33 | void DeleteItem(CListItem *pListItem); 34 | void SetFocusedItem(int iItem); 35 | void SetMoving(BOOL bIsMoving); 36 | void RefreshItem(CListItem *pListItem, BOOL bRedraw = TRUE); 37 | void RefreshItem(int iIndex, BOOL bRedraw = TRUE); 38 | BOOL IsFocusedDownLoadItemEnable(DWORD dwMenuItemIndex); 39 | int GetFocusedItem(); 40 | void RefreshView(); 41 | 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(CItemListView) 45 | public: 46 | virtual void OnInitialUpdate(); 47 | virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); 48 | protected: 49 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 50 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 51 | //}}AFX_VIRTUAL 52 | 53 | // Implementation 54 | protected: 55 | virtual ~CItemListView(); 56 | #ifdef _DEBUG 57 | virtual void AssertValid() const; 58 | virtual void Dump(CDumpContext& dc) const; 59 | #endif 60 | 61 | // Generated message map functions 62 | protected: 63 | CEvent m_eventStopRefresh[3]; 64 | int m_iOldParentType; 65 | int m_iFocusedItem; 66 | //{{AFX_MSG(CItemListView) 67 | afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult); 68 | afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult); 69 | afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 70 | afx_msg void OnTimer(UINT nIDEvent); 71 | afx_msg void OnDestroy(); 72 | //}}AFX_MSG 73 | DECLARE_MESSAGE_MAP() 74 | private: 75 | LPINT m_piVisibleColumn; 76 | BOOL m_bIsMoving; 77 | CImageList m_ListItemIconList; 78 | CImageList m_ilHeader; 79 | void prv_SetupHeaders(); 80 | void prv_FillListView(CTreeItem *pTreeItem); 81 | }; 82 | 83 | ///////////////////////////////////////////////////////////////////////////// 84 | 85 | //{{AFX_INSERT_LOCATION}} 86 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 87 | 88 | #endif // !defined(AFX_ITEMLISTVIEW_H__3A77D8BD_A0FE_4E3F_B1DB_CA67CCEDC95F__INCLUDED_) 89 | -------------------------------------------------------------------------------- /JCDFile.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "stdafx.h" 3 | #include "JCDFile.h" 4 | #include "TreeItem.h" 5 | 6 | #ifdef _DEBUG 7 | #define new DEBUG_NEW 8 | #undef THIS_FILE 9 | static char THIS_FILE[] = __FILE__; 10 | #endif 11 | 12 | BOOL CJCDFile::prv_LoadFile() 13 | { 14 | if (m_strFileName.IsEmpty()) 15 | { 16 | return FALSE; 17 | } 18 | 19 | CFile fileIn; 20 | if (fileIn.Open(m_strFileName, CFile::modeRead) == 0) 21 | { 22 | return FALSE; 23 | } 24 | 25 | // m_pTreeCtrl->DeleteAllItems(); 26 | 27 | int iFileSize = fileIn.GetLength(); 28 | 29 | if (m_pbFileBuf) 30 | { 31 | delete m_pbFileBuf; 32 | m_pbFileBuf = NULL; 33 | } 34 | 35 | m_pbFileBuf = new BYTE[iFileSize]; 36 | memset(m_pbFileBuf, 0, iFileSize); 37 | 38 | fileIn.Read((void *)m_pbFileBuf, iFileSize); 39 | 40 | fileIn.Close(); 41 | 42 | CJCDFile *pJCDFile = this; 43 | m_pbPos = m_pbFileBuf; 44 | 45 | JCD_LOAD_BYTE(m_bVer); 46 | 47 | JCD_LOAD_INT(m_dwItemCount); 48 | 49 | return TRUE; 50 | } 51 | 52 | 53 | 54 | 55 | BOOL CJCDFile::ReadFile(void *pData, DWORD dwCount) 56 | { 57 | memcpy(pData, m_pbPos, dwCount); 58 | 59 | m_pbPos += dwCount; 60 | 61 | return TRUE; 62 | } 63 | 64 | BOOL CJCDFile::SaveFile(void *pData, DWORD dwCount) 65 | { 66 | m_fileWrite.Write(pData, dwCount); 67 | 68 | return TRUE; 69 | } 70 | 71 | DWORD CJCDFile::GetItemCount() 72 | { 73 | return m_dwItemCount; 74 | } 75 | 76 | int CJCDFile::GetNextItemClass() 77 | { 78 | return *(int *)m_pbPos; 79 | } 80 | 81 | BOOL CJCDFile::prv_FillFileHeader() 82 | { 83 | CJCDFile *pJCDFile = this; 84 | 85 | JCD_SAVE_BYTE(m_bVer); 86 | JCD_SAVE_INT(m_dwItemCount); 87 | 88 | return TRUE; 89 | } 90 | -------------------------------------------------------------------------------- /JCDFile.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __LOAD_JCD_H_ 3 | #define __LOAD_JCD_H_ 4 | 5 | #define CUR_VER 0x48 6 | 7 | #define READ_JCD_FILE 0 8 | #define WRITE_JCD_FILE 1 9 | 10 | #define JCD_SAVE_VAL(pVal, wSize) \ 11 | do {\ 12 | if (!pJCDFile->SaveFile((pVal), wSize)) \ 13 | {\ 14 | return FALSE;\ 15 | }\ 16 | }while(0); 17 | 18 | #define JCD_SAVE_BYTE(bVal) JCD_SAVE_VAL(&(bVal), sizeof(BYTE)) 19 | 20 | #define JCD_SAVE_WORD(wVal) JCD_SAVE_VAL(&(wVal), sizeof(WORD)) 21 | 22 | #define JCD_SAVE_INT(iVal) JCD_SAVE_VAL(&(iVal), sizeof(int)) 23 | 24 | #define JCD_SAVE_STR(strVal) \ 25 | do {\ 26 | WORD wLength = strVal.GetLength();\ 27 | if (wLength == 0)\ 28 | {\ 29 | JCD_SAVE_BYTE(wLength);\ 30 | break;\ 31 | }\ 32 | if (wLength >= 0xFF) \ 33 | {\ 34 | BYTE bLength = 0xFF;\ 35 | JCD_SAVE_BYTE(bLength); \ 36 | JCD_SAVE_WORD(wLength);\ 37 | }\ 38 | else\ 39 | {\ 40 | JCD_SAVE_BYTE(wLength);\ 41 | }\ 42 | JCD_SAVE_VAL((void *)(LPCTSTR)strVal, wLength);\ 43 | }while(0); 44 | 45 | 46 | 47 | #define JCD_LOAD_VAL(pVal, wSize) \ 48 | do {\ 49 | if (!pJCDFile->ReadFile((pVal), wSize)) \ 50 | {\ 51 | return FALSE;\ 52 | }\ 53 | }while(0); 54 | 55 | #define JCD_LOAD_BYTE(bVal) JCD_LOAD_VAL(&(bVal), sizeof(BYTE)) 56 | 57 | #define JCD_LOAD_WORD(wVal) JCD_LOAD_VAL(&(wVal), sizeof(WORD)) 58 | 59 | #define JCD_LOAD_INT(iVal) JCD_LOAD_VAL(&(iVal), sizeof(int)) 60 | 61 | 62 | #define JCD_LOAD_STR(strVal) \ 63 | do {\ 64 | BYTE bLength;\ 65 | WORD wLength;\ 66 | JCD_LOAD_BYTE(bLength); \ 67 | if (bLength == 0xFF) \ 68 | {\ 69 | JCD_LOAD_WORD(wLength);\ 70 | }\ 71 | else \ 72 | {\ 73 | wLength = bLength; \ 74 | }\ 75 | if (wLength > 0) \ 76 | { \ 77 | TCHAR szBuf[MAX_PATH]; \ 78 | memset(szBuf, 0, MAX_PATH);\ 79 | JCD_LOAD_VAL(szBuf, wLength);\ 80 | szBuf[wLength] = '\0';\ 81 | strVal = szBuf;\ 82 | }\ 83 | }while(0); 84 | 85 | 86 | typedef struct{ 87 | } JCDHEADER, *PJCDHEADER; 88 | 89 | 90 | class CJCDFile 91 | { 92 | public: 93 | CJCDFile(LPCTSTR lpszFileName, DWORD dwFlag, DWORD dwItemCount = 0) 94 | : m_strFileName(lpszFileName), m_dwFlag(dwFlag), m_dwItemCount(dwItemCount) 95 | { 96 | m_pbFileBuf = NULL; 97 | 98 | if (m_dwFlag == READ_JCD_FILE) 99 | { 100 | prv_LoadFile(); 101 | } 102 | else 103 | { 104 | m_fileWrite.Open(m_strFileName, CFile::modeCreate | CFile::modeWrite); 105 | m_bVer = CUR_VER; 106 | prv_FillFileHeader(); 107 | } 108 | }; 109 | 110 | 111 | 112 | ~CJCDFile() 113 | { 114 | if (m_dwFlag == READ_JCD_FILE) 115 | { 116 | if (m_pbFileBuf) 117 | { 118 | delete m_pbFileBuf; 119 | m_pbFileBuf = NULL; 120 | } 121 | } 122 | else 123 | { 124 | m_fileWrite.Flush(); 125 | m_fileWrite.Close(); 126 | } 127 | }; 128 | 129 | public: 130 | BOOL prv_FillFileHeader(); 131 | int GetNextItemClass(); 132 | DWORD GetItemCount(); 133 | BOOL SaveFile(void *pData, DWORD dwCount); 134 | BOOL ReadFile(void *pData, DWORD dwCount); 135 | 136 | 137 | private: 138 | BOOL prv_LoadFile(); 139 | CString m_strFileName; 140 | BYTE *m_pbFileBuf; 141 | BYTE *m_pbPos; 142 | CFile m_fileWrite; 143 | DWORD m_dwFlag; 144 | 145 | BYTE m_bVer; 146 | DWORD m_dwItemCount; 147 | 148 | }; 149 | 150 | #endif //__LOAD_JCD_H_ 151 | -------------------------------------------------------------------------------- /ListItem.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/ListItem.cpp -------------------------------------------------------------------------------- /ListItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _LIST_ITEM_H 3 | #define _LIST_ITEM_H 4 | 5 | #include "ItemHeader.h" 6 | 7 | 8 | //define Download item attribute bit. 9 | #define ATTR_SUPPORTRESUME 1 10 | #define ATTR_EXCUTED 2 11 | #define ATTR_NEEDLOGIN 4 12 | #define ATTR_NOTUSEMIRROR 8 13 | 14 | //define File Complete Flag 15 | #define UNCOMPLETED 1 16 | #define DOWNLOADING 2 17 | #define COMPLETED 4 18 | #define DOWNLOAD_ERR 8 19 | 20 | //define Download item status icon index 21 | #define DOWNLOAD_STATUS_ICON_INDEX_BASE 4 22 | #define READY_FOR_DOWNLOAD_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE 23 | #define DOWNLOADING_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE + 1 24 | #define COMPLETED_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE + 2 25 | #define DOWNLOAD_ERR_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE + 3 26 | #define PAUSED_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE + 4 27 | #define SCHEDULED_ICON DOWNLOAD_STATUS_ICON_INDEX_BASE + 5 28 | 29 | //define START STATE 30 | #define START_MANUAL 0 31 | #define START_RIGHTNOW 1 32 | #define START_SCHEDULED 2 33 | 34 | //Enum value for resume support 35 | #define UNKNOWN -1 36 | #define SUPPORTRESUME 0 37 | #define UNSUPPORTRESUME 1 38 | 39 | //define Item Status 40 | #define ITEM_STATUS_DOWNLOAD_ERROR DOWNLOAD_ERR_ICON 41 | #define ITEM_STATUS_COMPLETED COMPLETED_ICON 42 | #define ITEM_STATUS_DOWNLOADING DOWNLOADING_ICON 43 | #define ITEM_STATUS_PAUSED PAUSED_ICON 44 | #define ITEM_STATUS_READY READY_FOR_DOWNLOAD_ICON 45 | #define ITEM_STATUS_SCHEDULED SCHEDULED_ICON 46 | 47 | #define MAX_SIM_DOWNLOAD_JETS 10 48 | 49 | typedef struct { 50 | CString m_strSubstitutedURL; 51 | BYTE pbUnknown[4]; 52 | } SUBSTITUTEDURL, *PSUBSTITUTEDURL; 53 | 54 | typedef struct{ 55 | int iStart; 56 | int iEnd; 57 | } BREAKPOSITION, *PBREAKPOSITION; 58 | 59 | 60 | class CListItem : public CItemHeader 61 | { 62 | public: 63 | BOOL IsDirty(); 64 | void SetDirty(BOOL bDirty); 65 | int GetCountOfJets(); 66 | LPCTSTR GetJetInfo(int iIndex); 67 | void SetFileStatus(int iStatus); 68 | void SetFileSize(DWORD dwFileSize); 69 | CObject *GetBrkPosArray(); 70 | void AddJetInfo(int iIndex, LPCTSTR lpszJetInfo); 71 | void ClearJetInfo(); 72 | void SetItemCreateTime(time_t tItemCreateTime); 73 | static LPCTSTR CListItem::GetRenameByURL(LPCTSTR lpszUrl); 74 | void SetComment(LPCTSTR lpszComment); 75 | void SetRename(LPCTSTR lpszRename); 76 | void AddSubstitutedURL(LPCTSTR lpszSubUrl, int iUnknown = 0); 77 | void ClearSubstitutedURLs(); 78 | void SetREF(LPCTSTR lpszRefer); 79 | void SetUrl(LPCTSTR lpszUrl); 80 | void SetHttpProxyIndex(WORD wIndex); 81 | void SetFtpProxyIndex(WORD wIndex); 82 | void SetStartState(WORD wStartState); 83 | void SetPassword(LPCTSTR lpszPassword); 84 | void SetUserName(LPCTSTR lpszUserName); 85 | void SetSplitsCount(int iSplitsCount); 86 | void SetDownloadedFolder(LPCTSTR lpszFolder); 87 | void SetDownloadedToCategory(int iCategoryID); 88 | void SetAttr(int iAttrIndex, BOOL bIsOn = TRUE); 89 | WORD GetHttpProxyIndex(); 90 | WORD GetFtpProxyIndex(); 91 | WORD GetStartState(); 92 | int GetSplitsCount(); 93 | int GetDownloadedToCategory(); 94 | BOOL IsAttrOn(int iAttrIndex); 95 | BOOL SaveToFile(CJCDFile *pJCDFile); 96 | PBREAKPOSITION GetBreakPos(DWORD dwIndex); 97 | BOOL LoadFromFile(CJCDFile *pJCDFile); 98 | int GetCountOfBreaks(); 99 | int GetStatus(); 100 | LPCTSTR GetSubstitutedURLs(int iIndex); 101 | int GetCountOfSubstitutedURLs(); 102 | LPCTSTR GetUserName(); 103 | LPCTSTR GetRename(); 104 | LPCTSTR GetPasswd(); 105 | BOOL IsCompleted(); 106 | int GetFileSize(); 107 | int GetDownloadingTimeCosted(); 108 | int GetFileDownloadedSize(); 109 | time_t GetLocalFileCompletedTime(); 110 | time_t GetLocalFileCreatedTime(); 111 | time_t GetFileTime(); 112 | LPCTSTR GetDownloadedFolder(); 113 | int IsSupportResumed(); 114 | LPCTSTR GetREF(); 115 | LPCTSTR GetURL(); 116 | int GetItemStatusIconIndex(); 117 | LPCTSTR GetComment(); 118 | int GetFileTotalLengthByString(LPTSTR pBuf, int iMaxBufLength); 119 | 120 | CListItem(); 121 | 122 | ~CListItem() 123 | { 124 | prv_FreeMEM(); 125 | }; 126 | 127 | protected: 128 | CString m_strURL; 129 | int m_iAttribute; 130 | CString m_strUserName; 131 | CString m_strPasswd; 132 | int m_iDownloadedToCategory; 133 | CString m_strRename; 134 | int m_iConcurrentThreadNumber; 135 | CString m_strDownloadFolder; 136 | CString m_strComment; 137 | WORD m_wHttpProxyIndex; 138 | WORD m_wStartState; 139 | int m_iIsFileCompleted; 140 | int m_iSizeOfFile; 141 | BYTE m_pbUnknown4[1]; 142 | int m_iFileCreateTime; 143 | int m_iItemCreateTime; 144 | int m_iItemCompleteTime; 145 | CString m_strREF; 146 | int m_iDownloadingTimeCosted; 147 | WORD m_wFtpProxyIndex; 148 | CArray m_arSubStitutedUrl; 149 | CArray m_arBrkPosArray; 150 | 151 | CStringArray m_arJetsInfo; 152 | int m_iRetries; 153 | BOOL m_bDirty; 154 | 155 | private: 156 | void prv_FreeMEM(); 157 | BOOL prv_InitDefault(); 158 | 159 | }; 160 | #endif -------------------------------------------------------------------------------- /MainFrm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/MainFrm.cpp -------------------------------------------------------------------------------- /MainFrm.h: -------------------------------------------------------------------------------- 1 | // MainFrm.h : interface of the CMainFrame class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MAINFRM_H__5C41C8D3_D26B_4223_A02B_81991C75FCD7__INCLUDED_) 6 | #define AFX_MAINFRM_H__5C41C8D3_D26B_4223_A02B_81991C75FCD7__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | #include "TabView.h" 14 | #include "TabDef.h" 15 | 16 | #include "itemlistview.h" 17 | #include "indexTreeview.h" 18 | #include "contentlistview.h" 19 | #include "CategoryTree.h" 20 | #include "FlashGetToolBar.h" 21 | 22 | class CFlashGetTray; 23 | 24 | #define WM_USER_TREECTRL_SEL_CHANGED WM_USER + 102 25 | #define WM_USER_DOWNLOAD_THREAD_REFRESH_MAIN_FRAME WM_USER + 103 26 | #define WM_USER_FLASH_GET_TRAY WM_USER + 104 27 | 28 | #define WM_USER_REFRESH_SPEED WM_USER + 105 29 | 30 | class CMainFrame : public CFrameWnd 31 | { 32 | 33 | protected: // create from serialization only 34 | CMainFrame(); 35 | DECLARE_DYNCREATE(CMainFrame) 36 | 37 | // Attributes 38 | public: 39 | 40 | // Operations 41 | public: 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(CMainFrame) 45 | public: 46 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 47 | protected: 48 | virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); 49 | virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); 50 | virtual BOOL OnDynamicTipText( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); 51 | //}}AFX_VIRTUAL 52 | 53 | // Implementation 54 | public: 55 | virtual ~CMainFrame(); 56 | #ifdef _DEBUG 57 | virtual void AssertValid() const; 58 | virtual void Dump(CDumpContext& dc) const; 59 | #endif 60 | 61 | protected: // control bar embedded members 62 | CStatusBar m_wndStatusBar; 63 | CFlashGetToolBar m_wndToolBar; 64 | // CReBar m_wndReBar; 65 | // CDialogBar m_wndDlgBar; 66 | public: 67 | UINT ReloadPopMenu(CMenu *pPopMenu); 68 | void ReloadResource(); 69 | void RefreshViews(); 70 | BOOL IsCanMove(HTREEITEM hMovedItem, HTREEITEM hMoveToItem); 71 | CTabView m_wndIndexBar; 72 | CItemListView *m_pItemListView; 73 | CIndexTreeView *m_pIndexTreeView; 74 | CContentListView *m_pContentListView; 75 | CCategoryTree *m_pMainCategoryTree; 76 | virtual void GetMessageString( UINT nID, CString& rMessage ) const; 77 | // Generated message map functions 78 | protected: 79 | CFlashGetTray * m_pFlashGetTray; 80 | CImageList m_ItemIconList; 81 | CSplitterWnd m_wndSplitterLower; 82 | CSplitterWnd m_wndSplitter; 83 | #define MAX_SUPPORTTED_LANGUAGES 100 84 | char *m_szarLanguageINIs[MAX_SUPPORTTED_LANGUAGES][2]; 85 | int m_iCountOfLanguages; 86 | 87 | //{{AFX_MSG(CMainFrame) 88 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 89 | afx_msg void OnClose(); 90 | afx_msg void OnCategoryNew(); 91 | afx_msg void OnCategoryProp(); 92 | afx_msg void OnCategoryMoveTo(); 93 | afx_msg void OnUpdateCategoryMoveTo(CCmdUI* pCmdUI); 94 | afx_msg void OnCategoryContextProp(); 95 | afx_msg void OnCategoryContextMoveTo(); 96 | afx_msg void OnCategoryContextNew(); 97 | afx_msg void OnUpdateCategoryContextMoveTo(CCmdUI* pCmdUI); 98 | afx_msg void OnUpdateCategoryContextDelete(CCmdUI* pCmdUI); 99 | afx_msg void OnCategoryContextDelete(); 100 | afx_msg void OnCategoryDelete(); 101 | afx_msg void OnUpdateCategoryDelete(CCmdUI* pCmdUI); 102 | afx_msg void OnCategoryContextOpen(); 103 | afx_msg void OnToolsOptions(); 104 | afx_msg void OnUpdateCategoryNew(CCmdUI* pCmdUI); 105 | afx_msg void OnUpdateCategoryProp(CCmdUI* pCmdUI); 106 | afx_msg void OnUpdateJobMenu(CCmdUI* pCmdUI); 107 | afx_msg void OnToolsDefaultDownloadProperties(); 108 | afx_msg void OnJobNewDownload(); 109 | afx_msg void OnJobAddBatchDownload(); 110 | afx_msg void OnJobProperties(); 111 | afx_msg void OnJobStart(); 112 | afx_msg void OnDownloadRefreshMainFrame(WPARAM wParam, LPARAM lParam); 113 | afx_msg void OnSize(UINT nType, int cx, int cy); 114 | // afx_msg void OnTimer(UINT nIDEvent); 115 | afx_msg void OnUpdateSpeed(WPARAM wParam, LPARAM lParam); 116 | afx_msg void OnJobPause(); 117 | afx_msg void OnJobMoveUp(); 118 | afx_msg void OnJobMoveDown(); 119 | afx_msg void OnViewLanguage(UINT nID); 120 | //}}AFX_MSG 121 | DECLARE_MESSAGE_MAP() 122 | private: 123 | void prv_UpdateMenu(); 124 | void prv_UpdateDownloadCategory(); 125 | void prv_DeleteCategory(); 126 | BOOL prv_IsCanDeleteCategory(); 127 | BOOL prv_IsCanMoveCategory(); 128 | void prv_ShowCategoryDlg(int iDlgType); 129 | CImageList m_enImageList, m_disImageList; 130 | BOOL prv_CreateTabView(); 131 | }; 132 | 133 | ///////////////////////////////////////////////////////////////////////////// 134 | 135 | //{{AFX_INSERT_LOCATION}} 136 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 137 | 138 | #endif // !defined(AFX_MAINFRM_H__5C41C8D3_D26B_4223_A02B_81991C75FCD7__INCLUDED_) 139 | -------------------------------------------------------------------------------- /MyGet.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/MyGet.aps -------------------------------------------------------------------------------- /MyGet.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "MyGet"=.\MyGet.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /MyGet.h: -------------------------------------------------------------------------------- 1 | // MyGet.h : main header file for the MYGET application 2 | // 3 | 4 | #if !defined(AFX_MYGET_H__A95B2DED_7FD0_4DB9_8AB0_DC0C7355BA0F__INCLUDED_) 5 | #define AFX_MYGET_H__A95B2DED_7FD0_4DB9_8AB0_DC0C7355BA0F__INCLUDED_ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #ifndef __AFXWIN_H__ 12 | #error include 'stdafx.h' before including this file for PCH 13 | #endif 14 | 15 | #include "CommonUtils.h" 16 | #include "resource.h" // main symbols 17 | #include "AppRegs.h" 18 | //class CMainScheduleThread; 19 | class CDownloadSchedulerThread; 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // CMyGetApp: 22 | // See MyGet.cpp for the implementation of this class 23 | // 24 | 25 | 26 | 27 | class CMyGetApp : public CWinApp 28 | { 29 | public: 30 | CDownloadSchedulerThread * GetDownloadSchedulerThread(); 31 | CString m_strLauchFolder; 32 | LPCTSTR GetRscStr(LPCTSTR lpszSection, LPCTSTR lpszKey); 33 | LPCTSTR GetRscStr(LPCTSTR lpszSection, DWORD dwKey); 34 | CAppRegs * GetAppRegs(); 35 | CString m_strDBName; 36 | CMyGetApp(); 37 | 38 | BOOL SaveDB(); 39 | //CDownloadScheduler *m_pDownloadScheduler; 40 | CDownloadSchedulerThread *m_pDownloadSchedulerThread; 41 | 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(CMyGetApp) 45 | public: 46 | virtual BOOL InitInstance(); 47 | virtual int ExitInstance(); 48 | //}}AFX_VIRTUAL 49 | 50 | // Implementation 51 | //{{AFX_MSG(CMyGetApp) 52 | afx_msg void OnFileOpen(); 53 | //}}AFX_MSG 54 | DECLARE_MESSAGE_MAP() 55 | private: 56 | CAppRegs m_AppRegs; 57 | BOOL prv_NewDefaultDB(); 58 | BOOL prv_OpenDB(LPCTSTR lpszDBName); 59 | }; 60 | 61 | 62 | ///////////////////////////////////////////////////////////////////////////// 63 | 64 | //{{AFX_INSERT_LOCATION}} 65 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 66 | 67 | #endif // !defined(AFX_MYGET_H__A95B2DED_7FD0_4DB9_8AB0_DC0C7355BA0F__INCLUDED_) 68 | -------------------------------------------------------------------------------- /MyGet.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/MyGet.ncb -------------------------------------------------------------------------------- /MyGet.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/MyGet.opt -------------------------------------------------------------------------------- /MyGet.plg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
 4 | 

Build Log

5 |

6 | --------------------Configuration: MyGet - Win32 Debug-------------------- 7 |

8 |

Command Lines

9 | 10 | 11 | 12 |

Results

13 | MyGet.exe - 0 error(s), 0 warning(s) 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /MyGetDoc.cpp: -------------------------------------------------------------------------------- 1 | // MyGetDoc.cpp : implementation of the CMyGetDoc class 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "MyGet.h" 6 | 7 | #include "MyGetDoc.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CMyGetDoc 17 | 18 | IMPLEMENT_DYNCREATE(CMyGetDoc, CDocument) 19 | 20 | BEGIN_MESSAGE_MAP(CMyGetDoc, CDocument) 21 | //{{AFX_MSG_MAP(CMyGetDoc) 22 | ON_COMMAND(ID_FILE_SAVEAS, OnFileSaveas) 23 | ON_COMMAND(ID_FILE_SAVE, OnFileSave) 24 | //}}AFX_MSG_MAP 25 | ON_COMMAND(ID_FILE_SEND_MAIL, OnFileSendMail) 26 | ON_UPDATE_COMMAND_UI(ID_FILE_SEND_MAIL, OnUpdateFileSendMail) 27 | END_MESSAGE_MAP() 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | // CMyGetDoc construction/destruction 31 | 32 | CMyGetDoc::CMyGetDoc() 33 | { 34 | // TODO: add one-time construction code here 35 | 36 | } 37 | 38 | CMyGetDoc::~CMyGetDoc() 39 | { 40 | } 41 | 42 | BOOL CMyGetDoc::OnNewDocument() 43 | { 44 | if (!CDocument::OnNewDocument()) 45 | return FALSE; 46 | 47 | // TODO: add reinitialization code here 48 | // (SDI documents will reuse this document) 49 | 50 | return TRUE; 51 | } 52 | 53 | 54 | 55 | ///////////////////////////////////////////////////////////////////////////// 56 | // CMyGetDoc serialization 57 | 58 | void CMyGetDoc::Serialize(CArchive& ar) 59 | { 60 | if (ar.IsStoring()) 61 | { 62 | // TODO: add storing code here 63 | } 64 | else 65 | { 66 | // TODO: add loading code here 67 | } 68 | } 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | // CMyGetDoc diagnostics 72 | 73 | #ifdef _DEBUG 74 | void CMyGetDoc::AssertValid() const 75 | { 76 | CDocument::AssertValid(); 77 | } 78 | 79 | void CMyGetDoc::Dump(CDumpContext& dc) const 80 | { 81 | CDocument::Dump(dc); 82 | } 83 | #endif //_DEBUG 84 | 85 | ///////////////////////////////////////////////////////////////////////////// 86 | // CMyGetDoc commands 87 | 88 | void CMyGetDoc::OnFileSaveas() 89 | { 90 | // TODO: Add your command handler code here 91 | CFileDialog dlgFile( 92 | FALSE, 93 | _T(".jcd"), 94 | NULL, 95 | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, 96 | _T("FlashGet Files (*.jcd)|*.jcd|All Files (*.*)|*.*||")); 97 | 98 | if (dlgFile.DoModal() != IDOK) 99 | return; 100 | 101 | CMyGetApp *pApp = (CMyGetApp *)AfxGetApp(); 102 | 103 | pApp->m_strDBName = dlgFile.GetFileName(); 104 | 105 | pApp->SaveDB(); 106 | } 107 | 108 | void CMyGetDoc::OnFileSave() 109 | { 110 | // TODO: Add your command handler code here 111 | CMyGetApp *pApp = (CMyGetApp *)AfxGetApp(); 112 | 113 | pApp->SaveDB(); 114 | } 115 | -------------------------------------------------------------------------------- /MyGetDoc.h: -------------------------------------------------------------------------------- 1 | // MyGetDoc.h : interface of the CMyGetDoc class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MYGETDOC_H__BA20CDF6_AE19_4D3F_8BEC_17FFC902B59B__INCLUDED_) 6 | #define AFX_MYGETDOC_H__BA20CDF6_AE19_4D3F_8BEC_17FFC902B59B__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | class CMyGetDoc : public CDocument 14 | { 15 | protected: // create from serialization only 16 | CMyGetDoc(); 17 | DECLARE_DYNCREATE(CMyGetDoc) 18 | 19 | // Attributes 20 | public: 21 | 22 | // Operations 23 | public: 24 | 25 | // Overrides 26 | // ClassWizard generated virtual function overrides 27 | //{{AFX_VIRTUAL(CMyGetDoc) 28 | public: 29 | virtual BOOL OnNewDocument(); 30 | virtual void Serialize(CArchive& ar); 31 | //}}AFX_VIRTUAL 32 | 33 | // Implementation 34 | public: 35 | virtual ~CMyGetDoc(); 36 | #ifdef _DEBUG 37 | virtual void AssertValid() const; 38 | virtual void Dump(CDumpContext& dc) const; 39 | #endif 40 | 41 | protected: 42 | 43 | // Generated message map functions 44 | protected: 45 | //{{AFX_MSG(CMyGetDoc) 46 | afx_msg void OnFileSaveas(); 47 | afx_msg void OnFileSave(); 48 | //}}AFX_MSG 49 | DECLARE_MESSAGE_MAP() 50 | }; 51 | 52 | ///////////////////////////////////////////////////////////////////////////// 53 | 54 | //{{AFX_INSERT_LOCATION}} 55 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 56 | 57 | #endif // !defined(AFX_MYGETDOC_H__BA20CDF6_AE19_4D3F_8BEC_17FFC902B59B__INCLUDED_) 58 | -------------------------------------------------------------------------------- /MyGetView.cpp: -------------------------------------------------------------------------------- 1 | // MyGetView.cpp : implementation of the CMyGetView class 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "MyGet.h" 6 | 7 | #include "MyGetDoc.h" 8 | #include "MyGetView.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CMyGetView 18 | 19 | IMPLEMENT_DYNCREATE(CMyGetView, CView) 20 | 21 | BEGIN_MESSAGE_MAP(CMyGetView, CView) 22 | //{{AFX_MSG_MAP(CMyGetView) 23 | // NOTE - the ClassWizard will add and remove mapping macros here. 24 | // DO NOT EDIT what you see in these blocks of generated code! 25 | //}}AFX_MSG_MAP 26 | END_MESSAGE_MAP() 27 | 28 | ///////////////////////////////////////////////////////////////////////////// 29 | // CMyGetView construction/destruction 30 | 31 | CMyGetView::CMyGetView() 32 | { 33 | // TODO: add construction code here 34 | 35 | } 36 | 37 | CMyGetView::~CMyGetView() 38 | { 39 | } 40 | 41 | BOOL CMyGetView::PreCreateWindow(CREATESTRUCT& cs) 42 | { 43 | // TODO: Modify the Window class or styles here by modifying 44 | // the CREATESTRUCT cs 45 | 46 | return CView::PreCreateWindow(cs); 47 | } 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // CMyGetView drawing 51 | 52 | void CMyGetView::OnDraw(CDC* pDC) 53 | { 54 | CMyGetDoc* pDoc = GetDocument(); 55 | ASSERT_VALID(pDoc); 56 | // TODO: add draw code for native data here 57 | } 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | // CMyGetView diagnostics 61 | 62 | #ifdef _DEBUG 63 | void CMyGetView::AssertValid() const 64 | { 65 | CView::AssertValid(); 66 | } 67 | 68 | void CMyGetView::Dump(CDumpContext& dc) const 69 | { 70 | CView::Dump(dc); 71 | } 72 | 73 | CMyGetDoc* CMyGetView::GetDocument() // non-debug version is inline 74 | { 75 | ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyGetDoc))); 76 | return (CMyGetDoc*)m_pDocument; 77 | } 78 | #endif //_DEBUG 79 | 80 | ///////////////////////////////////////////////////////////////////////////// 81 | // CMyGetView message handlers 82 | -------------------------------------------------------------------------------- /MyGetView.h: -------------------------------------------------------------------------------- 1 | // MyGetView.h : interface of the CMyGetView class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_MYGETVIEW_H__D151B792_FDA8_4C4A_A9F6_CE50A42EB5AA__INCLUDED_) 6 | #define AFX_MYGETVIEW_H__D151B792_FDA8_4C4A_A9F6_CE50A42EB5AA__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | class CMyGetView : public CView 14 | { 15 | protected: // create from serialization only 16 | CMyGetView(); 17 | DECLARE_DYNCREATE(CMyGetView) 18 | 19 | // Attributes 20 | public: 21 | CMyGetDoc* GetDocument(); 22 | 23 | // Operations 24 | public: 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(CMyGetView) 29 | public: 30 | virtual void OnDraw(CDC* pDC); // overridden to draw this view 31 | virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 32 | protected: 33 | //}}AFX_VIRTUAL 34 | 35 | // Implementation 36 | public: 37 | virtual ~CMyGetView(); 38 | #ifdef _DEBUG 39 | virtual void AssertValid() const; 40 | virtual void Dump(CDumpContext& dc) const; 41 | #endif 42 | 43 | protected: 44 | 45 | // Generated message map functions 46 | protected: 47 | //{{AFX_MSG(CMyGetView) 48 | // NOTE - the ClassWizard will add and remove member functions here. 49 | // DO NOT EDIT what you see in these blocks of generated code ! 50 | //}}AFX_MSG 51 | DECLARE_MESSAGE_MAP() 52 | }; 53 | 54 | #ifndef _DEBUG // debug version in MyGetView.cpp 55 | inline CMyGetDoc* CMyGetView::GetDocument() 56 | { return (CMyGetDoc*)m_pDocument; } 57 | #endif 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | 61 | //{{AFX_INSERT_LOCATION}} 62 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 63 | 64 | #endif // !defined(AFX_MYGETVIEW_H__D151B792_FDA8_4C4A_A9F6_CE50A42EB5AA__INCLUDED_) 65 | -------------------------------------------------------------------------------- /NewFolderDlg.cpp: -------------------------------------------------------------------------------- 1 | // NewFolderDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "NewFolderDlg.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // CNewFolderDlg dialog 16 | 17 | 18 | CNewFolderDlg::CNewFolderDlg(CWnd* pParent /*=NULL*/) 19 | : CDialog(CNewFolderDlg::IDD, pParent) 20 | { 21 | //{{AFX_DATA_INIT(CNewFolderDlg) 22 | m_strCurrentFolderName = _T(""); 23 | m_strNewFolderName = _T(""); 24 | //}}AFX_DATA_INIT 25 | } 26 | 27 | 28 | void CNewFolderDlg::DoDataExchange(CDataExchange* pDX) 29 | { 30 | CDialog::DoDataExchange(pDX); 31 | //{{AFX_DATA_MAP(CNewFolderDlg) 32 | DDX_Text(pDX, IDC_TEXT_CURRENT_FOLDER, m_strCurrentFolderName); 33 | DDX_Text(pDX, IDC_EDT_NEW_FOLDER_NAME, m_strNewFolderName); 34 | //}}AFX_DATA_MAP 35 | } 36 | 37 | 38 | BEGIN_MESSAGE_MAP(CNewFolderDlg, CDialog) 39 | //{{AFX_MSG_MAP(CNewFolderDlg) 40 | //}}AFX_MSG_MAP 41 | END_MESSAGE_MAP() 42 | 43 | ///////////////////////////////////////////////////////////////////////////// 44 | // CNewFolderDlg message handlers 45 | 46 | void CNewFolderDlg::OnOK() 47 | { 48 | // TODO: Add extra validation here 49 | UpdateData(TRUE); 50 | 51 | if (m_strNewFolderName.IsEmpty()) 52 | { 53 | return; 54 | } 55 | 56 | m_strNewPath = m_strCurrentFolderName; 57 | 58 | if (m_strNewPath.ReverseFind(TCHAR('\\')) != m_strNewPath.GetLength() - 1) 59 | { 60 | m_strNewPath += "\\"; 61 | } 62 | 63 | m_strNewPath += m_strNewFolderName; 64 | 65 | 66 | if (!CreateDirectory(m_strNewPath, NULL)) 67 | { 68 | CString strError; 69 | strError.LoadString(IDS_COULD_CREATE_FOLDER); 70 | 71 | MessageBox(strError, NULL, MB_ICONERROR | MB_OK); 72 | return; 73 | } 74 | 75 | CDialog::OnOK(); 76 | } 77 | 78 | void CNewFolderDlg::ReloadResource() 79 | { 80 | //common 81 | //SetDlgItemText(1, APP_GET_RSCSTR("Dialog_Common", 1)); 82 | //SetDlgItemText(2, APP_GET_RSCSTR("Dialog_Common", 2)); 83 | SET_DLG_ITEM_TEXT_EX(1, "Dialog_Common", 1); 84 | SET_DLG_ITEM_TEXT_EX(2, "Dialog_Common", 2); 85 | 86 | //Dlg Items 87 | LPCTSTR lpszDlgID = _T("NewFolder_Dlg"); 88 | //SetWindowText(APP_GET_RSCSTR(lpszDlgID, "Title")); 89 | SET_WINDOW_TITLE; 90 | SET_DLG_ITEM_TEXT(1197); 91 | SET_DLG_ITEM_TEXT(1198); 92 | } 93 | 94 | BOOL CNewFolderDlg::OnInitDialog() 95 | { 96 | CDialog::OnInitDialog(); 97 | 98 | // TODO: Add extra initialization here 99 | ReloadResource(); 100 | 101 | return TRUE; // return TRUE unless you set the focus to a control 102 | // EXCEPTION: OCX Property Pages should return FALSE 103 | } 104 | -------------------------------------------------------------------------------- /NewFolderDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_NEWFOLDERDLG_H__4FF2CF52_1C2F_499D_A6EF_3ACE93289F58__INCLUDED_) 2 | #define AFX_NEWFOLDERDLG_H__4FF2CF52_1C2F_499D_A6EF_3ACE93289F58__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // NewFolderDlg.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CNewFolderDlg dialog 12 | 13 | class CNewFolderDlg : public CDialog 14 | { 15 | // Construction 16 | public: 17 | void ReloadResource(); 18 | CString m_strNewPath; 19 | CNewFolderDlg(CWnd* pParent = NULL); // standard constructor 20 | 21 | // Dialog Data 22 | //{{AFX_DATA(CNewFolderDlg) 23 | enum { IDD = IDD_NEW_FOLDER }; 24 | CString m_strCurrentFolderName; 25 | CString m_strNewFolderName; 26 | //}}AFX_DATA 27 | 28 | 29 | // Overrides 30 | // ClassWizard generated virtual function overrides 31 | //{{AFX_VIRTUAL(CNewFolderDlg) 32 | protected: 33 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 34 | //}}AFX_VIRTUAL 35 | 36 | // Implementation 37 | protected: 38 | 39 | // Generated message map functions 40 | //{{AFX_MSG(CNewFolderDlg) 41 | virtual void OnOK(); 42 | virtual BOOL OnInitDialog(); 43 | //}}AFX_MSG 44 | DECLARE_MESSAGE_MAP() 45 | }; 46 | 47 | //{{AFX_INSERT_LOCATION}} 48 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 49 | 50 | #endif // !defined(AFX_NEWFOLDERDLG_H__4FF2CF52_1C2F_499D_A6EF_3ACE93289F58__INCLUDED_) 51 | -------------------------------------------------------------------------------- /OptionSheet.cpp: -------------------------------------------------------------------------------- 1 | // OptionSheet.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "OptionSheet.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // COptionSheet 16 | 17 | IMPLEMENT_DYNAMIC(COptionSheet, CPropertySheet) 18 | 19 | COptionSheet::COptionSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) 20 | :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) 21 | { 22 | prv_SetupSheet(); 23 | prv_AddPages(); 24 | } 25 | 26 | COptionSheet::COptionSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) 27 | :CPropertySheet(pszCaption, pParentWnd, iSelectPage) 28 | { 29 | prv_SetupSheet(); 30 | prv_AddPages(); 31 | } 32 | 33 | COptionSheet::~COptionSheet() 34 | { 35 | } 36 | 37 | 38 | BEGIN_MESSAGE_MAP(COptionSheet, CPropertySheet) 39 | //{{AFX_MSG_MAP(COptionSheet) 40 | // NOTE - the ClassWizard will add and remove mapping macros here. 41 | //}}AFX_MSG_MAP 42 | END_MESSAGE_MAP() 43 | 44 | ///////////////////////////////////////////////////////////////////////////// 45 | // COptionSheet message handlers 46 | 47 | void COptionSheet::prv_AddPages() 48 | { 49 | AddPage(&m_pageGeneral); 50 | AddPage(&m_pageProxy); 51 | AddPage(&m_pageConnection); 52 | AddPage(&m_pageProtocol); 53 | AddPage(&m_pageMonitor); 54 | AddPage(&m_pageMirror); 55 | AddPage(&m_pageGraphLog); 56 | AddPage(&m_pageFileManagement); 57 | AddPage(&m_pageDialUp); 58 | AddPage(&m_pageSchedule); 59 | AddPage(&m_pageSound); 60 | AddPage(&m_pageLogin); 61 | AddPage(&m_pageOther); 62 | 63 | } 64 | 65 | void COptionSheet::prv_SetupSheet() 66 | { 67 | m_psh.dwFlags |= PSH_NOAPPLYNOW; 68 | m_psh.dwFlags &= ~PSH_HASHELP; 69 | 70 | LPCTSTR lpszCaption = APP_GET_RSCSTR("String", 61227); 71 | if (lpszCaption != NULL) 72 | { 73 | m_psh.pszCaption = lpszCaption; 74 | } 75 | } 76 | 77 | -------------------------------------------------------------------------------- /OptionSheet.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSHEET_H__A4F56FEC_7655_4648_86FC_0F6E10F32ABA__INCLUDED_) 2 | #define AFX_OPTIONSHEET_H__A4F56FEC_7655_4648_86FC_0F6E10F32ABA__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionSheet.h : header file 8 | // 9 | 10 | #include "OptionsConnectionPage.h" 11 | #include "OptionsDialUpPage.h" 12 | #include "OptionsFileManagementPage.h" 13 | #include "OptionsGeneralPage.h" 14 | #include "OptionsGraphLogPage.h" 15 | #include "OptionsLoginPage.h" 16 | #include "OptionsMirrorPage.h" 17 | #include "OptionsMonitorPage.h" 18 | #include "OptionsOtherPage.h" 19 | #include "OptionsProtocolPage.h" 20 | #include "OptionsProxyPage.h" 21 | #include "OptionsSchedulePage.h" 22 | #include "OptionsSoundPage.h" 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // COptionSheet 26 | 27 | class COptionSheet : public CPropertySheet 28 | { 29 | DECLARE_DYNAMIC(COptionSheet) 30 | 31 | // Construction 32 | public: 33 | COptionSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); 34 | COptionSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0); 35 | 36 | // Attributes 37 | public: 38 | 39 | // Operations 40 | public: 41 | 42 | // Overrides 43 | // ClassWizard generated virtual function overrides 44 | //{{AFX_VIRTUAL(COptionSheet) 45 | //}}AFX_VIRTUAL 46 | 47 | // Implementation 48 | public: 49 | virtual ~COptionSheet(); 50 | COptionsConnectionPage m_pageConnection; 51 | COptionsDialUpPage m_pageDialUp; 52 | COptionsFileManagementPage m_pageFileManagement; 53 | COptionsGeneralPage m_pageGeneral; 54 | COptionsGraphLogPage m_pageGraphLog; 55 | COptionsLoginPage m_pageLogin; 56 | COptionsMirrorPage m_pageMirror; 57 | COptionsMonitorPage m_pageMonitor; 58 | COptionsOtherPage m_pageOther; 59 | COptionsProtocolPage m_pageProtocol; 60 | COptionsProxyPage m_pageProxy; 61 | COptionsSchedulePage m_pageSchedule; 62 | COptionsSoundPage m_pageSound; 63 | // Generated message map functions 64 | protected: 65 | //{{AFX_MSG(COptionSheet) 66 | // NOTE - the ClassWizard will add and remove member functions here. 67 | //}}AFX_MSG 68 | DECLARE_MESSAGE_MAP() 69 | private: 70 | void prv_SetupSheet(); 71 | void prv_AddPages(); 72 | }; 73 | 74 | ///////////////////////////////////////////////////////////////////////////// 75 | 76 | //{{AFX_INSERT_LOCATION}} 77 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 78 | 79 | #endif // !defined(AFX_OPTIONSHEET_H__A4F56FEC_7655_4648_86FC_0F6E10F32ABA__INCLUDED_) 80 | -------------------------------------------------------------------------------- /OptionsConnectionPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSCONNECTIONPAGE_H__B1985D06_D89C_45A7_ABCD_462A0C31912D__INCLUDED_) 2 | #define AFX_OPTIONSCONNECTIONPAGE_H__B1985D06_D89C_45A7_ABCD_462A0C31912D__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsConnectionPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsConnectionPage dialog 12 | 13 | class COptionsConnectionPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsConnectionPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsConnectionPage(); 21 | ~COptionsConnectionPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsConnectionPage) 25 | enum { IDD = IDD_OPTIONS_CONNECTION }; 26 | CSpinButtonCtrl m_spinRetryDelay; 27 | CSpinButtonCtrl m_spinNumOfRetries; 28 | CSpinButtonCtrl m_spinDataTimeOut; 29 | CSpinButtonCtrl m_spinMaxSimJobs; 30 | CSpinButtonCtrl m_spinConnectionTimeOut; 31 | int m_iConnectionTimeOut; 32 | int m_iDataTimeOut; 33 | BOOL m_boolStopAfter99NoData; 34 | BOOL m_boolAlwaysRetry; 35 | BOOL m_boolAlwaysObeySpeedLimit; 36 | int m_iMaxSimJobs; 37 | int m_iNumOfRetries; 38 | int m_iRetryDelay; 39 | double m_dblSpeedLimit; 40 | //}}AFX_DATA 41 | 42 | 43 | // Overrides 44 | // ClassWizard generate virtual function overrides 45 | //{{AFX_VIRTUAL(COptionsConnectionPage) 46 | public: 47 | virtual void OnOK(); 48 | protected: 49 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | // Generated message map functions 55 | //{{AFX_MSG(COptionsConnectionPage) 56 | virtual BOOL OnInitDialog(); 57 | afx_msg void OnCheckAlwaysRetry(); 58 | //}}AFX_MSG 59 | DECLARE_MESSAGE_MAP() 60 | 61 | private: 62 | void prv_FillDlg(); 63 | void prv_UpdateRetryOptions(); 64 | }; 65 | 66 | //{{AFX_INSERT_LOCATION}} 67 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 68 | 69 | #endif // !defined(AFX_OPTIONSCONNECTIONPAGE_H__B1985D06_D89C_45A7_ABCD_462A0C31912D__INCLUDED_) 70 | -------------------------------------------------------------------------------- /OptionsDialUpPage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/OptionsDialUpPage.cpp -------------------------------------------------------------------------------- /OptionsDialUpPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSDIALUP_H__5BC8B55B_3122_46AC_BFC0_649E425D6E8B__INCLUDED_) 2 | #define AFX_OPTIONSDIALUP_H__5BC8B55B_3122_46AC_BFC0_649E425D6E8B__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsDialUp.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsDialUpPage dialog 12 | 13 | class COptionsDialUpPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsDialUpPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsDialUpPage(); 21 | ~COptionsDialUpPage(); 22 | 23 | private: 24 | void prv_UpdateDialEntry(); 25 | void prv_UpdateRedial(); 26 | void prv_FillDlg(); 27 | 28 | // Dialog Data 29 | //{{AFX_DATA(COptionsDialUpPage) 30 | enum { IDD = IDD_OPTIONS_DIAL_UP }; 31 | CSpinButtonCtrl m_spn_WaitBetweenRetry; 32 | CSpinButtonCtrl m_spnRetryFailedConnection; 33 | int m_iConnection; 34 | BOOL m_bHandupWhenDone; 35 | BOOL m_bRedialIfFailedConnected; 36 | CString m_strConnectionWindowTitle; 37 | CString m_strPassword; 38 | CString m_strUserName; 39 | DWORD m_dwRetryFailedConnection; 40 | DWORD m_dwWaitBetweenRetry; 41 | //}}AFX_DATA 42 | 43 | 44 | // Overrides 45 | // ClassWizard generate virtual function overrides 46 | //{{AFX_VIRTUAL(COptionsDialUpPage) 47 | public: 48 | virtual void OnOK(); 49 | protected: 50 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 51 | //}}AFX_VIRTUAL 52 | 53 | // Implementation 54 | protected: 55 | // Generated message map functions 56 | //{{AFX_MSG(COptionsDialUpPage) 57 | virtual BOOL OnInitDialog(); 58 | afx_msg void OnChkRedialifdisconnected(); 59 | afx_msg void OnSelchangeCbxConnections(); 60 | //}}AFX_MSG 61 | DECLARE_MESSAGE_MAP() 62 | 63 | }; 64 | 65 | //{{AFX_INSERT_LOCATION}} 66 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 67 | 68 | #endif // !defined(AFX_OPTIONSDIALUP_H__5BC8B55B_3122_46AC_BFC0_649E425D6E8B__INCLUDED_) 69 | -------------------------------------------------------------------------------- /OptionsFileManagementPage.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/OptionsFileManagementPage.cpp -------------------------------------------------------------------------------- /OptionsFileManagementPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSFILEMANAGEMENTPAGE_H__9818C242_6E83_4555_BED7_EC364968BA92__INCLUDED_) 2 | #define AFX_OPTIONSFILEMANAGEMENTPAGE_H__9818C242_6E83_4555_BED7_EC364968BA92__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsFileManagementPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsFileManagementPage dialog 12 | 13 | class COptionsFileManagementPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsFileManagementPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsFileManagementPage(); 21 | ~COptionsFileManagementPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsFileManagementPage) 25 | enum { IDD = IDD_OPTIONS_FILE_MANAGEMENT }; 26 | int m_iStoragesCBX; 27 | BOOL m_bMoveSomeFilesToPortableStorage; 28 | BOOL m_bOpenFilesWhenDownloaded; 29 | BOOL m_bVirusScanDownloadedFiles; 30 | CString m_strOpenTypes; 31 | CString m_strVirsuScanner; 32 | CString m_strVirsuScannerArgs; 33 | CString m_strVirsuScannerTypes; 34 | int m_iDestinationExists; 35 | int m_iMoveDownloadedItem; 36 | //}}AFX_DATA 37 | 38 | 39 | // Overrides 40 | // ClassWizard generate virtual function overrides 41 | //{{AFX_VIRTUAL(COptionsFileManagementPage) 42 | public: 43 | virtual void OnOK(); 44 | protected: 45 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 46 | //}}AFX_VIRTUAL 47 | 48 | // Implementation 49 | protected: 50 | // Generated message map functions 51 | //{{AFX_MSG(COptionsFileManagementPage) 52 | virtual BOOL OnInitDialog(); 53 | afx_msg void OnBtnBrowsevirusscanner(); 54 | //}}AFX_MSG 55 | DECLARE_MESSAGE_MAP() 56 | 57 | private: 58 | void prv_FillDlg(); 59 | }; 60 | 61 | //{{AFX_INSERT_LOCATION}} 62 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 63 | 64 | #endif // !defined(AFX_OPTIONSFILEMANAGEMENTPAGE_H__9818C242_6E83_4555_BED7_EC364968BA92__INCLUDED_) 65 | -------------------------------------------------------------------------------- /OptionsGeneralPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSGENERALPAGE_H__720C2843_604C_475F_8C33_77D07976C7C2__INCLUDED_) 2 | #define AFX_OPTIONSGENERALPAGE_H__720C2843_604C_475F_8C33_77D07976C7C2__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsGeneralPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsGeneralPage dialog 12 | 13 | class COptionsGeneralPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsGeneralPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsGeneralPage(); 21 | ~COptionsGeneralPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsGeneralPage) 25 | enum { IDD = IDD_OPTIONS_GENERAL }; 26 | CSpinButtonCtrl m_spnBlockSize; 27 | BOOL m_boolStartMainframeMinimized; 28 | BOOL m_boolAutoSave; 29 | BOOL m_boolBackupEveryDay; 30 | BOOL m_boolErrorStop; 31 | BOOL m_boolFileSizeInBytes; 32 | BOOL m_boolGetFileDateFromServer; 33 | BOOL m_boolLogForEachDownloadedFile; 34 | BOOL m_boolPromptWhenDrop; 35 | BOOL m_boolStartDownloadOnStartup; 36 | BOOL m_boolStillDownloadEvenNonResumable; 37 | BOOL m_boolUseFileExt; 38 | int m_iAutoSaveInterval; 39 | int m_iBlockSize; 40 | //}}AFX_DATA 41 | 42 | 43 | // Overrides 44 | // ClassWizard generate virtual function overrides 45 | //{{AFX_VIRTUAL(COptionsGeneralPage) 46 | public: 47 | virtual void OnOK(); 48 | protected: 49 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 50 | //}}AFX_VIRTUAL 51 | 52 | // Implementation 53 | protected: 54 | // Generated message map functions 55 | //{{AFX_MSG(COptionsGeneralPage) 56 | virtual BOOL OnInitDialog(); 57 | //}}AFX_MSG 58 | DECLARE_MESSAGE_MAP() 59 | 60 | private: 61 | void prv_FillDlg(); 62 | }; 63 | 64 | //{{AFX_INSERT_LOCATION}} 65 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 66 | 67 | #endif // !defined(AFX_OPTIONSGENERALPAGE_H__720C2843_604C_475F_8C33_77D07976C7C2__INCLUDED_) 68 | -------------------------------------------------------------------------------- /OptionsGraphLogPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSGRAPHLOGPAGE_H__41A749A9_FDFF_400A_98C0_9B4462B9B33C__INCLUDED_) 2 | #define AFX_OPTIONSGRAPHLOGPAGE_H__41A749A9_FDFF_400A_98C0_9B4462B9B33C__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsGraphLogPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsGraphLogPage dialog 12 | #include "ColorButton.h" 13 | 14 | class COptionsGraphLogPage : public CPropertyPage 15 | { 16 | DECLARE_DYNCREATE(COptionsGraphLogPage) 17 | 18 | // Construction 19 | public: 20 | void ReloadResource(); 21 | COptionsGraphLogPage(); 22 | ~COptionsGraphLogPage(); 23 | 24 | // Dialog Data 25 | //{{AFX_DATA(COptionsGraphLogPage) 26 | enum { IDD = IDD_OPTIONS_GRAPH_LOG }; 27 | CSpinButtonCtrl m_spnGraphScale; 28 | CSpinButtonCtrl m_spnBlockSize; 29 | CColorButton m_clrbtnLogState; 30 | CColorButton m_clrbtnLogServer; 31 | CColorButton m_clrbtnLogError; 32 | CColorButton m_clrbtnLogCommand; 33 | CColorButton m_clrbtnGraphFore; 34 | CColorButton m_clrbtnGraphBack; 35 | CColorButton m_clrbtnBlockBack; 36 | BOOL m_bDropZoneDisplayGraph; 37 | BOOL m_bDropZoneTransparent; 38 | BOOL m_bLogSettingBkColor; 39 | int m_iBlockSize; 40 | int m_iGraphScale; 41 | DWORD m_dwGraphFore; 42 | DWORD m_dwGraphBack; 43 | DWORD m_dwLogCommand; 44 | DWORD m_dwLogCommandBk; 45 | DWORD m_dwLogState; 46 | DWORD m_dwLogStateBk; 47 | DWORD m_dwLogError; 48 | DWORD m_dwLogErrorBk; 49 | DWORD m_dwLogServer; 50 | DWORD m_dwLogServerBk; 51 | DWORD m_dwBlockBack; 52 | //}}AFX_DATA 53 | 54 | 55 | // Overrides 56 | // ClassWizard generate virtual function overrides 57 | //{{AFX_VIRTUAL(COptionsGraphLogPage) 58 | public: 59 | virtual void OnOK(); 60 | protected: 61 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 62 | //}}AFX_VIRTUAL 63 | 64 | // Implementation 65 | protected: 66 | // Generated message map functions 67 | //{{AFX_MSG(COptionsGraphLogPage) 68 | virtual BOOL OnInitDialog(); 69 | afx_msg void OnChkLogsettingbkcolor(); 70 | //}}AFX_MSG 71 | DECLARE_MESSAGE_MAP() 72 | 73 | private: 74 | void prv_FillDlg(); 75 | }; 76 | 77 | //{{AFX_INSERT_LOCATION}} 78 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 79 | 80 | #endif // !defined(AFX_OPTIONSGRAPHLOGPAGE_H__41A749A9_FDFF_400A_98C0_9B4462B9B33C__INCLUDED_) 81 | -------------------------------------------------------------------------------- /OptionsLoginPage.cpp: -------------------------------------------------------------------------------- 1 | // OptionsLoginPage.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "OptionsLoginPage.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // COptionsLoginPage property page 16 | 17 | IMPLEMENT_DYNCREATE(COptionsLoginPage, CPropertyPage) 18 | 19 | COptionsLoginPage::COptionsLoginPage() : CPropertyPage(COptionsLoginPage::IDD) 20 | { 21 | //{{AFX_DATA_INIT(COptionsLoginPage) 22 | // NOTE: the ClassWizard will add member initialization here 23 | //}}AFX_DATA_INIT 24 | //m_psp.dwFlags |= PSP_USETITLE; 25 | //static CString strCaption; 26 | //strCaption = APP_GET_RSCSTR("Login_PPG", "Title"); 27 | //m_psp.pszTitle = strCaption; 28 | SET_PROPERTYPAGE_TITLE("Login_PPG"); 29 | 30 | } 31 | 32 | COptionsLoginPage::~COptionsLoginPage() 33 | { 34 | } 35 | 36 | void COptionsLoginPage::DoDataExchange(CDataExchange* pDX) 37 | { 38 | CPropertyPage::DoDataExchange(pDX); 39 | //{{AFX_DATA_MAP(COptionsLoginPage) 40 | // NOTE: the ClassWizard will add DDX and DDV calls here 41 | //}}AFX_DATA_MAP 42 | } 43 | 44 | 45 | BEGIN_MESSAGE_MAP(COptionsLoginPage, CPropertyPage) 46 | //{{AFX_MSG_MAP(COptionsLoginPage) 47 | // NOTE: the ClassWizard will add message map macros here 48 | //}}AFX_MSG_MAP 49 | END_MESSAGE_MAP() 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | // COptionsLoginPage message handlers 53 | -------------------------------------------------------------------------------- /OptionsLoginPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSLOGINPAGE_H__4A5B0E30_65E7_4688_B2E0_01EC1E9FB05B__INCLUDED_) 2 | #define AFX_OPTIONSLOGINPAGE_H__4A5B0E30_65E7_4688_B2E0_01EC1E9FB05B__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsLoginPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsLoginPage dialog 12 | 13 | class COptionsLoginPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsLoginPage) 16 | 17 | // Construction 18 | public: 19 | COptionsLoginPage(); 20 | ~COptionsLoginPage(); 21 | 22 | // Dialog Data 23 | //{{AFX_DATA(COptionsLoginPage) 24 | enum { IDD = IDD_OPTIONS_LOGIN }; 25 | //}}AFX_DATA 26 | 27 | 28 | // Overrides 29 | // ClassWizard generate virtual function overrides 30 | //{{AFX_VIRTUAL(COptionsLoginPage) 31 | protected: 32 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 33 | //}}AFX_VIRTUAL 34 | 35 | // Implementation 36 | protected: 37 | // Generated message map functions 38 | //{{AFX_MSG(COptionsLoginPage) 39 | // NOTE: the ClassWizard will add member functions here 40 | //}}AFX_MSG 41 | DECLARE_MESSAGE_MAP() 42 | 43 | }; 44 | 45 | //{{AFX_INSERT_LOCATION}} 46 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 47 | 48 | #endif // !defined(AFX_OPTIONSLOGINPAGE_H__4A5B0E30_65E7_4688_B2E0_01EC1E9FB05B__INCLUDED_) 49 | -------------------------------------------------------------------------------- /OptionsMirrorPage.cpp: -------------------------------------------------------------------------------- 1 | // OptionsMirrorPage.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "OptionsMirrorPage.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // COptionsMirrorPage property page 16 | 17 | IMPLEMENT_DYNCREATE(COptionsMirrorPage, CPropertyPage) 18 | 19 | COptionsMirrorPage::COptionsMirrorPage() : CPropertyPage(COptionsMirrorPage::IDD) 20 | { 21 | //{{AFX_DATA_INIT(COptionsMirrorPage) 22 | m_bAutoCalcAddMirrors = FALSE; 23 | m_bAutoSearchMirrorSites = FALSE; 24 | m_bAutoSelectMirror = FALSE; 25 | m_bEnableMirror = FALSE; 26 | m_iFtpSearchMaxHit = 0; 27 | m_iFtpSearchMinSize = 0; 28 | //}}AFX_DATA_INIT 29 | //m_psp.dwFlags |= PSP_USETITLE; 30 | //static CString strCaption; 31 | //strCaption = APP_GET_RSCSTR("Mirrors_PPG", "Title"); 32 | //m_psp.pszTitle = strCaption; 33 | SET_PROPERTYPAGE_TITLE("Mirrors_PPG"); 34 | 35 | } 36 | 37 | COptionsMirrorPage::~COptionsMirrorPage() 38 | { 39 | } 40 | 41 | void COptionsMirrorPage::DoDataExchange(CDataExchange* pDX) 42 | { 43 | CPropertyPage::DoDataExchange(pDX); 44 | //{{AFX_DATA_MAP(COptionsMirrorPage) 45 | DDX_Control(pDX, IDC_SPIN_MINSIZE, m_spinMinSize); 46 | DDX_Control(pDX, IDC_SPIN_MAXHIT, m_spinMaxHit); 47 | DDX_Check(pDX, IDC_CHK_AUTOCALCADDMIRRORS, m_bAutoCalcAddMirrors); 48 | DDX_Check(pDX, IDC_CHK_AUTOSEARCHMIRRORSITES, m_bAutoSearchMirrorSites); 49 | DDX_Check(pDX, IDC_CHK_AUTOSELECTMIRROR, m_bAutoSelectMirror); 50 | DDX_Check(pDX, IDC_CHK_ENABLEMIRROW, m_bEnableMirror); 51 | DDX_Text(pDX, IDC_EDT_FTPSEARCHMAXHIT, m_iFtpSearchMaxHit); 52 | DDV_MinMaxInt(pDX, m_iFtpSearchMaxHit, 5, 100); 53 | DDX_Text(pDX, IDC_EDT_FTPSEARCHMINSIZE, m_iFtpSearchMinSize); 54 | DDV_MinMaxInt(pDX, m_iFtpSearchMinSize, 10, 102400); 55 | //}}AFX_DATA_MAP 56 | } 57 | 58 | 59 | BEGIN_MESSAGE_MAP(COptionsMirrorPage, CPropertyPage) 60 | //{{AFX_MSG_MAP(COptionsMirrorPage) 61 | //}}AFX_MSG_MAP 62 | END_MESSAGE_MAP() 63 | 64 | 65 | ///////////////////////////////////////////////////////////////////////////// 66 | // COptionsMirrorPage message handlers 67 | 68 | BOOL COptionsMirrorPage::OnInitDialog() 69 | { 70 | CPropertyPage::OnInitDialog(); 71 | 72 | // TODO: Add extra initialization here 73 | ReloadResource(); 74 | prv_FillDlg(); 75 | return TRUE; // return TRUE unless you set the focus to a control 76 | // EXCEPTION: OCX Property Pages should return FALSE 77 | } 78 | 79 | void COptionsMirrorPage::prv_FillDlg() 80 | { 81 | 82 | CAppRegs *pAppRegs = ((CMyGetApp *)AfxGetApp())->GetAppRegs(); 83 | 84 | 85 | m_bEnableMirror = pAppRegs->IsFlagOn(REG_FLAG_GENERAL_EXT_ENABLEMIRROWS); 86 | m_bAutoSearchMirrorSites = pAppRegs->IsFlagOn(REG_FLAG_GENERAL_EXT_AUTOSEARCHMIRRORSITE); 87 | m_bAutoCalcAddMirrors = pAppRegs->IsFlagOn(REG_FLAG_GENERAL_EXT_AUTOCALCADDMIRROR); 88 | m_bAutoSelectMirror = pAppRegs->IsFlagOn(REG_FLAG_GENERAL_EXT_AUTOSELECTMIRRORSITE); 89 | 90 | pAppRegs->GetVal(REG_GENERAL_FTPSEARCHMINSIZE, (DWORD *)&m_iFtpSearchMinSize); 91 | 92 | UDACCEL udAccelMinSize; 93 | m_spinMinSize.GetAccel(1, &udAccelMinSize); 94 | udAccelMinSize.nInc = 100; 95 | m_spinMinSize.SetAccel(1, &udAccelMinSize); 96 | m_spinMinSize.SetRange32(10, 102400); 97 | 98 | 99 | pAppRegs->GetVal(REG_GENERAL_FTPSEARCHMAXHIT, (DWORD *)&m_iFtpSearchMaxHit); 100 | UDACCEL udAccelMaxHit; 101 | m_spinMaxHit.GetAccel(1, &udAccelMaxHit); 102 | udAccelMaxHit.nInc = 5; 103 | m_spinMaxHit.SetAccel(1, &udAccelMaxHit); 104 | m_spinMaxHit.SetRange(5, 100); 105 | 106 | 107 | UpdateData(FALSE); 108 | } 109 | 110 | void COptionsMirrorPage::ReloadResource() 111 | { 112 | //Dlg Items 113 | LPCTSTR lpszDlgID = _T("Mirrors_PPG"); 114 | 115 | SET_DLG_ITEM_TEXT(1236); 116 | SET_DLG_ITEM_TEXT(1237); 117 | SET_DLG_ITEM_TEXT(1197); 118 | SET_DLG_ITEM_TEXT(1239); 119 | SET_DLG_ITEM_TEXT(1199); 120 | SET_DLG_ITEM_TEXT(1202); 121 | SET_DLG_ITEM_TEXT(1200); 122 | SET_DLG_ITEM_TEXT(1201); 123 | SET_DLG_ITEM_TEXT(1244); 124 | SET_DLG_ITEM_TEXT(1203); 125 | 126 | 127 | } 128 | -------------------------------------------------------------------------------- /OptionsMirrorPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSMIRRORPAGE_H__443D9E52_ACC9_4264_B270_A961A0B449A0__INCLUDED_) 2 | #define AFX_OPTIONSMIRRORPAGE_H__443D9E52_ACC9_4264_B270_A961A0B449A0__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsMirrorPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsMirrorPage dialog 12 | 13 | class COptionsMirrorPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsMirrorPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsMirrorPage(); 21 | ~COptionsMirrorPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsMirrorPage) 25 | enum { IDD = IDD_OPTIONS_MIRROR }; 26 | CSpinButtonCtrl m_spinMinSize; 27 | CSpinButtonCtrl m_spinMaxHit; 28 | BOOL m_bAutoCalcAddMirrors; 29 | BOOL m_bAutoSearchMirrorSites; 30 | BOOL m_bAutoSelectMirror; 31 | BOOL m_bEnableMirror; 32 | int m_iFtpSearchMaxHit; 33 | int m_iFtpSearchMinSize; 34 | //}}AFX_DATA 35 | 36 | 37 | // Overrides 38 | // ClassWizard generate virtual function overrides 39 | //{{AFX_VIRTUAL(COptionsMirrorPage) 40 | protected: 41 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 42 | //}}AFX_VIRTUAL 43 | 44 | // Implementation 45 | protected: 46 | // Generated message map functions 47 | //{{AFX_MSG(COptionsMirrorPage) 48 | virtual BOOL OnInitDialog(); 49 | //}}AFX_MSG 50 | DECLARE_MESSAGE_MAP() 51 | 52 | private: 53 | void prv_FillDlg(); 54 | }; 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_OPTIONSMIRRORPAGE_H__443D9E52_ACC9_4264_B270_A961A0B449A0__INCLUDED_) 60 | -------------------------------------------------------------------------------- /OptionsMonitorPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSMONITORPAGE_H__FD9DD468_5763_42E9_902C_3AEEEFADBE73__INCLUDED_) 2 | #define AFX_OPTIONSMONITORPAGE_H__FD9DD468_5763_42E9_902C_3AEEEFADBE73__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsMonitorPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsMonitorPage dialog 12 | 13 | class COptionsMonitorPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsMonitorPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsMonitorPage(); 21 | ~COptionsMonitorPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsMonitorPage) 25 | enum { IDD = IDD_OPTIONS_MONITOR }; 26 | BOOL m_bBrowserConfirm; 27 | BOOL m_bBrowserFillCommentWithClipboardContent; 28 | BOOL m_bBrowserIE; 29 | BOOL m_bBrowserIEWidMatch; 30 | BOOL m_bBrowserNetscape; 31 | BOOL m_bBrowserOpenCancelledUrls; 32 | BOOL m_bBrowserUseAlt; 33 | BOOL m_bClipboardConfirm; 34 | BOOL m_bClipboardMonitor; 35 | CString m_strMonitorTypes; 36 | int m_iBorwserIEMethod; 37 | //}}AFX_DATA 38 | 39 | 40 | // Overrides 41 | // ClassWizard generate virtual function overrides 42 | //{{AFX_VIRTUAL(COptionsMonitorPage) 43 | public: 44 | virtual void OnOK(); 45 | protected: 46 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 47 | //}}AFX_VIRTUAL 48 | 49 | // Implementation 50 | protected: 51 | // Generated message map functions 52 | //{{AFX_MSG(COptionsMonitorPage) 53 | virtual BOOL OnInitDialog(); 54 | afx_msg void OnChkBrowserie(); 55 | //}}AFX_MSG 56 | DECLARE_MESSAGE_MAP() 57 | 58 | private: 59 | void prv_UpdateIEOptions(); 60 | void prv_FillDlg(); 61 | }; 62 | 63 | //{{AFX_INSERT_LOCATION}} 64 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 65 | 66 | #endif // !defined(AFX_OPTIONSMONITORPAGE_H__FD9DD468_5763_42E9_902C_3AEEEFADBE73__INCLUDED_) 67 | -------------------------------------------------------------------------------- /OptionsOtherPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSOTHERPAGE_H__C09D37B8_D815_4AFA_9E3D_3C05B4703E9B__INCLUDED_) 2 | #define AFX_OPTIONSOTHERPAGE_H__C09D37B8_D815_4AFA_9E3D_3C05B4703E9B__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsOtherPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsOtherPage dialog 12 | 13 | #define COMMON_ITEM 0 14 | #define CHECKBOX_ITEM 1 15 | #define RADIOBUTTON_ITEM 2 16 | 17 | struct InitOtherTable 18 | { 19 | int iDepth; 20 | int iInitImage; // for Check Box / Radio button control, it is the default(unselected) image 21 | // When it is selected, the image index should be decrease by 1. 22 | LPCTSTR lpszSecton; 23 | UINT uiKeyID; 24 | int iType; //0: common, 1: Check Box; 2: Radio Button. 25 | int iGroupIndex; // the item index inside a group(just for radio button); it is zero-based. 26 | int *piVal; //The value store the state of check box or a group of radion button. 27 | 28 | LPCTSTR lpszDefaultLabel; 29 | HTREEITEM hTvItem; 30 | }; 31 | 32 | class COptionsOtherPage : public CPropertyPage 33 | { 34 | DECLARE_DYNCREATE(COptionsOtherPage) 35 | 36 | // Construction 37 | public: 38 | COptionsOtherPage(); 39 | ~COptionsOtherPage(); 40 | 41 | // Dialog Data 42 | //{{AFX_DATA(COptionsOtherPage) 43 | enum { IDD = IDD_OPTIONS_OTHER }; 44 | CTreeCtrl m_tvOthers; 45 | //}}AFX_DATA 46 | 47 | 48 | // Overrides 49 | // ClassWizard generate virtual function overrides 50 | //{{AFX_VIRTUAL(COptionsOtherPage) 51 | protected: 52 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 53 | //}}AFX_VIRTUAL 54 | 55 | // Implementation 56 | protected: 57 | CImageList m_ilOther; 58 | BOOL m_bConfirmQuitWhileDownloading; 59 | BOOL m_bConfirmQuitWhileOpenMultipleWindows; 60 | BOOL m_bConfirmAddJobUseIEMenu; 61 | BOOL m_bConfirmAddMultipleJobs; 62 | 63 | BOOL m_bShowSubCategoryInAlphaOrder; 64 | BOOL m_bHideWindowWhenMinimize; 65 | BOOL m_bMinimizeWhenX; 66 | BOOL m_bQuitAfterFinishedDownload; 67 | 68 | int m_iDoubleClickDownloadingOrReadyItem; 69 | int m_iDoubleClickDownloadedItem; 70 | int m_iDoubleClickFailedItem; 71 | 72 | struct InitOtherTable *m_pInitTable; 73 | int m_iSizeOfInitTable; 74 | // Generated message map functions 75 | //{{AFX_MSG(COptionsOtherPage) 76 | virtual BOOL OnInitDialog(); 77 | afx_msg void OnClickTvOthers(NMHDR* pNMHDR, LRESULT* pResult); 78 | //}}AFX_MSG 79 | DECLARE_MESSAGE_MAP() 80 | 81 | private: 82 | void prv_FillDlg(); 83 | }; 84 | 85 | //{{AFX_INSERT_LOCATION}} 86 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 87 | 88 | #endif // !defined(AFX_OPTIONSOTHERPAGE_H__C09D37B8_D815_4AFA_9E3D_3C05B4703E9B__INCLUDED_) 89 | -------------------------------------------------------------------------------- /OptionsProtocolPage.cpp: -------------------------------------------------------------------------------- 1 | // OptionsProtocolPage.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "OptionsProtocolPage.h" 7 | #include "AppRegs.h" 8 | #include "CommonUtils.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // COptionsProtocolPage property page 18 | 19 | IMPLEMENT_DYNCREATE(COptionsProtocolPage, CPropertyPage) 20 | 21 | COptionsProtocolPage::COptionsProtocolPage() : CPropertyPage(COptionsProtocolPage::IDD) 22 | { 23 | //{{AFX_DATA_INIT(COptionsProtocolPage) 24 | m_boolEnableCookie = FALSE; 25 | m_strAsciiMode = _T(""); 26 | m_strEmail = _T(""); 27 | m_strUserDefineAgent = _T(""); 28 | m_iUserAgent = -1; 29 | //}}AFX_DATA_INIT 30 | //m_psp.dwFlags |= PSP_USETITLE; 31 | //static CString strCaption; 32 | //strCaption = APP_GET_RSCSTR("Pro_PPG", "Title"); 33 | //m_psp.pszTitle = strCaption; 34 | 35 | SET_PROPERTYPAGE_TITLE("Pro_PPG"); 36 | } 37 | 38 | COptionsProtocolPage::~COptionsProtocolPage() 39 | { 40 | } 41 | 42 | void COptionsProtocolPage::DoDataExchange(CDataExchange* pDX) 43 | { 44 | CPropertyPage::DoDataExchange(pDX); 45 | //{{AFX_DATA_MAP(COptionsProtocolPage) 46 | DDX_Check(pDX, IDC_CHECK_ENABLE_COOKIE, m_boolEnableCookie); 47 | DDX_Text(pDX, IDC_EDIT_ASCII_MODE, m_strAsciiMode); 48 | DDX_Text(pDX, IDC_EDIT_EMAIL, m_strEmail); 49 | DDX_Text(pDX, IDC_EDIT_USER_DEFINE_AGENT, m_strUserDefineAgent); 50 | DDX_CBIndex(pDX, IDC_CBX_USER_AGENT, m_iUserAgent); 51 | //}}AFX_DATA_MAP 52 | } 53 | 54 | 55 | BEGIN_MESSAGE_MAP(COptionsProtocolPage, CPropertyPage) 56 | //{{AFX_MSG_MAP(COptionsProtocolPage) 57 | //}}AFX_MSG_MAP 58 | END_MESSAGE_MAP() 59 | 60 | ///////////////////////////////////////////////////////////////////////////// 61 | // COptionsProtocolPage message handlers 62 | 63 | BOOL COptionsProtocolPage::OnInitDialog() 64 | { 65 | CPropertyPage::OnInitDialog(); 66 | 67 | // TODO: Add extra initialization here 68 | ReloadResource(); 69 | prv_FillDlg(); 70 | return TRUE; // return TRUE unless you set the focus to a control 71 | // EXCEPTION: OCX Property Pages should return FALSE 72 | } 73 | 74 | void COptionsProtocolPage::prv_FillDlg() 75 | { 76 | CAppRegs *pAppRegs = ((CMyGetApp *)AfxGetApp())->GetAppRegs(); 77 | 78 | LPTSTR lpszBuf; 79 | 80 | lpszBuf = NULL; 81 | pAppRegs->GetVal(REG_PROTOCOL_ASCIIMODE, &lpszBuf); 82 | m_strAsciiMode = lpszBuf; 83 | 84 | lpszBuf = NULL; 85 | pAppRegs->GetVal(REG_PROTOCOL_EMAIL, &lpszBuf); 86 | m_strEmail = lpszBuf; 87 | 88 | lpszBuf = NULL; 89 | pAppRegs->GetVal(REG_PROTOCOL_USERAGENTTEXT, &lpszBuf); 90 | m_strUserDefineAgent = lpszBuf; 91 | 92 | m_boolEnableCookie = pAppRegs->IsFlagOn(REG_FLAG_GENERAL_EXT_ENABLE_COOKIE); 93 | 94 | pAppRegs->GetVal(REG_PROTOCOL_USERAGENT, (DWORD *)&m_iUserAgent); 95 | UpdateData(FALSE); 96 | } 97 | 98 | void COptionsProtocolPage::ReloadResource() 99 | { 100 | //Dlg Items 101 | LPCTSTR lpszDlgID = _T("Pro_PPG"); 102 | 103 | SET_DLG_ITEM_TEXT(1198); 104 | SET_DLG_ITEM_TEXT(1200); 105 | SET_DLG_ITEM_TEXT(1201); 106 | SET_DLG_ITEM_TEXT(1182); 107 | SET_DLG_ITEM_TEXT(1202); 108 | 109 | CComposedStrings strAgens(61271); 110 | 111 | for (int i = 0; i < strAgens.GetSubStringCount(); i ++) 112 | { 113 | ((CComboBox *)GetDlgItem(IDC_CBX_USER_AGENT))->AddString(strAgens.GetSubString(i)); 114 | } 115 | } 116 | 117 | void COptionsProtocolPage::OnOK() 118 | { 119 | // TODO: Add your specialized code here and/or call the base class 120 | UpdateData(TRUE); 121 | 122 | CAppRegs *pAppRegs = ((CMyGetApp *)AfxGetApp())->GetAppRegs(); 123 | 124 | pAppRegs->SetVal(REG_PROTOCOL_ASCIIMODE, m_strAsciiMode); 125 | pAppRegs->SetVal(REG_PROTOCOL_EMAIL, m_strEmail); 126 | pAppRegs->SetVal(REG_PROTOCOL_USERAGENTTEXT, m_strUserDefineAgent); 127 | 128 | pAppRegs->SetFlag(REG_FLAG_GENERAL_EXT_ENABLE_COOKIE, m_boolEnableCookie); 129 | 130 | pAppRegs->SetVal(REG_PROTOCOL_USERAGENT, (DWORD)m_iUserAgent); 131 | 132 | CPropertyPage::OnOK(); 133 | } 134 | -------------------------------------------------------------------------------- /OptionsProtocolPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSPROTOCOLPAGE_H__3190A3D7_CC4E_4DC5_9C9C_CA674399009C__INCLUDED_) 2 | #define AFX_OPTIONSPROTOCOLPAGE_H__3190A3D7_CC4E_4DC5_9C9C_CA674399009C__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsProtocolPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsProtocolPage dialog 12 | 13 | #define DEFAULT_EMAIL "yourname@yourcompany.com" 14 | 15 | class COptionsProtocolPage : public CPropertyPage 16 | { 17 | DECLARE_DYNCREATE(COptionsProtocolPage) 18 | 19 | // Construction 20 | public: 21 | void ReloadResource(); 22 | COptionsProtocolPage(); 23 | ~COptionsProtocolPage(); 24 | 25 | // Dialog Data 26 | //{{AFX_DATA(COptionsProtocolPage) 27 | enum { IDD = IDD_OPTIONS_PROTOCOL }; 28 | BOOL m_boolEnableCookie; 29 | CString m_strAsciiMode; 30 | CString m_strEmail; 31 | CString m_strUserDefineAgent; 32 | int m_iUserAgent; 33 | //}}AFX_DATA 34 | 35 | 36 | // Overrides 37 | // ClassWizard generate virtual function overrides 38 | //{{AFX_VIRTUAL(COptionsProtocolPage) 39 | public: 40 | virtual void OnOK(); 41 | protected: 42 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 43 | //}}AFX_VIRTUAL 44 | 45 | // Implementation 46 | protected: 47 | // Generated message map functions 48 | //{{AFX_MSG(COptionsProtocolPage) 49 | virtual BOOL OnInitDialog(); 50 | //}}AFX_MSG 51 | DECLARE_MESSAGE_MAP() 52 | 53 | private: 54 | void prv_FillDlg(); 55 | }; 56 | 57 | //{{AFX_INSERT_LOCATION}} 58 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 59 | 60 | #endif // !defined(AFX_OPTIONSPROTOCOLPAGE_H__3190A3D7_CC4E_4DC5_9C9C_CA674399009C__INCLUDED_) 61 | -------------------------------------------------------------------------------- /OptionsProxyPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSPROXYPAGE_H__00EEBD51_BAE0_4558_B4AA_B30A18A08467__INCLUDED_) 2 | #define AFX_OPTIONSPROXYPAGE_H__00EEBD51_BAE0_4558_B4AA_B30A18A08467__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsProxyPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsProxyPage dialog 12 | 13 | class COptionsProxyPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsProxyPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsProxyPage(); 21 | ~COptionsProxyPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsProxyPage) 25 | enum { IDD = IDD_OPTIONS_PROXY }; 26 | CListCtrl m_listctrlProxy; 27 | BOOL m_boolAllJobsUseDefaultProxy; 28 | int m_iRollBackSize; 29 | //}}AFX_DATA 30 | 31 | 32 | // Overrides 33 | // ClassWizard generate virtual function overrides 34 | //{{AFX_VIRTUAL(COptionsProxyPage) 35 | public: 36 | virtual void OnCancel(); 37 | virtual void OnOK(); 38 | protected: 39 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 40 | //}}AFX_VIRTUAL 41 | 42 | // Implementation 43 | protected: 44 | int m_iDefaultForHttp; 45 | int m_iDefaultForFtp; 46 | CImageList m_ilChoiceType; 47 | // Generated message map functions 48 | //{{AFX_MSG(COptionsProxyPage) 49 | virtual BOOL OnInitDialog(); 50 | afx_msg void OnItemchangedListProxy(NMHDR* pNMHDR, LRESULT* pResult); 51 | afx_msg void OnClickListProxy(NMHDR* pNMHDR, LRESULT* pResult); 52 | afx_msg void OnBtnEditProxy(); 53 | afx_msg void OnBtnAddProxy(); 54 | afx_msg void OnBtnDelete(); 55 | //}}AFX_MSG 56 | DECLARE_MESSAGE_MAP() 57 | 58 | private: 59 | void prv_FreeMEM(); 60 | void prv_SetupListColumns(); 61 | void prv_RefreshDefaultIndex(); 62 | void prv_FillProxyList(); 63 | }; 64 | 65 | //{{AFX_INSERT_LOCATION}} 66 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 67 | 68 | #endif // !defined(AFX_OPTIONSPROXYPAGE_H__00EEBD51_BAE0_4558_B4AA_B30A18A08467__INCLUDED_) 69 | -------------------------------------------------------------------------------- /OptionsSchedulePage.cpp: -------------------------------------------------------------------------------- 1 | // OptionsSchedulePage.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "OptionsSchedulePage.h" 7 | 8 | #ifdef _DEBUG 9 | #define new DEBUG_NEW 10 | #undef THIS_FILE 11 | static char THIS_FILE[] = __FILE__; 12 | #endif 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // COptionsSchedulePage property page 16 | 17 | IMPLEMENT_DYNCREATE(COptionsSchedulePage, CPropertyPage) 18 | 19 | COptionsSchedulePage::COptionsSchedulePage() : CPropertyPage(COptionsSchedulePage::IDD) 20 | { 21 | //{{AFX_DATA_INIT(COptionsSchedulePage) 22 | m_bEnableStopTimer = FALSE; 23 | m_bStartDownloadAtMonday = FALSE; 24 | m_bStartDownloadAtTuesday = FALSE; 25 | m_bStartDownloadAtWednesday = FALSE; 26 | m_bStartDownloadAtThursday = FALSE; 27 | m_bStartDownloadAtFriday = FALSE; 28 | m_bStartDownloadAtSaturday = FALSE; 29 | m_bStartDownloadAtSunday = FALSE; 30 | m_tDownloadStartAt = 0; 31 | m_tDownloadStopAt = 0; 32 | //}}AFX_DATA_INIT 33 | 34 | //m_psp.dwFlags |= PSP_USETITLE; 35 | //static CString strCaption; 36 | //strCaption = APP_GET_RSCSTR("Schedule_PPG", "Title"); 37 | //m_psp.pszTitle = strCaption; 38 | SET_PROPERTYPAGE_TITLE("Schedule_PPG"); 39 | 40 | } 41 | 42 | COptionsSchedulePage::~COptionsSchedulePage() 43 | { 44 | } 45 | 46 | void COptionsSchedulePage::DoDataExchange(CDataExchange* pDX) 47 | { 48 | CPropertyPage::DoDataExchange(pDX); 49 | //{{AFX_DATA_MAP(COptionsSchedulePage) 50 | DDX_Check(pDX, IDC_CHK_ENABLESTOPTIMER, m_bEnableStopTimer); 51 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_MONDAY, m_bStartDownloadAtMonday); 52 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_TUESDAY, m_bStartDownloadAtTuesday); 53 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_WEDNESDAY, m_bStartDownloadAtWednesday); 54 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_THURSDAY, m_bStartDownloadAtThursday); 55 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_FRIDAY, m_bStartDownloadAtFriday); 56 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_SATURDAY, m_bStartDownloadAtSaturday); 57 | DDX_Check(pDX, IDC_CHK_STARTDOWNLOADAT_SUNDAY, m_bStartDownloadAtSunday); 58 | DDX_DateTimeCtrl(pDX, IDC_DTP_DOWNLOADSTARTAT, m_tDownloadStartAt); 59 | DDX_DateTimeCtrl(pDX, IDC_DTP_DOWNLOADSTOPAT, m_tDownloadStopAt); 60 | //}}AFX_DATA_MAP 61 | } 62 | 63 | 64 | BEGIN_MESSAGE_MAP(COptionsSchedulePage, CPropertyPage) 65 | //{{AFX_MSG_MAP(COptionsSchedulePage) 66 | ON_BN_CLICKED(IDC_CHK_ENABLESTOPTIMER, OnChkEnablestoptimer) 67 | //}}AFX_MSG_MAP 68 | END_MESSAGE_MAP() 69 | 70 | ///////////////////////////////////////////////////////////////////////////// 71 | // COptionsSchedulePage message handlers 72 | 73 | BOOL COptionsSchedulePage::OnInitDialog() 74 | { 75 | CPropertyPage::OnInitDialog(); 76 | 77 | // TODO: Add extra initialization here 78 | ReloadResource(); 79 | prv_FillDlg(); 80 | return TRUE; // return TRUE unless you set the focus to a control 81 | // EXCEPTION: OCX Property Pages should return FALSE 82 | } 83 | 84 | void COptionsSchedulePage::prv_FillDlg() 85 | { 86 | CAppRegs *pAppRegs = ((CMyGetApp *)AfxGetApp())->GetAppRegs(); 87 | 88 | //Start Time 89 | pAppRegs->GetVal(REG_GENERAL_SCHEDULESTARTTIME, (DWORD *)&m_tDownloadStartAt); 90 | 91 | //Stop Time 92 | pAppRegs->GetVal(REG_GENERAL_SCHEDULESTOPTIME, (DWORD *)&m_tDownloadStopAt); 93 | 94 | //Enable download in week; 95 | m_bStartDownloadAtMonday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATMONDAY); 96 | m_bStartDownloadAtTuesday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATTUESDAY); 97 | m_bStartDownloadAtWednesday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATWEDNESDAY); 98 | m_bStartDownloadAtThursday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATTHURSDAY); 99 | m_bStartDownloadAtFriday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATFRIDAY); 100 | m_bStartDownloadAtSaturday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATSATURDAY); 101 | m_bStartDownloadAtSunday = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATSUNDAY); 102 | 103 | m_bEnableStopTimer = pAppRegs->IsFlagOn(REG_FLAG_SCHEDULE_ENABLESTOPTIMER); 104 | 105 | prv_UpdateStopTimer(); 106 | 107 | UpdateData(FALSE); 108 | } 109 | 110 | void COptionsSchedulePage::ReloadResource() 111 | { 112 | //Dlg Items 113 | LPCTSTR lpszDlgID = _T("Schedule_PPG"); 114 | 115 | SET_DLG_ITEM_TEXT(1197); 116 | SET_DLG_ITEM_TEXT(1110); 117 | SET_DLG_ITEM_TEXT(1111); 118 | SET_DLG_ITEM_TEXT(1112); 119 | SET_DLG_ITEM_TEXT(1113); 120 | SET_DLG_ITEM_TEXT(1114); 121 | SET_DLG_ITEM_TEXT(1115); 122 | SET_DLG_ITEM_TEXT(1116); 123 | SET_DLG_ITEM_TEXT(1082); 124 | 125 | } 126 | 127 | void COptionsSchedulePage::OnOK() 128 | { 129 | // TODO: Add your specialized code here and/or call the base class 130 | UpdateData(TRUE); 131 | CAppRegs *pAppRegs = ((CMyGetApp *)AfxGetApp())->GetAppRegs(); 132 | 133 | //Start Time 134 | pAppRegs->SetVal(REG_GENERAL_SCHEDULESTARTTIME, (DWORD)m_tDownloadStartAt.GetTime()); 135 | 136 | //Stop Time 137 | pAppRegs->SetVal(REG_GENERAL_SCHEDULESTOPTIME, (DWORD)m_tDownloadStopAt.GetTime()); 138 | 139 | //Enable download in week; 140 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATMONDAY, m_bStartDownloadAtMonday); 141 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATTUESDAY, m_bStartDownloadAtTuesday); 142 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATWEDNESDAY, m_bStartDownloadAtWednesday); 143 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATTHURSDAY, m_bStartDownloadAtThursday); 144 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATFRIDAY, m_bStartDownloadAtFriday); 145 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATSATURDAY, m_bStartDownloadAtSaturday); 146 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLEDOWNLOADATSUNDAY, m_bStartDownloadAtSunday); 147 | 148 | 149 | pAppRegs->SetFlag(REG_FLAG_SCHEDULE_ENABLESTOPTIMER, m_bEnableStopTimer); 150 | 151 | CPropertyPage::OnOK(); 152 | } 153 | 154 | void COptionsSchedulePage::OnChkEnablestoptimer() 155 | { 156 | // TODO: Add your control notification handler code here 157 | UpdateData(TRUE); 158 | 159 | prv_UpdateStopTimer(); 160 | } 161 | 162 | void COptionsSchedulePage::prv_UpdateStopTimer() 163 | { 164 | GetDlgItem(IDC_DTP_DOWNLOADSTOPAT)->EnableWindow(m_bEnableStopTimer); 165 | } 166 | -------------------------------------------------------------------------------- /OptionsSchedulePage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSSCHEDULEPAGE_H__D6EF6D89_8036_46DA_B84A_DFA0A8740AEB__INCLUDED_) 2 | #define AFX_OPTIONSSCHEDULEPAGE_H__D6EF6D89_8036_46DA_B84A_DFA0A8740AEB__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsSchedulePage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsSchedulePage dialog 12 | 13 | class COptionsSchedulePage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsSchedulePage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsSchedulePage(); 21 | ~COptionsSchedulePage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsSchedulePage) 25 | enum { IDD = IDD_OPTIONS_SCHEDULE }; 26 | BOOL m_bEnableStopTimer; 27 | BOOL m_bStartDownloadAtMonday; 28 | BOOL m_bStartDownloadAtTuesday; 29 | BOOL m_bStartDownloadAtWednesday; 30 | BOOL m_bStartDownloadAtThursday; 31 | BOOL m_bStartDownloadAtFriday; 32 | BOOL m_bStartDownloadAtSaturday; 33 | BOOL m_bStartDownloadAtSunday; 34 | CTime m_tDownloadStartAt; 35 | CTime m_tDownloadStopAt; 36 | //}}AFX_DATA 37 | 38 | 39 | // Overrides 40 | // ClassWizard generate virtual function overrides 41 | //{{AFX_VIRTUAL(COptionsSchedulePage) 42 | public: 43 | virtual void OnOK(); 44 | protected: 45 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 46 | //}}AFX_VIRTUAL 47 | 48 | // Implementation 49 | protected: 50 | // Generated message map functions 51 | //{{AFX_MSG(COptionsSchedulePage) 52 | virtual BOOL OnInitDialog(); 53 | afx_msg void OnChkEnablestoptimer(); 54 | //}}AFX_MSG 55 | DECLARE_MESSAGE_MAP() 56 | 57 | private: 58 | void prv_UpdateStopTimer(); 59 | void prv_FillDlg(); 60 | }; 61 | 62 | //{{AFX_INSERT_LOCATION}} 63 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 64 | 65 | #endif // !defined(AFX_OPTIONSSCHEDULEPAGE_H__D6EF6D89_8036_46DA_B84A_DFA0A8740AEB__INCLUDED_) 66 | -------------------------------------------------------------------------------- /OptionsSoundPage.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_OPTIONSSOUNDPAGE_H__A3F4D127_8DC9_4626_A649_D3C765B1AA26__INCLUDED_) 2 | #define AFX_OPTIONSSOUNDPAGE_H__A3F4D127_8DC9_4626_A649_D3C765B1AA26__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // OptionsSoundPage.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // COptionsSoundPage dialog 12 | 13 | class COptionsSoundPage : public CPropertyPage 14 | { 15 | DECLARE_DYNCREATE(COptionsSoundPage) 16 | 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | COptionsSoundPage(); 21 | ~COptionsSoundPage(); 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(COptionsSoundPage) 25 | enum { IDD = IDD_OPTIONS_SOUND }; 26 | CListCtrl m_lvSounds; 27 | BOOL m_bOpenDlgWhenDownloadAll; 28 | BOOL m_bOpenDlgWhenDownloadFailed; 29 | BOOL m_bOpenDlgWhenDownloadSucceed; 30 | BOOL m_bEnableSound; 31 | //}}AFX_DATA 32 | 33 | 34 | // Overrides 35 | // ClassWizard generate virtual function overrides 36 | //{{AFX_VIRTUAL(COptionsSoundPage) 37 | public: 38 | virtual void OnOK(); 39 | protected: 40 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 41 | //}}AFX_VIRTUAL 42 | 43 | // Implementation 44 | protected: 45 | // Generated message map functions 46 | //{{AFX_MSG(COptionsSoundPage) 47 | virtual BOOL OnInitDialog(); 48 | afx_msg void OnBtnClearsound(); 49 | afx_msg void OnBtnPlaysound(); 50 | afx_msg void OnBtnBrowsesound(); 51 | //}}AFX_MSG 52 | DECLARE_MESSAGE_MAP() 53 | 54 | private: 55 | void prv_FillDlg(); 56 | }; 57 | 58 | //{{AFX_INSERT_LOCATION}} 59 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 60 | 61 | #endif // !defined(AFX_OPTIONSSOUNDPAGE_H__A3F4D127_8DC9_4626_A649_D3C765B1AA26__INCLUDED_) 62 | -------------------------------------------------------------------------------- /ProgressChart.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_CHECKERCTRL_H__AD4BC4E3_7750_11D4_8718_008048CA4A77__INCLUDED_) 2 | #define AFX_CHECKERCTRL_H__AD4BC4E3_7750_11D4_8718_008048CA4A77__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // CheckerCtrl.h : header file 8 | // 9 | 10 | //////////////////////////////////////////////////////////////////////////// 11 | // CProgressChart window 12 | 13 | //define Progress Chart constant value 14 | #define BLOCK_HEIGHT 11 15 | #define BLOCK_WIDTH 10 16 | 17 | #define BLOCK_BYTE_SIZE (4 * 1024) 18 | 19 | #define BLOCK_UNCOMPLETED 0 20 | #define BLOCK_COMPLETED 1 21 | #define BLOCK_DOWNLOADING 2 22 | 23 | class CProgressChart : public CWnd 24 | { 25 | // Construction 26 | public: 27 | CProgressChart(); 28 | 29 | // Attributes 30 | public: 31 | 32 | // Operations 33 | public: 34 | 35 | // Overrides 36 | // ClassWizard generated virtual function overrides 37 | //{{AFX_VIRTUAL(CProgressChart) 38 | //}}AFX_VIRTUAL 39 | 40 | // Implementation 41 | public: 42 | void ResetBlocks(); 43 | int GetTotalBlocks(); 44 | void Resize(); 45 | void SetTotalBlocks(const UINT nNumberofBlocks, const UINT nStartIndex = 0); 46 | void Update(const UINT nBlockNumber); 47 | void Reset(); 48 | void SetBlock(const UINT nBlockNumber, DWORD dwBlockStatus); 49 | COLORREF GetBlock(const UINT nBlockNumber) const; 50 | BOOL Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID); 51 | virtual ~CProgressChart(); 52 | 53 | // Generated message map functions 54 | protected: 55 | CRect GetBlockRect(const UINT nRow, const UINT nColumn); 56 | const CPoint GetLefTopPointOfBlock(const UINT nRow, const UINT nColumn); 57 | CImageList m_BlockStatusImageList; 58 | //{{AFX_MSG(CProgressChart) 59 | afx_msg void OnPaint(); 60 | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); 61 | afx_msg void OnMouseMove(UINT nFlags, CPoint point); 62 | //}}AFX_MSG 63 | DECLARE_MESSAGE_MAP() 64 | private: 65 | BOOL IsVisible(const UINT nBlockNumber); 66 | void ShowBlock(UINT nRow, UINT nColumn, UINT iBlockStatus, CDC &dc); 67 | 68 | CWnd *m_pParentWnd; 69 | UINT m_nID; 70 | UINT m_nStartIndex; 71 | UINT m_nTotalVisibleBlocks; 72 | UINT m_nBlockStartPos; 73 | int m_nyPos; 74 | int m_nOffset; 75 | CRect m_rcClient; 76 | UINT m_nBlocksPerRow; 77 | UINT m_nBlocksPerColumn; 78 | UINT m_nNumberofBlocks; 79 | CBrush m_backgroundBrush; 80 | CArray m_arBlockStatus; 81 | }; 82 | 83 | ///////////////////////////////////////////////////////////////////////////// 84 | 85 | //{{AFX_INSERT_LOCATION}} 86 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 87 | 88 | #endif // !defined(AFX_CHECKERCTRL_H__AD4BC4E3_7750_11D4_8718_008048CA4A77__INCLUDED_) 89 | -------------------------------------------------------------------------------- /ProxyData.cpp: -------------------------------------------------------------------------------- 1 | // ProxyData.cpp: implementation of the CProxyData class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "myget.h" 7 | #include "ProxyData.h" 8 | 9 | #ifdef _DEBUG 10 | #undef THIS_FILE 11 | static char THIS_FILE[]=__FILE__; 12 | #define new DEBUG_NEW 13 | #endif 14 | 15 | ////////////////////////////////////////////////////////////////////// 16 | // Construction/Destruction 17 | ////////////////////////////////////////////////////////////////////// 18 | 19 | CProxyData::CProxyData() 20 | { 21 | m_pProxyStruct = new PROXYSTRUCT; 22 | memset(m_pProxyStruct, 0, sizeof(PROXYSTRUCT)); 23 | 24 | SetTitle(""); 25 | SetServer(""); 26 | SetUser(""); 27 | m_pProxyStruct->dwFlag = PASV_MASK | NO_CACHE_MASK; 28 | } 29 | 30 | CProxyData::~CProxyData() 31 | { 32 | if (!m_pProxyStruct) 33 | { 34 | return; 35 | } 36 | 37 | if (m_pProxyStruct->pszTitle) 38 | { 39 | delete m_pProxyStruct->pszTitle; 40 | m_pProxyStruct->pszTitle = NULL; 41 | } 42 | 43 | if (m_pProxyStruct->pszServer) 44 | { 45 | delete m_pProxyStruct->pszServer; 46 | m_pProxyStruct->pszServer = NULL; 47 | } 48 | 49 | 50 | if (m_pProxyStruct->pszUserName) 51 | { 52 | delete m_pProxyStruct->pszUserName; 53 | m_pProxyStruct->pszUserName = NULL; 54 | } 55 | 56 | 57 | 58 | if (m_pProxyStruct->pszPassword) 59 | { 60 | delete m_pProxyStruct->pszPassword; 61 | m_pProxyStruct->pszPassword = NULL; 62 | } 63 | 64 | delete m_pProxyStruct; 65 | } 66 | 67 | DWORD CProxyData::GetFlag() 68 | { 69 | return m_pProxyStruct->dwFlag; 70 | } 71 | 72 | void CProxyData::SetFlag(DWORD dwFlag) 73 | { 74 | m_pProxyStruct->dwFlag = dwFlag; 75 | } 76 | 77 | UINT CProxyData::GetPort() 78 | { 79 | return (UINT)m_pProxyStruct->dwPort; 80 | } 81 | 82 | void CProxyData::SetPort(DWORD dwPort) 83 | { 84 | m_pProxyStruct->dwPort = dwPort; 85 | } 86 | 87 | DWORD CProxyData::GetType() 88 | { 89 | return m_pProxyStruct->dwType; 90 | } 91 | 92 | void CProxyData::SetType(DWORD dwType) 93 | { 94 | m_pProxyStruct->dwType = dwType; 95 | } 96 | 97 | LPTSTR CProxyData::GetServer() 98 | { 99 | return m_pProxyStruct->pszServer; 100 | } 101 | 102 | void CProxyData::SetServer(LPCTSTR pszServer) 103 | { 104 | if (pszServer)// && (strlen(pszServer) > 0)) 105 | { 106 | if (m_pProxyStruct->pszServer) 107 | { 108 | delete(m_pProxyStruct->pszServer); 109 | } 110 | 111 | m_pProxyStruct->pszServer = new TCHAR[strlen(pszServer) + 1]; 112 | 113 | if (!m_pProxyStruct->pszServer) 114 | { 115 | return; 116 | } 117 | 118 | strcpy(m_pProxyStruct->pszServer, pszServer); 119 | } 120 | } 121 | 122 | LPTSTR CProxyData::GetTitle() 123 | { 124 | return m_pProxyStruct->pszTitle; 125 | } 126 | 127 | void CProxyData::SetTitle(LPCTSTR pszTitle) 128 | { 129 | if (pszTitle)// && (strlen(pszTitle) > 0)) 130 | { 131 | if (m_pProxyStruct->pszTitle) 132 | { 133 | delete(m_pProxyStruct->pszTitle); 134 | } 135 | 136 | m_pProxyStruct->pszTitle = new TCHAR[strlen(pszTitle) + 1]; 137 | 138 | if (!m_pProxyStruct->pszTitle) 139 | { 140 | return; 141 | } 142 | 143 | 144 | strcpy(m_pProxyStruct->pszTitle, pszTitle); 145 | } 146 | } 147 | 148 | LPTSTR CProxyData::GetUser() 149 | { 150 | return m_pProxyStruct->pszUserName; 151 | } 152 | 153 | void CProxyData::SetUser(LPCTSTR pszUserName) 154 | { 155 | if (pszUserName)// && (strlen(pszUserName) > 0)) 156 | { 157 | if (m_pProxyStruct->pszUserName) 158 | { 159 | delete(m_pProxyStruct->pszUserName); 160 | } 161 | 162 | m_pProxyStruct->pszUserName = new TCHAR[strlen(pszUserName) + 1]; 163 | 164 | if (!m_pProxyStruct->pszUserName) 165 | { 166 | return; 167 | } 168 | 169 | 170 | strcpy(m_pProxyStruct->pszUserName, pszUserName); 171 | } 172 | 173 | } 174 | 175 | LPTSTR CProxyData::GetPassword() 176 | { 177 | return m_pProxyStruct->pszPassword; 178 | } 179 | 180 | void CProxyData::SetPassword(LPCTSTR pszPassword) 181 | { 182 | if (pszPassword) 183 | { 184 | if (m_pProxyStruct->pszPassword) 185 | { 186 | delete m_pProxyStruct->pszPassword; 187 | m_pProxyStruct->pszPassword = NULL; 188 | 189 | } 190 | 191 | m_pProxyStruct->pszPassword = new TCHAR[strlen(pszPassword) + 1]; 192 | 193 | if (m_pProxyStruct->pszPassword) 194 | { 195 | strcpy(m_pProxyStruct->pszPassword, pszPassword); 196 | } 197 | 198 | 199 | 200 | } 201 | } 202 | 203 | PPROXYSTRUCT CProxyData::GetProxyStruct() 204 | { 205 | return m_pProxyStruct; 206 | } 207 | -------------------------------------------------------------------------------- /ProxyData.h: -------------------------------------------------------------------------------- 1 | // ProxyData.h: interface for the CProxyData class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_PROXYDATA_H__A001C8D3_A3B4_486C_9F48_DF80FF478EC3__INCLUDED_) 6 | #define AFX_PROXYDATA_H__A001C8D3_A3B4_486C_9F48_DF80FF478EC3__INCLUDED_ 7 | 8 | #include "AppRegs.h" 9 | 10 | #if _MSC_VER > 1000 11 | #pragma once 12 | #endif // _MSC_VER > 1000 13 | 14 | //define proxy flag 15 | #define AUTH_MASK 1 16 | #define PASV_MASK 2 17 | #define NO_CACHE_MASK 4 18 | 19 | 20 | 21 | //define Proxy type 22 | #define REG_RROXY_TYPE_BASE 0 23 | #define REG_DIR_CONNECTION REG_RROXY_TYPE_BASE 24 | #define REG_FTP_OPEN_HOST REG_RROXY_TYPE_BASE + 1 25 | #define REG_FTP_USER_HOST_PORT1 REG_RROXY_TYPE_BASE + 2 26 | #define REG_HTTP_GET REG_RROXY_TYPE_BASE + 3 27 | #define REG_FTP_USER_HOST_PORT2 REG_RROXY_TYPE_BASE + 4 28 | #define REG_FTP_SITE_HOST REG_RROXY_TYPE_BASE + 5 29 | #define REG_FTP_SITE_USER_HOST REG_RROXY_TYPE_BASE + 6 30 | #define REG_DIR_SOCKS5 REG_RROXY_TYPE_BASE + 7 31 | #define REG_DIR_HTTP_CONNECT REG_RROXY_TYPE_BASE + 8 32 | 33 | 34 | class CProxyData 35 | { 36 | public: 37 | PPROXYSTRUCT GetProxyStruct(); 38 | void SetPassword(LPCTSTR pszPassword); 39 | LPTSTR GetPassword(); 40 | void SetUser(LPCTSTR pszUserName); 41 | LPTSTR GetUser(); 42 | void SetTitle(LPCTSTR pszTitle); 43 | LPTSTR GetTitle(); 44 | void SetServer(LPCTSTR pszServer); 45 | LPTSTR GetServer(); 46 | void SetType(DWORD dwType); 47 | DWORD GetType(); 48 | void SetPort(DWORD dwPort); 49 | UINT GetPort(); 50 | void SetFlag(DWORD dwFlag); 51 | DWORD GetFlag(); 52 | CProxyData(); 53 | virtual ~CProxyData(); 54 | 55 | protected: 56 | PPROXYSTRUCT m_pProxyStruct; 57 | }; 58 | 59 | #endif // !defined(AFX_PROXYDATA_H__A001C8D3_A3B4_486C_9F48_DF80FF478EC3__INCLUDED_) 60 | -------------------------------------------------------------------------------- /ProxySettingsDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_PROXYSETTINGSDLG_H__EF2B7C82_8199_4085_8A29_31709303B2F8__INCLUDED_) 2 | #define AFX_PROXYSETTINGSDLG_H__EF2B7C82_8199_4085_8A29_31709303B2F8__INCLUDED_ 3 | 4 | #include "ProxyData.h" // Added by ClassView 5 | #if _MSC_VER > 1000 6 | #pragma once 7 | #endif // _MSC_VER > 1000 8 | // ProxySettingsDlg.h : header file 9 | // 10 | 11 | ///////////////////////////////////////////////////////////////////////////// 12 | // CProxySettingsDlg dialog 13 | 14 | 15 | 16 | 17 | class CProxySettingsDlg : public CDialog 18 | { 19 | // Construction 20 | public: 21 | BOOL m_bIsDirectConn; 22 | void ReloadResource(); 23 | CProxyData *m_pProxyData; 24 | CProxySettingsDlg(CWnd* pParent = NULL); // standard constructor 25 | 26 | // Dialog Data 27 | //{{AFX_DATA(CProxySettingsDlg) 28 | enum { IDD = IDD_PROXY_SETTINGS }; 29 | int m_iType; 30 | BOOL m_boolNoCache; 31 | BOOL m_boolPasvMode; 32 | CString m_strPassword; 33 | UINT m_uiPort; 34 | CString m_strServer; 35 | CString m_strTitle; 36 | CString m_strUser; 37 | BOOL m_boolAuth; 38 | //}}AFX_DATA 39 | 40 | 41 | // Overrides 42 | // ClassWizard generated virtual function overrides 43 | //{{AFX_VIRTUAL(CProxySettingsDlg) 44 | protected: 45 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 46 | //}}AFX_VIRTUAL 47 | 48 | // Implementation 49 | protected: 50 | 51 | // Generated message map functions 52 | //{{AFX_MSG(CProxySettingsDlg) 53 | virtual BOOL OnInitDialog(); 54 | afx_msg void OnCheckAuth(); 55 | virtual void OnOK(); 56 | afx_msg void OnTypeClick(); 57 | //}}AFX_MSG 58 | DECLARE_MESSAGE_MAP() 59 | private: 60 | void prv_FillDlg(); 61 | }; 62 | 63 | //{{AFX_INSERT_LOCATION}} 64 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 65 | 66 | #endif // !defined(AFX_PROXYSETTINGSDLG_H__EF2B7C82_8199_4085_8A29_31709303B2F8__INCLUDED_) 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # myget 2 | 十几年前开发的,使用MFC,用到了多种界面类,模拟了FlashGet的界面和动作。 3 | ![Image text](img/1.jpg) 4 | -------------------------------------------------------------------------------- /SetupAlternativeURLsDlg.cpp: -------------------------------------------------------------------------------- 1 | // SetupAlternativeURLsDlg.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "myget.h" 6 | #include "SetupAlternativeURLsDlg.h" 7 | #include "ListItem.h" 8 | #include "InputDlg.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CSetupAlternativeURLsDlg dialog 18 | 19 | 20 | CSetupAlternativeURLsDlg::CSetupAlternativeURLsDlg(CWnd* pParent /*=NULL*/) 21 | : CDialog(CSetupAlternativeURLsDlg::IDD, pParent) 22 | { 23 | //{{AFX_DATA_INIT(CSetupAlternativeURLsDlg) 24 | m_strUrl = _T(""); 25 | //}}AFX_DATA_INIT 26 | } 27 | 28 | 29 | void CSetupAlternativeURLsDlg::DoDataExchange(CDataExchange* pDX) 30 | { 31 | CDialog::DoDataExchange(pDX); 32 | //{{AFX_DATA_MAP(CSetupAlternativeURLsDlg) 33 | DDX_Control(pDX, IDC_LIST_ALTERNATE_URLS, m_lstAlternativeUrls); 34 | DDX_Text(pDX, IDC_TEXT_URL, m_strUrl); 35 | //}}AFX_DATA_MAP 36 | } 37 | 38 | 39 | BEGIN_MESSAGE_MAP(CSetupAlternativeURLsDlg, CDialog) 40 | //{{AFX_MSG_MAP(CSetupAlternativeURLsDlg) 41 | ON_WM_CLOSE() 42 | ON_BN_CLICKED(IDC_BTN_DELETE, OnBtnDelete) 43 | ON_BN_CLICKED(IDC_BTN_ADD, OnBtnAdd) 44 | //}}AFX_MSG_MAP 45 | END_MESSAGE_MAP() 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // CSetupAlternativeURLsDlg message handlers 49 | 50 | BOOL CSetupAlternativeURLsDlg::OnInitDialog() 51 | { 52 | CDialog::OnInitDialog(); 53 | 54 | // TODO: Add extra initialization here 55 | ReloadResource(); 56 | prv_SetupDlg(); 57 | prv_FillDlg(); 58 | return TRUE; // return TRUE unless you set the focus to a control 59 | // EXCEPTION: OCX Property Pages should return FALSE 60 | } 61 | 62 | void CSetupAlternativeURLsDlg::prv_FillDlg() 63 | { 64 | for (int i = 0; i < m_parSubStitutedUrl->GetSize(); i ++) 65 | { 66 | m_lstAlternativeUrls.InsertItem(i, m_parSubStitutedUrl->GetAt(i)->m_strSubstitutedURL); 67 | } 68 | 69 | UpdateData(FALSE); 70 | } 71 | 72 | void CSetupAlternativeURLsDlg::prv_SetupDlg() 73 | { 74 | m_lstAlternativeUrls.InsertColumn(0, "", LVCFMT_LEFT, 1000); 75 | } 76 | 77 | 78 | 79 | void CSetupAlternativeURLsDlg::OnClose() 80 | { 81 | // TODO: Add your message handler code here and/or call default 82 | prv_SaveURLs(); 83 | 84 | CDialog::OnClose(); 85 | } 86 | 87 | void CSetupAlternativeURLsDlg::OnOK() 88 | { 89 | // TODO: Add extra validation here 90 | prv_SaveURLs(); 91 | CDialog::OnOK(); 92 | } 93 | 94 | void CSetupAlternativeURLsDlg::prv_SaveURLs() 95 | { 96 | int i; 97 | 98 | PSUBSTITUTEDURL pSubsUrl; 99 | for (i = 0; i < m_parSubStitutedUrl->GetSize(); i ++) 100 | { 101 | pSubsUrl = m_parSubStitutedUrl->GetAt(i); 102 | 103 | delete pSubsUrl; 104 | } 105 | 106 | m_parSubStitutedUrl->RemoveAll(); 107 | 108 | for (i = 0; i < m_lstAlternativeUrls.GetItemCount(); i ++) 109 | { 110 | pSubsUrl = new SUBSTITUTEDURL; 111 | 112 | pSubsUrl->m_strSubstitutedURL = m_lstAlternativeUrls.GetItemText(i, 0); 113 | *(int *)pSubsUrl->pbUnknown = 0; 114 | 115 | m_parSubStitutedUrl->Add(pSubsUrl); 116 | 117 | } 118 | 119 | } 120 | 121 | void CSetupAlternativeURLsDlg::OnBtnDelete() 122 | { 123 | // TODO: Add your control notification handler code here 124 | int iSelectIndex = m_lstAlternativeUrls.GetNextItem(-1, LVNI_SELECTED); 125 | 126 | if (iSelectIndex == -1) 127 | { 128 | return; 129 | } 130 | 131 | m_lstAlternativeUrls.DeleteItem(iSelectIndex); 132 | } 133 | 134 | void CSetupAlternativeURLsDlg::OnBtnAdd() 135 | { 136 | // TODO: Add your control notification handler code here 137 | CInputDlg dlg; 138 | dlg.m_iDlgType = ADD_ALTER_URL; 139 | 140 | if (dlg.DoModal() == IDOK) 141 | { 142 | m_lstAlternativeUrls.InsertItem(m_lstAlternativeUrls.GetItemCount(), dlg.m_strInput); 143 | } 144 | } 145 | 146 | void CSetupAlternativeURLsDlg::ReloadResource() 147 | { 148 | //common 149 | //SetDlgItemText(1, APP_GET_RSCSTR("Dialog_Common", 1)); 150 | SET_DLG_ITEM_TEXT_EX(1, "Dialog_Common", 1); 151 | SET_DLG_ITEM_TEXT_EX(2, "Dialog_Common", 2); 152 | 153 | //Dlg Items 154 | LPCTSTR lpszDlgID = _T("AltUrls_Dlg"); 155 | //SetWindowText(APP_GET_RSCSTR(lpszDlgID, "Title")); 156 | SET_WINDOW_TITLE; 157 | 158 | SET_DLG_ITEM_TEXT(1155); 159 | SET_DLG_ITEM_TEXT(1157); 160 | 161 | } 162 | -------------------------------------------------------------------------------- /SetupAlternativeURLsDlg.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_SETUPALTERNATIVEURLSDLG_H__5952F6B9_D4F3_490B_879E_AB221EB91D14__INCLUDED_) 2 | #define AFX_SETUPALTERNATIVEURLSDLG_H__5952F6B9_D4F3_490B_879E_AB221EB91D14__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // SetupAlternativeURLsDlg.h : header file 8 | // 9 | #include "ListItem.h" 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CSetupAlternativeURLsDlg dialog 12 | 13 | class CListItem; 14 | 15 | class CSetupAlternativeURLsDlg : public CDialog 16 | { 17 | // Construction 18 | public: 19 | void ReloadResource(); 20 | CArray *m_parSubStitutedUrl; 21 | CSetupAlternativeURLsDlg(CWnd* pParent = NULL); // standard constructor 22 | 23 | // Dialog Data 24 | //{{AFX_DATA(CSetupAlternativeURLsDlg) 25 | enum { IDD = IDD_SETUP_ALTERNATE_URLS }; 26 | CListCtrl m_lstAlternativeUrls; 27 | CString m_strUrl; 28 | //}}AFX_DATA 29 | 30 | 31 | // Overrides 32 | // ClassWizard generated virtual function overrides 33 | //{{AFX_VIRTUAL(CSetupAlternativeURLsDlg) 34 | protected: 35 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 36 | //}}AFX_VIRTUAL 37 | 38 | // Implementation 39 | protected: 40 | 41 | // Generated message map functions 42 | //{{AFX_MSG(CSetupAlternativeURLsDlg) 43 | virtual BOOL OnInitDialog(); 44 | afx_msg void OnClose(); 45 | virtual void OnOK(); 46 | afx_msg void OnBtnDelete(); 47 | afx_msg void OnBtnAdd(); 48 | //}}AFX_MSG 49 | DECLARE_MESSAGE_MAP() 50 | private: 51 | void prv_SaveURLs(); 52 | void prv_SetupDlg(); 53 | void prv_FillDlg(); 54 | }; 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_SETUPALTERNATIVEURLSDLG_H__5952F6B9_D4F3_490B_879E_AB221EB91D14__INCLUDED_) 60 | -------------------------------------------------------------------------------- /ShellPidl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_SHELLPIDL_H__INCLUDED_) 2 | #define AFX_SHELLPIDL_H__INCLUDED_ 3 | 4 | #if _MSC_VER >= 1000 5 | #pragma once 6 | #endif // _MSC_VER >= 1000 7 | // ShellPidl.h : header file 8 | // 9 | 10 | #include 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // CShellPidl window 14 | // 15 | // This source is part of CShellTree - Selom Ofori 16 | // 17 | // Version: 1.02 (any previously unversioned copies are older/inferior 18 | // 19 | // This code is free for all to use. Mutatilate it as much as you want 20 | // See MFCENUM sample from microsoft 21 | 22 | class CShellPidl 23 | { 24 | public: 25 | // STRUCTURES 26 | typedef struct tagLVID 27 | { 28 | LPSHELLFOLDER lpsfParent; 29 | LPITEMIDLIST lpi; 30 | ULONG ulAttribs; 31 | } LVITEMDATA, *LPLVITEMDATA; 32 | 33 | typedef struct tagID 34 | { 35 | LPSHELLFOLDER lpsfParent; 36 | LPITEMIDLIST lpi; 37 | LPITEMIDLIST lpifq; 38 | } TVITEMDATA, *LPTVITEMDATA; 39 | 40 | public: 41 | 42 | // Functions that deal with PIDLs 43 | LPITEMIDLIST ConcatPidls(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); 44 | LPITEMIDLIST GetFullyQualPidl(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi); 45 | LPITEMIDLIST CopyITEMID(LPMALLOC lpMalloc, LPITEMIDLIST lpi); 46 | BOOL GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR lpFriendlyName); 47 | LPITEMIDLIST CreatePidl(UINT cbSize); 48 | UINT GetSize(LPCITEMIDLIST pidl); 49 | LPITEMIDLIST Next(LPCITEMIDLIST pidl); 50 | 51 | // Utility Functions 52 | BOOL DoTheMenuThing(HWND hwnd, LPSHELLFOLDER lpsfParent, LPITEMIDLIST lpi, LPPOINT lppt); 53 | int GetItemIcon(LPITEMIDLIST lpi, UINT uFlags); 54 | }; 55 | 56 | #endif // !defined(AFX_SHELLTREE_H__INCLUDED_) 57 | -------------------------------------------------------------------------------- /ShellTree.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_) 2 | #define AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_ 3 | 4 | #if _MSC_VER >= 1000 5 | #pragma once 6 | #endif // _MSC_VER >= 1000 7 | // ShellTree.h : header file 8 | // 9 | 10 | #include 11 | #include "FileName.h" 12 | #include "ShellPidl.h" 13 | ///////////////////////////////////////////////////////////////////////////// 14 | // CShellTree window 15 | // 16 | // This source is part of CShellTree - Selom Ofori 17 | // 18 | // Version: 1.02 (any previously unversioned copies are older/inferior 19 | // 20 | // This code is free for all to use. Mutatilate it as much as you want 21 | // See MFCENUM sample from microsoft 22 | 23 | class CShellTree : public CTreeCtrl, public CShellPidl 24 | { 25 | public: 26 | enum FindAttribs{type_drive,type_folder}; 27 | 28 | // Construction 29 | public: 30 | CShellTree(); 31 | 32 | // Attributes 33 | public: 34 | BOOL m_bOutaHere; 35 | 36 | // Operations 37 | public: 38 | void PopulateTree(); 39 | void PopulateTree(int nFolder); 40 | void OnFolderExpanding(NMHDR* pNMHDR, LRESULT* pResult); 41 | void GetContextMenu(NMHDR* pNMHDR, LRESULT* pResult); 42 | BOOL OnFolderSelected(NMHDR* pNMHDR, LRESULT* pResult, CString &szFolderPath); 43 | void OnDeleteShellItem(NMHDR* pNMHDR, LRESULT* pResult); 44 | void EnableImages(); 45 | BOOL GetSelectedFolderPath(CString &szFolderPath); 46 | bool SearchTree(HTREEITEM treeNode, CString szSearchName, FindAttribs attr); 47 | void TunnelTree(CString szFindPath); 48 | LPSHELLFOLDER GetParentShellFolder(HTREEITEM folderNode); 49 | LPITEMIDLIST GetRelativeIDLIST(HTREEITEM folderNode); 50 | LPITEMIDLIST GetFullyQualifiedID(HTREEITEM folderNode); 51 | void FindTreePidl( HTREEITEM nextNode, 52 | HTREEITEM& folderNode, 53 | LPLVITEMDATA lplvid, 54 | bool& valid); 55 | 56 | // Overrides 57 | // ClassWizard generated virtual function overrides 58 | //{{AFX_VIRTUAL(CShellTree) 59 | //}}AFX_VIRTUAL 60 | 61 | // Implementation 62 | public: 63 | virtual ~CShellTree(); 64 | 65 | // Generated message map functions 66 | protected: 67 | void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST lpifq, HTREEITEM hParent); 68 | void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTV_ITEM lptvitem); 69 | static int CALLBACK TreeViewCompareProc(LPARAM, LPARAM, LPARAM); 70 | 71 | //{{AFX_MSG(CShellTree) 72 | //}}AFX_MSG 73 | 74 | DECLARE_MESSAGE_MAP() 75 | }; 76 | 77 | ///////////////////////////////////////////////////////////////////////////// 78 | 79 | //{{AFX_INSERT_LOCATION}} 80 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 81 | 82 | #endif // !defined(AFX_SHELLTREE_H__6B1818E3_8ADA_11D1_B10E_40F603C10000__INCLUDED_) 83 | -------------------------------------------------------------------------------- /SocksPacket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/SocksPacket.cpp -------------------------------------------------------------------------------- /SocksPacket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/SocksPacket.h -------------------------------------------------------------------------------- /StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MyGet.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /StdAfx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #if !defined(AFX_STDAFX_H__606C7130_68A9_4254_A8B8_8604DCB7C41C__INCLUDED_) 7 | #define AFX_STDAFX_H__606C7130_68A9_4254_A8B8_8604DCB7C41C__INCLUDED_ 8 | 9 | #if _MSC_VER > 1000 10 | #pragma once 11 | #endif // _MSC_VER > 1000 12 | 13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 14 | 15 | #include // MFC core and standard components 16 | #include // MFC extensions 17 | #include // MFC Automation classes 18 | #include // MFC support for Internet Explorer 4 Common Controls 19 | #ifndef _AFX_NO_AFXCMN_SUPPORT 20 | #include // MFC support for Windows Common Controls 21 | #endif // _AFX_NO_AFXCMN_SUPPORT 22 | 23 | //#include // MFC socket extensions 24 | #include 25 | #include 26 | 27 | #include 28 | //{{AFX_INSERT_LOCATION}} 29 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 30 | 31 | #endif // !defined(AFX_STDAFX_H__606C7130_68A9_4254_A8B8_8604DCB7C41C__INCLUDED_) 32 | -------------------------------------------------------------------------------- /TE_Socket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/TE_Socket.cpp -------------------------------------------------------------------------------- /TE_Socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/TE_Socket.h -------------------------------------------------------------------------------- /TabCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TabCtrl.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include "TabDef.h" 7 | #include "TabCtrl.h" 8 | 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #undef THIS_FILE 13 | static char THIS_FILE[] = __FILE__; 14 | #endif 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // CTabSheet 18 | 19 | CTabSheet::CTabSheet() 20 | { 21 | m_nNumOfTabs = 0; 22 | } 23 | 24 | CTabSheet::~CTabSheet() 25 | { 26 | } 27 | 28 | 29 | BEGIN_MESSAGE_MAP(CTabSheet, CTabCtrl) 30 | //{{AFX_MSG_MAP(CTabSheet) 31 | // NOTE - the ClassWizard will add and remove mapping macros here. 32 | //}}AFX_MSG_MAP 33 | END_MESSAGE_MAP() 34 | 35 | ///////////////////////////////////////////////////////////////////////////// 36 | // CTabSheet message handlers 37 | 38 | 39 | 40 | 41 | BOOL CTabSheet::InsertTab(char *TabString) 42 | { 43 | TC_ITEM TabCtrlItem; 44 | 45 | TabCtrlItem.mask = TCIF_TEXT; 46 | TabCtrlItem.cchTextMax = _MAX_WORD ; 47 | TabCtrlItem. pszText = TabString; 48 | 49 | if(m_nNumOfTabs == InsertItem(m_nNumOfTabs, &TabCtrlItem)) 50 | { 51 | m_nNumOfTabs++; 52 | return TRUE; 53 | } 54 | else 55 | return FALSE; 56 | } 57 | 58 | int CTabSheet::GetCount() 59 | { 60 | return m_nNumOfTabs; 61 | } 62 | -------------------------------------------------------------------------------- /TabCtrl.h: -------------------------------------------------------------------------------- 1 | #if !defined(AFX_TABCTRL_H__E3D71444_FDA6_11D3_9FA5_006097D3A30A__INCLUDED_) 2 | #define AFX_TABCTRL_H__E3D71444_FDA6_11D3_9FA5_006097D3A30A__INCLUDED_ 3 | 4 | #if _MSC_VER > 1000 5 | #pragma once 6 | #endif // _MSC_VER > 1000 7 | // TabCtrl.h : header file 8 | // 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // CTabSheet window 12 | 13 | class CTabSheet : public CTabCtrl 14 | { 15 | // Construction 16 | public: 17 | CTabSheet(); 18 | 19 | // Attributes 20 | public: 21 | BOOL InsertTab (char *TabString); 22 | 23 | int m_nNumOfTabs; 24 | public: 25 | 26 | // Overrides 27 | // ClassWizard generated virtual function overrides 28 | //{{AFX_VIRTUAL(CTabSheet) 29 | //}}AFX_VIRTUAL 30 | 31 | // Implementation 32 | public: 33 | int GetCount (void); 34 | virtual ~CTabSheet(); 35 | 36 | // Generated message map functions 37 | protected: 38 | //{{AFX_MSG(CTabSheet) 39 | // NOTE - the ClassWizard will add and remove member functions here. 40 | //}}AFX_MSG 41 | 42 | DECLARE_MESSAGE_MAP() 43 | }; 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | 47 | //{{AFX_INSERT_LOCATION}} 48 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 49 | 50 | #endif // !defined(AFX_TABCTRL_H__E3D71444_FDA6_11D3_9FA5_006097D3A30A__INCLUDED_) 51 | -------------------------------------------------------------------------------- /TabDef.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ifndef _TAB_DEF_H_ 5 | #define _TAB_DEF_H_ 6 | 7 | #define FRAME_SIZE 5 8 | 9 | #define _MAX_WORD 100 10 | #define _MAX_CHAR_INT 10 11 | #define TREE_VIEW_EXPLORER 1 12 | #define TREE_VIEW_TEXT 2 13 | #define TREE_VIEW_DEFAULT_FLAG TREE_VIEW_TEXT 14 | #define TREE_VIEW_DEFAULT_PATH "c:\\windows\\*.*" 15 | #define DEFAULT_FILE "c:\\avitest.INI" 16 | #define _MAX_ITEMS_AT_ROOT 3000 17 | 18 | 19 | #define LIST_BOX_ERROR_MESSAGE "Error can't open dirs and files." 20 | #define TABVIEW_HEADER_ERR_MSG "TabView Error" 21 | 22 | #define TABVIEW_DEFAULT_LPARAM 0 23 | 24 | #define TAB_CTRL_ID 205 25 | #define TREE_VIEW_ID 300 26 | #define LIST_BOX_TEMP_ID 255 27 | 28 | 29 | #define START_DIRECTORY '[' 30 | #define END__DIRECTORY ']' 31 | #define SEPERATOR_CHAR "\\" 32 | 33 | #define TABVIEW_SUCCESS 1 34 | #define TABVIEW_ERROR -1 35 | #define TABVIEW_DIR_INSERT_ERROR -2 36 | #define TABVIEW_LIST_FILES_ERROR -3 37 | #define TABVIEW_INSERTITEM_ERROR -4 38 | #define TABVIEW_HANDLE_NULL -5 39 | #define TABVIEW_LIMIT_ERROR -6 40 | 41 | 42 | 43 | 44 | #endif //_TAB_DEF_H_ -------------------------------------------------------------------------------- /TabView.cpp: -------------------------------------------------------------------------------- 1 | // mybar.cpp : implementation file 2 | // 3 | 4 | #include "stdafx.h" 5 | #include "tabview.h" 6 | #include "tabdef.h" 7 | #include "CategoryTree.h" 8 | 9 | #ifdef _DEBUG 10 | #define new DEBUG_NEW 11 | #undef THIS_FILE 12 | static char THIS_FILE[] = __FILE__; 13 | #endif 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // CTabView 17 | 18 | CTabView::CTabView() 19 | { 20 | m_IdMenuResource = NULL; 21 | m_DbClickMsg = NULL; 22 | m_SelChangedMsg = NULL; 23 | m_DefLParam = TABVIEW_DEFAULT_LPARAM; 24 | 25 | } 26 | 27 | CTabView::~CTabView() 28 | { 29 | 30 | } 31 | 32 | 33 | BEGIN_MESSAGE_MAP(CTabView, baseCTabView) 34 | //{{AFX_MSG_MAP(CTabView) 35 | ON_WM_CREATE() 36 | ON_WM_SIZE() 37 | ON_WM_DESTROY() 38 | ON_NOTIFY(TCN_SELCHANGE, TAB_CTRL_ID, OnSelchangeTab) 39 | ON_NOTIFY(TCN_SELCHANGING, TAB_CTRL_ID, OnSelchangingTab) 40 | 41 | //}}AFX_MSG_MAP 42 | END_MESSAGE_MAP() 43 | 44 | 45 | ///////////////////////////////////////////////////////////////////////////// 46 | // CTabView message handlers 47 | 48 | int CTabView::OnCreate(LPCREATESTRUCT lpCreateStruct) 49 | { 50 | if (baseCTabView::OnCreate(lpCreateStruct) == -1) 51 | return -1; 52 | 53 | SetSCBStyle(GetSCBStyle() | SCBS_SHOWEDGES | SCBS_SIZECHILD); 54 | 55 | m_TabCtrl.Create(WS_CHILD|WS_VISIBLE|TCS_BOTTOM, 56 | CRect(10,10,50,50),this, TAB_CTRL_ID); 57 | 58 | //m_TabCtrl.ModifyStyleEx(0, WS_EX_CLIENTEDGE); 59 | m_font.CreateStockObject(DEFAULT_GUI_FONT); 60 | 61 | m_TabCtrl.SetFont(&m_font); 62 | 63 | //AddTab("Bad"); 64 | //AddTab("IS"); 65 | //AddTab("Good"); 66 | 67 | //SetDirToTree(1,"C:\\Novell\\*.*"); 68 | 69 | return 0; 70 | } 71 | 72 | void CTabView::OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler) 73 | { 74 | baseCTabView::OnUpdateCmdUI(pTarget, bDisableIfNoHndler); 75 | 76 | UpdateDialogControls(pTarget, bDisableIfNoHndler); 77 | } 78 | 79 | void CTabView::OnSize(UINT nType, int cx, int cy) 80 | { 81 | CRect rc; 82 | 83 | baseCTabView::OnSize(nType, cx, cy); 84 | 85 | GetClientRect(rc); 86 | m_TabCtrl.MoveWindow(rc); 87 | NormalizeVisibleTree(); 88 | 89 | } 90 | 91 | 92 | void CTabView::AddTab (char *chptr) 93 | { 94 | CCategoryTree *Tree1 ; 95 | Tree1 = new CCategoryTree ; 96 | 97 | //Add Tab : 98 | m_TabCtrl.InsertTab(chptr); 99 | 100 | //Create and add Tree : 101 | Tree1->CreateTree(&m_TabCtrl, TREE_VIEW_ID + m_TabCtrl.GetCount()); 102 | 103 | Tree1->DragAcceptFiles(TRUE); //for drop commands. 104 | 105 | 106 | m_TreeList.AddTail(Tree1); 107 | } 108 | 109 | 110 | 111 | void CTabView::OnDestroy() 112 | { 113 | baseCTabView::OnDestroy(); 114 | 115 | DeleteAllTrees(); 116 | } 117 | 118 | 119 | CTreeCtrl* CTabView::GetTreeByIndex(int index) 120 | { 121 | if((index >= 0)&&(index <= m_TreeList.GetCount())) 122 | { 123 | POSITION pos = m_TreeList.FindIndex( index ); 124 | return ( (CTreeCtrl*)m_TreeList.GetAt( pos ) ); 125 | } 126 | 127 | return NULL; 128 | } 129 | 130 | 131 | 132 | 133 | void CTabView::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult) 134 | { 135 | CRect rect; 136 | CTreeCtrl *Treeptr = GetVisibleTree(); 137 | 138 | ShowTree(Treeptr); 139 | *pResult = 0; 140 | } 141 | 142 | 143 | 144 | 145 | void CTabView::OnSelchangingTab(NMHDR* pNMHDR, LRESULT* pResult) 146 | { 147 | CTreeCtrl *Treeptr = GetVisibleTree(); 148 | 149 | Treeptr -> ShowWindow(SW_HIDE); 150 | *pResult = 0; 151 | } 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | void CTabView::prvSetTreeRect(CRect *rect) 160 | { 161 | CRect lTabRect; 162 | CPoint pointTL,pointBR; 163 | 164 | m_TabCtrl.GetClientRect(rect); 165 | m_TabCtrl.GetItemRect(m_TabCtrl.GetCurSel(), &lTabRect); 166 | pointTL = rect -> TopLeft(); 167 | pointBR.x = rect->Width(); 168 | pointBR.y = lTabRect.top; 169 | 170 | rect->SetRect(pointTL, pointBR); //final rect of tree view. 171 | 172 | rect->InflateRect(2,2); 173 | rect->DeflateRect(FRAME_SIZE, FRAME_SIZE); 174 | } 175 | 176 | 177 | 178 | 179 | 180 | void CTabView::ShowTree(CTreeCtrl *Treeptr) 181 | { 182 | CRect rect; 183 | 184 | prvSetTreeRect(&rect); 185 | Treeptr -> MoveWindow(rect); 186 | Treeptr->ShowWindow(SW_SHOW); 187 | } 188 | 189 | 190 | 191 | 192 | 193 | CTreeCtrl* CTabView::GetVisibleTree() 194 | { 195 | int selected = m_TabCtrl.GetCurSel(); 196 | 197 | if(selected == CB_ERR) 198 | { 199 | return NULL; 200 | } 201 | return(GetTreeByIndex(selected)); 202 | } 203 | 204 | 205 | 206 | 207 | 208 | void CTabView::NormalizeVisibleTree() 209 | { 210 | CTreeCtrl *Treeptr = GetVisibleTree(); 211 | 212 | if(Treeptr != NULL) 213 | { 214 | ShowTree(Treeptr); 215 | } 216 | } 217 | 218 | 219 | 220 | void CTabView::DeleteAllTrees() 221 | { 222 | int index; 223 | int count = m_TreeList.GetCount(); 224 | CTreeCtrl *Treeptr; 225 | 226 | for(index = count-1; index >= 0; index--) 227 | { 228 | Treeptr = GetTreeByIndex(index); 229 | delete Treeptr; 230 | } 231 | 232 | m_TreeList.RemoveAll(); 233 | } 234 | 235 | 236 | 237 | 238 | 239 | void CTabView::SetMenu(UINT ResMenu) 240 | { 241 | m_IdMenuResource = ResMenu; 242 | } 243 | 244 | void CTabView::SetDbClickMsg(UINT msg) 245 | { 246 | m_DbClickMsg = msg; 247 | } 248 | 249 | void CTabView::SetSelChangedMsg(UINT msg) 250 | { 251 | m_SelChangedMsg = msg; 252 | } 253 | 254 | 255 | 256 | 257 | LPARAM CTabView::GetDefaultLParam() 258 | { 259 | return m_DefLParam; 260 | } 261 | 262 | void CTabView::SetDefaultLParam(LPARAM param) 263 | { 264 | m_DefLParam = param; 265 | } 266 | -------------------------------------------------------------------------------- /Tabview.h: -------------------------------------------------------------------------------- 1 | #if !defined(__TAB_VIEW_H__) 2 | #define __TAB_VIEW_H__ 3 | 4 | #if _MSC_VER >= 1000 5 | #pragma once 6 | #endif // _MSC_VER >= 1000 7 | // mybar.h : header file 8 | // 9 | 10 | #include "stdafx.h" 11 | 12 | #include "sizecbar.h" 13 | //#include "TreeControl.h" 14 | #include "TabCtrl.h" 15 | 16 | //#include "scbarg.h" 17 | //#include "common.h" 18 | 19 | 20 | ///////////////////////////////////////////////////////////////////////////// 21 | // CMyBar window 22 | 23 | #ifndef baseCTabView 24 | #define baseCTabView CSizingControlBar 25 | #endif 26 | 27 | class CTabView : public baseCTabView 28 | { 29 | // Construction 30 | public: 31 | CTabView(); 32 | virtual ~CTabView(); 33 | 34 | // Attributes 35 | public: 36 | 37 | void AddTab (char *chptr); 38 | CTreeCtrl* GetTreeByIndex (int index ); 39 | void prvSetTreeRect (CRect *rect); 40 | void ShowTree (CTreeCtrl *Treeptr); 41 | 42 | // Overridables 43 | virtual void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler); 44 | 45 | // Operations 46 | public: 47 | 48 | // Overrides 49 | // ClassWizard generated virtual function overrides 50 | //{{AFX_VIRTUAL(CTabView) 51 | //}}AFX_VIRTUAL 52 | 53 | // Implementation 54 | public: 55 | void SetDefaultLParam ( LPARAM param); 56 | 57 | LPARAM GetDefaultLParam(); 58 | 59 | LPARAM ReturnLParam (HTREEITEM hItem); 60 | void SetDbClickMsg (UINT msg); 61 | void SetSelChangedMsg(UINT msg); 62 | void SetMenu (UINT Resenu); 63 | 64 | 65 | void NormalizeVisibleTree (void); 66 | CTreeCtrl* GetVisibleTree (void); 67 | 68 | 69 | 70 | 71 | 72 | 73 | protected: 74 | // CButton m_wndChild; 75 | // CFont m_font; 76 | 77 | UINT m_IdMenuResource; 78 | UINT m_DbClickMsg; 79 | UINT m_SelChangedMsg; 80 | 81 | CTabSheet m_TabCtrl; 82 | CFont m_font; 83 | CObList m_TreeList; 84 | 85 | LPARAM m_DefLParam; 86 | // Generated message map functions 87 | protected: 88 | void DeleteAllTrees (void); 89 | 90 | //{{AFX_MSG(CTabView) 91 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 92 | afx_msg void OnSize(UINT nType, int cx, int cy); 93 | afx_msg void OnDestroy(); 94 | afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult); 95 | afx_msg void OnSelchangingTab(NMHDR* pNMHDR, LRESULT* pResult); 96 | //}}AFX_MSG 97 | DECLARE_MESSAGE_MAP() 98 | }; 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | 102 | //{{AFX_INSERT_LOCATION}} 103 | // Microsoft Developer Studio will insert additional declarations immediately before the previous line. 104 | 105 | #endif // !defined(__TAB_VIEW_H__) 106 | -------------------------------------------------------------------------------- /TreeItem.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "JCDFile.h" 3 | #include "TreeItem.h" 4 | #include "ListItem.h" 5 | 6 | #ifdef _DEBUG 7 | #define new DEBUG_NEW 8 | #undef THIS_FILE 9 | static char THIS_FILE[] = __FILE__; 10 | #endif 11 | 12 | 13 | 14 | CTreeItem::CTreeItem() : CItemHeader(ITEM_CLASS_TREEITEM) 15 | { 16 | m_arListItem.RemoveAll(); 17 | } 18 | 19 | CTreeItem::~CTreeItem() 20 | { 21 | prv_FreeMEM(); 22 | }; 23 | 24 | BOOL CTreeItem::IsSystemItem() 25 | { 26 | switch(GetType()) 27 | { 28 | case FLASHGET_ROOT_ITEM: 29 | case DOWNLOADING_ITEM: 30 | case DOWNLOADED_ITEM: 31 | case DELETED_ITEM: 32 | return TRUE; 33 | case OTHER_ITEMS: 34 | default: 35 | return FALSE; 36 | } 37 | } 38 | 39 | LPCTSTR CTreeItem::GetCategoryName() 40 | { 41 | return m_strCategoryName; 42 | } 43 | 44 | LPCTSTR CTreeItem::GetDefaultDir() 45 | { 46 | return m_strDefaultDir; 47 | } 48 | 49 | CListItem *CTreeItem::GetSubListItem(DWORD dwIndex) 50 | { 51 | return m_arListItem.GetAt(dwIndex); 52 | } 53 | 54 | 55 | void CTreeItem::SetCategoryName(LPCTSTR pszCategoryName) 56 | { 57 | m_strCategoryName = pszCategoryName; 58 | } 59 | 60 | 61 | 62 | void CTreeItem::SetDefaultDir(LPCTSTR pszDefaultDir) 63 | { 64 | m_strDefaultDir = pszDefaultDir; 65 | } 66 | 67 | 68 | int CTreeItem::GetSubListItemCount() 69 | { 70 | return m_arListItem.GetSize(); 71 | } 72 | 73 | BOOL CTreeItem::AddSubListItem(CListItem *pListItem) 74 | { 75 | m_arListItem.InsertAt(0, pListItem); 76 | 77 | return TRUE; 78 | } 79 | 80 | BOOL CTreeItem::LoadFromFile(CJCDFile *pJCDFile) 81 | { 82 | //Call base method first. 83 | CItemHeader::LoadFromFile(pJCDFile); 84 | 85 | JCD_LOAD_STR(m_strCategoryName); 86 | JCD_LOAD_STR(m_strDefaultDir); 87 | 88 | return TRUE; 89 | } 90 | 91 | BOOL CTreeItem::SaveToFile(CJCDFile *pJCDFile) 92 | { 93 | CItemHeader::SaveToFile(pJCDFile); 94 | 95 | //Save CategoryName 96 | JCD_SAVE_STR(m_strCategoryName); 97 | JCD_SAVE_STR(m_strDefaultDir); 98 | 99 | 100 | CListItem *pListItem; 101 | 102 | for (int i = GetSubListItemCount() - 1; i >= 0; i --) 103 | { 104 | pListItem = m_arListItem[i]; 105 | 106 | pListItem->SaveToFile(pJCDFile); 107 | } 108 | 109 | return TRUE; 110 | } 111 | 112 | 113 | BOOL CTreeItem::prv_FreeMEM() 114 | { 115 | CListItem *pListItem; 116 | 117 | for (int i = 0; i < GetSubListItemCount(); i ++) 118 | { 119 | pListItem = m_arListItem[i]; 120 | 121 | delete pListItem; 122 | } 123 | 124 | m_arListItem.RemoveAll(); 125 | 126 | return TRUE; 127 | } 128 | 129 | void CTreeItem::ClearSubListItems() 130 | { 131 | m_arListItem.RemoveAll(); 132 | } 133 | 134 | void CTreeItem::RemoveSubListItem(CListItem *pListItem) 135 | { 136 | for (int i =0; i < m_arListItem.GetSize(); i ++) 137 | { 138 | if (pListItem == m_arListItem[i]) 139 | { 140 | m_arListItem.RemoveAt(i); 141 | 142 | return; 143 | } 144 | 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /TreeItem.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TREE_ITEM_H 3 | #define _TREE_ITEM_H 4 | 5 | 6 | #include "ItemHeader.h" 7 | 8 | class CListItem; 9 | 10 | 11 | class CTreeItem : public CItemHeader 12 | { 13 | public: 14 | void RemoveSubListItem(CListItem *pListItem); 15 | void ClearSubListItems(); 16 | BOOL SaveToFile(CJCDFile *pJCDFile); 17 | BOOL LoadFromFile(CJCDFile *pJCDFile); 18 | BOOL AddSubListItem(CListItem *pListItem); 19 | int GetSubListItemCount(); 20 | void SetDefaultDir(LPCTSTR pszDefaultDir); 21 | void SetCategoryName(LPCTSTR pszCategoryName); 22 | CListItem *GetSubListItem(DWORD dwIndex); 23 | LPCTSTR GetDefaultDir(); 24 | LPCTSTR GetCategoryName(); 25 | BOOL IsSystemItem(); 26 | CTreeItem(); 27 | ~CTreeItem(); 28 | 29 | protected: 30 | CString m_strCategoryName; 31 | CString m_strDefaultDir; 32 | 33 | CArray m_arListItem; 34 | private: 35 | BOOL prv_FreeMEM(); 36 | }; 37 | 38 | 39 | #endif //_TREE_ITEM_H -------------------------------------------------------------------------------- /a.jcd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/a.jcd -------------------------------------------------------------------------------- /img/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/img/1.jpg -------------------------------------------------------------------------------- /img/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/img/2.jpg -------------------------------------------------------------------------------- /language/CVS/Entries: -------------------------------------------------------------------------------- 1 | /jcchs.ini/1.1.1.1/Thu May 22 12:49:39 2003/-ku/ 2 | /jcchs.ini.bak/1.1.1.1/Thu May 22 12:49:39 2003/-ku/ 3 | /jccht.ini/1.1.1.1/Thu May 22 12:49:39 2003/-ku/ 4 | /jceng.ini/1.1.1.1/Thu May 22 12:49:39 2003/-ku/ 5 | /jceng.ini.bak/1.1.1.1/Thu May 22 12:49:39 2003/-ku/ 6 | D 7 | -------------------------------------------------------------------------------- /language/CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | /jcchs.ini/// 2 | /jcchs.ini.bak/// 3 | /jccht.ini/// 4 | /jceng.ini/// 5 | /jceng.ini.bak/// 6 | -------------------------------------------------------------------------------- /language/CVS/Repository: -------------------------------------------------------------------------------- 1 | UniNet.ML/MyGet/language 2 | -------------------------------------------------------------------------------- /language/CVS/Root: -------------------------------------------------------------------------------- 1 | :local:c:\cvsstorage 2 | -------------------------------------------------------------------------------- /language/jcchs.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/language/jcchs.ini -------------------------------------------------------------------------------- /language/jcchs.ini.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/language/jcchs.ini.bak -------------------------------------------------------------------------------- /language/jccht.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/language/jccht.ini -------------------------------------------------------------------------------- /res/CVS/Entries: -------------------------------------------------------------------------------- 1 | /MyGet.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 2 | /MyGet.rc2/1.1.1.1/Thu May 22 12:49:39 2003// 3 | /MyGetDoc.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 4 | /bitmap1.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 5 | /bmp00001.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 6 | /bmp133.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 7 | /bmp145.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 8 | /bmp159.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 9 | /bmp160.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 10 | /bmp199.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 11 | /bmp200.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 12 | /check_bo.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 13 | /choice_t.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 14 | /content_.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 15 | /idr_main.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 16 | /item_ico.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 17 | /list_ite.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 18 | /mainfram.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 19 | /others.bmp/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 20 | /tray.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 21 | /tray1.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 22 | /tray2.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 23 | /tray3.ico/1.1.1.1/Thu May 22 12:49:39 2003/-kb/ 24 | D 25 | -------------------------------------------------------------------------------- /res/CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | /MyGet.ico/// 2 | /MyGet.rc2/// 3 | /MyGetDoc.ico/// 4 | /bitmap1.bmp/// 5 | /bmp00001.bmp/// 6 | /bmp133.bmp/// 7 | /bmp145.bmp/// 8 | /bmp159.bmp/// 9 | /bmp160.bmp/// 10 | /bmp199.bmp/// 11 | /bmp200.bmp/// 12 | /check_bo.bmp/// 13 | /choice_t.bmp/// 14 | /content_.bmp/// 15 | /idr_main.ico/// 16 | /item_ico.bmp/// 17 | /list_ite.bmp/// 18 | /mainfram.bmp/// 19 | /others.bmp/// 20 | /tray.ico/// 21 | /tray1.ico/// 22 | /tray2.ico/// 23 | /tray3.ico/// 24 | -------------------------------------------------------------------------------- /res/CVS/Repository: -------------------------------------------------------------------------------- 1 | UniNet.ML/MyGet/res 2 | -------------------------------------------------------------------------------- /res/CVS/Root: -------------------------------------------------------------------------------- 1 | :local:c:\cvsstorage 2 | -------------------------------------------------------------------------------- /res/MyGet.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/MyGet.ico -------------------------------------------------------------------------------- /res/MyGet.rc2: -------------------------------------------------------------------------------- 1 | // 2 | // MYGET.RC2 - resources Microsoft Visual C++ does not edit directly 3 | // 4 | 5 | #ifdef APSTUDIO_INVOKED 6 | #error this file is not editable by Microsoft Visual C++ 7 | #endif //APSTUDIO_INVOKED 8 | 9 | 10 | ///////////////////////////////////////////////////////////////////////////// 11 | // Add manually edited resources here... 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | -------------------------------------------------------------------------------- /res/MyGetDoc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/MyGetDoc.ico -------------------------------------------------------------------------------- /res/bitmap1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bitmap1.bmp -------------------------------------------------------------------------------- /res/bmp00001.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp00001.bmp -------------------------------------------------------------------------------- /res/bmp133.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp133.bmp -------------------------------------------------------------------------------- /res/bmp145.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp145.bmp -------------------------------------------------------------------------------- /res/bmp159.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp159.bmp -------------------------------------------------------------------------------- /res/bmp160.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp160.bmp -------------------------------------------------------------------------------- /res/bmp199.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp199.bmp -------------------------------------------------------------------------------- /res/bmp200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/bmp200.bmp -------------------------------------------------------------------------------- /res/check_bo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/check_bo.bmp -------------------------------------------------------------------------------- /res/choice_t.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/choice_t.bmp -------------------------------------------------------------------------------- /res/content_.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/content_.bmp -------------------------------------------------------------------------------- /res/idr_main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/idr_main.ico -------------------------------------------------------------------------------- /res/item_ico.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/item_ico.bmp -------------------------------------------------------------------------------- /res/list_ite.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/list_ite.bmp -------------------------------------------------------------------------------- /res/mainfram.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/mainfram.bmp -------------------------------------------------------------------------------- /res/others.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/others.bmp -------------------------------------------------------------------------------- /res/tray.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/tray.ico -------------------------------------------------------------------------------- /res/tray1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/tray1.ico -------------------------------------------------------------------------------- /res/tray2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/tray2.ico -------------------------------------------------------------------------------- /res/tray3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuxh123/myget/dc3080b2a287db7ce1b577d371383df94e52536d/res/tray3.ico --------------------------------------------------------------------------------