home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / mm / mmbrowse / mmbrowse.h < prev    next >
C/C++ Source or Header  |  1999-05-11  |  7KB  |  190 lines

  1. #include "mmioos2.h"
  2.   #ifndef MMIOM_QUERYIMAGE
  3.    #define MMIOM_QUERYIMAGE         MMIOM_START + 39
  4.    #define MMIOM_QUERYIMAGECOUNT    MMIOM_START + 40
  5.    #define MMIOM_SETIMAGE           MMIOM_START + 41
  6. #endif
  7. #define ERR_CANCELLED                 1
  8. #define ERR_SOURCEOPEN                2
  9. #define ERR_TARGETOPEN                3
  10. #define ERR_SOURCEHEADER              4
  11. #define ERR_TARGETHEADER              5
  12. #define ERR_SOURCEWRITE               6
  13. #define ERR_TARGETWRITE               7
  14. #define ERR_SOURCECLOSE               8
  15. #define ERR_TARGETCLOSE               9
  16. #define ERR_MEMORY                   10
  17. #define HELP_GET_FOURCC              3000
  18. #define ID_HELP_REMOVE_PERM_LIST_BOX 3001
  19. #define MAX_FILENAME_SIZE         256
  20. #define STRING_LENGTH             80
  21. #define ID_WINDOW                 256
  22. #define ID_POINTER                257
  23. #define ID_FILE                   260
  24. #define ID_FILE_OPEN              261
  25. #define ID_FILE_SAVEAS            262
  26. #define ID_FILE_PRINT             263
  27. #define ID_FILE_ABOUT             264
  28. #define ID_FILE_EDIT              265
  29. #define ID_CONFIG                 270
  30. #define ID_CONFIG_INST_TEMP       271
  31. #define ID_CONFIG_INST_PERM       272
  32. #define ID_CONFIG_REM_TEMP        273
  33. #define ID_CONFIG_REM_PERM        274
  34. #define ID_CONFIG_QUERY_ALL       275
  35. #define ID_HELP                   280
  36. #define ID_HELP_FOR_HELP          281
  37. #define ID_HELP_KEYS              282
  38. #define ID_HELP_INDEX             283
  39. #define ID_HELP_PRODUCTINFO       284
  40. #define ID_EXITPROG               289
  41. #define IDS_MMBROWSER             290
  42. #define IDS_OPEN                  291
  43. #define IDS_PRINT                 292
  44. #define IDS_INSTALL               293
  45. #define IDS_SAVEAS                294
  46. #define IDS_REMOVE                295
  47. #define IDS_QUERY                 296
  48. #define IDS_HELP_INDEX            297
  49. #define IDS_HELP_GENERAL          298
  50. #define IDS_HELP_USING            299
  51. #define IDS_HELP_KEYS             300
  52. #define IDS_HELP_INFO             301
  53. #define IDS_OPEN_OK_BUTTON        400
  54. #define IDS_OPEN_DIALOG_TITLE     401
  55. #define IDS_OPEN_DIALOG_FILE_EXT  402
  56. #define IDS_SAVEAS_BUTTON         403
  57. #define IDS_SAVEAS_DIALOG_TITLE   404
  58. #define IDS_SAVEAS_DIALOG_FILE_EXT 405
  59. #define IDS_INSTALL_TITLE         500
  60. #define IDS_INSTALL_FILE_EXT      501
  61. #define IDS_INSTALL_OK_BUTTON     502
  62. #define IDS_INSTALL_EXIT          503
  63. #define IDS_INSTALL_EXIT_BUTTON   504
  64. #define IDS_INSTALL_NOTE          505
  65. #define IDS_REMOVE_TITLE          600
  66. #define IDS_REMOVE_FILE_EXT       601
  67. #define IDS_REMOVE_OK_BUTTON      602
  68. #define IDS_IOPROC_NAME           700
  69. #define IDS_INSTALL_IOPROC_FAILED 701
  70. #define GET_FOURCC                800
  71. #define GET_FOURCC_INSTRUCTIONS   801
  72. #define GET_FOURCC_TEXT           802
  73. #define GET_FOURCC_OK_BUTTON      803
  74. #define GET_FOURCC_CANCEL_BUTTON  804
  75. #define GET_FOURCC_HELP_BUTTON    805
  76. #define QUERY_ALL_LIST_BOX                  1000
  77. #define QUERY_ALL_LIST_BOX_ENTRIES          1001
  78. #define QUERY_ALL_LIST_BOX_OK               1002
  79. #define QUERY_ALL_LIST_BOX_CANCEL           1003
  80. #define QUERY_ALL_LIST_BOX_HELP             1004
  81. #define REMOVE_PERM_LIST_BOX            1100
  82. #define REMOVE_PERM_LIST_BOX_ENTRIES    1101
  83. #define REMOVE_PERM_LIST_BOX_OK         1102
  84. #define REMOVE_PERM_LIST_BOX_CANCEL     1103
  85. #define REMOVE_PERM_LIST_BOX_HELP       1104
  86. #define ID_RESOURCE    1
  87. #define IDR_BITMAP     2
  88. #define IDC_BITMAP     3
  89. #define IDM_START  (WM_USER+0)
  90. #define IDM_STOP   (WM_USER+1)
  91. #define IDM_SET    (WM_USER+2)
  92. #define IDM_DONE   (WM_USER+3) /* Message posted when thread terminates */
  93. #define IDM_ON     (WM_USER+4)
  94. #define IDM_OFF    (WM_USER+5)
  95. #define IDD_SETCOUNT                           1
  96. #define IDD_ENTRYFLD                           2
  97. #define IDD_MSGBOX                             3
  98. #define IDD_PRODUCTINFO                        4
  99. #define IDD_HELP                               5
  100. #define IDM_HELPUSINGHELP                   9100
  101. #define IDM_HELP                            9300
  102. #define IDM_HELPGENERAL                     9200
  103. #define IDM_HELPINDEX                       9400
  104. #define IDM_HELPPRODUCTINFO                 9600
  105. /*
  106.  *  Help table and subtables
  107.  */
  108. #define MMBROWSER_HELP_TABLE                    1000
  109. /*
  110.  *  Main window help panels
  111.  */
  112. #define SUBTABLE_MAIN                       2000
  113. #define PANEL_MAIN                          2100
  114. #define PANEL_HELP                          2910
  115. #define PANEL_HELPUSINGHELP                 2920
  116. #define PANEL_HELPGENERAL                   2930
  117. #define PANEL_HELPINDEX                     2950
  118. #define PANEL_HELPPRODUCTINFO               2960
  119. /*
  120.  *  Enter text dialog help subtable
  121.  */
  122. #define SUBTABLE_PRODUCTINFODLG             3900
  123. #define PANEL_PRODUCTINFODLG                3910
  124. #define PANEL_PRODUCTINFO_OK                3920
  125. /*
  126.  * Function prototypes
  127.  */
  128.  
  129. HBITMAP GetBitMap(HWND, PSZ);
  130. MRESULT EXPENTRY MyWindowProc ( HWND, USHORT, MPARAM, MPARAM );
  131. MRESULT EXPENTRY GetFOURCCDialogProc ( HWND, ULONG, MPARAM, MPARAM );
  132. VOID FixSysMenu(HWND);
  133. MRESULT EXPENTRY AboutDlgProc(HWND, ULONG, MPARAM, MPARAM);
  134. MRESULT EXPENTRY QueryAllDialogProc ( HWND, USHORT, MPARAM, MPARAM );
  135. MRESULT EXPENTRY RemovePermDialogProc ( HWND, USHORT, MPARAM, MPARAM );
  136. ULONG DisplayImageFile ( HWND, PSZ );
  137. VOID DisplayMessageBox ( HWND, USHORT, USHORT, USHORT );
  138. BOOL OpenFileDialog ( HWND, PSZ, PSZ, PSZ, PSZ );
  139. VOID FourccToString( FOURCC, PSZ );
  140. VOID MakeItBusy ( BOOL );
  141. VOID main ( int argc, char *argv[], char *envp[] );
  142. VOID DrawBitMap ( HWND );
  143. VOID CenterDialog ( HWND );
  144. VOID FixSysMenu (HWND);
  145. BOOL InstallTempIOProc ( HWND );
  146. HBITMAP LoadBitmap (HAB, HDC, HPS *, PSZ );
  147. BOOL DoConvert(PSZ, FOURCC, PSZ, FOURCC );
  148. BOOL SaveAsDialog ( HWND, PSZ, PSZ, PSZ, PSZ );
  149.  
  150. /*
  151.  * Global variables.
  152.  */
  153. BOOL      Cancel = FALSE;
  154. BOOL      FileOnCommandLine = FALSE;
  155. CHAR      szCommandLineFilename[ 256 ];
  156. HAB       hab;
  157. HBITMAP   hBmp;
  158. HPS       *hps;
  159. HPS       hpsMemory;
  160. HDC       hdcMemory;
  161. BOOL      bBusy = FALSE;
  162. BOOL      bSuspendIdentify = FALSE;
  163. BOOL      bHelpEnabled=FALSE;
  164. CHAR      szFOURCC[ STRING_LENGTH ];
  165. PCHAR     pszFileName;
  166. PCHAR     pszTarget;
  167. CHAR      szSource[MAX_FILENAME_SIZE];
  168. CHAR      szInstallFileExt[ STRING_LENGTH ];
  169. CHAR      szInstallTitle[ STRING_LENGTH ];
  170. CHAR      szInstallOKButton[ STRING_LENGTH ];
  171. CHAR      szRemoveFileExt[ STRING_LENGTH ];
  172. CHAR      szRemoveTitle[ STRING_LENGTH ];
  173. CHAR      szRemoveOKButton[ STRING_LENGTH ];
  174. CHAR      szString[STRING_LENGTH];
  175. CHAR      szInstall[ STRING_LENGTH ];
  176. CHAR      szOpenDialogTitle[ STRING_LENGTH ];
  177. CHAR      szOpenDialogFileExt[ STRING_LENGTH ];
  178. CHAR      szOpenOKButton[ STRING_LENGTH ];
  179. CHAR      szIOProcName[STRING_LENGTH];
  180. CHAR      szSaveAsDialogTitle[ STRING_LENGTH ];
  181. CHAR      szSaveAsDialogFileExt[ STRING_LENGTH ];
  182. CHAR      szSaveAsButton[ STRING_LENGTH ];
  183. HPOINTER  hPointer;
  184. HELPINIT  hmiHelpStructure;                 /* Help init. structure. */
  185. HWND      hwndHelpInstance;                  /* Handle to Help window.            */
  186. BOOL      fHelpEnabled;
  187.  
  188. VOID SaveFile (HWND hwndClient, PSZ pszSource, FOURCC fccSourceIOProc );
  189. VOID InitializeHelp( HWND hwndFrame) ;
  190.