home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SRC / AUXDATA.H_ / AUXDATA.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  5.1 KB  |  157 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library. 
  2. // Copyright (C) 1992 Microsoft Corporation 
  3. // All rights reserved. 
  4. //  
  5. // This source code is only intended as a supplement to the 
  6. // Microsoft Foundation Classes Reference and Microsoft 
  7. // QuickHelp documentation provided with the library. 
  8. // See these sources for detailed information regarding the 
  9. // Microsoft Foundation Classes product. 
  10.  
  11. /////////////////////////////////////////////////////////////////////////////
  12. // Auxiliary System/Screen metrics
  13.  
  14. #ifdef AFX_CLASS_MODEL
  15. struct NEAR AUX_DATA
  16. #else
  17. struct AUX_DATA
  18. #endif
  19. {
  20.     // System metrics
  21.     int     cxVScroll, cyHScroll;
  22.     int     cxIcon, cyIcon;
  23.  
  24.     // Device metrics for screen
  25.     int     cxPixelsPerInch, cyPixelsPerInch;
  26.     int     cySysFont;
  27.  
  28.     // Solid brushes with convenient gray colors and system colors
  29.     HBRUSH  hbrLtGray, hbrDkGray;
  30.     HBRUSH  hbrBtnHilite, hbrBtnFace, hbrBtnShadow;
  31.  
  32.     // Color values of system colors used for CToolBar
  33.     COLORREF    clrBtnFace, clrBtnShadow, clrBtnHilite;
  34.     COLORREF    clrBtnText, clrWindowFrame;
  35.  
  36.     // Standard cursors
  37.     HCURSOR     hcurWait;
  38.     HCURSOR     hcurArrow;
  39.  
  40.     // Data interchange formats
  41.     UINT    cfNative, cfOwnerLink, cfObjectLink;
  42.  
  43.     // Special GDI objects allocated on demand
  44.     HFONT   hStatusFont;
  45.     HBITMAP hbmMenuDot;
  46.     void (PASCAL* pfnFreeToolBar)();    // cleanup procedure
  47.  
  48.     BOOL    bWin31;             // TRUE if 3.1 or higher
  49.                                 // TRUE under Windows NT
  50.     BOOL    bWin30Compat;       // TRUE if App is marked as Win 3.0 compatible
  51.  
  52. // Implementation
  53.     AUX_DATA();
  54.     ~AUX_DATA();
  55.     void UpdateSysColors();
  56. };
  57.  
  58. extern AUX_DATA NEAR afxData;
  59.  
  60. // NOTE: we don't use afxData.cxBorder and afxData.cyBorder anymore
  61. #define CX_BORDER   1
  62. #define CY_BORDER   1
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // Window class names and other window creation support
  66.  
  67. // from window.cpp
  68. extern const char NEAR _afxWnd[];           // simple child windows/controls
  69. extern const char NEAR _afxWndControlBar[]; // controls with grey backgrounds
  70. extern const char NEAR _afxWndMDIFrame[];
  71. extern const char NEAR _afxWndFrameOrView[];
  72. extern MSG NEAR _afxLastMsg;
  73.  
  74. #ifndef _AFXDLL
  75. extern HBRUSH NEAR afxDlgBkBrush; // dialog and message box background brush
  76. extern COLORREF NEAR afxDlgTextClr;
  77. #else
  78. #define afxDlgBkBrush   (_AfxGetAppData()->appDlgBkBrush)
  79. #define afxDlgTextClr   (_AfxGetAppData()->appDlgTextClr)
  80. #endif //_AFXDLL
  81.  
  82. #ifndef _USRDLL
  83. extern HHOOK _afxHHookOldCbtFilter;
  84. #endif
  85.  
  86. void PASCAL _AfxHookWindowCreate(CWnd* pWnd);
  87. BOOL PASCAL _AfxUnhookWindowCreate();
  88.  
  89. LRESULT CALLBACK AFX_EXPORT _AfxDlgProc(HWND, UINT, WPARAM, LPARAM);
  90. UINT CALLBACK AFX_EXPORT _AfxCommDlgProc(HWND hWnd, UINT, WPARAM, LPARAM);
  91.  
  92. // Support for standard dialogs
  93. extern const UINT NEAR _afxNMsgSETRGB;
  94. typedef UINT (CALLBACK* COMMDLGPROC)(HWND, UINT, UINT, LONG);
  95.  
  96. // Special mode helpers
  97. HWND PASCAL _AfxGetSafeOwner(CWnd* pParent);
  98. BOOL PASCAL _AfxIsComboBoxControl(HWND hWnd, UINT nStyle);
  99. void PASCAL _AfxCancelModes(HWND hWndRcvr);
  100. BOOL PASCAL _AfxHelpEnabled();  // determine if ID_HELP handler exists
  101.  
  102. // String helpers
  103. void PASCAL _AfxSmartSetWindowText(HWND hWndCtrl, LPCSTR lpszNew);
  104. int  PASCAL _AfxLoadString(UINT nIDS, char* pszBuf);    // 255 char buffer
  105.  
  106. #define _AfxStrChr      _fstrchr
  107.  
  108. /////////////////////////////////////////////////////////////////////////////
  109. // Sub-Segment Allocation
  110.  
  111. LPVOID  PASCAL _AfxLocalAlloc(UINT sgmnt, UINT wFlags, UINT wBytes);
  112. void    PASCAL _AfxLocalFree(LPVOID lhBlock);
  113. BOOL    PASCAL _AfxLocalUnlock(LPVOID lhBlock);
  114. LPSTR   PASCAL _AfxLocalLock(LPVOID lhBlock);
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // Portability abstractions
  118.  
  119. #define _AfxSetDlgCtrlID(hWnd, nID)     SetWindowWord(hWnd, GWW_ID, (WORD)nID)
  120. #define _AfxGetHookHandle() \
  121.     GetModuleHandle((LPCSTR)MAKELONG(AfxGetInstanceHandle(),0))
  122.  
  123. #define _AfxGetDlgCtrlID(hWnd)          ((UINT)(WORD)::GetDlgCtrlID(hWnd))
  124.  
  125. // misc helpers
  126. void PASCAL _AfxStrCpy(LPSTR lpszDest, LPCSTR lpszSrc, size_t nSizeDest);
  127. BOOL PASCAL _AfxFullPath(LPSTR lpszPathOut, LPCSTR lpszFileIn);
  128.  
  129. AFX_MSGMAP_ENTRY FAR* PASCAL _AfxFindMessageEntry(
  130.     AFX_MSGMAP_ENTRY FAR* lpEntry, UINT nMsg, UINT nID);
  131.  
  132. /////////////////////////////////////////////////////////////////////////////
  133. // Debugging/Tracing helpers
  134.  
  135. #ifdef _DEBUG
  136. void AFXAPI _AfxTraceMsg(LPCSTR lpszPrefix, const MSG* pMsg);
  137. BOOL AFXAPI _AfxCheckDialogTemplate(LPCSTR lpszResource, BOOL bInvisibleChild);
  138. #endif
  139.  
  140. /////////////////////////////////////////////////////////////////////////////
  141. // Delete on exit for MFC allocated objects (emits debug message)
  142.  
  143. void PASCAL _AfxExitDelete(HGDIOBJ hObject);
  144.  
  145. /////////////////////////////////////////////////////////////////////////////
  146. // Memory Allocation Failure Handler
  147.  
  148. #include <new.h>
  149.  
  150. #ifdef _AFXDLL
  151. _PNH AFXAPI _AfxSetNewHandler(_PNH);
  152. #else
  153. #define _AfxSetNewHandler(pnh)  _set_new_handler(pnh)
  154. #endif
  155.  
  156. /////////////////////////////////////////////////////////////////////////////
  157.