home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / comctl / reitp / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-12  |  2.3 KB  |  75 lines

  1. /*
  2.  * COMMON.H
  3.  *
  4.  * Structures and definitions applicable to all OLE 2.0 UI dialogs.
  5.  *
  6.  * Copyright (c)1992-1996 Microsoft Corporation, All Right Reserved
  7.  */
  8.  
  9.  
  10. #ifndef _COMMON_H_
  11. #define _COMMON_H_
  12.  
  13. #include "ansiapi.h"
  14.  
  15. //Structure for label and source extraction from a metafile
  16. typedef struct tagLABELEXTRACT
  17.    {
  18.    LPOLESTR    lpsz;
  19.    UINT        Index;      // index in lpsz (so we can retrieve 2+ lines)
  20.    DWORD       PrevIndex;  // index of last line (so we can mimic word wrap)
  21.  
  22.    union
  23.       {
  24.       UINT    cch;        //Length of label for label extraction
  25.       UINT    iIcon;      //Index of icon in source extraction.
  26.       } u;
  27.  
  28.    //For internal use in enum procs
  29.    BOOL        fFoundIconOnly;
  30.    BOOL        fFoundSource;
  31.    BOOL        fFoundIndex;
  32.    } LABELEXTRACT, FAR * LPLABELEXTRACT;
  33.  
  34.  
  35. //Structure for extracting icons from a metafile (CreateIcon parameters)
  36. typedef struct tagICONEXTRACT
  37.    {
  38.    HICON       hIcon;          //Icon created in the enumeration proc.
  39.  
  40.    /*
  41.     * Since we want to handle multitasking well we have the caller
  42.     * of the enumeration proc instantiate these variables instead of
  43.     * using statics in the enum proc (which would be bad).
  44.     */
  45.    BOOL        fAND;
  46.    HGLOBAL     hMemAND;        //Enumeration proc allocates and copies
  47.    } ICONEXTRACT, FAR * LPICONEXTRACT;
  48.  
  49.  
  50. //Structure to use to pass info to EnumMetafileDraw
  51. typedef struct tagDRAWINFO
  52.    {
  53.    RECT     Rect;
  54.    BOOL     fIconOnly;
  55.    } DRAWINFO, FAR * LPDRAWINFO;
  56.  
  57. int CALLBACK EXPORT EnumMetafileIconDraw(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPARAM);
  58. int CALLBACK EXPORT EnumMetafileExtractLabel(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPLABELEXTRACT);
  59. int CALLBACK EXPORT EnumMetafileExtractIcon(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPICONEXTRACT);
  60. int CALLBACK EXPORT EnumMetafileExtractIconSource(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPLABELEXTRACT);
  61.  
  62. //Shared globals:  our instance and clipboard formats used by the PasteSpecial dialog
  63.  
  64. extern HINSTANCE  ghInst;
  65.  
  66. extern UINT       cfObjectDescriptor;
  67. extern UINT       cfLinkSrcDescriptor;
  68. extern UINT       cfEmbedSource;
  69. extern UINT       cfEmbeddedObject;
  70. extern UINT       cfLinkSource;
  71. extern UINT       cfOwnerLink;
  72. extern UINT       cfFileName;
  73.  
  74. #endif //_COMMON_H_
  75.