home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / wince / winmain.h < prev    next >
C/C++ Source or Header  |  1997-03-25  |  6KB  |  158 lines

  1. //******************************************************************************
  2. //
  3. // File:        WINMAIN.H
  4. //
  5. // Description: This module contains all the Windows specific decalrations for
  6. //              Pocket UnZip.  See WINMAIN.CPP for a more detailed description
  7. //              and the actual implementation.
  8. //
  9. // Copyright:   All the source files for Pocket UnZip, except for components
  10. //              written by the Info-ZIP group, are copyrighted 1997 by Steve P.
  11. //              Miller.  The product "Pocket UnZip" itself is property of the
  12. //              author and cannot be altered in any way without written consent
  13. //              from Steve P. Miller.
  14. //
  15. // Disclaimer:  All project files are provided "as is" with no guarantee of
  16. //              their correctness.  The authors are not liable for any outcome
  17. //              that is the result of using this source.  The source for Pocket
  18. //              UnZip has been placed in the public domain to help provide an
  19. //              understanding of its implementation.  You are hereby granted
  20. //              full permission to use this source in any way you wish, except
  21. //              to alter Pocket UnZip itself.  For comments, suggestions, and
  22. //              bug reports, please write to stevemil@pobox.com.
  23. //
  24. //
  25. // Date      Name          History
  26. // --------  ------------  -----------------------------------------------------
  27. // 02/01/97  Steve Miller  Created (Version 1.0 using Info-ZIP UnZip 5.30)
  28. //
  29. //******************************************************************************
  30.  
  31. #ifndef __WINMAIN_H__
  32. #define __WINMAIN_H__
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. //******************************************************************************
  39. //***** Constants / Macros
  40. //******************************************************************************
  41.  
  42. #define MRU_MAX_FILE                       4  // Should not exceed 9
  43. #define MRU_START_ID                     501
  44.  
  45. #define WM_PRIVATE                    0x9999
  46. #define MSG_SUBCLASS_DIALOG                1
  47. #define MSG_INIT_DIALOG                    2
  48. #define MSG_ADD_TEXT_TO_EDIT               3
  49. #define MSG_PROMPT_TO_REPLACE              4
  50. #define MSG_PROMPT_FOR_PASSWORD            5
  51. #define MSG_UPDATE_PROGRESS_PARTIAL        6
  52. #define MSG_UPDATE_PROGRESS_COMPLETE       7
  53. #define MSG_OPERATION_COMPLETE             8
  54.  
  55. #define IDC_SAVE_FILE_LIST                12
  56. #define IDC_SAVE_NAME_PROMPT            1023
  57. #define IDC_SAVE_NAME_EDIT              1021
  58. #define IDC_SAVE_TYPE_PROMPT            1022
  59. #define IDC_SAVE_TYPE_LIST              1020
  60.  
  61. #define PROGRESS_MAX                   32768
  62.  
  63. #define FILE_ATTRIBUTE_VOLUME     0x00000008
  64. #define FILE_ATTRIBUTE_ENCRYPTED  0x10000000
  65. #define FILE_ATTRIBUTE_COMMENT    0x20000000
  66.  
  67. #define IMAGE_VOLUME                       0
  68. #define IMAGE_FOLDER                       1
  69. #define IMAGE_APPLICATION                  2
  70. #define IMAGE_GENERIC                      3
  71.  
  72.  
  73. #ifndef LVS_EX_FULLROWSELECT
  74. #define LVS_EX_FULLROWSELECT      0x00000020
  75. #endif
  76.  
  77. // LVM_SETEXTENDEDLISTVIEWSTYLE came after VC 4.0
  78. #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
  79. #define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 54)
  80. #endif
  81.  
  82. // LVM_GETEXTENDEDLISTVIEWSTYLE came after VC 4.0
  83. #ifndef LVM_GETEXTENDEDLISTVIEWSTYLE
  84. #define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST + 55)
  85. #endif
  86.  
  87. #ifdef _WIN32_WCE
  88. #define CheckDlgButton(hDlg, ctrl, fChecked) \
  89.            SendDlgItemMessage(hDlg, ctrl, BM_SETCHECK, fChecked, 0)
  90. #define IsDlgButtonChecked(hDlg, ctrl) \
  91.            SendDlgItemMessage(hDlg, ctrl, BM_GETCHECK, 0, 0)
  92. #endif
  93.  
  94. //******************************************************************************
  95. //***** Types and Structures
  96. //******************************************************************************
  97.  
  98. typedef struct _FILE_TYPE_NODE {
  99.    struct _FILE_TYPE_NODE *pNext;
  100.    int                     image;
  101.    CHAR                    szExtAndDesc[2];
  102. } FILE_TYPE_NODE, *LPFILE_TYPE_NODE;
  103.  
  104. typedef struct _FILE_NODE {
  105.    DWORD           dwSize;
  106.    DWORD           dwCompressedSize;
  107.    DWORD           dwModified;
  108.    DWORD           dwAttributes;
  109.    DWORD           dwCRC;
  110.    LPCSTR          szComment;
  111.    LPCSTR          szType;
  112.    CHAR            szPathAndMethod[2];
  113. } FILE_NODE, *LPFILE_NODE;
  114.  
  115. typedef struct _COLUMN {
  116.    LPTSTR szName;
  117.    int    format;
  118. } COLUMN, *LPCOLUMN;
  119.  
  120.  
  121. //******************************************************************************
  122. //***** Exported Function Prototypes
  123. //******************************************************************************
  124.  
  125. void AddFileToListView(FILE_NODE *pFile);
  126. LPCSTR GetFileFromPath(LPCSTR szPath);
  127. void ForwardSlashesToBackSlashesA(LPSTR szBuffer);
  128.  
  129.  
  130. //******************************************************************************
  131. //***** Global Variables
  132. //******************************************************************************
  133.  
  134. #ifdef GLOBAL_DECLARE
  135. #undef GLOBAL_DECLARE
  136. #undef GLOBAL_INIT
  137. #endif
  138.  
  139. #ifdef __WINMAIN_CPP__
  140.    #define GLOBAL_DECLARE
  141.    #define GLOBAL_INIT(value) =value
  142. #else
  143.    #define GLOBAL_DECLARE extern
  144.    #define GLOBAL_INIT(value)
  145. #endif
  146.  
  147. GLOBAL_DECLARE HINSTANCE g_hInst                GLOBAL_INIT(NULL);
  148. GLOBAL_DECLARE HWND      g_hWndMain             GLOBAL_INIT(NULL);
  149. GLOBAL_DECLARE HWND      g_hWndEdit             GLOBAL_INIT(NULL);
  150. GLOBAL_DECLARE HWND      g_hDlgProgress         GLOBAL_INIT(NULL);
  151. GLOBAL_DECLARE CHAR      g_szZipFile[_MAX_PATH] GLOBAL_INIT("");
  152.  
  153. #ifdef __cplusplus
  154. } // extern "C"
  155. #endif
  156.  
  157. #endif // __WINMAIN_H__
  158.