home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / OLECTL.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  39KB  |  1,090 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Runtime Library                  }
  5. {       OLE Controls interface unit                     }
  6. {                                                       }
  7. {       Copyright (C) 1996,99 Inprise Corporation       }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit OleCtl;
  12.  
  13. {$WEAKPACKAGEUNIT}
  14.  
  15. interface
  16.  
  17. (*$HPPEMIT '' *)
  18. (*$HPPEMIT '#include <ocidl.h>' *)
  19. (*$HPPEMIT '#include <olectl.h>' *)
  20. (*$HPPEMIT '' *)
  21.  
  22. uses Windows, Messages, Ole2;
  23.  
  24. const
  25.  
  26. { OLE control status codes }
  27.  
  28.   {$EXTERNALSYM CTL_E_ILLEGALFUNCTIONCALL}
  29.   CTL_E_ILLEGALFUNCTIONCALL       = $800A0000 + 5;
  30.   {$EXTERNALSYM CTL_E_OVERFLOW}
  31.   CTL_E_OVERFLOW                  = $800A0000 + 6;
  32.   {$EXTERNALSYM CTL_E_OUTOFMEMORY}
  33.   CTL_E_OUTOFMEMORY               = $800A0000 + 7;
  34.   {$EXTERNALSYM CTL_E_DIVISIONBYZERO}
  35.   CTL_E_DIVISIONBYZERO            = $800A0000 + 11;
  36.   {$EXTERNALSYM CTL_E_OUTOFSTRINGSPACE}
  37.   CTL_E_OUTOFSTRINGSPACE          = $800A0000 + 14;
  38.   {$EXTERNALSYM CTL_E_OUTOFSTACKSPACE}
  39.   CTL_E_OUTOFSTACKSPACE           = $800A0000 + 28;
  40.   {$EXTERNALSYM CTL_E_BADFILENAMEORNUMBER}
  41.   CTL_E_BADFILENAMEORNUMBER       = $800A0000 + 52;
  42.   {$EXTERNALSYM CTL_E_FILENOTFOUND}
  43.   CTL_E_FILENOTFOUND              = $800A0000 + 53;
  44.   {$EXTERNALSYM CTL_E_BADFILEMODE}
  45.   CTL_E_BADFILEMODE               = $800A0000 + 54;
  46.   {$EXTERNALSYM CTL_E_FILEALREADYOPEN}
  47.   CTL_E_FILEALREADYOPEN           = $800A0000 + 55;
  48.   {$EXTERNALSYM CTL_E_DEVICEIOERROR}
  49.   CTL_E_DEVICEIOERROR             = $800A0000 + 57;
  50.   {$EXTERNALSYM CTL_E_FILEALREADYEXISTS}
  51.   CTL_E_FILEALREADYEXISTS         = $800A0000 + 58;
  52.   {$EXTERNALSYM CTL_E_BADRECORDLENGTH}
  53.   CTL_E_BADRECORDLENGTH           = $800A0000 + 59;
  54.   {$EXTERNALSYM CTL_E_DISKFULL}
  55.   CTL_E_DISKFULL                  = $800A0000 + 61;
  56.   {$EXTERNALSYM CTL_E_BADRECORDNUMBER}
  57.   CTL_E_BADRECORDNUMBER           = $800A0000 + 63;
  58.   {$EXTERNALSYM CTL_E_BADFILENAME}
  59.   CTL_E_BADFILENAME               = $800A0000 + 64;
  60.   {$EXTERNALSYM CTL_E_TOOMANYFILES}
  61.   CTL_E_TOOMANYFILES              = $800A0000 + 67;
  62.   {$EXTERNALSYM CTL_E_DEVICEUNAVAILABLE}
  63.   CTL_E_DEVICEUNAVAILABLE         = $800A0000 + 68;
  64.   {$EXTERNALSYM CTL_E_PERMISSIONDENIED}
  65.   CTL_E_PERMISSIONDENIED          = $800A0000 + 70;
  66.   {$EXTERNALSYM CTL_E_DISKNOTREADY}
  67.   CTL_E_DISKNOTREADY              = $800A0000 + 71;
  68.   {$EXTERNALSYM CTL_E_PATHFILEACCESSERROR}
  69.   CTL_E_PATHFILEACCESSERROR       = $800A0000 + 75;
  70.   {$EXTERNALSYM CTL_E_PATHNOTFOUND}
  71.   CTL_E_PATHNOTFOUND              = $800A0000 + 76;
  72.   {$EXTERNALSYM CTL_E_INVALIDPATTERNSTRING}
  73.   CTL_E_INVALIDPATTERNSTRING      = $800A0000 + 93;
  74.   {$EXTERNALSYM CTL_E_INVALIDUSEOFNULL}
  75.   CTL_E_INVALIDUSEOFNULL          = $800A0000 + 94;
  76.   {$EXTERNALSYM CTL_E_INVALIDFILEFORMAT}
  77.   CTL_E_INVALIDFILEFORMAT         = $800A0000 + 321;
  78.   {$EXTERNALSYM CTL_E_INVALIDPROPERTYVALUE}
  79.   CTL_E_INVALIDPROPERTYVALUE      = $800A0000 + 380;
  80.   {$EXTERNALSYM CTL_E_INVALIDPROPERTYARRAYINDEX}
  81.   CTL_E_INVALIDPROPERTYARRAYINDEX = $800A0000 + 381;
  82.   {$EXTERNALSYM CTL_E_SETNOTSUPPORTEDATRUNTIME}
  83.   CTL_E_SETNOTSUPPORTEDATRUNTIME  = $800A0000 + 382;
  84.   {$EXTERNALSYM CTL_E_SETNOTSUPPORTED}
  85.   CTL_E_SETNOTSUPPORTED           = $800A0000 + 383;
  86.   {$EXTERNALSYM CTL_E_NEEDPROPERTYARRAYINDEX}
  87.   CTL_E_NEEDPROPERTYARRAYINDEX    = $800A0000 + 385;
  88.   {$EXTERNALSYM CTL_E_SETNOTPERMITTED}
  89.   CTL_E_SETNOTPERMITTED           = $800A0000 + 387;
  90.   {$EXTERNALSYM CTL_E_GETNOTSUPPORTEDATRUNTIME}
  91.   CTL_E_GETNOTSUPPORTEDATRUNTIME  = $800A0000 + 393;
  92.   {$EXTERNALSYM CTL_E_GETNOTSUPPORTED}
  93.   CTL_E_GETNOTSUPPORTED           = $800A0000 + 394;
  94.   {$EXTERNALSYM CTL_E_PROPERTYNOTFOUND}
  95.   CTL_E_PROPERTYNOTFOUND          = $800A0000 + 422;
  96.   {$EXTERNALSYM CTL_E_INVALIDCLIPBOARDFORMAT}
  97.   CTL_E_INVALIDCLIPBOARDFORMAT    = $800A0000 + 460;
  98.   {$EXTERNALSYM CTL_E_INVALIDPICTURE}
  99.   CTL_E_INVALIDPICTURE            = $800A0000 + 481;
  100.   {$EXTERNALSYM CTL_E_PRINTERERROR}
  101.   CTL_E_PRINTERERROR              = $800A0000 + 482;
  102.   {$EXTERNALSYM CTL_E_CANTSAVEFILETOTEMP}
  103.   CTL_E_CANTSAVEFILETOTEMP        = $800A0000 + 735;
  104.   {$EXTERNALSYM CTL_E_SEARCHTEXTNOTFOUND}
  105.   CTL_E_SEARCHTEXTNOTFOUND        = $800A0000 + 744;
  106.   {$EXTERNALSYM CTL_E_REPLACEMENTSTOOLONG}
  107.   CTL_E_REPLACEMENTSTOOLONG       = $800A0000 + 746;
  108.  
  109.   {$EXTERNALSYM CTL_E_CUSTOM_FIRST}
  110.   CTL_E_CUSTOM_FIRST = $800A0000 + 600;
  111.  
  112. { IClassFactory2 status codes }
  113.  
  114.   {$EXTERNALSYM CLASS_E_NOTLICENSED}
  115.   CLASS_E_NOTLICENSED = CLASSFACTORY_E_FIRST + 2;
  116.  
  117. { IConnectionPoint status codes }
  118.  
  119.   {$EXTERNALSYM CONNECT_E_FIRST}
  120.   CONNECT_E_FIRST = $80040200;
  121.   {$EXTERNALSYM CONNECT_E_LAST}
  122.   CONNECT_E_LAST  = $8004020F;
  123.   {$EXTERNALSYM CONNECT_S_FIRST}
  124.   CONNECT_S_FIRST = $00040200;
  125.   {$EXTERNALSYM CONNECT_S_LAST}
  126.   CONNECT_S_LAST  = $0004020F;
  127.  
  128.   {$EXTERNALSYM CONNECT_E_NOCONNECTION}
  129.   CONNECT_E_NOCONNECTION  = CONNECT_E_FIRST + 0;
  130.   {$EXTERNALSYM CONNECT_E_ADVISELIMIT}
  131.   CONNECT_E_ADVISELIMIT   = CONNECT_E_FIRST + 1;
  132.   {$EXTERNALSYM CONNECT_E_CANNOTCONNECT}
  133.   CONNECT_E_CANNOTCONNECT = CONNECT_E_FIRST + 2;
  134.   {$EXTERNALSYM CONNECT_E_OVERRIDDEN}
  135.   CONNECT_E_OVERRIDDEN    = CONNECT_E_FIRST + 3;
  136.  
  137. { DllRegisterServer/DllUnregisterServer status codes }
  138.  
  139.   {$EXTERNALSYM SELFREG_E_FIRST}
  140.   SELFREG_E_FIRST = $80040200;
  141.   {$EXTERNALSYM SELFREG_E_LAST}
  142.   SELFREG_E_LAST  = $80040200;
  143.   {$EXTERNALSYM SELFREG_S_FIRST}
  144.   SELFREG_S_FIRST = $00040200;
  145.   {$EXTERNALSYM SELFREG_S_LAST}
  146.   SELFREG_S_LAST  = $00040200;
  147.  
  148.   {$EXTERNALSYM SELFREG_E_TYPELIB}
  149.   SELFREG_E_TYPELIB = SELFREG_E_FIRST + 0;
  150.   {$EXTERNALSYM SELFREG_E_CLASS}
  151.   SELFREG_E_CLASS   = SELFREG_E_FIRST + 1;
  152.  
  153. { IPerPropertyBrowsing status codes }
  154.  
  155.   {$EXTERNALSYM PERPROP_E_FIRST}
  156.   PERPROP_E_FIRST = $80040200;
  157.   {$EXTERNALSYM PERPROP_E_LAST}
  158.   PERPROP_E_LAST  = $8004020F;
  159.   {$EXTERNALSYM PERPROP_S_FIRST}
  160.   PERPROP_S_FIRST = $00040200;
  161.   {$EXTERNALSYM PERPROP_S_LAST}
  162.   PERPROP_S_LAST  = $0004020F;
  163.  
  164.   {$EXTERNALSYM PERPROP_E_NOPAGEAVAILABLE}
  165.   PERPROP_E_NOPAGEAVAILABLE = PERPROP_E_FIRST + 0;
  166.  
  167. { Additional OLEMISC constants }
  168.  
  169.   {$EXTERNALSYM OLEMISC_INVISIBLEATRUNTIME}
  170.   OLEMISC_INVISIBLEATRUNTIME = $00000400;
  171.   {$EXTERNALSYM OLEMISC_ALWAYSRUN}
  172.   OLEMISC_ALWAYSRUN          = $00000800;
  173.   {$EXTERNALSYM OLEMISC_ACTSLIKEBUTTON}
  174.   OLEMISC_ACTSLIKEBUTTON     = $00001000;
  175.   {$EXTERNALSYM OLEMISC_ACTSLIKELABEL}
  176.   OLEMISC_ACTSLIKELABEL      = $00002000;
  177.   {$EXTERNALSYM OLEMISC_NOUIACTIVATE}
  178.   OLEMISC_NOUIACTIVATE       = $00004000;
  179.   {$EXTERNALSYM OLEMISC_ALIGNABLE}
  180.   OLEMISC_ALIGNABLE          = $00008000;
  181.   {$EXTERNALSYM OLEMISC_SIMPLEFRAME}
  182.   OLEMISC_SIMPLEFRAME        = $00010000;
  183.   {$EXTERNALSYM OLEMISC_SETCLIENTSITEFIRST}
  184.   OLEMISC_SETCLIENTSITEFIRST = $00020000;
  185.   {$EXTERNALSYM OLEMISC_IMEMODE}
  186.   OLEMISC_IMEMODE            = $00040000;
  187.  
  188. { Additional OLEIVERB constants }
  189.  
  190.   {$EXTERNALSYM OLEIVERB_PROPERTIES}
  191.   OLEIVERB_PROPERTIES = -7;
  192.  
  193. { Additional variant type tags for property sets }
  194.  
  195.   {$EXTERNALSYM VT_STREAMED_PROPSET}
  196.   VT_STREAMED_PROPSET = 73;  { Stream contains a property set }
  197.   {$EXTERNALSYM VT_STORED_PROPSET}
  198.   VT_STORED_PROPSET   = 74;  { Storage contains a property set }
  199.   {$EXTERNALSYM VT_BLOB_PROPSET}
  200.   VT_BLOB_PROPSET     = 75;  { Blob contains a property set }
  201.  
  202. { Variant type tags that are just aliases for others }
  203.  
  204.   {$EXTERNALSYM VT_COLOR}
  205.   VT_COLOR          = VT_I4;
  206.   {$EXTERNALSYM VT_XPOS_PIXELS}
  207.   VT_XPOS_PIXELS    = VT_I4;
  208.   {$EXTERNALSYM VT_YPOS_PIXELS}
  209.   VT_YPOS_PIXELS    = VT_I4;
  210.   {$EXTERNALSYM VT_XSIZE_PIXELS}
  211.   VT_XSIZE_PIXELS   = VT_I4;
  212.   {$EXTERNALSYM VT_YSIZE_PIXELS}
  213.   VT_YSIZE_PIXELS   = VT_I4;
  214.   {$EXTERNALSYM VT_XPOS_HIMETRIC}
  215.   VT_XPOS_HIMETRIC  = VT_I4;
  216.   {$EXTERNALSYM VT_YPOS_HIMETRIC}
  217.   VT_YPOS_HIMETRIC  = VT_I4;
  218.   {$EXTERNALSYM VT_XSIZE_HIMETRIC}
  219.   VT_XSIZE_HIMETRIC = VT_I4;
  220.   {$EXTERNALSYM VT_YSIZE_HIMETRIC}
  221.   VT_YSIZE_HIMETRIC = VT_I4;
  222.   {$EXTERNALSYM VT_TRISTATE}
  223.   VT_TRISTATE       = VT_I2;
  224.   {$EXTERNALSYM VT_OPTEXCLUSIVE}
  225.   VT_OPTEXCLUSIVE   = VT_BOOL;
  226.   {$EXTERNALSYM VT_FONT}
  227.   VT_FONT           = VT_DISPATCH;
  228.   {$EXTERNALSYM VT_PICTURE}
  229.   VT_PICTURE        = VT_DISPATCH;
  230.   {$EXTERNALSYM VT_HANDLE}
  231.   VT_HANDLE         = VT_I4;
  232.  
  233. { Reflected window message IDs }
  234.  
  235.   {$EXTERNALSYM OCM__BASE}
  236.   OCM__BASE = WM_USER + $1C00;
  237.  
  238.   {$EXTERNALSYM OCM_COMMAND}
  239.   OCM_COMMAND           = OCM__BASE + WM_COMMAND;
  240.   {$EXTERNALSYM OCM_CTLCOLORBTN}
  241.   OCM_CTLCOLORBTN       = OCM__BASE + WM_CTLCOLORBTN;
  242.   {$EXTERNALSYM OCM_CTLCOLOREDIT}
  243.   OCM_CTLCOLOREDIT      = OCM__BASE + WM_CTLCOLOREDIT;
  244.   {$EXTERNALSYM OCM_CTLCOLORDLG}
  245.   OCM_CTLCOLORDLG       = OCM__BASE + WM_CTLCOLORDLG;
  246.   {$EXTERNALSYM OCM_CTLCOLORLISTBOX}
  247.   OCM_CTLCOLORLISTBOX   = OCM__BASE + WM_CTLCOLORLISTBOX;
  248.   {$EXTERNALSYM OCM_CTLCOLORMSGBOX}
  249.   OCM_CTLCOLORMSGBOX    = OCM__BASE + WM_CTLCOLORMSGBOX;
  250.   {$EXTERNALSYM OCM_CTLCOLORSCROLLBAR}
  251.   OCM_CTLCOLORSCROLLBAR = OCM__BASE + WM_CTLCOLORSCROLLBAR;
  252.   {$EXTERNALSYM OCM_CTLCOLORSTATIC}
  253.   OCM_CTLCOLORSTATIC    = OCM__BASE + WM_CTLCOLORSTATIC;
  254.   {$EXTERNALSYM OCM_DRAWITEM}
  255.   OCM_DRAWITEM          = OCM__BASE + WM_DRAWITEM;
  256.   {$EXTERNALSYM OCM_MEASUREITEM}
  257.   OCM_MEASUREITEM       = OCM__BASE + WM_MEASUREITEM;
  258.   {$EXTERNALSYM OCM_DELETEITEM}
  259.   OCM_DELETEITEM        = OCM__BASE + WM_DELETEITEM;
  260.   {$EXTERNALSYM OCM_VKEYTOITEM}
  261.   OCM_VKEYTOITEM        = OCM__BASE + WM_VKEYTOITEM;
  262.   {$EXTERNALSYM OCM_CHARTOITEM}
  263.   OCM_CHARTOITEM        = OCM__BASE + WM_CHARTOITEM;
  264.   {$EXTERNALSYM OCM_COMPAREITEM}
  265.   OCM_COMPAREITEM       = OCM__BASE + WM_COMPAREITEM;
  266.   {$EXTERNALSYM OCM_HSCROLL}
  267.   OCM_HSCROLL           = OCM__BASE + WM_HSCROLL;
  268.   {$EXTERNALSYM OCM_VSCROLL}
  269.   OCM_VSCROLL           = OCM__BASE + WM_VSCROLL;
  270.   {$EXTERNALSYM OCM_PARENTNOTIFY}
  271.   OCM_PARENTNOTIFY      = OCM__BASE + WM_PARENTNOTIFY;
  272.  
  273. { TControlInfo.dwFlags masks }
  274.  
  275.   {$EXTERNALSYM CTRLINFO_EATS_RETURN}
  276.   CTRLINFO_EATS_RETURN = 1;  { Control doesn't send Return to container }
  277.   {$EXTERNALSYM CTRLINFO_EATS_ESCAPE}
  278.   CTRLINFO_EATS_ESCAPE = 2;  { Control doesn't send Escape to container }
  279.  
  280. { IOleControlSite.TransformCoords flags }
  281.  
  282.   {$EXTERNALSYM XFORMCOORDS_POSITION}
  283.   XFORMCOORDS_POSITION            = 1;
  284.   {$EXTERNALSYM XFORMCOORDS_SIZE}
  285.   XFORMCOORDS_SIZE                = 2;
  286.   {$EXTERNALSYM XFORMCOORDS_HIMETRICTOCONTAINER}
  287.   XFORMCOORDS_HIMETRICTOCONTAINER = 4;
  288.   {$EXTERNALSYM XFORMCOORDS_CONTAINERTOHIMETRIC}
  289.   XFORMCOORDS_CONTAINERTOHIMETRIC = 8;
  290.  
  291. { IPropertyPageSite.OnStatusChange flags }
  292.  
  293.   {$EXTERNALSYM PROPPAGESTATUS_DIRTY}
  294.   PROPPAGESTATUS_DIRTY    = 1;  { Values in page have changed }
  295.   {$EXTERNALSYM PROPPAGESTATUS_VALIDATE}
  296.   PROPPAGESTATUS_VALIDATE = 2;  { Appropriate time to validate/apply }
  297.  
  298. { Picture attributes }
  299.  
  300.   {$EXTERNALSYM PICTURE_SCALABLE}
  301.   PICTURE_SCALABLE    = 1;
  302.   {$EXTERNALSYM PICTURE_TRANSPARENT}
  303.   PICTURE_TRANSPARENT = 2;
  304.  
  305. { TPictDesc.picType values }
  306.  
  307.   {$EXTERNALSYM PICTYPE_UNINITIALIZED}
  308.   PICTYPE_UNINITIALIZED = -1;
  309.   {$EXTERNALSYM PICTYPE_NONE}
  310.   PICTYPE_NONE          = 0;
  311.   {$EXTERNALSYM PICTYPE_BITMAP}
  312.   PICTYPE_BITMAP        = 1;
  313.   {$EXTERNALSYM PICTYPE_METAFILE}
  314.   PICTYPE_METAFILE      = 2;
  315.   {$EXTERNALSYM PICTYPE_ICON}
  316.   PICTYPE_ICON          = 3;
  317.   {$EXTERNALSYM PICTYPE_ENHMETAFILE}
  318.   PICTYPE_ENHMETAFILE   = 4;
  319.  
  320. { Standard dispatch ID constants }
  321.  
  322.   {$EXTERNALSYM DISPID_AUTOSIZE}
  323.   DISPID_AUTOSIZE      = -500;
  324.   {$EXTERNALSYM DISPID_BACKCOLOR}
  325.   DISPID_BACKCOLOR     = -501;
  326.   {$EXTERNALSYM DISPID_BACKSTYLE}
  327.   DISPID_BACKSTYLE     = -502;
  328.   {$EXTERNALSYM DISPID_BORDERCOLOR}
  329.   DISPID_BORDERCOLOR   = -503;
  330.   {$EXTERNALSYM DISPID_BORDERSTYLE}
  331.   DISPID_BORDERSTYLE   = -504;
  332.   {$EXTERNALSYM DISPID_BORDERWIDTH}
  333.   DISPID_BORDERWIDTH   = -505;
  334.   {$EXTERNALSYM DISPID_DRAWMODE}
  335.   DISPID_DRAWMODE      = -507;
  336.   {$EXTERNALSYM DISPID_DRAWSTYLE}
  337.   DISPID_DRAWSTYLE     = -508;
  338.   {$EXTERNALSYM DISPID_DRAWWIDTH}
  339.   DISPID_DRAWWIDTH     = -509;
  340.   {$EXTERNALSYM DISPID_FILLCOLOR}
  341.   DISPID_FILLCOLOR     = -510;
  342.   {$EXTERNALSYM DISPID_FILLSTYLE}
  343.   DISPID_FILLSTYLE     = -511;
  344.   {$EXTERNALSYM DISPID_FONT}
  345.   DISPID_FONT          = -512;
  346.   {$EXTERNALSYM DISPID_FORECOLOR}
  347.   DISPID_FORECOLOR     = -513;
  348.   {$EXTERNALSYM DISPID_ENABLED}
  349.   DISPID_ENABLED       = -514;
  350.   {$EXTERNALSYM DISPID_HWND}
  351.   DISPID_HWND          = -515;
  352.   {$EXTERNALSYM DISPID_TABSTOP}
  353.   DISPID_TABSTOP       = -516;
  354.   {$EXTERNALSYM DISPID_TEXT}
  355.   DISPID_TEXT          = -517;
  356.   {$EXTERNALSYM DISPID_CAPTION}
  357.   DISPID_CAPTION       = -518;
  358.   {$EXTERNALSYM DISPID_BORDERVISIBLE}
  359.   DISPID_BORDERVISIBLE = -519;
  360.  
  361.   {$EXTERNALSYM DISPID_REFRESH}
  362.   DISPID_REFRESH  = -550;
  363.   {$EXTERNALSYM DISPID_DOCLICK}
  364.   DISPID_DOCLICK  = -551;
  365.   {$EXTERNALSYM DISPID_ABOUTBOX}
  366.   DISPID_ABOUTBOX = -552;
  367.  
  368.   {$EXTERNALSYM DISPID_CLICK}
  369.   DISPID_CLICK      = -600;
  370.   {$EXTERNALSYM DISPID_DBLCLICK}
  371.   DISPID_DBLCLICK   = -601;
  372.   {$EXTERNALSYM DISPID_KEYDOWN}
  373.   DISPID_KEYDOWN    = -602;
  374.   {$EXTERNALSYM DISPID_KEYPRESS}
  375.   DISPID_KEYPRESS   = -603;
  376.   {$EXTERNALSYM DISPID_KEYUP}
  377.   DISPID_KEYUP      = -604;
  378.   {$EXTERNALSYM DISPID_MOUSEDOWN}
  379.   DISPID_MOUSEDOWN  = -605;
  380.   {$EXTERNALSYM DISPID_MOUSEMOVE}
  381.   DISPID_MOUSEMOVE  = -606;
  382.   {$EXTERNALSYM DISPID_MOUSEUP}
  383.   DISPID_MOUSEUP    = -607;
  384.   {$EXTERNALSYM DISPID_ERROREVENT}
  385.   DISPID_ERROREVENT = -608;
  386.  
  387.   {$EXTERNALSYM DISPID_AMBIENT_BACKCOLOR}
  388.   DISPID_AMBIENT_BACKCOLOR         = -701;
  389.   {$EXTERNALSYM DISPID_AMBIENT_DISPLAYNAME}
  390.   DISPID_AMBIENT_DISPLAYNAME       = -702;
  391.   {$EXTERNALSYM DISPID_AMBIENT_FONT}
  392.   DISPID_AMBIENT_FONT              = -703;
  393.   {$EXTERNALSYM DISPID_AMBIENT_FORECOLOR}
  394.   DISPID_AMBIENT_FORECOLOR         = -704;
  395.   {$EXTERNALSYM DISPID_AMBIENT_LOCALEID}
  396.   DISPID_AMBIENT_LOCALEID          = -705;
  397.   {$EXTERNALSYM DISPID_AMBIENT_MESSAGEREFLECT}
  398.   DISPID_AMBIENT_MESSAGEREFLECT    = -706;
  399.   {$EXTERNALSYM DISPID_AMBIENT_SCALEUNITS}
  400.   DISPID_AMBIENT_SCALEUNITS        = -707;
  401.   {$EXTERNALSYM DISPID_AMBIENT_TEXTALIGN}
  402.   DISPID_AMBIENT_TEXTALIGN         = -708;
  403.   {$EXTERNALSYM DISPID_AMBIENT_USERMODE}
  404.   DISPID_AMBIENT_USERMODE          = -709;
  405.   {$EXTERNALSYM DISPID_AMBIENT_UIDEAD}
  406.   DISPID_AMBIENT_UIDEAD            = -710;
  407.   {$EXTERNALSYM DISPID_AMBIENT_SHOWGRABHANDLES}
  408.   DISPID_AMBIENT_SHOWGRABHANDLES   = -711;
  409.   {$EXTERNALSYM DISPID_AMBIENT_SHOWHATCHING}
  410.   DISPID_AMBIENT_SHOWHATCHING      = -712;
  411.   {$EXTERNALSYM DISPID_AMBIENT_DISPLAYASDEFAULT}
  412.   DISPID_AMBIENT_DISPLAYASDEFAULT  = -713;
  413.   {$EXTERNALSYM DISPID_AMBIENT_SUPPORTSMNEMONICS}
  414.   DISPID_AMBIENT_SUPPORTSMNEMONICS = -714;
  415.   {$EXTERNALSYM DISPID_AMBIENT_AUTOCLIP}
  416.   DISPID_AMBIENT_AUTOCLIP          = -715;
  417.  
  418. { Dispatch ID constants for fonts }
  419.  
  420.   {$EXTERNALSYM DISPID_FONT_NAME}
  421.   DISPID_FONT_NAME    = 0;
  422.   {$EXTERNALSYM DISPID_FONT_SIZE}
  423.   DISPID_FONT_SIZE    = 2;
  424.   {$EXTERNALSYM DISPID_FONT_BOLD}
  425.   DISPID_FONT_BOLD    = 3;
  426.   {$EXTERNALSYM DISPID_FONT_ITALIC}
  427.   DISPID_FONT_ITALIC  = 4;
  428.   {$EXTERNALSYM DISPID_FONT_UNDER}
  429.   DISPID_FONT_UNDER   = 5;
  430.   {$EXTERNALSYM DISPID_FONT_STRIKE}
  431.   DISPID_FONT_STRIKE  = 6;
  432.   {$EXTERNALSYM DISPID_FONT_WEIGHT}
  433.   DISPID_FONT_WEIGHT  = 7;
  434.   {$EXTERNALSYM DISPID_FONT_CHARSET}
  435.   DISPID_FONT_CHARSET = 8;
  436.  
  437. { Dispatch ID constants for pictures }
  438.  
  439.   {$EXTERNALSYM DISPID_PICT_HANDLE}
  440.   DISPID_PICT_HANDLE = 0;
  441.   {$EXTERNALSYM DISPID_PICT_HPAL}
  442.   DISPID_PICT_HPAL   = 2;
  443.   {$EXTERNALSYM DISPID_PICT_TYPE}
  444.   DISPID_PICT_TYPE   = 3;
  445.   {$EXTERNALSYM DISPID_PICT_WIDTH}
  446.   DISPID_PICT_WIDTH  = 4;
  447.   {$EXTERNALSYM DISPID_PICT_HEIGHT}
  448.   DISPID_PICT_HEIGHT = 5;
  449.   {$EXTERNALSYM DISPID_PICT_RENDER}
  450.   DISPID_PICT_RENDER = 6;
  451.  
  452. type
  453.  
  454.   PTextMetricOle = PTextMetricW;
  455.   TTextMetricOle = TTextMetricW;
  456.  
  457.   TOleColor = Longint;
  458.  
  459.   {$EXTERNALSYM OLE_XPOS_PIXELS}
  460.   OLE_XPOS_PIXELS  = Longint;
  461.   {$EXTERNALSYM OLE_YPOS_PIXELS}
  462.   OLE_YPOS_PIXELS  = Longint;
  463.   {$EXTERNALSYM OLE_XSIZE_PIXELS}
  464.   OLE_XSIZE_PIXELS = Longint;
  465.   {$EXTERNALSYM OLE_YSIZE_PIXELS}
  466.   OLE_YSIZE_PIXELS = Longint;
  467.  
  468.   {$EXTERNALSYM OLE_XPOS_HIMETRIC}
  469.   OLE_XPOS_HIMETRIC  = Longint;
  470.   {$EXTERNALSYM OLE_YPOS_HIMETRIC}
  471.   OLE_YPOS_HIMETRIC  = Longint;
  472.   {$EXTERNALSYM OLE_XSIZE_HIMETRIC}
  473.   OLE_XSIZE_HIMETRIC = Longint;
  474.   {$EXTERNALSYM OLE_YSIZE_HIMETRIC}
  475.   OLE_YSIZE_HIMETRIC = Longint;
  476.  
  477.   {$EXTERNALSYM OLE_XPOS_CONTAINER}
  478.   OLE_XPOS_CONTAINER  = Single;
  479.   {$EXTERNALSYM OLE_YPOS_CONTAINER}
  480.   OLE_YPOS_CONTAINER  = Single;
  481.   {$EXTERNALSYM OLE_XSIZE_CONTAINER}
  482.   OLE_XSIZE_CONTAINER = Single;
  483.   {$EXTERNALSYM OLE_YSIZE_CONTAINER}
  484.   OLE_YSIZE_CONTAINER = Single;
  485.  
  486.   OLE_TRISTATE = (triUnchecked, triChecked, triGray);
  487.  
  488.   {$EXTERNALSYM OLE_OPTEXCLUSIVE}
  489.   OLE_OPTEXCLUSIVE = Bool;
  490.  
  491.   {$EXTERNALSYM OLE_CANCELBOOL}
  492.   OLE_CANCELBOOL = Bool;
  493.  
  494.   {$EXTERNALSYM OLE_ENABLEDEFAULTBOOL}
  495.   OLE_ENABLEDEFAULTBOOL = Bool;
  496.  
  497.   {$EXTERNALSYM OLE_HANDLE}
  498.   OLE_HANDLE = Longint;
  499.  
  500. { Registration function types }
  501.  
  502.   TDLLRegisterServer = function: HResult stdcall;
  503.   TDLLUnregisterServer = function: HResult stdcall;
  504.  
  505. { TPointF structure }
  506.  
  507.   PPointF = ^TPointF;
  508.   {$EXTERNALSYM tagPOINTFX}
  509.   tagPOINTFX = record
  510.     x: Single;
  511.     y: Single;
  512.   end;
  513.   TPointF = tagPOINTFX;
  514.   {$EXTERNALSYM POINTF}
  515.   POINTF = tagPOINTFX;
  516.  
  517. { TControlInfo structure }
  518.  
  519.   PControlInfo = ^TControlInfo;
  520.   {$EXTERNALSYM tagCONTROLINFO}
  521.   tagCONTROLINFO = record
  522.     cb: Longint;
  523.     hAccel: HAccel;
  524.     cAccel: Word;
  525.     dwFlags: Longint;
  526.   end;
  527.   TControlInfo = tagCONTROLINFO;
  528.   {$EXTERNALSYM CONTROLINFO}
  529.   CONTROLINFO = tagCONTROLINFO;
  530.  
  531. { Forward declarations }
  532.  
  533.   {$EXTERNALSYM IOleControl}
  534.   IOleControl = class;
  535.   {$EXTERNALSYM IOleControlSite}
  536.   IOleControlSite = class;
  537.   {$EXTERNALSYM ISimpleFrameSite}
  538.   ISimpleFrameSite = class;
  539.   {$EXTERNALSYM IPersistStreamInit}
  540.   IPersistStreamInit = class;
  541.   {$EXTERNALSYM IPropertyNotifySink }
  542.   IPropertyNotifySink = class;
  543.   {$EXTERNALSYM IProvideClassInfo }
  544.   IProvideClassInfo = class;
  545.   {$EXTERNALSYM IConnectionPointContainer}
  546.   IConnectionPointContainer = class;
  547.   {$EXTERNALSYM IEnumConnectionPoints}
  548.   IEnumConnectionPoints = class;
  549.   {$EXTERNALSYM IConnectionPoint}
  550.   IConnectionPoint = class;
  551.   {$EXTERNALSYM IEnumConnections}
  552.   IEnumConnections = class;
  553.   {$EXTERNALSYM IClassFactory2 }
  554.   IClassFactory2 = class;
  555.   {$EXTERNALSYM ISpecifyPropertyPages }
  556.   ISpecifyPropertyPages = class;
  557.   {$EXTERNALSYM IPerPropertyBrowsing}
  558.   IPerPropertyBrowsing = class;
  559.   {$EXTERNALSYM IPropertyPageSite}
  560.   IPropertyPageSite = class;
  561.   {$EXTERNALSYM IPropertyPage }
  562.   IPropertyPage = class;
  563.   {$EXTERNALSYM IPropertyPage2 }
  564.   IPropertyPage2 = class;
  565.   {$EXTERNALSYM IFont }
  566.   IFont = class;
  567.   {$EXTERNALSYM IFontDisp}
  568.   IFontDisp = class;
  569.   {$EXTERNALSYM IPicture}
  570.   IPicture = class;
  571.   {$EXTERNALSYM IPictureDisp}
  572.   IPictureDisp = class;
  573.  
  574. { IOleControl interface }
  575.  
  576.   {$EXTERNALSYM IOleControl}
  577.   IOleControl = class(IUnknown)
  578.   public
  579.     function GetControlInfo(var ci: TControlInfo): HResult; virtual; stdcall; abstract;
  580.     function OnMnemonic(msg: PMsg): HResult; virtual; stdcall; abstract;
  581.     function OnAmbientPropertyChange(dispid: TDispID): HResult; virtual; stdcall; abstract;
  582.     function FreezeEvents(bFreeze: BOOL): HResult; virtual; stdcall; abstract;
  583.   end;
  584.  
  585. { IOleControlSite interface }
  586.  
  587.   {$EXTERNALSYM IOleControlSite}
  588.   IOleControlSite = class(IUnknown)
  589.   public
  590.     function OnControlInfoChanged: HResult; virtual; stdcall; abstract;
  591.     function LockInPlaceActive(fLock: BOOL): HResult; virtual; stdcall; abstract;
  592.     function GetExtendedControl(var disp: IDispatch): HResult; virtual; stdcall; abstract;
  593.     function TransformCoords(var ptlHimetric: TPoint; var ptfContainer: TPointF;
  594.       flags: Longint): HResult; virtual; stdcall; abstract;
  595.     function TranslateAccelerator(msg: PMsg; grfModifiers: Longint): HResult;
  596.        virtual; stdcall; abstract;
  597.     function OnFocus(fGotFocus: BOOL): HResult; virtual; stdcall; abstract;
  598.     function ShowPropertyFrame: HResult; virtual; stdcall; abstract;
  599.   end;
  600.  
  601. { ISimpleFrameSite interface }
  602.  
  603.   {$EXTERNALSYM ISimpleFrameSite}
  604.   ISimpleFrameSite = class(IUnknown)
  605.   public
  606.     function PreMessageFilter(wnd: HWnd; msg, wp, lp: Integer;
  607.       var res: Integer; var Cookie: Longint): HResult;
  608.       virtual; stdcall; abstract;
  609.     function PostMessageFilter(wnd: HWnd; msg, wp, lp: Integer;
  610.       var res: Integer; Cookie: Longint): HResult;
  611.       virtual; stdcall; abstract;
  612.   end;
  613.  
  614. { IPersistStreamInit interface }
  615.  
  616.   {$EXTERNALSYM IPersistStreamInit}
  617.   IPersistStreamInit = class(IPersistStream)
  618.   public
  619.     function InitNew: HResult; virtual; stdcall; abstract;
  620.   end;
  621.  
  622. { IPropertyNotifySink interface }
  623.  
  624.   {$EXTERNALSYM IPropertyNotifySink }
  625.   IPropertyNotifySink = class(IUnknown)
  626.   public
  627.     function OnChanged(dispid: TDispID): HResult; virtual; stdcall; abstract;
  628.     function OnRequestEdit(dispid: TDispID): HResult; virtual; stdcall; abstract;
  629.   end;
  630.  
  631. { IProvideClassInfo interface }
  632.  
  633.   {$EXTERNALSYM IProvideClassInfo }
  634.   IProvideClassInfo = class(IUnknown)
  635.   public
  636.     function GetClassInfo(var ti: ITypeInfo): HResult; virtual; stdcall; abstract;
  637.   end;
  638.  
  639. { IConnectionPointContainer interface }
  640.  
  641.   {$EXTERNALSYM IConnectionPointContainer}
  642.   IConnectionPointContainer = class(IUnknown)
  643.   public
  644.     function EnumConnectionPoints(var Enum: IEnumConnectionPoints): HResult;
  645.       virtual; stdcall; abstract;
  646.     function FindConnectionPoint(const iid: TIID;
  647.       var cp: IConnectionPoint): HResult; virtual; stdcall; abstract;
  648.   end;
  649.  
  650. { IEnumConnectionPoints interface }
  651.  
  652.   {$EXTERNALSYM IEnumConnectionPoints}
  653.   IEnumConnectionPoints = class(IUnknown)
  654.   public
  655.     function Next(celt: Longint; var elt;
  656.       pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
  657.     function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
  658.     function Reset: HResult; virtual; stdcall; abstract;
  659.     function Clone(var Enum: IEnumConnectionPoints): HResult;
  660.       virtual; stdcall; abstract;
  661.   end;
  662.  
  663. { IConnectionPoint interface }
  664.  
  665.   {$EXTERNALSYM IConnectionPoint}
  666.   IConnectionPoint = class(IUnknown)
  667.   public
  668.     function GetConnectionInterface(var iid: TIID): HResult; virtual; stdcall; abstract;
  669.     function GetConnectionPointContainer(var cpc: IConnectionPointContainer): HResult;
  670.       virtual; stdcall; abstract;
  671.     function Advise(unkSink: IUnknown; var dwCookie: Longint): HResult; virtual; stdcall; abstract;
  672.     function Unadvise(dwCookie: Longint): HResult; virtual; stdcall; abstract;
  673.     function EnumConnections(var Enum: IEnumConnections): HResult; virtual; stdcall; abstract;
  674.   end;
  675.  
  676. { TConnectData structure }
  677.  
  678.   PConnectData = ^TConnectData;
  679.   {$EXTERNALSYM tagCONNECTDATA}
  680.   tagCONNECTDATA = record
  681.     pUnk: IUnknown;
  682.     dwCookie: Longint;
  683.   end;
  684.   TConnectData = tagCONNECTDATA;
  685.   {$EXTERNALSYM CONNECTDATA}
  686.   CONNECTDATA = tagCONNECTDATA;
  687.  
  688. { IEnumConnections interface }
  689.  
  690.   {$EXTERNALSYM IEnumConnections}
  691.   IEnumConnections = class(IUnknown)
  692.   public
  693.     function Next(celt: Longint; var elt;
  694.       pceltFetched: PLongint): HResult; virtual; stdcall; abstract;
  695.     function Skip(celt: Longint): HResult; virtual; stdcall; abstract;
  696.     function Reset: HResult; virtual; stdcall; abstract;
  697.     function Clone(var Enum: IEnumConnections): HResult; virtual; stdcall; abstract;
  698.   end;
  699.  
  700. { TLicInfo structure }
  701.  
  702.   PLicInfo = ^TLicInfo;
  703.   {$EXTERNALSYM tagLICINFO}
  704.   tagLICINFO = record
  705.     cbLicInfo: Longint;
  706.     fRuntimeKeyAvail: BOOL;
  707.     fLicVerified: BOOL;
  708.   end;
  709.   TLicInfo = tagLICINFO;
  710.   {$EXTERNALSYM LICINFO}
  711.   LICINFO = tagLICINFO;
  712.  
  713. { IClassFactory2 interface }
  714.  
  715.   {$EXTERNALSYM IClassFactory2 }
  716.   IClassFactory2 = class(IClassFactory)
  717.     function GetLicInfo(var licInfo: TLicInfo): HResult; virtual; stdcall; abstract;
  718.     function RequestLicKey(dwResrved: Longint; var bstrKey: TBStr): HResult;
  719.       virtual; stdcall; abstract;
  720.     function CreateInstanceLic(unkOuter: IUnknown; unkReserved: IUnknown;
  721.       const iid: TIID; bstrKey: TBStr; var vObject): HResult; virtual; stdcall; abstract;
  722.   end;
  723.  
  724. { TCAUUID structure - a counted array of TGUID }
  725.  
  726.   PGUIDList = ^TGUIDList;
  727.   TGUIDList = array[0..65535] of TGUID;
  728.  
  729.   PCAGUID = ^TCAGUID;
  730.   TCAGUID = record
  731.     cElems: Longint;
  732.     pElems: PGUIDList;
  733.   end;
  734.  
  735. { TCAPOleStr structure - a counted array of POleStr }
  736.  
  737.   PCAPOleStr = ^TCAPOleStr;
  738.   TCAPOleStr = record
  739.     cElems: Longint;
  740.     pElems: POleStrList;
  741.   end;
  742.  
  743. { TCALongint - a counted array of Longint }
  744.  
  745.   PLongintList = ^TLongintList;
  746.   TLongintList = array[0..65535] of Longint;
  747.  
  748.   PCALongint = ^TCALongint;
  749.   TCALongint = record
  750.     cElems: Longint;
  751.     pElems: PLongintList;
  752.   end;
  753.  
  754. { TOCPFIParams - parameters for OleCreatePropertyFrameIndirect }
  755.  
  756.   POCPFIParams = ^TOCPFIParams;
  757.   {$EXTERNALSYM tagOCPFIPARAMS}
  758.   tagOCPFIPARAMS = record
  759.     cbStructSize: Longint;
  760.     hWndOwner: HWnd;
  761.     x: Integer;
  762.     y: Integer;
  763.     lpszCaption: POleStr;
  764.     cObjects: Longint;
  765.     pObjects: Pointer;
  766.     cPages: Longint;
  767.     pPages: Pointer;
  768.     lcid: TLCID;
  769.     dispidInitialProperty: TDispID;
  770.   end;
  771.   TOCPFIParams = tagOCPFIPARAMS;
  772.   {$EXTERNALSYM OCPFIPARAMS}
  773.   OCPFIPARAMS = tagOCPFIPARAMS;
  774.  
  775. { TPropPageInfo structure - information about a property page }
  776.  
  777.   PPropPageInfo = ^TPropPageInfo;
  778.   {$EXTERNALSYM tagPROPPAGEINFO}
  779.   tagPROPPAGEINFO = record
  780.     cb: Longint;
  781.     pszTitle: POleStr;
  782.     size: TSize;
  783.     pszDocString: POleStr;
  784.     pszHelpFile: POleStr;
  785.     dwHelpContext: Longint;
  786.   end;
  787.   TPropPageInfo = tagPROPPAGEINFO;
  788.   {$EXTERNALSYM PROPPAGEINFO}
  789.   PROPPAGEINFO = tagPROPPAGEINFO;
  790.  
  791. { ISpecifyPropertyPages interface }
  792.  
  793.   {$EXTERNALSYM ISpecifyPropertyPages }
  794.   ISpecifyPropertyPages = class(IUnknown)
  795.   public
  796.     function GetPages(var pages: TCAGUID): HResult; virtual; stdcall; abstract;
  797.   end;
  798.  
  799. { IPerPropertyBrowsing interface }
  800.  
  801.   {$EXTERNALSYM IPerPropertyBrowsing}
  802.   IPerPropertyBrowsing = class(IUnknown)
  803.   public
  804.     function GetDisplayString(dispid: TDispID; var bstr: TBStr): HResult;
  805.       virtual; stdcall; abstract;
  806.     function MapPropertyToPage(dispid: TDispID; var clsid: TCLSID): HResult;
  807.       virtual; stdcall; abstract;
  808.     function GetPredefinedStrings(dispid: TDispID; var caStringsOut: TCAPOleStr;
  809.       var caCookiesOut: TCALongint): HResult; virtual; stdcall; abstract;
  810.     function GetPredefinedValue(dispid: TDispID; dwCookie: Longint;
  811.       var varOut: Variant): HResult; virtual; stdcall; abstract;
  812.   end;
  813.  
  814. { IPropertyPageSite interface }
  815.  
  816.   {$EXTERNALSYM IPropertyPageSite}
  817.   IPropertyPageSite = class(IUnknown)
  818.   public
  819.     function OnStatusChange(flags: Longint): HResult; virtual; stdcall; abstract;
  820.     function GetLocaleID(var localeID: TLCID): HResult; virtual; stdcall; abstract;
  821.     function GetPageContainer(var unk: IUnknown): HResult; virtual; stdcall; abstract;
  822.     function TranslateAccelerator(msg: PMsg): HResult; virtual; stdcall; abstract;
  823.   end;
  824.  
  825. { IPropertyPage interface }
  826.  
  827.   {$EXTERNALSYM IPropertyPage }
  828.   IPropertyPage = class(IUnknown)
  829.   public
  830.     function SetPageSite(pageSite: IPropertyPageSite): HResult; virtual; stdcall; abstract;
  831.     function Activate(hwndParent: HWnd; const rc: TRect; bModal: BOOL): HResult;
  832.       virtual; stdcall; abstract;
  833.     function Deactivate: HResult; virtual; stdcall; abstract;
  834.     function GetPageInfo(var pageInfo: TPropPageInfo): HResult; virtual; stdcall; abstract;
  835.     function SetObjects(cObjects: Longint; unk: IUnknown): HResult; virtual; stdcall; abstract;
  836.     function Show(nCmdShow: Integer): HResult; virtual; stdcall; abstract;
  837.     function Move(const rect: TRect): HResult; virtual; stdcall; abstract;
  838.     function IsPageDirty: HResult; virtual; stdcall; abstract;
  839.     function Apply: HResult; virtual; stdcall; abstract;
  840.     function Help(pszHelpDir: POleStr): HResult; virtual; stdcall; abstract;
  841.     function TranslateAccelerator(msg: PMsg): HResult; virtual; stdcall; abstract;
  842.   end;
  843.  
  844. { IPropertyPage2 interface }
  845.  
  846.   {$EXTERNALSYM IPropertyPage2 }
  847.   IPropertyPage2 = class(IPropertyPage)
  848.   public
  849.     function EditProperty(dispid: TDispID): HResult; virtual; stdcall; abstract;
  850.   end;
  851.  
  852. { IFont interface }
  853.  
  854.   {$EXTERNALSYM IFont }
  855.   IFont = class(IUnknown)
  856.   public
  857.     function get_Name(var name: TBStr): HResult; virtual; stdcall; abstract;
  858.     function put_Name(name: TBStr): HResult; virtual; stdcall; abstract;
  859.     function get_Size(var size: TCurrency): HResult; virtual; stdcall; abstract;
  860.     function put_Size(size: TCurrency): HResult; virtual; stdcall; abstract;
  861.     function get_Bold(var bold: BOOL): HResult; virtual; stdcall; abstract;
  862.     function put_Bold(bold: BOOL): HResult; virtual; stdcall; abstract;
  863.     function get_Italic(var italic: BOOL): HResult; virtual; stdcall; abstract;
  864.     function put_Italic(italic: BOOL): HResult; virtual; stdcall; abstract;
  865.     function get_Underline(var underline: BOOL): HResult; virtual; stdcall; abstract;
  866.     function put_Underline(underline: BOOL): HResult; virtual; stdcall; abstract;
  867.     function get_Strikethrough(var strikethrough: BOOL): HResult; virtual; stdcall; abstract;
  868.     function put_Strikethrough(strikethrough: BOOL): HResult; virtual; stdcall; abstract;
  869.     function get_Weight(var weight: Smallint): HResult; virtual; stdcall; abstract;
  870.     function put_Weight(weight: Smallint): HResult; virtual; stdcall; abstract;
  871.     function get_Charset(var charset: Smallint): HResult; virtual; stdcall; abstract;
  872.     function put_Charset(charset: Smallint): HResult; virtual; stdcall; abstract;
  873.     function get_hFont(var font: HFont): HResult; virtual; stdcall; abstract;
  874.     function Clone(var font: IFont): HResult; virtual; stdcall; abstract;
  875.     function IsEqual(fontOther: IFont): HResult; virtual; stdcall; abstract;
  876.     function SetRatio(cyLogical, cyHimetric: Longint): HResult; virtual; stdcall; abstract;
  877.     function QueryTextMetrics(var tm: TTextMetricOle): HResult; virtual; stdcall; abstract;
  878.     function AddRefHfont(font: HFont): HResult; virtual; stdcall; abstract;
  879.     function ReleaseHfont(font: HFont): HResult; virtual; stdcall; abstract;
  880.   end;
  881.  
  882. { IFontDisp interface }
  883.  
  884.   {$EXTERNALSYM IFontDisp}
  885.   IFontDisp = class(IDispatch);
  886.  
  887. { TFontDesc structure }
  888.  
  889.   PFontDesc = ^TFontDesc;
  890.   {$EXTERNALSYM tagFONTDESC}
  891.   tagFONTDESC = record
  892.     cbSizeofstruct: Integer;
  893.     lpstrName: POleStr;
  894.     cySize: Comp;
  895.     sWeight: Smallint;
  896.     sCharset: Smallint;
  897.     fItalic: BOOL;
  898.     fUnderline: BOOL;
  899.     fStrikethrough: BOOL;
  900.   end;
  901.   TFontDesc = tagFONTDESC;
  902.   {$EXTERNALSYM FONTDESC}
  903.   FONTDESC = tagFONTDESC;
  904.  
  905. { IPicture interface }
  906.  
  907.   {$EXTERNALSYM IPicture}
  908.   IPicture = class(IUnknown)
  909.   public
  910.     function get_Handle(var handle: OLE_HANDLE): HResult;  virtual; stdcall; abstract;
  911.     function get_hPal(var handle: OLE_HANDLE): HResult; virtual; stdcall; abstract;
  912.     function get_Type(var typ: Smallint): HResult; virtual; stdcall; abstract;
  913.     function get_Width(var width: OLE_XSIZE_HIMETRIC): HResult; virtual; stdcall; abstract;
  914.     function get_Height(var height: OLE_YSIZE_HIMETRIC): HResult; virtual; stdcall; abstract;
  915.     function Render(dc: HDC; x, y, cx, cy: Longint;
  916.       xSrc: OLE_XPOS_HIMETRIC; ySrc: OLE_YPOS_HIMETRIC;
  917.       cxSrc: OLE_XSIZE_HIMETRIC; cySrc: OLE_YSIZE_HIMETRIC;
  918.       const rcWBounds: TRect): HResult; virtual; stdcall; abstract;
  919.     function set_hPal(hpal: OLE_HANDLE): HResult; virtual; stdcall; abstract;
  920.     function get_CurDC(var dcOut: HDC): HResult; virtual; stdcall; abstract;
  921.     function SelectPicture(dcIn: HDC; var hdcOut: HDC;
  922.       var bmpOut: OLE_HANDLE): HResult; virtual; stdcall; abstract;
  923.     function get_KeepOriginalFormat(var fkeep: BOOL): HResult; virtual; stdcall; abstract;
  924.     function put_KeepOriginalFormat(fkeep: BOOL): HResult; virtual; stdcall; abstract;
  925.     function PictureChanged: HResult; virtual; stdcall; abstract;
  926.     function SaveAsFile(stream: IStream; fSaveMemCopy: BOOL;
  927.       var cbSize: Longint): HResult; virtual; stdcall; abstract;
  928.     function get_Attributes(dwAttr: Longint): HResult; virtual; stdcall; abstract;
  929.   end;
  930.  
  931. { IPictureDisp interface }
  932.  
  933.   {$EXTERNALSYM IPictureDisp}
  934.   IPictureDisp = class(IDispatch);
  935.  
  936. { TPictDesc structure }
  937.  
  938.   PPictDesc = ^TPictDesc;
  939.   {$EXTERNALSYM tagPICTDESC}
  940.   tagPICTDESC = record
  941.     cbSizeofstruct: Integer;
  942.     picType: Integer;
  943.     case Integer of
  944.       PICTYPE_BITMAP: (
  945.         hbitmap: THandle;       { Bitmap }
  946.         hpal: THandle);         { Accompanying palette }
  947.       PICTYPE_METAFILE: (
  948.         hMeta: THandle;         { Metafile }
  949.         xExt, yExt: Integer);   { Extent }
  950.       PICTYPE_ICON: (
  951.         hIcon: THandle);        { Icon }
  952.   end;
  953.   TPictDesc = tagPICTDESC;
  954.   {$EXTERNALSYM PICTDESC}
  955.   PICTDESC = tagPICTDESC;
  956.  
  957. const
  958.  
  959. { Standard interface IDs }
  960.  
  961.   {$EXTERNALSYM IID_IPropertyNotifySink}
  962.   IID_IPropertyNotifySink: TGUID = (
  963.     D1:$9BFBBC02;D2:$EFF1;D3:$101A;D4:($84,$ED,$00,$AA,$00,$34,$1D,$07));
  964.   {$EXTERNALSYM IID_IClassFactory2}
  965.   IID_IClassFactory2: TGUID = (
  966.     D1:$B196B28F;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  967.   {$EXTERNALSYM IID_IProvideClassInfo}
  968.   IID_IProvideClassInfo: TGUID = (
  969.     D1:$B196B283;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  970.   {$EXTERNALSYM IID_IConnectionPointContainer}
  971.   IID_IConnectionPointContainer: TGUID = (
  972.     D1:$B196B284;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  973.   {$EXTERNALSYM IID_IEnumConnectionPoints}
  974.   IID_IEnumConnectionPoints: TGUID = (
  975.     D1:$B196B285;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  976.   {$EXTERNALSYM IID_IConnectionPoint}
  977.   IID_IConnectionPoint: TGUID = (
  978.     D1:$B196B286;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  979.   {$EXTERNALSYM IID_IEnumConnections}
  980.   IID_IEnumConnections: TGUID = (
  981.     D1:$B196B287;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  982.   {$EXTERNALSYM IID_IOleControl}
  983.   IID_IOleControl: TGUID = (
  984.     D1:$B196B288;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  985.   {$EXTERNALSYM IID_IOleControlSite}
  986.   IID_IOleControlSite: TGUID = (
  987.     D1:$B196B289;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  988.   {$EXTERNALSYM IID_ISimpleFrameSite}
  989.   IID_ISimpleFrameSite: TGUID = (
  990.     D1:$742B0E01;D2:$14E6;D3:$101B;D4:($91,$4E,$00,$AA,$00,$30,$0C,$AB));
  991.   {$EXTERNALSYM IID_IPersistStreamInit}
  992.   IID_IPersistStreamInit: TGUID = (
  993.     D1:$7FD52380;D2:$4E07;D3:$101B;D4:($AE,$2D,$08,$00,$2B,$2E,$C7,$13));
  994.   {$EXTERNALSYM IID_IPropertyFrame}
  995.   IID_IPropertyFrame: TGUID = (
  996.     D1:$B196B28A;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  997.   {$EXTERNALSYM IID_ISpecifyPropertyPages}
  998.   IID_ISpecifyPropertyPages: TGUID = (
  999.     D1:$B196B28B;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  1000.   {$EXTERNALSYM IID_IPerPropertyBrowsing}
  1001.   IID_IPerPropertyBrowsing: TGUID = (
  1002.     D1:$376BD3AA;D2:$3845;D3:$101B;D4:($84,$ED,$08,$00,$2B,$2E,$C7,$13));
  1003.   {$EXTERNALSYM IID_IPropertyPageSite}
  1004.   IID_IPropertyPageSite: TGUID = (
  1005.     D1:$B196B28C;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  1006.   {$EXTERNALSYM IID_IPropertyPage}
  1007.   IID_IPropertyPage: TGUID = (
  1008.     D1:$B196B28D;D2:$BAB4;D3:$101A;D4:($B6,$9C,$00,$AA,$00,$34,$1D,$07));
  1009.   {$EXTERNALSYM IID_IPropertyPage2}
  1010.   IID_IPropertyPage2: TGUID = (
  1011.     D1:$01E44665;D2:$24AC;D3:$101B;D4:($84,$ED,$08,$00,$2B,$2E,$C7,$13));
  1012.   {$EXTERNALSYM IID_IFont}
  1013.   IID_IFont: TGUID = (
  1014.     D1:$BEF6E002;D2:$A874;D3:$101A;D4:($8B,$BA,$00,$AA,$00,$30,$0C,$AB));
  1015.   {$EXTERNALSYM IID_IFontDisp}
  1016.   IID_IFontDisp: TGUID = (
  1017.     D1:$BEF6E003;D2:$A874;D3:$101A;D4:($8B,$BA,$00,$AA,$00,$30,$0C,$AB));
  1018.   {$EXTERNALSYM IID_IPicture}
  1019.   IID_IPicture: TGUID = (
  1020.     D1:$7BF80980;D2:$BF32;D3:$101A;D4:($8B,$BB,$00,$AA,$00,$30,$0C,$AB));
  1021.   {$EXTERNALSYM IID_IPictureDisp}
  1022.   IID_IPictureDisp: TGUID = (
  1023.     D1:$7Bf80981;D2:$BF32;D3:$101A;D4:($8B,$BB,$00,$AA,$00,$30,$0C,$AB));
  1024.  
  1025. { Standard class IDs }
  1026.  
  1027.   CLSID_CFontPropPage: TGUID = (
  1028.     D1:$2542f180;D2:$3532;D3:$1069;D4:($a2,$cd,$00,$aa,$00,$34,$b5,$0b));
  1029.   CLSID_CColorPropPage: TGUID = (
  1030.     D1:$ddf5a600;D2:$b9c0;D3:$101a;D4:($af,$1a,$00,$aa,$00,$34,$b5,$0b));
  1031.   CLSID_CPicturePropPage: TGUID = (
  1032.     D1:$fc7af71d;D2:$fc74;D3:$101a;D4:($84,$ed,$08,$00,$2b,$2e,$c7,$13));
  1033.   CLSID_PersistPropset: TGUID = (
  1034.     D1:$fb8f0821;D2:$0164;D3:$101b;D4:($84,$ed,$08,$00,$2b,$2e,$c7,$13));
  1035.   CLSID_ConvertVBX: TGUID = (
  1036.     D1:$fb8f0822;D2:$0164;D3:$101b;D4:($84,$ed,$08,$00,$2b,$2e,$c7,$13));
  1037.   CLSID_StdFont: TGUID = (
  1038.     D1:$fb8f0823;D2:$0164;D3:$101b;D4:($84,$ed,$08,$00,$2b,$2e,$c7,$13));
  1039.   CLSID_StdPicture: TGUID = (
  1040.     D1:$fb8f0824;D2:$0164;D3:$101b;D4:($84,$ed,$08,$00,$2b,$2e,$c7,$13));
  1041.  
  1042. { Property frame APIs }
  1043.  
  1044. {$EXTERNALSYM OleCreatePropertyFrame}
  1045. function OleCreatePropertyFrame(hwndOwner: HWnd; x, y: Integer;
  1046.   lpszCaption: POleStr; cObjects: Integer; pObjects: Pointer;
  1047.   cPages: Integer; pPageCLSIDs: Pointer; lcid: TLCID; dwReserved: Longint;
  1048.   pvReserved: Pointer): HResult; stdcall;
  1049.  
  1050. {$EXTERNALSYM OleCreatePropertyFrameIndirect}
  1051. function OleCreatePropertyFrameIndirect(var Params: TOCPFIParams): HResult; stdcall;
  1052.  
  1053. { Standard type APIs }
  1054.  
  1055. {$EXTERNALSYM OleTranslateColor}
  1056. function OleTranslateColor(clr: TOleColor; hpal: HPalette;
  1057.  var colorref: TColorRef): HResult; stdcall;
  1058.  
  1059. {$EXTERNALSYM OleCreateFontIndirect}
  1060. function OleCreateFontIndirect(var FontDesc: TFontDesc; const iid: TIID;
  1061.   var vObject): HResult; stdcall;
  1062.  
  1063. {$EXTERNALSYM OleCreatePictureIndirect}
  1064. function OleCreatePictureIndirect(var PictDesc: TPictDesc; const iid: TIID;
  1065.   fOwn: BOOL; var vObject): HResult; stdcall;
  1066.  
  1067. {$EXTERNALSYM OleLoadPicture}
  1068. function OleLoadPicture(stream: IStream; lSize: Longint; fRunmode: BOOL;
  1069.   const iid: TIID; var vObject): HResult; stdcall;
  1070.  
  1071. {$EXTERNALSYM OleIconToCursor}
  1072. function OleIconToCursor(hinstExe: THandle; hIcon: THandle): HCursor; stdcall;
  1073.  
  1074. implementation
  1075.  
  1076. const
  1077.   olepro32 = 'olepro32.dll';
  1078.  
  1079. { Externals from olepro32.dll }
  1080.  
  1081. function OleCreatePropertyFrame;            external olepro32 name 'OleCreatePropertyFrame';
  1082. function OleCreatePropertyFrameIndirect;    external olepro32 name 'OleCreatePropertyFrameIndirect';
  1083. function OleTranslateColor;                 external olepro32 name 'OleTranslateColor';
  1084. function OleCreateFontIndirect;             external olepro32 name 'OleCreateFontIndirect';
  1085. function OleCreatePictureIndirect;          external olepro32 name 'OleCreatePictureIndirect';
  1086. function OleLoadPicture;                    external olepro32 name 'OleLoadPicture';
  1087. function OleIconToCursor;                   external olepro32 name 'OleIconToCursor';
  1088.  
  1089. end.
  1090.