⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.h

📁 类似flashget下载工具代码 本来想在完善了上传的
💻 H
字号:
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__33F8325A_65EE_4CD0_9634_A120C04BCB07__INCLUDED_)
#define AFX_MAINFRM_H__33F8325A_65EE_4CD0_9634_A120C04BCB07__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GeoWorkSpace.h"
#include "GeoOutWorkSpace.h"
#include "GeoLogWorkSpace.h"
#include "GeoDropWin.h"
#include "TrayIcon.h"
#include "TrueColorToolBar.h"
#include "WatchClipBoard.h"
#include "SetupRegister.h"

#define CFrameWnd CBCGPFrameWnd
class CGeoHttpDown;

class CMainFrame : public CFrameWnd
{
	
protected: // create from serialization only
	CMainFrame();
	DECLARE_DYNCREATE(CMainFrame)
    BOOL SetHttpProxy(CString ip, UINT port);
	void GetHttpProxy(CString& IP_Proxy,int& port);
	void DeleteProxy(CString ProxyName);
	void UpdateWindowSkin();
	void SetConfig();
    void SetSkin(const char* Skin);
// Attributes
private:
	CTrayIcon m_TrayIcon;
	HICON     m_hIcon;
public:
    
	CGeoWorkSpace m_workspace;
	CGeoOutWorkSpace m_outworkspace;
	CGeoLogWorkSpace m_Logworkspace;
	CGeoDropWin* m_dropWnd;

	CWatchClipBoard m_ClipBoard;
	//保存在载
    vector<CGeoHttpDown*>m_httpdwonVec;
	//代理列表
	vector<LPProxyInfo>m_proxy_list;
	//代理设置菜单状态
    bool m_ie_state;
	//是否使用了代理
	bool m_is_user_porxy;
	//配置文件路局
	CString m_config_path;
	//配置数据库路局
	CString m_config_db;
	//默认代理
    LPProxyInfo m_default_proxy;
// Operations
	PURL url;
	//保存下载相关信息
    typedef vector<LPDownLoadIndo>DOWNINFOMAP;
	DOWNINFOMAP m_down_info_list;
    
	//LPHTTPDL_INFO保存的线程下载的公共信息
    typedef vector<LPHTTPDL_INFO> HTTPDLINFO;
    HTTPDLINFO m_http_info;

	//窗口状态
    bool m_Hide;
	//菜单状态
    bool m_MenuXP;
	bool m_MenuOffice2003;
	bool m_MenuOffiec2007_Laun;
    bool m_MenuOffice2007_Silver;
    bool m_MenuOffice2007_Obsidian;
	//开机是否自动运行
    bool m_AutoStart;
	//
	NOTIFYICONDATA m_nData;
private:
	//获得配置文件路局
    void GetConfigPath();
    //读配置文件
    void ReadConfig();
	//获得代理信息
	bool GetProxyInfo();
	//写代理信息到数据库
	bool WriteProxyInfo(LPProxyInfo proxy);
	//判断代理纪录是否存在
	bool Is_Exist_record(LPProxyInfo proxy);
    //删除数据库中的代理纪录
    bool Delete_Proxy_Record(const LPProxyInfo proxy);
	//更新下载列表框
    void Updata_Down_list(const LPDownLoadIndo pinfo);

    //计算下载时间
	void CalculateTime(int PID);
    //停止所有下载任务
    void StopAllDown();
	//保存下载信息
	void SaveAllDown();
	//释放内存
	void Clear();
	//创建托盘
	void CreateNotifyIcon();
	//获得选种项目的文件名字
	CString GetSelectItem();
	//删除任务文件
	void DeleteFile(const char* FileName);
public:
	//获得一个下载信息结构
    LPDownLoadIndo GetDownLoadInfo(int PID);
	//更新下在进度
	void Calculateprogress(int PID,int CID,long recvsize); 
public:
  
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMainFrame)
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:  // control bar embedded members
	CBCGPMenuBar		m_wndMenuBar;
	CBCGPStatusBar	m_wndStatusBar;
	CBCGPToolBar		m_wndToolBar;

// Generated message map functions
protected:
	//{{AFX_MSG(CMainFrame)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnMenuAbout();
	afx_msg void OnMenuIdPorxy();
	afx_msg void OnMenuSetProxy();
	afx_msg void OnUpdateMenuIdPorxy(CCmdUI* pCmdUI);
	afx_msg void OnTimer(UINT nIDEvent);//更新下载信息
	afx_msg void OnMenuSetting();
	afx_msg void OnMenuPuls();
	afx_msg void OnEditStop();
	afx_msg void OnEditStart();
	afx_msg void OnClose();
	afx_msg void OnMenuHideShow();
	afx_msg void OnMenuExit();
	afx_msg void OnMenuXp();
	afx_msg void OnMENUOffice2003();
	afx_msg void OnMENULuna();
	afx_msg void OnMenuSilver();
	afx_msg void OnMenuObsidian();
	afx_msg void OnUpdateMenuXp(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMENUOffice2003(CCmdUI* pCmdUI);
	afx_msg void OnMenuStart();
	afx_msg void OnUpdateMenuStart(CCmdUI* pCmdUI);
	afx_msg void OnMyIconNotify(WPARAM wParam,LPARAM lParam);
    afx_msg void OnDownLoadFinish(WPARAM wParam,LPARAM lParam);
	afx_msg void OnMenuexit();
	afx_msg void OnMenuDeleteDown();
	//}}AFX_MSG
	afx_msg void OnViewCustomize();
	afx_msg LRESULT OnToolbarReset(WPARAM,LPARAM);
	afx_msg LRESULT OnToolbarContextMenu(WPARAM,LPARAM);
	afx_msg void set_down_info(WPARAM,LPARAM);
	afx_msg void Play_Sound(WPARAM wParam,LPARAM lParam);
	LRESULT OnTrayNotification(WPARAM wParam,LPARAM lParam);
	afx_msg void OnUpdataProgress(WPARAM wParam,LPARAM lParam);
	DECLARE_MESSAGE_MAP()

	virtual BOOL OnShowPopupMenu (CBCGPPopupMenu* pMenuPopup);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__33F8325A_65EE_4CD0_9634_A120C04BCB07__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -