UnrarObject.h
上传用户:sz4588
上传日期:2022-05-26
资源大小:2253k
文件大小:3k
源码类别:

压缩解压

开发平台:

Visual C++

  1. // UnrarObject.h: interface for the CUnrarObject class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. //-------------------------------------------------------------------------
  5. // This class is developed by 
  6. //-------------------------------------------------------------------------
  7. // Dr. David, Xinyu Kou 
  8. // Department of Mechanical Engineering,
  9. // The University of Kong
  10. // http://FlashUnpack.3322.org
  11. //-------------------------------------------------------------------------
  12. //
  13. // This class wraps the APIs provided by RARLAB into a MFC object class  
  14. // You can use it freely for your freeware. 
  15. // Commercial uses are NOT ALLOWED unless approved by the the author.
  16. // Latest update: 2006/07/26
  17. //-------------------------------------------------------------------------
  18. #if !defined(AFX_UNRAROBJECT_H__CFAE5F77_FBA3_47DF_B4B1_3F6BA5D41DD4__INCLUDED_)
  19. #define AFX_UNRAROBJECT_H__CFAE5F77_FBA3_47DF_B4B1_3F6BA5D41DD4__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "AfxTempl.h"
  24. #include "unrar.h"
  25. struct CGuiStruct
  26. {
  27. CListBox *m_pListBox;
  28. CStatic *m_pstatic;
  29. //Append your own controls here, e.g. CTreeListCtrl as you like
  30. //http://www.codeproject.com/treectrl/treelistcode.asp
  31. };
  32. //---------------------------------------------------
  33. class CUnrarObject  
  34. {
  35. public:
  36. CUnrarObject();
  37. virtual ~CUnrarObject();
  38. //--------------------------------------------------------------------
  39. CString m_InputPath;
  40. CString m_OutputPath;
  41. int SetInputPath(CString InputPath);
  42. void SetCleanArchiveOption(bool bRemove);
  43. //--------------------------------------------------------------------
  44. // GUI functions
  45. void ResetGuiControls();
  46. void Update_Gui_Info(CString Info, BOOL bClearDataFirst=FALSE);
  47. //--------------------------------------------------------------------
  48. // Operation functions
  49. void Unpack(bool bMultiThread=TRUE);
  50. UINT static UnpackThreadFun(LPVOID pParam); //Multi-thread
  51. void CleanOriginalArchive(BOOL bClearFilesOnSuccess);
  52. //--------------------------------------------------------------------
  53. // Callback functions, must be static
  54. int static CALLBACK ExtractCallbackProc(UINT msg,LONG UserData,LONG P1,LONG P2);
  55. protected:
  56. HANDLE m_hArchive;
  57. BOOL bCleanOriginalArchive;
  58. CStringArray UnpackedArchives; //For deletion of the original files
  59. CGuiStruct* pGUIWindows;
  60. private:
  61. };
  62. #endif // !defined(AFX_UNRAROBJECT_H__CFAE5F77_FBA3_47DF_B4B1_3F6BA5D41DD4__INCLUDED_)