IcoModule.h
上传用户:yatsl7111
上传日期:2007-01-08
资源大小:1433k
文件大小:4k
- // IcoModule.h : main header file for the ICOMODULE DLL
- //
- #if !defined(AFX_ICOMODULE_H__C03B0E3D_460A_11D4_8853_C6A14464AE19__INCLUDED_)
- #define AFX_ICOMODULE_H__C03B0E3D_460A_11D4_8853_C6A14464AE19__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
- #endif
- #include "resource.h" // main symbols
- #include "..publicgol_isee.h" // 此文件定义了接口数据包
- #define ICONTYPE 1
- #define CURTYPE 2
- // 扫描行宽度
- #define WIDTHBYTES(bits) ((((bits)+31)>>5)<<2)
- #define RWPROGRESSSIZE 100
- #define BORDERSPEC 16
- #define IMGTXTSPEC 4
- #define TXTIMGSPEC 8
- // 单个图标图像的信息头结构
- typedef struct
- {
- BYTE bWidth; // Width of the image
- BYTE bHeight; // Height of the image (times 2)
- BYTE bColorCount; // Number of colors in image (0 if >=8bpp)
- BYTE bReserved; // Reserved
- WORD wPlanes; // Color Planes
- WORD wBitCount; // Bits per pixel
- DWORD dwBytesInRes; // how many bytes in this resource?
- DWORD dwImageOffset; // where in the file is this image
- } ICONDIRENTRY, *LPICONDIRENTRY;
- // 图标文件信息头结构
- typedef struct
- {
- WORD idReserved; // Reserved
- WORD idType; // resource type (1 for icons)
- WORD idCount; // how many images?
- ICONDIRENTRY idEntries[1]; // the entries for each image
- } ICONDIR, *LPICONDIR;
- // 图像信息结构
- typedef struct
- {
- int index;
- int colnum; // 颜色个数(如果位深大于8bpp则为0)
- SIZE imgsize; // 图像尺寸
- SIZE txtsize; // 图像描述串尺寸
- char string[32]; // 图像尺寸字串
- } IMGINFO, *LPIMGINFO;
- /////////////////////////////////////////////////////////////////////////////
- // CIcoModuleApp
- // See IcoModule.cpp for the implementation of this class
- //
- class CIcoModuleApp : public CWinApp
- {
- public:
- CIcoModuleApp();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CIcoModuleApp)
- //}}AFX_VIRTUAL
- //{{AFX_MSG(CIcoModuleApp)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- // 定义模块版本
- #define MODULE_BUILDID 11
- // 接口函数声明 — 第一层,唯一与外界联系的接口
- int WINAPI AccessICOModule(INFOSTR *pInfo);
- // 命令解释函数 — 第二层解释函数
- void _fnCMD_GETPROCTYPE(INFOSTR *pInfo);
- void _fnCMD_GETWRITERS(INFOSTR *pInfo);
- void _fnCMD_GETWRITERMESS(INFOSTR *pInfo);
- void _fnCMD_GETBUILDID(INFOSTR *pInfo);
- void _fnCMD_IS_VALID_FILE(INFOSTR *pInfo);
- void _fnCMD_GET_FILE_INFO(INFOSTR *pInfo);
- void _fnCMD_LOAD_FROM_FILE(INFOSTR *pInfo);
- void _fnCMD_SAVE_TO_FILE(INFOSTR *pInfo);
- void _fnCMD_IS_SUPPORT(INFOSTR *pInfo);
- void _fnCMD_RESIZE(INFOSTR *pInfo);
- // 内部执行函数 - 第三层执行函数.....
- BOOL IsFileExist(char *lpFileName);
- LPICONDIR ReadIconInfo(CFile& file);
- UINT ReadICOHeader(CFile file);
- LPSTR FindDIBBits(LPSTR lpbi);
- WORD DIBNumColors(LPSTR lpbi);
- WORD PaletteSize(LPSTR lpbi);
- DWORD BytesPerLine(LPBITMAPINFOHEADER lpBMIH);
- void _get_image_info(LPICONDIR lpIR, int index, LPSIZE lpSize, int *pColnum);
- void _get_string_info(LPSIZE lpImgSize, int colnum, LPTSTR lpString, LPSIZE lpTxtSize);
- void _get_synthesis_imgsize(int imgcount, LPIMGINFO lpImgInfo, LPSIZE lpSize);
- void _do_sort(int imgcount, LPIMGINFO lpImgInfo);
- HBITMAP _get_hbmp(CFile& file, LPICONDIR lpIR, LPIMGINFO lpImgInfo, int index);
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_ICOMODULE_H__C03B0E3D_460A_11D4_8853_C6A14464AE19__INCLUDED_)