home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / DIBVIEW / CHILD.H_ / CHILD.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.9 KB  |  108 lines

  1.  
  2. #ifndef CHILD_INCLUDED
  3. #define CHILD_INCLUDED
  4.  
  5. #include "options.h"
  6.  
  7.    // Externally used variables.
  8.  
  9. extern BOOL  bUseDDBs;
  10. extern HWND  hWndAnimate;
  11. extern HWND  hWndClip;
  12. extern POINT ptClipSize;
  13. extern int   nDIBsOpen;
  14.  
  15.  
  16.    // Defines
  17.  
  18. #ifndef MAX_FILENAME
  19. #define MAX_FILENAME 129               // Max # of bytes in a filename.
  20. #endif
  21.  
  22.  
  23.    // Class extra bytes for MDI Children.  Room for DIBINFO structure handle.
  24.  
  25. #define CBWNDEXTRA (sizeof (WORD))
  26.  
  27.  
  28.    // MDI Child Window Words.
  29.  
  30. #define WW_DIB_HINFO 0                 // Handle to DIBINFO structure
  31.  
  32.  
  33.  
  34.  
  35.  
  36.    // Structure whose handle is stored in the MDI Children's window
  37.    //  extra bytes.  Has all the info needed to be stored on a per
  38.    //  bitmap basis.
  39.  
  40. typedef struct
  41.    {
  42.    HANDLE      hDIB;                // Handle to the DIB
  43.    HPALETTE    hPal;                // Handle to the bitmap's palette.
  44.    HBITMAP     hBitmap;             // Handle to the DDB.
  45.  
  46.    WORD        wDIBType;            // DIB's type - RGB, RLE4, RLE8, PM
  47.    WORD        wDIBBits;            // Bits per pixel
  48.    WORD        wDIBWidth;           // Print width of the DIB
  49.    WORD        wDIBHeight;          // Print height of the DIB
  50.  
  51.    char        szFileName[MAX_FILENAME];  // DIB's filename
  52.    RECT        rcClip;              // Clipboard cut rectangle.
  53.  
  54.    OPTIONSINFO Options;             // Option info from Options dialog box.
  55.  
  56.    } DIBINFO, FAR *LPDIBINFO;
  57.  
  58.  
  59.  
  60.  
  61.  
  62.    // A handle to memory containing this structure is passed into the
  63.    //  WM_CREATE case of the DIB window.  It's used to initialize the
  64.    //  DIBINFO structure stored in the DIB window's window words.
  65.  
  66. typedef struct
  67.    {
  68.    HANDLE hDIB;                  // Handle to the DIB.
  69.    char   szFileName [128];      // Its filename.
  70.    } DIBCREATEINFO, FAR * LPDIBCREATEINFO;
  71.  
  72.  
  73.  
  74.  
  75.    // User defined message for MDI child windows.
  76.  
  77. #define MYWM_ANIMATE         WM_USER     // Start palette animation
  78. #define MYWM_RESTOREPALETTE  WM_USER+1   // Stop animation and restore palette
  79. #define MYWM_QUERYNEWPALETTE WM_USER+2   // Frame got a WM_QUERYNEWPALETTE,
  80.                                          //   realize child's palette as
  81.                                          //   foreground palette.
  82.  
  83.  
  84.  
  85. long FAR PASCAL __export ChildWndProc(HWND hWnd,
  86.                  UINT message,
  87.                  WPARAM wParam,
  88.                  LPARAM lParam);
  89.  
  90.  
  91. HPALETTE CurrentDIBPalette        (void);
  92. HWND     GetCurrentMDIWnd         (void);
  93. BOOL     GetCurrentDIBStretchFlag (void);
  94. void     SetCurrentDIBStretchFlag (BOOL bFlag);
  95.  
  96. void     SendMessageToAllChildren (HWND hWnd,
  97.                                unsigned message,
  98.                                    WORD wParam,
  99.                                    LONG lParam);
  100.  
  101. void     CloseAllDIBWindows (void);
  102.  
  103. RECT     GetCurrentClipRect (HWND hWnd);
  104. POINT    GetCurrentDIBSize  (HWND hWnd);
  105.  
  106. #endif // CHILD_INCLUDED
  107.  
  108.