home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / olestd.h < prev    next >
C/C++ Source or Header  |  1998-04-24  |  38KB  |  1,112 lines

  1. /*************************************************************************
  2. **
  3. **    OLE 2.0 Utilities
  4. **
  5. **    olestd.h
  6. **
  7. **    This file contains file contains data structure defintions,
  8. **    function prototypes, constants, etc. for the common OLE 2.0
  9. **    utilities.
  10. **
  11. **    These utilities include the following:
  12. **          Debuging Assert/Verify macros
  13. **          HIMETRIC conversion routines
  14. **          reference counting debug support
  15. **          OleStd API's for common compound-document app support
  16. **
  17. **    (c) Copyright Microsoft Corp. 1990 - 1996 All Rights Reserved
  18. **
  19. *************************************************************************/
  20.  
  21. #if !defined( _OLESTD_H_ )
  22. #define _OLESTD_H_
  23.  
  24. #if !defined(__cplusplus) && !defined( __TURBOC__)
  25. #define NONAMELESSUNION     // use strict ANSI standard (for DVOBJ.H)
  26. #endif
  27.  
  28. #include <windows.h>
  29. #include <shellapi.h>
  30. #include <ole2.h>
  31. #include <string.h>
  32. #include <dlgs.h>           //For fileopen dlg; standard include
  33. #include "ansiapi.h"
  34. #include "oledlg.h"
  35.  
  36. /*************************************************************************
  37. ** DEBUG ASSERTION ROUTINES
  38. *************************************************************************/
  39.  
  40. #if DBG
  41. #include "assert.h"
  42. #define FnAssert(lpstrExpr, lpstrMsg, lpstrFileName, iLine)     \
  43.         (_assert(lpstrMsg ? lpstrMsg : lpstrExpr,               \
  44.                  lpstrFileName,                                 \
  45.                  iLine), NOERROR)
  46. #endif //DBG
  47.  
  48. // BEGINING OF OLD OLESTD.H FILE
  49. #if defined( __TURBOC__ ) || defined( WIN32 )
  50. #define _based(a)
  51. #endif
  52.  
  53. #ifndef RC_INVOKED
  54. #include <dos.h>        // needed for filetime
  55. #endif  /* RC_INVOKED */
  56.  
  57. #include <commdlg.h>    // needed for LPPRINTDLG
  58. #include <shellapi.h>   // needed for HKEY
  59. #include "ansiapi.h"
  60.  
  61. // String table defines...
  62. #define  IDS_OLESTDNOCREATEFILE   700
  63. #define  IDS_OLESTDNOOPENFILE     701
  64. #define  IDS_OLESTDDISKFULL       702
  65.  
  66.  
  67. /*
  68.  * Some C interface declaration stuff
  69.  */
  70.  
  71. #if ! defined(__cplusplus)
  72. typedef struct tagINTERFACEIMPL {
  73.       IUnknownVtbl FAR*       lpVtbl;
  74.       LPVOID                  lpBack;
  75.       int                     cRef;   // interface specific ref count.
  76. } INTERFACEIMPL, FAR* LPINTERFACEIMPL;
  77.  
  78. #define INIT_INTERFACEIMPL(lpIFace, pVtbl, pBack)   \
  79.       ((lpIFace)->lpVtbl = pVtbl, \
  80.          ((LPINTERFACEIMPL)(lpIFace))->lpBack = (LPVOID)pBack,   \
  81.          ((LPINTERFACEIMPL)(lpIFace))->cRef = 0  \
  82.       )
  83.  
  84. #if defined( _DEBUG )
  85. #define OleDbgQueryInterfaceMethod(lpUnk)   \
  86.       ((lpUnk) != NULL ? ((LPINTERFACEIMPL)(lpUnk))->cRef++ : 0)
  87. #define OleDbgAddRefMethod(lpThis, iface)   \
  88.       ((LPINTERFACEIMPL)(lpThis))->cRef++
  89.  
  90. #if _DEBUGLEVEL >= 2
  91. #define OleDbgReleaseMethod(lpThis, iface) \
  92.       (--((LPINTERFACEIMPL)(lpThis))->cRef == 0 ? \
  93.          OleDbgOut("\t" iface "* RELEASED (cRef == 0)\r\n"),1 : \
  94.           (((LPINTERFACEIMPL)(lpThis))->cRef < 0) ? \
  95.             ( \
  96.                DebugBreak(), \
  97.                OleDbgOut(  \
  98.                   "\tERROR: " iface "* RELEASED TOO MANY TIMES\r\n") \
  99.             ),1 : \
  100.             1)
  101.  
  102. #else       // if _DEBUGLEVEL < 2
  103. #define OleDbgReleaseMethod(lpThis, iface) \
  104.       (--((LPINTERFACEIMPL)(lpThis))->cRef == 0 ? \
  105.          1 : \
  106.           (((LPINTERFACEIMPL)(lpThis))->cRef < 0) ? \
  107.             ( \
  108.                OleDbgOut(  \
  109.                   "\tERROR: " iface "* RELEASED TOO MANY TIMES\r\n") \
  110.       ),1 : \
  111.             1)
  112.  
  113. #endif      // if _DEBUGLEVEL < 2
  114.  
  115. #else       // ! defined (_DEBUG)
  116.  
  117. #define OleDbgQueryInterfaceMethod(lpUnk)
  118. #define OleDbgAddRefMethod(lpThis, iface)
  119. #define OleDbgReleaseMethod(lpThis, iface)
  120.  
  121. #endif      // if defined( _DEBUG )
  122.  
  123. #endif      // ! defined(__cplusplus)
  124.  
  125. /*
  126.  * Some docfiles stuff
  127.  */
  128.  
  129. #define STGM_DFRALL (STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_DENY_WRITE)
  130. #define STGM_DFALL (STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_EXCLUSIVE)
  131. #define STGM_SALL (STGM_READWRITE | STGM_SHARE_EXCLUSIVE)
  132.  
  133. /*
  134.  * Some Concurrency stuff
  135.  */
  136.  
  137. /* standard Delay (in msec) to wait before retrying an LRPC call.
  138. **    this value is returned from IMessageFilter::RetryRejectedCall
  139. */
  140. #define OLESTDRETRYDELAY    (DWORD)5000
  141.  
  142. /* Cancel the pending outgoing LRPC call.
  143. **    this value is returned from IMessageFilter::RetryRejectedCall
  144. */
  145. #define OLESTDCANCELRETRY   (DWORD)-1
  146.  
  147. /*
  148.  * Some Icon support stuff.
  149.  *
  150.  * The following API's are now OBSOLETE because equivalent API's have been
  151.  * added to the OLE2.DLL library
  152.  *      GetIconOfFile       superceeded by OleGetIconOfFile
  153.  *      GetIconOfClass      superceeded by OleGetIconOfClass
  154.  *      OleUIMetafilePictFromIconAndLabel
  155.  *                          superceeded by OleMetafilePictFromIconAndLabel
  156.  *
  157.  * The following macros are defined for backward compatibility with previous
  158.  * versions of the OLE2UI library. It is recommended that the new Ole* API's
  159.  * should be used instead.
  160.  */
  161. #define GetIconOfFile(hInst, lpszFileName, fUseFileAsLabel) \
  162.    OleGetIconOfFile(lpszFileName, fUseFileAsLabel)
  163.  
  164. #define GetIconOfClass(hInst, rclsid, lpszLabel, fUseTypeAsLabel) \
  165.    OleGetIconOfClass(rclsid, lpszLabel, fUseTypeAsLabel)
  166.  
  167. #define OleUIMetafilePictFromIconAndLabel(hIcon,pszLabel,pszSourceFile,iIcon)\
  168.    OleMetafilePictFromIconAndLabel(hIcon, pszLabel, pszSourceFile, iIcon)
  169.  
  170.  
  171. /*
  172.  * Some Clipboard Copy/Paste & Drag/Drop support stuff
  173.  */
  174.  
  175. //Macro to set all FormatEtc fields
  176. #define SETFORMATETC(fe, cf, asp, td, med, li)   \
  177.    ((fe).cfFormat=cf, \
  178.     (fe).dwAspect=asp, \
  179.     (fe).ptd=td, \
  180.     (fe).tymed=med, \
  181.     (fe).lindex=li)
  182.  
  183. //Macro to set interesting FormatEtc fields defaulting the others.
  184. #define SETDEFAULTFORMATETC(fe, cf, med)  \
  185.    ((fe).cfFormat=cf, \
  186.     (fe).dwAspect=DVASPECT_CONTENT, \
  187.     (fe).ptd=NULL, \
  188.     (fe).tymed=med, \
  189.     (fe).lindex=-1)
  190.  
  191. // Macro to test if two FormatEtc structures are an exact match
  192. #define IsEqualFORMATETC(fe1, fe2)  \
  193.    (OleStdCompareFormatEtc(&(fe1), &(fe2))==0)
  194.  
  195. // Clipboard format strings
  196. #define CF_EMBEDSOURCE      TEXT("Embed Source")
  197. #define CF_EMBEDDEDOBJECT   TEXT("Embedded Object")
  198. #define CF_LINKSOURCE       TEXT("Link Source")
  199. #define CF_CUSTOMLINKSOURCE TEXT("Custom Link Source")
  200. #define CF_OBJECTDESCRIPTOR TEXT("Object Descriptor")
  201. #define CF_LINKSRCDESCRIPTOR TEXT("Link Source Descriptor")
  202. #define CF_OWNERLINK        TEXT("OwnerLink")
  203. #define CF_FILENAME         TEXT("FileName")
  204.  
  205. #define OleStdQueryOleObjectData(lpformatetc)   \
  206.    (((lpformatetc)->tymed & TYMED_ISTORAGE) ?    \
  207.          NOERROR : ResultFromScode(DV_E_FORMATETC))
  208.  
  209. #define OleStdQueryLinkSourceData(lpformatetc)   \
  210.    (((lpformatetc)->tymed & TYMED_ISTREAM) ?    \
  211.          NOERROR : ResultFromScode(DV_E_FORMATETC))
  212.  
  213. #define OleStdQueryObjectDescriptorData(lpformatetc)    \
  214.    (((lpformatetc)->tymed & TYMED_HGLOBAL) ?    \
  215.          NOERROR : ResultFromScode(DV_E_FORMATETC))
  216.  
  217. #define OleStdQueryFormatMedium(lpformatetc, tymd)  \
  218.    (((lpformatetc)->tymed & tymd) ?    \
  219.          NOERROR : ResultFromScode(DV_E_FORMATETC))
  220.  
  221. // Make an independent copy of a MetafilePict
  222. #define OleStdCopyMetafilePict(hpictin, phpictout)  \
  223.    (*(phpictout) = OleDuplicateData(hpictin,CF_METAFILEPICT,GHND|GMEM_SHARE))
  224.  
  225.  
  226. // REVIEW: these need to be added to OLE2.H
  227. #if !defined( DD_DEFSCROLLINTERVAL )
  228. #define DD_DEFSCROLLINTERVAL    50
  229. #endif
  230.  
  231. #if !defined( DD_DEFDRAGDELAY )
  232. #define DD_DEFDRAGDELAY         200
  233. #endif
  234.  
  235. #if !defined( DD_DEFDRAGMINDIST )
  236. #define DD_DEFDRAGMINDIST       2
  237. #endif
  238.  
  239.  
  240. /* OleStdGetDropEffect
  241. ** -------------------
  242. **
  243. ** Convert a keyboard state into a DROPEFFECT.
  244. **
  245. ** returns the DROPEFFECT value derived from the key state.
  246. **    the following is the standard interpretation:
  247. **          no modifier -- Default Drop     (NULL is returned)
  248. **          CTRL        -- DROPEFFECT_COPY
  249. **          SHIFT       -- DROPEFFECT_MOVE
  250. **          CTRL-SHIFT  -- DROPEFFECT_LINK
  251. **
  252. **    Default Drop: this depends on the type of the target application.
  253. **    this is re-interpretable by each target application. a typical
  254. **    interpretation is if the drag is local to the same document
  255. **    (which is source of the drag) then a MOVE operation is
  256. **    performed. if the drag is not local, then a COPY operation is
  257. **    performed.
  258. */
  259. #define OleStdGetDropEffect(grfKeyState)    \
  260.    ( (grfKeyState & MK_CONTROL) ?          \
  261.       ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_LINK : DROPEFFECT_COPY ) :  \
  262.       ( (grfKeyState & MK_SHIFT) ? DROPEFFECT_MOVE : 0 ) )
  263.  
  264.  
  265. #define OLESTDDROP_NONE         0
  266. #define OLESTDDROP_DEFAULT      1
  267. #define OLESTDDROP_NONDEFAULT   2
  268.  
  269.  
  270. /*
  271.  * Some misc stuff
  272.  */
  273.  
  274. #define EMBEDDINGFLAG "Embedding"     // Cmd line switch for launching a srvr
  275.  
  276. #define HIMETRIC_PER_INCH   2540      // number HIMETRIC units per inch
  277. #define PTS_PER_INCH        72        // number points (font size) per inch
  278.  
  279. #define MAP_PIX_TO_LOGHIM(x,ppli)   MulDiv(HIMETRIC_PER_INCH, (x), (ppli))
  280. #define MAP_LOGHIM_TO_PIX(x,ppli)   MulDiv((ppli), (x), HIMETRIC_PER_INCH)
  281.  
  282. // Returns TRUE if all fields of the two Rect's are equal, else FALSE.
  283. #define AreRectsEqual(lprc1, lprc2)     \
  284.    (((lprc1->top == lprc2->top) &&     \
  285.      (lprc1->left == lprc2->left) &&   \
  286.      (lprc1->right == lprc2->right) && \
  287.      (lprc1->bottom == lprc2->bottom)) ? TRUE : FALSE)
  288.  
  289. #define LSTRCPYN(lpdst, lpsrc, cch) \
  290. (\
  291.    (lpdst)[(cch)-1] = '\0', \
  292.    ((cch)>1 ? _fstrncpy(lpdst, lpsrc, (cch)-1) : 0)\
  293. )
  294.  
  295.  
  296.  
  297. /****** DEBUG Stuff *****************************************************/
  298.  
  299. #ifdef _DEBUG
  300.  
  301. #if !defined( _DBGTRACE )
  302. #define _DEBUGLEVEL 2
  303. #else
  304. #define _DEBUGLEVEL _DBGTRACE
  305. #endif
  306.  
  307.  
  308. #if defined( NOASSERT )
  309.  
  310. #define OLEDBGASSERTDATA
  311. #define OleDbgAssert(a)
  312. #define OleDbgAssertSz(a, b)
  313. #define OleDbgVerify(a)
  314. #define OleDbgVerifySz(a, b)
  315.  
  316. #else   // ! NOASSERT
  317.  
  318. #define OLEDBGASSERTDATA    \
  319.       static char _based(_segname("_CODE")) _szAssertFile[]= __FILE__;
  320.  
  321. #define OleDbgAssert(a) \
  322.       (!(a) ? FnAssert(#a, NULL, _szAssertFile, __LINE__) : (HRESULT)1)
  323.  
  324. #define OleDbgAssertSz(a, b)    \
  325.       (!(a) ? FnAssert(#a, b, _szAssertFile, __LINE__) : (HRESULT)1)
  326.  
  327. #define OleDbgVerify(a) \
  328.       OleDbgAssert(a)
  329.  
  330. #define OleDbgVerifySz(a, b)    \
  331.       OleDbgAssertSz(a, b)
  332.  
  333. #endif  // ! NOASSERT
  334.  
  335.  
  336. #define OLEDBGDATA_MAIN(szPrefix)   \
  337.       char near g_szDbgPrefix[] = szPrefix;    \
  338.       OLEDBGASSERTDATA
  339. #define OLEDBGDATA  \
  340.       extern char near g_szDbgPrefix[];    \
  341.       OLEDBGASSERTDATA
  342.  
  343. #define OLEDBG_BEGIN(lpsz) \
  344.       OleDbgPrintAlways(g_szDbgPrefix,lpsz,1);
  345.  
  346. #define OLEDBG_END  \
  347.       OleDbgPrintAlways(g_szDbgPrefix,"End\r\n",-1);
  348.  
  349. #define OleDbgOut(lpsz) \
  350.       OleDbgPrintAlways(g_szDbgPrefix,lpsz,0)
  351.  
  352. #define OleDbgOutNoPrefix(lpsz) \
  353.       OleDbgPrintAlways("",lpsz,0)
  354.  
  355. #define OleDbgOutRefCnt(lpsz,lpObj,refcnt)      \
  356.       OleDbgPrintRefCntAlways(g_szDbgPrefix,lpsz,lpObj,(ULONG)refcnt)
  357.  
  358. #define OleDbgOutRect(lpsz,lpRect)      \
  359.       OleDbgPrintRectAlways(g_szDbgPrefix,lpsz,lpRect)
  360.  
  361. #define OleDbgOutHResult(lpsz,hr)   \
  362.       OleDbgPrintScodeAlways(g_szDbgPrefix,lpsz,GetScode(hr))
  363.  
  364. #define OleDbgOutScode(lpsz,sc) \
  365.       OleDbgPrintScodeAlways(g_szDbgPrefix,lpsz,sc)
  366.  
  367. #define OleDbgOut1(lpsz)    \
  368.       OleDbgPrint(1,g_szDbgPrefix,lpsz,0)
  369.  
  370. #define OleDbgOutNoPrefix1(lpsz)    \
  371.       OleDbgPrint(1,"",lpsz,0)
  372.  
  373. #define OLEDBG_BEGIN1(lpsz)    \
  374.       OleDbgPrint(1,g_szDbgPrefix,lpsz,1);
  375.  
  376. #define OLEDBG_END1 \
  377.       OleDbgPrint(1,g_szDbgPrefix,"End\r\n",-1);
  378.  
  379. #define OleDbgOutRefCnt1(lpsz,lpObj,refcnt)     \
  380.       OleDbgPrintRefCnt(1,g_szDbgPrefix,lpsz,lpObj,(ULONG)refcnt)
  381.  
  382. #define OleDbgOutRect1(lpsz,lpRect)     \
  383.       OleDbgPrintRect(1,g_szDbgPrefix,lpsz,lpRect)
  384.  
  385. #define OleDbgOut2(lpsz)    \
  386.       OleDbgPrint(2,g_szDbgPrefix,lpsz,0)
  387.  
  388. #define OleDbgOutNoPrefix2(lpsz)    \
  389.       OleDbgPrint(2,"",lpsz,0)
  390.  
  391. #define OLEDBG_BEGIN2(lpsz)    \
  392.       OleDbgPrint(2,g_szDbgPrefix,lpsz,1);
  393.  
  394. #define OLEDBG_END2 \
  395.       OleDbgPrint(2,g_szDbgPrefix,"End\r\n",-1);
  396.  
  397. #define OleDbgOutRefCnt2(lpsz,lpObj,refcnt)     \
  398.       OleDbgPrintRefCnt(2,g_szDbgPrefix,lpsz,lpObj,(ULONG)refcnt)
  399.  
  400. #define OleDbgOutRect2(lpsz,lpRect)     \
  401.       OleDbgPrintRect(2,g_szDbgPrefix,lpsz,lpRect)
  402.  
  403. #define OleDbgOut3(lpsz)    \
  404.       OleDbgPrint(3,g_szDbgPrefix,lpsz,0)
  405.  
  406. #define OleDbgOutNoPrefix3(lpsz)    \
  407.       OleDbgPrint(3,"",lpsz,0)
  408.  
  409. #define OLEDBG_BEGIN3(lpsz)    \
  410.       OleDbgPrint(3,g_szDbgPrefix,lpsz,1);
  411.  
  412. #define OLEDBG_END3 \
  413.       OleDbgPrint(3,g_szDbgPrefix,"End\r\n",-1);
  414.  
  415. #define OleDbgOutRefCnt3(lpsz,lpObj,refcnt)     \
  416.       OleDbgPrintRefCnt(3,g_szDbgPrefix,lpsz,lpObj,(ULONG)refcnt)
  417.  
  418. #define OleDbgOutRect3(lpsz,lpRect)     \
  419.       OleDbgPrintRect(3,g_szDbgPrefix,lpsz,lpRect)
  420.  
  421. #define OleDbgOut4(lpsz)    \
  422.       OleDbgPrint(4,g_szDbgPrefix,lpsz,0)
  423.  
  424. #define OleDbgOutNoPrefix4(lpsz)    \
  425.       OleDbgPrint(4,"",lpsz,0)
  426.  
  427. #define OLEDBG_BEGIN4(lpsz)    \
  428.       OleDbgPrint(4,g_szDbgPrefix,lpsz,1);
  429.  
  430. #define OLEDBG_END4 \
  431.       OleDbgPrint(4,g_szDbgPrefix,"End\r\n",-1);
  432.  
  433. #define OleDbgOutRefCnt4(lpsz,lpObj,refcnt)     \
  434.       OleDbgPrintRefCnt(4,g_szDbgPrefix,lpsz,lpObj,(ULONG)refcnt)
  435.  
  436. #define OleDbgOutRect4(lpsz,lpRect)     \
  437.       OleDbgPrintRect(4,g_szDbgPrefix,lpsz,lpRect)
  438.  
  439. #else   //  !_DEBUG
  440.  
  441. #define OLEDBGDATA_MAIN(szPrefix)
  442. #define OLEDBGDATA
  443. #define OleDbgAssert(a)
  444. #define OleDbgAssertSz(a, b)
  445. #define OleDbgVerify(a)         (a)
  446. #define OleDbgVerifySz(a, b)    (a)
  447. #define OleDbgOutHResult(lpsz,hr)
  448. #define OleDbgOutScode(lpsz,sc)
  449. #define OLEDBG_BEGIN(lpsz)
  450. #define OLEDBG_END
  451. #define OleDbgOut(lpsz)
  452. #define OleDbgOut1(lpsz)
  453. #define OleDbgOut2(lpsz)
  454. #define OleDbgOut3(lpsz)
  455. #define OleDbgOut4(lpsz)
  456. #define OleDbgOutNoPrefix(lpsz)
  457. #define OleDbgOutNoPrefix1(lpsz)
  458. #define OleDbgOutNoPrefix2(lpsz)
  459. #define OleDbgOutNoPrefix3(lpsz)
  460. #define OleDbgOutNoPrefix4(lpsz)
  461. #define OLEDBG_BEGIN1(lpsz)
  462. #define OLEDBG_BEGIN2(lpsz)
  463. #define OLEDBG_BEGIN3(lpsz)
  464. #define OLEDBG_BEGIN4(lpsz)
  465. #define OLEDBG_END1
  466. #define OLEDBG_END2
  467. #define OLEDBG_END3
  468. #define OLEDBG_END4
  469. #define OleDbgOutRefCnt(lpsz,lpObj,refcnt)
  470. #define OleDbgOutRefCnt1(lpsz,lpObj,refcnt)
  471. #define OleDbgOutRefCnt2(lpsz,lpObj,refcnt)
  472. #define OleDbgOutRefCnt3(lpsz,lpObj,refcnt)
  473. #define OleDbgOutRefCnt4(lpsz,lpObj,refcnt)
  474. #define OleDbgOutRect(lpsz,lpRect)
  475. #define OleDbgOutRect1(lpsz,lpRect)
  476. #define OleDbgOutRect2(lpsz,lpRect)
  477. #define OleDbgOutRect3(lpsz,lpRect)
  478. #define OleDbgOutRect4(lpsz,lpRect)
  479.  
  480. #endif  //  _DEBUG
  481.  
  482.  
  483. /*************************************************************************
  484. ** Function prototypes
  485. *************************************************************************/
  486.  
  487.  
  488. //OLESTD.C
  489. STDAPI_(int) SetDCToAnisotropic(HDC hDC, LPRECT lprcPhysical, LPRECT lprcLogical, LPRECT lprcWindowOld, LPRECT lprcViewportOld);
  490. STDAPI_(int) SetDCToDrawInHimetricRect(HDC, LPRECT, LPRECT, LPRECT, LPRECT);
  491. STDAPI_(int) ResetOrigDC(HDC, int, LPRECT, LPRECT);
  492.  
  493. STDAPI_(int)        XformWidthInHimetricToPixels(HDC, int);
  494. STDAPI_(int)        XformWidthInPixelsToHimetric(HDC, int);
  495. STDAPI_(int)        XformHeightInHimetricToPixels(HDC, int);
  496. STDAPI_(int)        XformHeightInPixelsToHimetric(HDC, int);
  497.  
  498. STDAPI_(void) XformRectInPixelsToHimetric(HDC, LPRECT, LPRECT);
  499. STDAPI_(void) XformRectInHimetricToPixels(HDC, LPRECT, LPRECT);
  500. STDAPI_(void) XformSizeInPixelsToHimetric(HDC, LPSIZEL, LPSIZEL);
  501. STDAPI_(void) XformSizeInHimetricToPixels(HDC, LPSIZEL, LPSIZEL);
  502. STDAPI_(int) XformWidthInHimetricToPixels(HDC, int);
  503. STDAPI_(int) XformWidthInPixelsToHimetric(HDC, int);
  504. STDAPI_(int) XformHeightInHimetricToPixels(HDC, int);
  505. STDAPI_(int) XformHeightInPixelsToHimetric(HDC, int);
  506.  
  507. STDAPI_(void) ParseCmdLine(LPSTR, BOOL FAR *, LPSTR);
  508.  
  509. STDAPI_(BOOL) OleStdIsOleLink(LPUNKNOWN lpUnk);
  510. STDAPI_(LPUNKNOWN) OleStdQueryInterface(LPUNKNOWN lpUnk, REFIID riid);
  511. STDAPI_(LPSTORAGE) OleStdCreateRootStorage(LPOLESTR lpszStgName, DWORD grfMode);
  512. STDAPI_(LPSTORAGE) OleStdOpenRootStorage(LPOLESTR lpszStgName, DWORD grfMode);
  513. STDAPI_(LPSTORAGE) OleStdOpenOrCreateRootStorage(LPOLESTR lpszStgName, DWORD grfMode);
  514. STDAPI_(LPSTORAGE) OleStdCreateChildStorage(LPSTORAGE lpStg, LPOLESTR lpszStgName);
  515. STDAPI_(LPSTORAGE) OleStdOpenChildStorage(LPSTORAGE lpStg, LPOLESTR lpszStgName, DWORD grfMode);
  516. STDAPI_(BOOL) OleStdCommitStorage(LPSTORAGE lpStg);
  517. STDAPI OleStdDestroyAllElements(LPSTORAGE lpStg);
  518.  
  519. STDAPI_(LPSTORAGE) OleStdCreateStorageOnHGlobal(
  520.       HANDLE hGlobal,
  521.       BOOL fDeleteOnRelease,
  522.       DWORD dwgrfMode
  523. );
  524. STDAPI_(LPSTORAGE) OleStdCreateTempStorage(BOOL fUseMemory, DWORD grfMode);
  525. STDAPI OleStdDoConvert(LPSTORAGE lpStg, REFCLSID rClsidNew);
  526. STDAPI_(BOOL) OleStdGetTreatAsFmtUserType(
  527.       REFCLSID        rClsidApp,
  528.       LPSTORAGE       lpStg,
  529.       CLSID FAR*      lpclsid,
  530.       CLIPFORMAT FAR* lpcfFmt,
  531.       LPOLESTR FAR*      lplpszType
  532. );
  533. STDAPI OleStdDoTreatAsClass(LPOLESTR lpszUserType, REFCLSID rclsid, REFCLSID rclsidNew);
  534. STDAPI_(BOOL) OleStdSetupAdvises(LPOLEOBJECT lpOleObject, DWORD dwDrawAspect,
  535.                LPOLESTR lpszContainerApp, LPOLESTR lpszContainerObj,
  536.                LPADVISESINK lpAdviseSink, BOOL fCreate);
  537. STDAPI OleStdSwitchDisplayAspect(
  538.       LPOLEOBJECT             lpOleObj,
  539.       LPDWORD                 lpdwCurAspect,
  540.       DWORD                   dwNewAspect,
  541.       HGLOBAL                 hMetaPict,
  542.       BOOL                    fDeleteOldAspect,
  543.       BOOL                    fSetupViewAdvise,
  544.       LPADVISESINK            lpAdviseSink,
  545.       BOOL FAR*               lpfMustUpdate
  546. );
  547. STDAPI OleStdSetIconInCache(LPOLEOBJECT lpOleObj, HGLOBAL hMetaPict);
  548. STDAPI_(HGLOBAL) OleStdGetData(
  549.       LPDATAOBJECT        lpDataObj,
  550.       CLIPFORMAT          cfFormat,
  551.       DVTARGETDEVICE FAR* lpTargetDevice,
  552.       DWORD               dwAspect,
  553.       LPSTGMEDIUM         lpMedium
  554. );
  555. STDAPI_(void) OleStdMarkPasteEntryList(
  556.       LPDATAOBJECT        lpSrcDataObj,
  557.       LPOLEUIPASTEENTRY   lpPriorityList,
  558.       int                 cEntries
  559. );
  560. STDAPI_(int) OleStdGetPriorityClipboardFormat(
  561.       LPDATAOBJECT        lpSrcDataObj,
  562.       LPOLEUIPASTEENTRY   lpPriorityList,
  563.       int                 cEntries
  564. );
  565. STDAPI_(BOOL) OleStdIsDuplicateFormat(
  566.       LPFORMATETC         lpFmtEtc,
  567.       LPFORMATETC         arrFmtEtc,
  568.       int                 nFmtEtc
  569. );
  570. STDAPI_(void) OleStdRegisterAsRunning(LPUNKNOWN lpUnk, LPMONIKER lpmkFull, DWORD FAR* lpdwRegister);
  571. STDAPI_(void) OleStdRevokeAsRunning(DWORD FAR* lpdwRegister);
  572. STDAPI_(void) OleStdNoteFileChangeTime(LPOLESTR lpszFileName, DWORD dwRegister);
  573. STDAPI_(void) OleStdNoteObjectChangeTime(DWORD dwRegister);
  574. STDAPI OleStdGetOleObjectData(
  575.       LPPERSISTSTORAGE    lpPStg,
  576.       LPFORMATETC         lpformatetc,
  577.       LPSTGMEDIUM         lpMedium,
  578.       BOOL                fUseMemory
  579. );
  580. STDAPI OleStdGetLinkSourceData(
  581.       LPMONIKER           lpmk,
  582.       LPCLSID             lpClsID,
  583.       LPFORMATETC         lpformatetc,
  584.       LPSTGMEDIUM         lpMedium
  585. );
  586. STDAPI_(HGLOBAL) OleStdGetObjectDescriptorData(
  587.       CLSID               clsid,
  588.       DWORD               dwAspect,
  589.       SIZEL               sizel,
  590.       POINTL              pointl,
  591.       DWORD               dwStatus,
  592.       LPOLESTR            lpszFullUserTypeName,
  593.       LPOLESTR            lpszSrcOfCopy
  594. );
  595. STDAPI_(HGLOBAL) OleStdGetObjectDescriptorDataFromOleObject(
  596.       LPOLEOBJECT         lpOleObj,
  597.       LPOLESTR            lpszSrcOfCopy,
  598.       DWORD               dwAspect,
  599.       POINTL              pointl,
  600.       LPSIZEL             lpSizelHim
  601. );
  602. STDAPI_(HGLOBAL) OleStdFillObjectDescriptorFromData(
  603.       LPDATAOBJECT       lpDataObject,
  604.       LPSTGMEDIUM        lpmedium,
  605.       CLIPFORMAT FAR*    lpcfFmt
  606. );
  607. STDAPI_(HANDLE) OleStdGetMetafilePictFromOleObject(
  608.       LPOLEOBJECT         lpOleObj,
  609.       DWORD               dwDrawAspect,
  610.       LPSIZEL             lpSizelHim,
  611.       DVTARGETDEVICE FAR* ptd
  612. );
  613.  
  614. STDAPI_(void) OleStdCreateTempFileMoniker(LPOLESTR lpszPrefixString, UINT FAR* lpuUnique, LPOLESTR lpszName, LPMONIKER FAR* lplpmk);
  615. STDAPI_(LPMONIKER) OleStdGetFirstMoniker(LPMONIKER lpmk);
  616. STDAPI_(ULONG) OleStdGetLenFilePrefixOfMoniker(LPMONIKER lpmk);
  617. STDAPI OleStdMkParseDisplayName(
  618.       REFCLSID        rClsid,
  619.       LPBC            lpbc,
  620.       LPOLESTR        lpszUserName,
  621.       ULONG FAR*      lpchEaten,
  622.       LPMONIKER FAR*  lplpmk
  623. );
  624. STDAPI_(LPVOID) OleStdMalloc(ULONG ulSize);
  625. STDAPI_(LPVOID) OleStdRealloc(LPVOID pmem, ULONG ulSize);
  626. STDAPI_(void) OleStdFree(LPVOID pmem);
  627. STDAPI_(ULONG) OleStdGetSize(LPVOID pmem);
  628. STDAPI_(void) OleStdFreeString(LPOLESTR lpsz, LPMALLOC lpMalloc);
  629. STDAPI_(LPOLESTR) OleStdCopyString(LPOLESTR lpszSrc, LPMALLOC lpMalloc);
  630. STDAPI_(ULONG) OleStdGetItemToken(LPOLESTR lpszSrc, LPOLESTR lpszDst,int nMaxChars);
  631.  
  632. STDAPI_(UINT)     OleStdIconLabelTextOut(HDC        hDC,
  633.                                HFONT      hFont,
  634.                                int        nXStart,
  635.                                int        nYStart,
  636.                                UINT       fuOptions,
  637.                                RECT FAR * lpRect,
  638.                                LPOLESTR   lpszString,
  639.                                UINT       cchString,
  640.                                int FAR *  lpDX);
  641.  
  642. // registration database query functions
  643. STDAPI_(UINT)     OleStdGetAuxUserType(REFCLSID rclsid,
  644.                              WORD   wAuxUserType,
  645.                              LPOLESTR  lpszAuxUserType,
  646.                              int    cch,
  647.                              HKEY   hKey);
  648.  
  649. STDAPI_(UINT)     OleStdGetUserTypeOfClass(REFCLSID rclsid,
  650.                                  LPOLESTR lpszUserType,
  651.                                  UINT cch,
  652.                                  HKEY hKey);
  653.  
  654. STDAPI_(BOOL) OleStdGetMiscStatusOfClass(REFCLSID, HKEY, DWORD FAR *);
  655. STDAPI_(CLIPFORMAT) OleStdGetDefaultFileFormatOfClass(
  656.       REFCLSID        rclsid,
  657.       HKEY            hKey
  658. );
  659.  
  660. STDAPI_(void) OleStdInitVtbl(LPVOID lpVtbl, UINT nSizeOfVtbl);
  661. STDMETHODIMP OleStdNullMethod(LPUNKNOWN lpThis);
  662. STDAPI_(BOOL) OleStdCheckVtbl(LPVOID lpVtbl, UINT nSizeOfVtbl, LPOLESTR lpszIface);
  663. STDAPI_(ULONG) OleStdVerifyRelease(LPUNKNOWN lpUnk, LPOLESTR lpszMsg);
  664. STDAPI_(ULONG) OleStdRelease(LPUNKNOWN lpUnk);
  665.  
  666. STDAPI_(HDC) OleStdCreateDC(DVTARGETDEVICE FAR* ptd);
  667. STDAPI_(HDC) OleStdCreateIC(DVTARGETDEVICE FAR* ptd);
  668. STDAPI_(DVTARGETDEVICE FAR*) OleStdCreateTargetDevice(LPPRINTDLG lpPrintDlg);
  669. STDAPI_(BOOL) OleStdDeleteTargetDevice(DVTARGETDEVICE FAR* ptd);
  670. STDAPI_(DVTARGETDEVICE FAR*) OleStdCopyTargetDevice(DVTARGETDEVICE FAR* ptdSrc);
  671. STDAPI_(BOOL) OleStdCopyFormatEtc(LPFORMATETC petcDest, LPFORMATETC petcSrc);
  672. STDAPI_(int) OleStdCompareFormatEtc(FORMATETC FAR* pFetcLeft, FORMATETC FAR* pFetcRight);
  673. STDAPI_(BOOL) OleStdCompareTargetDevice
  674.    (DVTARGETDEVICE FAR* ptdLeft, DVTARGETDEVICE FAR* ptdRight);
  675.  
  676.  
  677. STDAPI_(void) OleDbgPrint(
  678.       int     nDbgLvl,
  679.       LPSTR   lpszPrefix,
  680.       LPSTR   lpszMsg,
  681.       int     nIndent
  682. );
  683. STDAPI_(void) OleDbgPrintAlways(LPSTR lpszPrefix, LPSTR lpszMsg, int nIndent);
  684. STDAPI_(void) OleDbgSetDbgLevel(int nDbgLvl);
  685. STDAPI_(int) OleDbgGetDbgLevel( void );
  686. STDAPI_(void) OleDbgIndent(int n);
  687. STDAPI_(void) OleDbgPrintRefCnt(
  688.       int         nDbgLvl,
  689.       LPSTR       lpszPrefix,
  690.       LPSTR       lpszMsg,
  691.       LPVOID      lpObj,
  692.       ULONG       refcnt
  693. );
  694. STDAPI_(void) OleDbgPrintRefCntAlways(
  695.       LPSTR       lpszPrefix,
  696.       LPSTR       lpszMsg,
  697.       LPVOID      lpObj,
  698.       ULONG       refcnt
  699. );
  700. STDAPI_(void) OleDbgPrintRect(
  701.       int         nDbgLvl,
  702.       LPSTR       lpszPrefix,
  703.       LPSTR       lpszMsg,
  704.       LPRECT      lpRect
  705. );
  706. STDAPI_(void) OleDbgPrintRectAlways(
  707.       LPSTR       lpszPrefix,
  708.       LPSTR       lpszMsg,
  709.       LPRECT      lpRect
  710. );
  711. STDAPI_(void) OleDbgPrintScodeAlways(LPSTR lpszPrefix, LPSTR lpszMsg, SCODE sc);
  712.  
  713.  
  714. STDAPI_(LPENUMFORMATETC)
  715.   OleStdEnumFmtEtc_Create(ULONG nCount, LPFORMATETC lpEtc);
  716.  
  717. STDAPI_(LPENUMSTATDATA)
  718.   OleStdEnumStatData_Create(ULONG nCount, LPSTATDATA lpStat);
  719.  
  720. STDAPI_(BOOL)
  721.   OleStdCopyStatData(LPSTATDATA pDest, LPSTATDATA pSrc);
  722.  
  723. STDAPI_(HPALETTE)
  724.   OleStdCreateStandardPalette(void);
  725.  
  726. #if defined( OBSOLETE )
  727.  
  728. /*************************************************************************
  729. ** The following API's have been converted into macros:
  730. **          OleStdQueryOleObjectData
  731. **          OleStdQueryLinkSourceData
  732. **          OleStdQueryObjectDescriptorData
  733. **          OleStdQueryFormatMedium
  734. **          OleStdCopyMetafilePict
  735. **          AreRectsEqual
  736. **          OleStdGetDropEffect
  737. **
  738. **    These macros are defined above
  739. *************************************************************************/
  740. STDAPI_(BOOL) AreRectsEqual(LPRECT lprc1, LPRECT lprc2);
  741. STDAPI_(BOOL) OleStdCopyMetafilePict(HANDLE hpictin, HANDLE FAR* phpictout);
  742. STDAPI OleStdQueryOleObjectData(LPFORMATETC lpformatetc);
  743. STDAPI OleStdQueryLinkSourceData(LPFORMATETC lpformatetc);
  744. STDAPI OleStdQueryObjectDescriptorData(LPFORMATETC lpformatetc);
  745. STDAPI OleStdQueryFormatMedium(LPFORMATETC lpformatetc, TYMED tymed);
  746. STDAPI_(DWORD) OleStdGetDropEffect ( DWORD grfKeyState );
  747. #endif  // OBSOLETE
  748.  
  749. // END OF OLD OLESTD.H FILE
  750.  
  751. #define UPDATELINKS_STARTDELAY 2000 // delay before first link
  752.  
  753. #ifdef __TURBOC__
  754. #define _getcwd getcwd
  755. #define _itoa   itoa
  756. #define __max   max
  757. #define _find_t find_t
  758. #endif // __TURBOC__
  759.  
  760. #ifdef WIN32
  761. #define _fmemset memset
  762. #define _fmemcpy memcpy
  763. #define _fmemcmp memcmp
  764. #define _fstrcpy strcpy
  765. #define _fstrncpy strncpy
  766. #define _fstrlen strlen
  767. #define _fstrrchr strrchr
  768. #define _fstrtok strtok
  769.  
  770. // BUGBUG32: isspace function does not seem to work properly
  771. #undef isspace
  772. #define isspace(j) (j==' ' || j=='\t' || j=='\n')
  773. #endif  // WIN32
  774.  
  775. #if !defined( EXPORT )
  776. #ifdef WIN32
  777. #define EXPORT
  778. #else
  779. #define EXPORT  __export
  780. #endif  // WIN32
  781. #endif  // !EXPORT
  782.  
  783. /*
  784.  * Initialization / Uninitialization routines.  OleStdInitialize
  785.  * must be called prior to using any functions in OLESTD.LIB.
  786.  */
  787.  
  788. STDAPI_(BOOL) OleStdInitialize(HINSTANCE hInstance);
  789. STDAPI_(void) OleStdUninitialize(void);
  790.  
  791. // object count, used to support DllCanUnloadNow and OleUICanUnloadNow
  792. extern DWORD g_dwObjectCount;
  793.  
  794. STDAPI OleUICanUnloadNow(void);
  795. STDAPI OleUILockLibrary(BOOL fLock);
  796.  
  797.  
  798. //Dialog Identifiers as passed in Help messages to identify the source.
  799. #define IDD_FILEOPEN            32253
  800.  
  801. // The following Dialogs are message dialogs used by OleUIPromptUser API
  802.  
  803. // Stringtable identifers
  804. #define IDS_OLE2UIUNKNOWN       32300
  805. #define IDS_OLE2UILINK          32301
  806. #define IDS_OLE2UIOBJECT        32302
  807. #define IDS_OLE2UIEDIT          32303
  808. #define IDS_OLE2UICONVERT       32304
  809. #define IDS_OLE2UIEDITLINKCMD_1VERB     32305
  810. #define IDS_OLE2UIEDITOBJECTCMD_1VERB   32306
  811. #define IDS_OLE2UIEDITLINKCMD_NVERB     32307
  812. #define IDS_OLE2UIEDITOBJECTCMD_NVERB   32308
  813. #define IDS_OLE2UIEDITNOOBJCMD  32309
  814. // def. icon label (usu. "Document")
  815. #define IDS_DEFICONLABEL        32310
  816. #define IDS_OLE2UIPASTELINKEDTYPE  32311
  817.  
  818.  
  819. #define IDS_FILTERS             32320
  820. #define IDS_ICONFILTERS         32321
  821. #define IDS_BROWSE              32322
  822.  
  823. //Resource identifiers for bitmaps
  824. #define IDB_RESULTSEGA                  32325
  825. #define IDB_RESULTSVGA                  32326
  826. #define IDB_RESULTSHIRESVGA             32327
  827.  
  828.  
  829. //Missing from windows.h
  830. #ifndef PVOID
  831. typedef VOID *PVOID;
  832. #endif
  833.  
  834.  
  835. //Hook type used in all structures.
  836. typedef UINT (CALLBACK *LPFNOLEUIHOOK)(HWND, UINT, WPARAM, LPARAM);
  837.  
  838.  
  839. //Strings for registered messages
  840. #define SZOLEUI_MSG_FILEOKSTRING        "OLEUI_MSG_FILEOKSTRING"
  841.  
  842.  
  843. //Help Button Identifier
  844. #define ID_OLEUIHELP                    99
  845.  
  846. // Static text control (use this instead of -1 so things work correctly for
  847. // localization
  848. #define  ID_STATIC                      98
  849.  
  850. //Maximum key size we read from the RegDB.
  851. #define OLEUI_CCHKEYMAX                 256  // make any changes to this in geticon.c too
  852.  
  853. //Maximum verb length and length of Object menu
  854. #define OLEUI_CCHVERBMAX                32
  855. #define OLEUI_OBJECTMENUMAX             256
  856.  
  857. //Maximum MS-DOS pathname.
  858. #define OLEUI_CCHPATHMAX                256 // make any changes to this in geticon.c too
  859. #define OLEUI_CCHFILEMAX                13
  860.  
  861. //Icon label length
  862. #define OLEUI_CCHLABELMAX               40  // make any changes to this in geticon.c too
  863.  
  864. //Length of the CLSID string
  865. #define OLEUI_CCHCLSIDSTRING            39
  866.  
  867.  
  868. //Metafile utility functions
  869. WINOLEAPI_(HGLOBAL) OleUIMetafilePictFromIconAndLabel(HICON, LPOLESTR, LPOLESTR, UINT);
  870. STDAPI_(void)    OleUIMetafilePictIconFree(HGLOBAL);
  871. STDAPI_(BOOL)    OleUIMetafilePictIconDraw(HDC, LPRECT, HGLOBAL, BOOL);
  872. STDAPI_(UINT)    OleUIMetafilePictExtractLabel(HGLOBAL, LPOLESTR, UINT, LPDWORD);
  873. STDAPI_(HICON)   OleUIMetafilePictExtractIcon(HGLOBAL);
  874. STDAPI_(BOOL)    OleUIMetafilePictExtractIconSource(HGLOBAL,LPOLESTR,UINT FAR *);
  875.  
  876.  
  877.  
  878.  
  879.  
  880. /*************************************************************************
  881. ** INSERT OBJECT DIALOG
  882. *************************************************************************/
  883.  
  884. //Insert Object Dialog identifiers
  885. #define ID_IO_CREATENEW                 2100
  886. #define ID_IO_CREATEFROMFILE            2101
  887. #define ID_IO_LINKFILE                  2102
  888. #define ID_IO_OBJECTTYPELIST            2103
  889. #define ID_IO_DISPLAYASICON             2104
  890. #define ID_IO_CHANGEICON                2105
  891. #define ID_IO_FILE                      2106
  892. #define ID_IO_FILEDISPLAY               2107
  893. #define ID_IO_RESULTIMAGE               2108
  894. #define ID_IO_RESULTTEXT                2109
  895. #define ID_IO_ICONDISPLAY               2110
  896. #define ID_IO_OBJECTTYPETEXT            2111
  897. #define ID_IO_FILETEXT                  2112
  898. #define ID_IO_FILETYPE                  2113
  899.  
  900. // Strings in OLE2UI resources
  901. #define IDS_IORESULTNEW                 32400
  902. #define IDS_IORESULTNEWICON             32401
  903. #define IDS_IORESULTFROMFILE1           32402
  904. #define IDS_IORESULTFROMFILE2           32403
  905. #define IDS_IORESULTFROMFILEICON2       32404
  906. #define IDS_IORESULTLINKFILE1           32405
  907. #define IDS_IORESULTLINKFILE2           32406
  908. #define IDS_IORESULTLINKFILEICON1       32407
  909. #define IDS_IORESULTLINKFILEICON2       32408
  910.  
  911. /*************************************************************************
  912. ** PASTE SPECIAL DIALOG
  913. *************************************************************************/
  914.  
  915. //Paste Special Dialog identifiers
  916. #define ID_PS_PASTE                    500
  917. #define ID_PS_PASTELINK                501
  918. #define ID_PS_SOURCETEXT               502
  919. #define ID_PS_PASTELIST                503
  920. #define ID_PS_PASTELINKLIST            504
  921. #define ID_PS_DISPLAYLIST              505
  922. #define ID_PS_DISPLAYASICON            506
  923. #define ID_PS_ICONDISPLAY              507
  924. #define ID_PS_CHANGEICON               508
  925. #define ID_PS_RESULTIMAGE              509
  926. #define ID_PS_RESULTTEXT               510
  927. #define ID_PS_RESULTGROUP              511
  928. #define ID_PS_STXSOURCE                512
  929. #define ID_PS_STXAS                    513
  930.  
  931. // Paste Special String IDs
  932. #define IDS_PSPASTEDATA                32410
  933. #define IDS_PSPASTEOBJECT              32411
  934. #define IDS_PSPASTEOBJECTASICON        32412
  935. #define IDS_PSPASTELINKDATA            32413
  936. #define IDS_PSPASTELINKOBJECT          32414
  937. #define IDS_PSPASTELINKOBJECTASICON    32415
  938. #define IDS_PSNONOLE                   32416
  939. #define IDS_PSUNKNOWNTYPE              32417
  940. #define IDS_PSUNKNOWNSRC               32418
  941. #define IDS_PSUNKNOWNAPP               32419
  942.  
  943.  
  944. /*************************************************************************
  945. ** EDIT LINKS DIALOG
  946. *************************************************************************/
  947.  
  948. // Edit Links Dialog identifiers
  949. #define ID_EL_CHANGESOURCE             201
  950. #define ID_EL_AUTOMATIC                202
  951. #define ID_EL_CLOSE                    208
  952. #define ID_EL_CANCELLINK               209
  953. #define ID_EL_UPDATENOW                210
  954. #define ID_EL_OPENSOURCE               211
  955. #define ID_EL_MANUAL                   212
  956. #define ID_EL_LINKSOURCE               216
  957. #define ID_EL_LINKTYPE                 217
  958. #define ID_EL_UPDATE                   218
  959. #define ID_EL_NULL                     -1
  960. #define ID_EL_LINKSLISTBOX             206
  961. #define ID_EL_COL1                     220
  962. #define ID_EL_COL2                     221
  963. #define ID_EL_COL3                     222
  964.  
  965.  
  966.  
  967. /*************************************************************************
  968. ** CHANGE ICON DIALOG
  969. *************************************************************************/
  970.  
  971. //Change Icon Dialog identifiers
  972. #define ID_GROUP                    120
  973. #define ID_CURRENT                  121
  974. #define ID_CURRENTICON              122
  975. #define ID_DEFAULT                  123
  976. #define ID_DEFAULTICON              124
  977. #define ID_FROMFILE                 125
  978. #define ID_FROMFILEEDIT             126
  979. #define ID_ICONLIST                 127
  980. #define ID_LABEL                    128
  981. #define ID_LABELEDIT                129
  982. #define ID_BROWSE                   130
  983. #define ID_RESULTICON               132
  984. #define ID_RESULTLABEL              133
  985.  
  986. // Stringtable defines for Change Icon
  987. #define IDS_CINOICONSINFILE         32430
  988. #define IDS_CIINVALIDFILE           32431
  989. #define IDS_CIFILEACCESS            32432
  990. #define IDS_CIFILESHARE             32433
  991. #define IDS_CIFILEOPENFAIL          32434
  992.  
  993.  
  994.  
  995. /*************************************************************************
  996. ** CONVERT DIALOG
  997. *************************************************************************/
  998.  
  999. //Convert Dialog identifiers
  1000. #define IDCV_OBJECTTYPE             150
  1001. #define IDCV_DISPLAYASICON          152
  1002. #define IDCV_CHANGEICON             153
  1003. #define IDCV_ACTIVATELIST           154
  1004. #define IDCV_CONVERTTO              155
  1005. #define IDCV_ACTIVATEAS             156
  1006. #define IDCV_RESULTTEXT             157
  1007. #define IDCV_CONVERTLIST            158
  1008. #define IDCV_ICON                   159
  1009. #define IDCV_ICONLABEL1             160
  1010. #define IDCV_ICONLABEL2             161
  1011. #define IDCV_STXCURTYPE             162
  1012. #define IDCV_GRPRESULT              163
  1013. #define IDCV_STXCONVERTTO           164
  1014.  
  1015. // String IDs for Convert dialog
  1016. #define IDS_CVRESULTCONVERTLINK     32440
  1017. #define IDS_CVRESULTCONVERTTO       32441
  1018. #define IDS_CVRESULTNOCHANGE        32442
  1019. #define IDS_CVRESULTDISPLAYASICON   32443
  1020. #define IDS_CVRESULTACTIVATEAS      32444
  1021. #define IDS_CVRESULTACTIVATEDIFF    32445
  1022.  
  1023.  
  1024. /*************************************************************************
  1025. ** BUSY DIALOG
  1026. *************************************************************************/
  1027.  
  1028. // Busy dialog identifiers
  1029. #define IDBZ_RETRY                      600
  1030. #define IDBZ_ICON                       601
  1031. #define IDBZ_MESSAGE1                   602
  1032. #define IDBZ_SWITCHTO                   604
  1033.  
  1034. // Busy dialog stringtable defines
  1035. #define IDS_BZRESULTTEXTBUSY            32447
  1036. #define IDS_BZRESULTTEXTNOTRESPONDING   32448
  1037.  
  1038. // Links dialog stringtable defines
  1039. #define IDS_LINK_AUTO           32450
  1040. #define IDS_LINK_MANUAL         32451
  1041. #define IDS_LINK_UNKNOWN        32452
  1042. #define IDS_LINKS               32453
  1043. #define IDS_FAILED              32454
  1044. #define IDS_CHANGESOURCE        32455
  1045. #define IDS_INVALIDSOURCE       32456
  1046. #define IDS_ERR_GETLINKSOURCE   32457
  1047. #define IDS_ERR_GETLINKUPDATEOPTIONS    32458
  1048. #define IDS_ERR_ADDSTRING       32459
  1049. #define IDS_CHANGEADDITIONALLINKS   32460
  1050. #define IDS_CLOSE               32461
  1051.  
  1052.  
  1053. /*************************************************************************
  1054. ** PROMPT USER DIALOGS
  1055. *************************************************************************/
  1056. #define ID_PU_LINKS             900
  1057. #define ID_PU_TEXT              901
  1058. #define ID_PU_CONVERT           902
  1059. #define ID_PU_BROWSE            904
  1060. #define ID_PU_METER             905
  1061. #define ID_PU_PERCENT           906
  1062. #define ID_PU_STOP              907
  1063.  
  1064. // used for -1 ids in dialogs:
  1065. #define ID_DUMMY    999
  1066.  
  1067. /* inside ole2ui.c */
  1068. #ifdef __cplusplus
  1069. extern "C"
  1070. #endif
  1071.  
  1072. /*************************************************************************
  1073. ** OLE OBJECT FEEDBACK EFFECTS
  1074. *************************************************************************/
  1075.  
  1076. #define OLEUI_HANDLES_USEINVERSE    0x00000001L
  1077. #define OLEUI_HANDLES_NOBORDER      0x00000002L
  1078. #define OLEUI_HANDLES_INSIDE        0x00000004L
  1079. #define OLEUI_HANDLES_OUTSIDE       0x00000008L
  1080.  
  1081.  
  1082. #define OLEUI_SHADE_FULLRECT        1
  1083. #define OLEUI_SHADE_BORDERIN        2
  1084. #define OLEUI_SHADE_BORDEROUT       3
  1085.  
  1086. /* objfdbk.c function prototypes */
  1087. STDAPI_(void) OleUIDrawHandles(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cSize, BOOL fDraw);
  1088. STDAPI_(void) OleUIDrawShading(LPRECT lpRect, HDC hdc, DWORD dwFlags, UINT cWidth);
  1089. STDAPI_(void) OleUIShowObject(LPCRECT lprc, HDC hdc, BOOL fIsLink);
  1090.  
  1091.  
  1092. /*************************************************************************
  1093. ** Hatch window definitions and prototypes                              **
  1094. *************************************************************************/
  1095. #define DEFAULT_HATCHBORDER_WIDTH   4
  1096.  
  1097. STDAPI_(BOOL) RegisterHatchWindowClass(HINSTANCE hInst);
  1098. STDAPI_(HWND) CreateHatchWindow(HWND hWndParent, HINSTANCE hInst);
  1099. STDAPI_(UINT) GetHatchWidth(HWND hWndHatch);
  1100. STDAPI_(void) GetHatchRect(HWND hWndHatch, LPRECT lpHatchRect);
  1101. STDAPI_(void) SetHatchRect(HWND hWndHatch, LPRECT lprcHatchRect);
  1102. STDAPI_(void) SetHatchWindowSize(
  1103.       HWND        hWndHatch,
  1104.       LPRECT      lprcIPObjRect,
  1105.       LPRECT      lprcClipRect,
  1106.       LPPOINT     lpptOffset
  1107. );
  1108.  
  1109. #define OLEUI_VERSION_MAGIC 0x4D42
  1110.  
  1111. #endif // _OLESTD_H_
  1112.