home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / classlib / desaware / dwmetric.cls < prev    next >
Encoding:
Text File  |  1996-04-05  |  10.6 KB  |  389 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "dwMetrics"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' Class dwMetrics
  11. ' System Metrics class
  12. ' Copyright (c) 1996 by Desaware Inc.
  13. ' Part of the Desaware API Classes Library
  14.  
  15. ' GetSystemMetrics() codes
  16. Private Const SM_CXSCREEN = 0
  17. Private Const SM_CYSCREEN = 1
  18. Private Const SM_CXVSCROLL = 2
  19. Private Const SM_CYHSCROLL = 3
  20. Private Const SM_CYCAPTION = 4
  21. Private Const SM_CXBORDER = 5
  22. Private Const SM_CYBORDER = 6
  23. Private Const SM_CXDLGFRAME = 7
  24. Private Const SM_CYDLGFRAME = 8
  25. Private Const SM_CYVTHUMB = 9
  26. Private Const SM_CXHTHUMB = 10
  27. Private Const SM_CXICON = 11
  28. Private Const SM_CYICON = 12
  29. Private Const SM_CXCURSOR = 13
  30. Private Const SM_CYCURSOR = 14
  31. Private Const SM_CYMENU = 15
  32. Private Const SM_CXFULLSCREEN = 16
  33. Private Const SM_CYFULLSCREEN = 17
  34. Private Const SM_CYKANJIWINDOW = 18
  35. Private Const SM_MOUSEPRESENT = 19
  36. Private Const SM_CYVSCROLL = 20
  37. Private Const SM_CXHSCROLL = 21
  38. Private Const SM_DEBUG = 22
  39. Private Const SM_SWAPBUTTON = 23
  40. Private Const SM_RESERVED1 = 24
  41. Private Const SM_RESERVED2 = 25
  42. Private Const SM_RESERVED3 = 26
  43. Private Const SM_RESERVED4 = 27
  44. Private Const SM_CXMIN = 28
  45. Private Const SM_CYMIN = 29
  46. Private Const SM_CXSIZE = 30
  47. Private Const SM_CYSIZE = 31
  48. Private Const SM_CXFRAME = 32
  49. Private Const SM_CYFRAME = 33
  50. Private Const SM_CXMINTRACK = 34
  51. Private Const SM_CYMINTRACK = 35
  52. Private Const SM_CXDOUBLECLK = 36
  53. Private Const SM_CYDOUBLECLK = 37
  54. Private Const SM_CXICONSPACING = 38
  55. Private Const SM_CYICONSPACING = 39
  56. Private Const SM_MENUDROPALIGNMENT = 40
  57. Private Const SM_PENWINDOWS = 41
  58. Private Const SM_DBCSENABLED = 42
  59. Private Const SM_CMOUSEBUTTONS = 43
  60. Private Const SM_CMETRICS = 44
  61. Private Const SM_ARRANGE = 56
  62. Private Const SM_CLEANBOOT = 67
  63. Private Const SM_CXDRAG = 68
  64. Private Const SM_CXEDGE = 45
  65. Private Const SM_CXFIXEDFRAME = SM_CXDLGFRAME
  66. Private Const SM_CXMAXIMIZED = 61
  67. Private Const SM_CXMAXTRACK = 59
  68. Private Const SM_CXMENUCHECK = 71
  69. Private Const SM_CXMENUSIZE = 54
  70. Private Const SM_CXMINIMIZED = 57
  71. Private Const SM_CXMINSPACING = 47
  72. Private Const SM_CXSIZEFRAME = SM_CXFRAME
  73. Private Const SM_CXSMICON = 49
  74. Private Const SM_CXSMSIZE = 52
  75. Private Const SM_CYDRAG = 69
  76. Private Const SM_CYEDGE = 46
  77. Private Const SM_CYFIXEDFRAME = SM_CYDLGFRAME
  78. Private Const SM_CYMAXIMIZED = 62
  79. Private Const SM_CYMAXTRACK = 60
  80. Private Const SM_CYMENUCHECK = 72
  81. Private Const SM_CYMENUSIZE = 55
  82. Private Const SM_CYMINIMIZED = 58
  83. Private Const SM_CYMINSPACING = 48
  84. Private Const SM_CYSIZEFRAME = SM_CYFRAME
  85. Private Const SM_CYSMCAPTION = 51
  86. Private Const SM_CYSMICON = 50
  87. Private Const SM_CYSMSIZE = 53
  88. Private Const SM_MIDEASTENABLED = 74
  89. Private Const SM_NETWORK = 63
  90. Private Const SM_SECURE = 44
  91. Private Const SM_SLOWMACHINE = 73
  92.  
  93. #If Win32 Then
  94. Private Declare Function GetSystemMetrics& Lib "user32" (ByVal nIndex As Long)
  95. Attribute GetSystemMetrics.VB_HelpID = 2884
  96. Attribute GetSystemMetrics.VB_Description = "Help available in Visual Basic Programmer's Guide to Win32 API CD ROM"
  97. #Else
  98. Private Declare Function GetSystemMetrics% Lib "user" (ByVal nIndex%)
  99. #End If
  100.  
  101.  
  102. Public Property Get CXSCREEN() As Long
  103.     CXSCREEN = GetSystemMetrics(SM_CXSCREEN)
  104. End Property
  105.  
  106. Public Property Get CYSCREEN() As Long
  107.     CYSCREEN = GetSystemMetrics(SM_CYSCREEN)
  108. End Property
  109.  
  110. Public Property Get CXVSCROLL() As Long
  111.     CXVSCROLL = GetSystemMetrics(SM_CXVSCROLL)
  112. End Property
  113.  
  114. Public Property Get CYHSCROLL() As Long
  115.     CYHSCROLL = GetSystemMetrics(SM_CYHSCROLL)
  116. End Property
  117.  
  118. Public Property Get CYCAPTION() As Long
  119.     CYCAPTION = GetSystemMetrics(SM_CYCAPTION)
  120. End Property
  121.  
  122. Public Property Get CXBORDER() As Long
  123.     CXBORDER = GetSystemMetrics(SM_CXBORDER)
  124. End Property
  125.  
  126. Public Property Get CYBORDER() As Long
  127.     CYBORDER = GetSystemMetrics(SM_CYBORDER)
  128. End Property
  129.  
  130. Public Property Get CXDLGFRAME() As Long
  131.     CXDLGFRAME = GetSystemMetrics(SM_CXDLGFRAME)
  132. End Property
  133.  
  134. Public Property Get CYDLGFRAME() As Long
  135.     CYDLGFRAME = GetSystemMetrics(SM_CYDLGFRAME)
  136. End Property
  137.  
  138. Public Property Get CYVTHUMB() As Long
  139.     CYVTHUMB = GetSystemMetrics(SM_CYVTHUMB)
  140. End Property
  141.  
  142. Public Property Get CXHTHUMB() As Long
  143.     CXHTHUMB = GetSystemMetrics(SM_CXHTHUMB)
  144. End Property
  145.  
  146. Public Property Get CXICON() As Long
  147.     CXICON = GetSystemMetrics(SM_CXICON)
  148. End Property
  149.  
  150. Public Property Get CYICON() As Long
  151.     CYICON = GetSystemMetrics(SM_CYICON)
  152. End Property
  153.  
  154. Public Property Get CXCURSOR() As Long
  155.     CXCURSOR = GetSystemMetrics(SM_CXCURSOR)
  156. End Property
  157.  
  158. Public Property Get CYCURSOR() As Long
  159.     CYCURSOR = GetSystemMetrics(SM_CYCURSOR)
  160. End Property
  161.  
  162. Public Property Get CYMENU() As Long
  163.     CYMENU = GetSystemMetrics(SM_CYMENU)
  164. End Property
  165.  
  166. Public Property Get CXFULLSCREEN() As Long
  167.     CXFULLSCREEN = GetSystemMetrics(SM_CXFULLSCREEN)
  168. End Property
  169.  
  170. Public Property Get CYFULLSCREEN() As Long
  171.     CYFULLSCREEN = GetSystemMetrics(SM_CYFULLSCREEN)
  172. End Property
  173.  
  174. Public Property Get CYKANJIWINDOW() As Long
  175.     CYKANJIWINDOW = GetSystemMetrics(SM_CYKANJIWINDOW)
  176. End Property
  177.  
  178. Public Property Get MOUSEPRESENT() As Long
  179.     MOUSEPRESENT = GetSystemMetrics(SM_MOUSEPRESENT)
  180. End Property
  181.  
  182. Public Property Get CYVSCROLL() As Long
  183.     CYVSCROLL = GetSystemMetrics(SM_CYVSCROLL)
  184. End Property
  185.  
  186. Public Property Get CXHSCROLL() As Long
  187.     CXHSCROLL = GetSystemMetrics(SM_CXHSCROLL)
  188. End Property
  189.  
  190. Public Property Get DEBUGAPI() As Long
  191.     DEBUGAPI = GetSystemMetrics(SM_DEBUG)
  192. End Property
  193.  
  194. Public Property Get SWAPBUTTON() As Long
  195.     SWAPBUTTON = GetSystemMetrics(SM_SWAPBUTTON)
  196. End Property
  197.  
  198. Public Property Get CXMIN() As Long
  199.     CXMIN = GetSystemMetrics(SM_CXMIN)
  200. End Property
  201.  
  202. Public Property Get CYMIN() As Long
  203.     CYMIN = GetSystemMetrics(SM_CYMIN)
  204. End Property
  205.  
  206. Public Property Get CXSIZE() As Long
  207.     CXSIZE = GetSystemMetrics(SM_CXSIZE)
  208. End Property
  209.  
  210. Public Property Get CYSIZE() As Long
  211.     CYSIZE = GetSystemMetrics(SM_CYSIZE)
  212. End Property
  213.  
  214. Public Property Get CXFRAME() As Long
  215.     CXFRAME = GetSystemMetrics(SM_CXFRAME)
  216. End Property
  217.  
  218. Public Property Get CYFRAME() As Long
  219.     CYFRAME = GetSystemMetrics(SM_CYFRAME)
  220. End Property
  221.  
  222. Public Property Get CXMINTRACK() As Long
  223.     CXMINTRACK = GetSystemMetrics(SM_CXMINTRACK)
  224. End Property
  225.  
  226. Public Property Get CYMINTRACK() As Long
  227.     CYMINTRACK = GetSystemMetrics(SM_CYMINTRACK)
  228. End Property
  229.  
  230. Public Property Get CXDOUBLECLK() As Long
  231.     CXDOUBLECLK = GetSystemMetrics(SM_CXDOUBLECLK)
  232. End Property
  233.  
  234. Public Property Get CYDOUBLECLK() As Long
  235.     CYDOUBLECLK = GetSystemMetrics(SM_CYDOUBLECLK)
  236. End Property
  237.  
  238. Public Property Get CXICONSPACING() As Long
  239.     CXICONSPACING = GetSystemMetrics(SM_CXICONSPACING)
  240. End Property
  241.  
  242. Public Property Get CYICONSPACING() As Long
  243.     CYICONSPACING = GetSystemMetrics(SM_CYICONSPACING)
  244. End Property
  245.  
  246. Public Property Get MENUDROPALIGNMENT() As Long
  247.     MENUDROPALIGNMENT = GetSystemMetrics(SM_MENUDROPALIGNMENT)
  248. End Property
  249.  
  250. Public Property Get PENWINDOWS() As Long
  251.     PENWINDOWS = GetSystemMetrics(SM_PENWINDOWS)
  252. End Property
  253.  
  254. Public Property Get DBCSENABLED() As Long
  255.     DBCSENABLED = GetSystemMetrics(SM_DBCSENABLED)
  256. End Property
  257.  
  258. Public Property Get CMOUSEBUTTONS() As Long
  259.     CMOUSEBUTTONS = GetSystemMetrics(SM_CMOUSEBUTTONS)
  260. End Property
  261.  
  262. Public Property Get CMETRICS() As Long
  263.     CMETRICS = GetSystemMetrics(SM_CMETRICS)
  264. End Property
  265.  
  266. Public Property Get ARRANGE() As Long
  267.     ARRANGE = GetSystemMetrics(SM_ARRANGE)
  268. End Property
  269.  
  270. Public Property Get CLEANBOOT() As Long
  271.     CLEANBOOT = GetSystemMetrics(SM_CLEANBOOT)
  272. End Property
  273.  
  274. Public Property Get CXDRAG() As Long
  275.     CXDRAG = GetSystemMetrics(SM_CXDRAG)
  276. End Property
  277.  
  278. Public Property Get CXEDGE() As Long
  279.     CXEDGE = GetSystemMetrics(SM_CXEDGE)
  280. End Property
  281.  
  282. Public Property Get CXFIXEDFRAME() As Long
  283.     CXFIXEDFRAME = GetSystemMetrics(SM_CXFIXEDFRAME)
  284. End Property
  285.  
  286. Public Property Get CXMAXIMIZED() As Long
  287.     CXMAXIMIZED = GetSystemMetrics(SM_CXMAXIMIZED)
  288. End Property
  289.  
  290. Public Property Get CXMAXTRACK() As Long
  291.     CXMAXTRACK = GetSystemMetrics(SM_CXMAXTRACK)
  292. End Property
  293.  
  294. Public Property Get CXMENUCHECK() As Long
  295.     CXMENUCHECK = GetSystemMetrics(SM_CXMENUCHECK)
  296. End Property
  297.  
  298. Public Property Get CXMENUSIZE() As Long
  299.     CXMENUSIZE = GetSystemMetrics(SM_CXMENUSIZE)
  300. End Property
  301.  
  302. Public Property Get CXMINIMIZED() As Long
  303.     CXMINIMIZED = GetSystemMetrics(SM_CXMINIMIZED)
  304. End Property
  305.  
  306. Public Property Get CXMINSPACING() As Long
  307.     CXMINSPACING = GetSystemMetrics(SM_CXMINSPACING)
  308. End Property
  309.  
  310. Public Property Get CXSIZEFRAME() As Long
  311.     CXSIZEFRAME = GetSystemMetrics(SM_CXSIZEFRAME)
  312. End Property
  313.  
  314. Public Property Get CXSMICON() As Long
  315.     CXSMICON = GetSystemMetrics(SM_CXSMICON)
  316. End Property
  317.  
  318. Public Property Get CXSMSIZE() As Long
  319.     CXSMSIZE = GetSystemMetrics(SM_CXSMSIZE)
  320. End Property
  321.  
  322. Public Property Get CYDRAG() As Long
  323.      CYDRAG = GetSystemMetrics(SM_CYDRAG)
  324. End Property
  325.  
  326. Public Property Get CYEDGE() As Long
  327.     CYEDGE = GetSystemMetrics(SM_CYEDGE)
  328. End Property
  329.  
  330. Public Property Get CYFIXEDFRAME() As Long
  331.     CYFIXEDFRAME = GetSystemMetrics(SM_CYFIXEDFRAME)
  332. End Property
  333.  
  334. Public Property Get CYMAXIMIZED() As Long
  335.     CYMAXIMIZED = GetSystemMetrics(SM_CYMAXIMIZED)
  336. End Property
  337.  
  338. Public Property Get CYMAXTRACK() As Long
  339.     CYMAXTRACK = GetSystemMetrics(SM_CYMAXTRACK)
  340. End Property
  341.  
  342. Public Property Get CYMENUCHECK() As Long
  343.     CYMENUCHECK = GetSystemMetrics(SM_CYMENUCHECK)
  344. End Property
  345.  
  346. Public Property Get CYMENUSIZE() As Long
  347.     CYMENUSIZE = GetSystemMetrics(SM_CYMENUSIZE)
  348. End Property
  349.  
  350. Public Property Get CYMINIMIZED() As Long
  351.     CYMINIMIZED = GetSystemMetrics(SM_CYMINIMIZED)
  352. End Property
  353.  
  354. Public Property Get CYMINSPACING() As Long
  355.     CYMINSPACING = GetSystemMetrics(SM_CYMINSPACING)
  356. End Property
  357.  
  358. Public Property Get CYSIZEFRAME() As Long
  359.     CYSIZEFRAME = GetSystemMetrics(SM_CYSIZEFRAME)
  360. End Property
  361.  
  362. Public Property Get CYSMCAPTION() As Long
  363.     CYSMCAPTION = GetSystemMetrics(SM_CYSMCAPTION)
  364. End Property
  365.  
  366. Public Property Get CYSMICON() As Long
  367.     CYSMICON = GetSystemMetrics(SM_CYSMICON)
  368. End Property
  369.  
  370. Public Property Get CYSMSIZE() As Long
  371.     CYSMSIZE = GetSystemMetrics(SM_CYSMSIZE)
  372. End Property
  373.  
  374. Public Property Get MIDEASTENABLED() As Long
  375.     MIDEASTENABLED = GetSystemMetrics(SM_MIDEASTENABLED)
  376. End Property
  377.  
  378. Public Property Get NETWORK() As Long
  379.     NETWORK = GetSystemMetrics(SM_NETWORK)
  380. End Property
  381.  
  382. Public Property Get SECURE() As Long
  383.     SECURE = GetSystemMetrics(SM_SECURE)
  384. End Property
  385.  
  386. Public Property Get SLOWMACHINE() As Long
  387.     SLOWMACHINE = GetSystemMetrics(SM_SLOWMACHINE)
  388. End Property
  389.