stdole2.pas 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. Unit StdOle2;
  2. // Imported on 24/12/2011 13:43:11 from C:\WINDOWS\system32\stdole2.tlb
  3. // Modified by Ludo Brands to remove redeclarations
  4. // Warning: renamed method 'Reset' in IEnumVARIANT to 'Reset_'
  5. // Warning: renamed property 'Type' in IPicture to 'Type_'
  6. // Warning: 'pointer' not automatable in Picturedisp.Render
  7. // Warning: renamed property 'Type' in Picture to 'Type_'
  8. {$mode delphi}{$H+}
  9. interface
  10. uses Windows, ActiveX, Classes, OleServer, Variants;
  11. Const
  12. stdoleMajorVersion = 2;
  13. stdoleMinorVersion = 0;
  14. LIBID_stdole : TGUID = '{00020430-0000-0000-C000-000000000046}';
  15. IID_IUnknown : TGUID = '{00000000-0000-0000-C000-000000000046}';
  16. IID_IDispatch : TGUID = '{00020400-0000-0000-C000-000000000046}';
  17. IID_IEnumVARIANT : TGUID = '{00020404-0000-0000-C000-000000000046}';
  18. IID_IFont : TGUID = '{BEF6E002-A874-101A-8BBA-00AA00300CAB}';
  19. IID_Font : TGUID = '{BEF6E003-A874-101A-8BBA-00AA00300CAB}';
  20. CLASS_StdFont : TGUID = '{0BE35203-8F91-11CE-9DE3-00AA004BB851}';
  21. IID_IPicture : TGUID = '{7BF80980-BF32-101A-8BBB-00AA00300CAB}';
  22. IID_Picture : TGUID = '{7BF80981-BF32-101A-8BBB-00AA00300CAB}';
  23. CLASS_StdPicture : TGUID = '{0BE35204-8F91-11CE-9DE3-00AA004BB851}';
  24. IID_FontEvents : TGUID = '{4EF6100A-AF88-11D0-9846-00C04FC29993}';
  25. //Enums
  26. Type
  27. OLE_TRISTATE =TOleEnum;
  28. Const
  29. Unchecked = $0000000000000000;
  30. Checked = $0000000000000001;
  31. Gray = $0000000000000002;
  32. Type
  33. LoadPictureConstants =TOleEnum;
  34. Const
  35. Default = $0000000000000000;
  36. Monochrome = $0000000000000001;
  37. VgaColor = $0000000000000002;
  38. Color = $0000000000000004;
  39. //Forward declarations
  40. Type
  41. // for activex aliases see mantis 25907
  42. IEnumVARIANT = ActiveX.IEnumVariant;
  43. IFont = ActiveX.IFont;
  44. Font = dispinterface;
  45. IPicture = ActiveX.IPicture;
  46. Picture = dispinterface;
  47. FontEvents = dispinterface;
  48. //records, unions, aliases
  49. EXCEPINFO = packed record
  50. wCode : Word;
  51. wReserved : Word;
  52. bstrSource : WideString;
  53. bstrDescription : WideString;
  54. bstrHelpFile : WideString;
  55. dwHelpContext : LongWord;
  56. pvReserved : Ppointer;
  57. pfnDeferredFillIn : Ppointer;
  58. scode : SCODE;
  59. end;
  60. OLE_COLOR = LongWord;
  61. OLE_XPOS_PIXELS = Integer;
  62. OLE_YPOS_PIXELS = Integer;
  63. OLE_XSIZE_PIXELS = Integer;
  64. OLE_YSIZE_PIXELS = Integer;
  65. OLE_XPOS_HIMETRIC = Integer;
  66. OLE_YPOS_HIMETRIC = Integer;
  67. OLE_XSIZE_HIMETRIC = Integer;
  68. OLE_YSIZE_HIMETRIC = Integer;
  69. OLE_XPOS_CONTAINER = Single;
  70. OLE_YPOS_CONTAINER = Single;
  71. OLE_XSIZE_CONTAINER = Single;
  72. OLE_YSIZE_CONTAINER = Single;
  73. OLE_HANDLE = SYSINT;
  74. OLE_OPTEXCLUSIVE = WordBool;
  75. OLE_CANCELBOOL = WordBool;
  76. OLE_ENABLEDEFAULTBOOL = WordBool;
  77. FONTNAME = WideString;
  78. FONTSIZE = Currency;
  79. FONTBOLD = WordBool;
  80. FONTITALIC = WordBool;
  81. FONTUNDERSCORE = WordBool;
  82. FONTSTRIKETHROUGH = WordBool;
  83. IFontDisp = Font;
  84. IPictureDisp = Picture;
  85. IFontEventsDisp = FontEvents;
  86. //interface declarations
  87. // Font :
  88. Font = dispinterface
  89. ['{BEF6E003-A874-101A-8BBA-00AA00300CAB}']
  90. // Name :
  91. property Name:WideString dispid 0;
  92. // Size :
  93. property Size:Currency dispid 2;
  94. // Bold :
  95. property Bold:WordBool dispid 3;
  96. // Italic :
  97. property Italic:WordBool dispid 4;
  98. // Underline :
  99. property Underline:WordBool dispid 5;
  100. // Strikethrough :
  101. property Strikethrough:WordBool dispid 6;
  102. // Weight :
  103. property Weight:Smallint dispid 7;
  104. // Charset :
  105. property Charset:Smallint dispid 8;
  106. end;
  107. // Picture :
  108. Picture = dispinterface
  109. ['{7BF80981-BF32-101A-8BBB-00AA00300CAB}']
  110. // Render :
  111. procedure Render(hdc:SYSINT;x:Integer;y:Integer;cx:Integer;cy:Integer;xSrc:OLE_XPOS_HIMETRIC;ySrc:OLE_YPOS_HIMETRIC;cxSrc:OLE_XSIZE_HIMETRIC;cySrc:OLE_YSIZE_HIMETRIC;prcWBounds:{!! pointer !!} OleVariant);dispid 6;
  112. // Handle :
  113. property Handle:OLE_HANDLE dispid 0;
  114. // hPal :
  115. property hPal:OLE_HANDLE dispid 2;
  116. // Type :
  117. property Type_:Smallint dispid 3;
  118. // Width :
  119. property Width:OLE_XSIZE_HIMETRIC dispid 4;
  120. // Height :
  121. property Height:OLE_YSIZE_HIMETRIC dispid 5;
  122. end;
  123. // FontEvents : Event interface for the Font object
  124. FontEvents = dispinterface
  125. ['{4EF6100A-AF88-11D0-9846-00C04FC29993}']
  126. // FontChanged :
  127. procedure FontChanged(PropertyName:WideString);dispid 9;
  128. end;
  129. //CoClasses
  130. CoStdFont =class
  131. class function Create: Font;
  132. class function CreateRemote(const MachineName: string): Font;
  133. end;
  134. CoStdPicture =class
  135. class function Create: Picture;
  136. class function CreateRemote(const MachineName: string): Picture;
  137. end;
  138. implementation
  139. uses comobj;
  140. class function CoStdFont.Create: Font;
  141. begin
  142. Result := CreateComObject(CLASS_StdFont) as Font;
  143. end;
  144. class function CoStdFont.CreateRemote(const MachineName: string): Font;
  145. begin
  146. Result := CreateRemoteComObject(MachineName,CLASS_StdFont) as Font;
  147. end;
  148. class function CoStdPicture.Create: Picture;
  149. begin
  150. Result := CreateComObject(CLASS_StdPicture) as Picture;
  151. end;
  152. class function CoStdPicture.CreateRemote(const MachineName: string): Picture;
  153. begin
  154. Result := CreateRemoteComObject(MachineName,CLASS_StdPicture) as Picture;
  155. end;
  156. end.