Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for getsystemmetricsdll.cs

(view source code of getsystemmetricsdll.cs as plain text)

  1. using System;
  2. using System.Diagnostics;
  3. using System.IO;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6.  
  7.  
  8. namespace RobvanderWoude
  9. {
  10. 	[InterfaceType( ComInterfaceType.InterfaceIsIDispatch )]
  11. 	public interface _GetSystemMetricsDLL
  12. 	{
  13. 		[DispId( 1 )]
  14. 		string GetHelp( );
  15.  
  16. 		[DispId( 2 )]
  17. 		int GetPropertyValue( object property );
  18.  
  19. 		[DispId( 3 )]
  20. 		string GetVersion( );
  21.  
  22. 		[DispId( 4 )]
  23. 		string ListPropertyNames( );
  24.  
  25. 		[DispId( 5 )]
  26. 		string ListPropertyValues( );
  27. 	}
  28.  
  29.  
  30. 	[ComVisible( true )]
  31. 	[ClassInterface( ClassInterfaceType.AutoDispatch )]
  32. 	[ProgId( "RobvanderWoude.GetSystemMetrics" )]
  33. 	public class GetSystemMetricsDLL : _GetSystemMetricsDLL
  34. 	{
  35. 		private static string mypath = Assembly.GetAssembly( typeof( RobvanderWoude.GetSystemMetricsDLL ) ).Location.ToString( );
  36.  
  37.  
  38. 		public string GetHelp( )
  39. 		{
  40. 			string helptemplate = "{0}, Version {1}\n{2}\n\nUsage in VBScript:\n\n";
  41. 			helptemplate += "Set objSystemMetrics = CreateObject( \"RobvanderWoude.GetSystemMetricsDLL\" )\n\n";
  42. 			helptemplate += "' Read some property values\n";
  43. 			helptemplate += "WScript.Echo objSystemMetrics.SM_CXSCREEN\n";
  44. 			helptemplate += "WScript.Echo objSystemMetrics.SM_CMONITORS\n";
  45. 			helptemplate += "WScript.Echo objSystemMetrics.GetPropertyValue( \"SM_CMONITORS\" )\n\n";
  46. 			helptemplate += "' Get the DLL's version\n";
  47. 			helptemplate += "WScript.Echo objSystemMetrics.GetVersion( )\n\n";
  48. 			helptemplate += "' List all available property names\n";
  49. 			helptemplate += "WScript.Echo objSystemMetrics.ListPropertyNames( )\n\n";
  50. 			helptemplate += "' List all property names and their values\n";
  51. 			helptemplate += "Wscript.Echo objSystemMetrics.ListPropertyValues( )\n\n";
  52. 			helptemplate += "' Show this help text\n";
  53. 			helptemplate += "Wscript.Echo objSystemMetrics.GetHelp( )\n\n";
  54. 			helptemplate += "Note:     All property values are returned as 32-bit integer.\n\n";
  55. 			helptemplate += "          The meaning of the returned metric values can be found at\n";
  56. 			helptemplate += "          https://msdn.microsoft.com/library/windows/desktop/ms724385.aspx\n\n";
  57. 			helptemplate += "Credits:  SystemMetric enumeration published by Gabriel T. Sharp on PInvoke.net\n";
  58. 			helptemplate += "          http://pinvoke.net/default.aspx/Enums/SystemMetric.html\n\n";
  59. 			helptemplate += "{3}\n";
  60. 			helptemplate += "http://www.robvanderwoude.com\n";
  61. 			FileVersionInfo myfileversioninfo = FileVersionInfo.GetVersionInfo( mypath );
  62. 			string filename = Path.GetFileName( myfileversioninfo.FileName );
  63. 			string fileversion = myfileversioninfo.FileVersion;
  64. 			string filecomment = myfileversioninfo.Comments;
  65. 			string copyrights = myfileversioninfo.LegalCopyright.Replace( "\u00E9", "(C)" );
  66. 			string description = String.Format( helptemplate, filename, fileversion, filecomment, copyrights );
  67. 			return description;
  68. 		}
  69.  
  70.  
  71. 		public int GetPropertyValue( object property )
  72. 		{
  73. 			try
  74. 			{
  75. 				int propertynumber = (int) Enum.Parse( typeof( SystemMetric ), property.ToString( ) );
  76. 				return Convert.ToInt32( this.GetType( ).GetProperty( Enum.GetName( typeof( SystemMetric ), propertynumber ) ).GetValue( this, null ) );
  77. 			}
  78. 			catch
  79. 			{
  80. 				return -1;
  81. 			}
  82. 		}
  83.  
  84.  
  85. 		public string GetVersion( )
  86. 		{
  87. 			return FileVersionInfo.GetVersionInfo( mypath ).FileVersion;
  88. 		}
  89.  
  90.  
  91. 		public string ListPropertyNames( )
  92. 		{
  93. 			string result = String.Empty;
  94. 			foreach ( PropertyInfo property in this.GetType( ).GetProperties( ) )
  95. 			{
  96. 				result += property.Name + "\n";
  97. 			}
  98. 			return result;
  99. 		}
  100.  
  101.  
  102. 		public string ListPropertyValues( )
  103. 		{
  104. 			string result = String.Empty;
  105. 			foreach ( PropertyInfo property in this.GetType( ).GetProperties( ) )
  106. 			{
  107. 				string val = String.Empty;
  108. 				try
  109. 				{
  110. 					val = property.GetValue( this, null ).ToString( );
  111. 				}
  112. 				catch { };
  113. 				result += String.Format( "{0}={1}\n", property.Name, val );
  114. 			}
  115. 			return result;
  116. 		}
  117.  
  118.  
  119. 		#region Properties
  120.  
  121.  
  122. 		public int SM_ARRANGE
  123. 		{
  124. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_ARRANGE ) ); }
  125. 		}
  126.  
  127.  
  128. 		public int SM_CLEANBOOT
  129. 		{
  130. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CLEANBOOT ) ); }
  131. 		}
  132.  
  133.  
  134. 		public int SM_CMONITORS
  135. 		{
  136. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CMONITORS ) ); }
  137. 		}
  138.  
  139.  
  140. 		public int SM_CMOUSEBUTTONS
  141. 		{
  142. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CMOUSEBUTTONS ) ); }
  143. 		}
  144.  
  145.  
  146. 		public int SM_CXBORDER
  147. 		{
  148. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXBORDER ) ); }
  149. 		}
  150.  
  151.  
  152. 		public int SM_CXCURSOR
  153. 		{
  154. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXCURSOR ) ); }
  155. 		}
  156.  
  157.  
  158. 		public int SM_CXDLGFRAME
  159. 		{
  160. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXDLGFRAME ) ); }
  161. 		}
  162.  
  163.  
  164. 		public int SM_CXDOUBLECLK
  165. 		{
  166. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXDOUBLECLK ) ); }
  167. 		}
  168.  
  169.  
  170. 		public int SM_CXDRAG
  171. 		{
  172. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXDRAG ) ); }
  173. 		}
  174.  
  175.  
  176. 		public int SM_CXEDGE
  177. 		{
  178. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXEDGE ) ); }
  179. 		}
  180.  
  181.  
  182. 		public int SM_CXFIXEDFRAME
  183. 		{
  184. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXFIXEDFRAME ) ); }
  185. 		}
  186.  
  187.  
  188. 		public int SM_CXFOCUSBORDER
  189. 		{
  190. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXFOCUSBORDER ) ); }
  191. 		}
  192.  
  193.  
  194. 		public int SM_CXFRAME
  195. 		{
  196. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXFRAME ) ); }
  197. 		}
  198.  
  199.  
  200. 		public int SM_CXFULLSCREEN
  201. 		{
  202. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXFULLSCREEN ) ); }
  203. 		}
  204.  
  205.  
  206. 		public int SM_CXHSCROLL
  207. 		{
  208. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXHSCROLL ) ); }
  209. 		}
  210.  
  211.  
  212. 		public int SM_CXHTHUMB
  213. 		{
  214. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXHTHUMB ) ); }
  215. 		}
  216.  
  217.  
  218. 		public int SM_CXICON
  219. 		{
  220. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXICON ) ); }
  221. 		}
  222.  
  223.  
  224. 		public int SM_CXICONSPACING
  225. 		{
  226. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXICONSPACING ) ); }
  227. 		}
  228.  
  229.  
  230. 		public int SM_CXMAXIMIZED
  231. 		{
  232. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMAXIMIZED ) ); }
  233. 		}
  234.  
  235.  
  236. 		public int SM_CXMAXTRACK
  237. 		{
  238. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMAXTRACK ) ); }
  239. 		}
  240.  
  241.  
  242. 		public int SM_CXMENUCHECK
  243. 		{
  244. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMENUCHECK ) ); }
  245. 		}
  246.  
  247.  
  248. 		public int SM_CXMENUSIZE
  249. 		{
  250. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMENUSIZE ) ); }
  251. 		}
  252.  
  253.  
  254. 		public int SM_CXMIN
  255. 		{
  256. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMIN ) ); }
  257. 		}
  258.  
  259.  
  260. 		public int SM_CXMINIMIZED
  261. 		{
  262. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMINIMIZED ) ); }
  263. 		}
  264.  
  265.  
  266. 		public int SM_CXMINSPACING
  267. 		{
  268. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMINSPACING ) ); }
  269. 		}
  270.  
  271.  
  272. 		public int SM_CXMINTRACK
  273. 		{
  274. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXMINTRACK ) ); }
  275. 		}
  276.  
  277.  
  278. 		public int SM_CXPADDEDBORDER
  279. 		{
  280. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXPADDEDBORDER ) ); }
  281. 		}
  282.  
  283.  
  284. 		public int SM_CXSCREEN
  285. 		{
  286. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXSCREEN ) ); }
  287. 		}
  288.  
  289.  
  290. 		public int SM_CXSIZE
  291. 		{
  292. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXSIZE ) ); }
  293. 		}
  294.  
  295.  
  296. 		public int SM_CXSIZEFRAME
  297. 		{
  298. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXSIZEFRAME ) ); }
  299. 		}
  300.  
  301.  
  302. 		public int SM_CXSMICON
  303. 		{
  304. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXSMICON ) ); }
  305. 		}
  306.  
  307.  
  308. 		public int SM_CXSMSIZE
  309. 		{
  310. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXSMSIZE ) ); }
  311. 		}
  312.  
  313.  
  314. 		public int SM_CXVIRTUALSCREEN
  315. 		{
  316. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXVIRTUALSCREEN ) ); }
  317. 		}
  318.  
  319.  
  320. 		public int SM_CXVSCROLL
  321. 		{
  322. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CXVSCROLL ) ); }
  323. 		}
  324.  
  325.  
  326. 		public int SM_CYBORDER
  327. 		{
  328. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYBORDER ) ); }
  329. 		}
  330.  
  331.  
  332. 		public int SM_CYCAPTION
  333. 		{
  334. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYCAPTION ) ); }
  335. 		}
  336.  
  337.  
  338. 		public int SM_CYCURSOR
  339. 		{
  340. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYCURSOR ) ); }
  341. 		}
  342.  
  343.  
  344. 		public int SM_CYDLGFRAME
  345. 		{
  346. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYDLGFRAME ) ); }
  347. 		}
  348.  
  349.  
  350. 		public int SM_CYDOUBLECLK
  351. 		{
  352. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYDOUBLECLK ) ); }
  353. 		}
  354.  
  355.  
  356. 		public int SM_CYDRAG
  357. 		{
  358. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYDRAG ) ); }
  359. 		}
  360.  
  361.  
  362. 		public int SM_CYEDGE
  363. 		{
  364. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYEDGE ) ); }
  365. 		}
  366.  
  367.  
  368. 		public int SM_CYFIXEDFRAME
  369. 		{
  370. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYFIXEDFRAME ) ); }
  371. 		}
  372.  
  373.  
  374. 		public int SM_CYFOCUSBORDER
  375. 		{
  376. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYFOCUSBORDER ) ); }
  377. 		}
  378.  
  379.  
  380. 		public int SM_CYFRAME
  381. 		{
  382. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYFRAME ) ); }
  383. 		}
  384.  
  385.  
  386. 		public int SM_CYFULLSCREEN
  387. 		{
  388. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYFULLSCREEN ) ); }
  389. 		}
  390.  
  391.  
  392. 		public int SM_CYHSCROLL
  393. 		{
  394. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYHSCROLL ) ); }
  395. 		}
  396.  
  397.  
  398. 		public int SM_CYICON
  399. 		{
  400. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYICON ) ); }
  401. 		}
  402.  
  403.  
  404. 		public int SM_CYICONSPACING
  405. 		{
  406. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYICONSPACING ) ); }
  407. 		}
  408.  
  409.  
  410. 		public int SM_CYKANJIWINDOW
  411. 		{
  412. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYKANJIWINDOW ) ); }
  413. 		}
  414.  
  415.  
  416. 		public int SM_CYMAXIMIZED
  417. 		{
  418. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMAXIMIZED ) ); }
  419. 		}
  420.  
  421.  
  422. 		public int SM_CYMAXTRACK
  423. 		{
  424. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMAXTRACK ) ); }
  425. 		}
  426.  
  427.  
  428. 		public int SM_CYMENU
  429. 		{
  430. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMENU ) ); }
  431. 		}
  432.  
  433.  
  434. 		public int SM_CYMENUCHECK
  435. 		{
  436. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMENUCHECK ) ); }
  437. 		}
  438.  
  439.  
  440. 		public int SM_CYMENUSIZE
  441. 		{
  442. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMENUSIZE ) ); }
  443. 		}
  444.  
  445.  
  446. 		public int SM_CYMIN
  447. 		{
  448. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMIN ) ); }
  449. 		}
  450.  
  451.  
  452. 		public int SM_CYMINIMIZED
  453. 		{
  454. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMINIMIZED ) ); }
  455. 		}
  456.  
  457.  
  458. 		public int SM_CYMINSPACING
  459. 		{
  460. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMINSPACING ) ); }
  461. 		}
  462.  
  463.  
  464. 		public int SM_CYMINTRACK
  465. 		{
  466. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYMINTRACK ) ); }
  467. 		}
  468.  
  469.  
  470. 		public int SM_CYSCREEN
  471. 		{
  472. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSCREEN ) ); }
  473. 		}
  474.  
  475.  
  476. 		public int SM_CYSIZE
  477. 		{
  478. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSIZE ) ); }
  479. 		}
  480.  
  481.  
  482. 		public int SM_CYSIZEFRAME
  483. 		{
  484. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSIZEFRAME ) ); }
  485. 		}
  486.  
  487.  
  488. 		public int SM_CYSMCAPTION
  489. 		{
  490. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSMCAPTION ) ); }
  491. 		}
  492.  
  493.  
  494. 		public int SM_CYSMICON
  495. 		{
  496. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSMICON ) ); }
  497. 		}
  498.  
  499.  
  500. 		public int SM_CYSMSIZE
  501. 		{
  502. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYSMSIZE ) ); }
  503. 		}
  504.  
  505.  
  506. 		public int SM_CYVIRTUALSCREEN
  507. 		{
  508. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYVIRTUALSCREEN ) ); }
  509. 		}
  510.  
  511.  
  512. 		public int SM_CYVSCROLL
  513. 		{
  514. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYVSCROLL ) ); }
  515. 		}
  516.  
  517.  
  518. 		public int SM_CYVTHUMB
  519. 		{
  520. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_CYVTHUMB ) ); }
  521. 		}
  522.  
  523.  
  524. 		public int SM_DBCSENABLED
  525. 		{
  526. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_DBCSENABLED ) ); }
  527. 		}
  528.  
  529.  
  530. 		public int SM_DEBUG
  531. 		{
  532. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_DEBUG ) ); }
  533. 		}
  534.  
  535.  
  536. 		public int SM_DIGITIZER
  537. 		{
  538. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_DIGITIZER ) ); }
  539. 		}
  540.  
  541.  
  542. 		public int SM_IMMENABLED
  543. 		{
  544. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_IMMENABLED ) ); }
  545. 		}
  546.  
  547.  
  548. 		public int SM_MAXIMUMTOUCHES
  549. 		{
  550. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MAXIMUMTOUCHES ) ); }
  551. 		}
  552.  
  553.  
  554. 		public int SM_MEDIACENTER
  555. 		{
  556. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MEDIACENTER ) ); }
  557. 		}
  558.  
  559.  
  560. 		public int SM_MENUDROPALIGNMENT
  561. 		{
  562. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MENUDROPALIGNMENT ) ); }
  563. 		}
  564.  
  565.  
  566. 		public int SM_MIDEASTENABLED
  567. 		{
  568. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MIDEASTENABLED ) ); }
  569. 		}
  570.  
  571.  
  572. 		public int SM_MOUSEHORIZONTALWHEELPRESENT
  573. 		{
  574. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MOUSEHORIZONTALWHEELPRESENT ) ); }
  575. 		}
  576.  
  577.  
  578. 		public int SM_MOUSEPRESENT
  579. 		{
  580. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MOUSEPRESENT ) ); }
  581. 		}
  582.  
  583.  
  584. 		public int SM_MOUSEWHEELPRESENT
  585. 		{
  586. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_MOUSEWHEELPRESENT ) ); }
  587. 		}
  588.  
  589.  
  590. 		public int SM_NETWORK
  591. 		{
  592. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_NETWORK ) ); }
  593. 		}
  594.  
  595.  
  596. 		public int SM_PENWINDOWS
  597. 		{
  598. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_PENWINDOWS ) ); }
  599. 		}
  600.  
  601.  
  602. 		public int SM_REMOTECONTROL
  603. 		{
  604. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_REMOTECONTROL ) ); }
  605. 		}
  606.  
  607.  
  608. 		public int SM_REMOTESESSION
  609. 		{
  610. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_REMOTESESSION ) ); }
  611. 		}
  612.  
  613.  
  614. 		public int SM_SAMEDISPLAYFORMAT
  615. 		{
  616. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SAMEDISPLAYFORMAT ) ); }
  617. 		}
  618.  
  619.  
  620. 		public int SM_SECURE
  621. 		{
  622. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SECURE ) ); }
  623. 		}
  624.  
  625.  
  626. 		public int SM_SERVERR2
  627. 		{
  628. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SERVERR2 ) ); }
  629. 		}
  630.  
  631.  
  632. 		public int SM_SHOWSOUNDS
  633. 		{
  634. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SHOWSOUNDS ) ); }
  635. 		}
  636.  
  637.  
  638. 		public int SM_SHUTTINGDOWN
  639. 		{
  640. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SHUTTINGDOWN ) ); }
  641. 		}
  642.  
  643.  
  644. 		public int SM_SLOWMACHINE
  645. 		{
  646. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SLOWMACHINE ) ); }
  647. 		}
  648.  
  649.  
  650. 		public int SM_STARTER
  651. 		{
  652. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_STARTER ) ); }
  653. 		}
  654.  
  655.  
  656. 		public int SM_SWAPBUTTON
  657. 		{
  658. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_SWAPBUTTON ) ); }
  659. 		}
  660.  
  661.  
  662. 		public int SM_TABLETPC
  663. 		{
  664. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_TABLETPC ) ); }
  665. 		}
  666.  
  667.  
  668. 		public int SM_XVIRTUALSCREEN
  669. 		{
  670. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_XVIRTUALSCREEN ) ); }
  671. 		}
  672.  
  673.  
  674. 		public int SM_YVIRTUALSCREEN
  675. 		{
  676. 			get { return Convert.ToInt32( GetSystemMetrics( SystemMetric.SM_YVIRTUALSCREEN ) ); }
  677. 		}
  678.  
  679.  
  680. 		#endregion Properties
  681.  
  682.  
  683. 		#region DLL Import
  684.  
  685.  
  686. 		[DllImport( "user32.dll" )]
  687. 		static extern int GetSystemMetrics( SystemMetric smIndex );
  688.  
  689.  
  690. 		#endregion DLL Import
  691.  
  692.  
  693. 		#region Properties Enumeration
  694.  
  695.  
  696. 		/// <summary>
  697. 		/// Flags used with the Windows API (User32.dll):GetSystemMetrics(SystemMetric smIndex)
  698. 		///  
  699. 		/// This Enum and declaration signature was written by Gabriel T. Sharp
  700. 		/// ai_productions@verizon.net or osirisgothra@hotmail.com
  701. 		/// Obtained on pinvoke.net, please contribute your code to support the wiki!
  702. 		/// </summary>
  703. 		public enum SystemMetric : int
  704. 		{
  705. 			/// <summary>
  706. 			/// The flags that specify how the system arranged minimized windows. For more information, see the Remarks section in this topic.
  707. 			/// </summary>
  708. 			SM_ARRANGE = 56,
  709.  
  710. 			/// <summary>
  711. 			/// The value that specifies how the system is started:
  712. 			/// 0 Normal boot
  713. 			/// 1 Fail-safe boot
  714. 			/// 2 Fail-safe with network boot
  715. 			/// A fail-safe boot (also called SafeBoot, Safe Mode, or Clean Boot) bypasses the user startup files.
  716. 			/// </summary>
  717. 			SM_CLEANBOOT = 67,
  718.  
  719. 			/// <summary>
  720. 			/// The number of display monitors on a desktop. For more information, see the Remarks section in this topic.
  721. 			/// </summary>
  722. 			SM_CMONITORS = 80,
  723.  
  724. 			/// <summary>
  725. 			/// The number of buttons on a mouse, or zero if no mouse is installed.
  726. 			/// </summary>
  727. 			SM_CMOUSEBUTTONS = 43,
  728.  
  729. 			/// <summary>
  730. 			/// The width of a window border, in pixels. This is equivalent to the SM_CXEDGE value for windows with the 3-D look.
  731. 			/// </summary>
  732. 			SM_CXBORDER = 5,
  733.  
  734. 			/// <summary>
  735. 			/// The width of a cursor, in pixels. The system cannot create cursors of other sizes.
  736. 			/// </summary>
  737. 			SM_CXCURSOR = 13,
  738.  
  739. 			/// <summary>
  740. 			/// This value is the same as SM_CXFIXEDFRAME.
  741. 			/// </summary>
  742. 			SM_CXDLGFRAME = 7,
  743.  
  744. 			/// <summary>
  745. 			/// The width of the rectangle around the location of a first click in a double-click sequence, in pixels. ,
  746. 			/// The second click must occur within the rectangle that is defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system
  747. 			/// to consider the two clicks a double-click. The two clicks must also occur within a specified time.
  748. 			/// To set the width of the double-click rectangle, call SystemParametersInfo with SPI_SETDOUBLECLKWIDTH.
  749. 			/// </summary>
  750. 			SM_CXDOUBLECLK = 36,
  751.  
  752. 			/// <summary>
  753. 			/// The number of pixels on either side of a mouse-down point that the mouse pointer can move before a drag operation begins.
  754. 			/// This allows the user to click and release the mouse button easily without unintentionally starting a drag operation.
  755. 			/// If this value is negative, it is subtracted from the left of the mouse-down point and added to the right of it.
  756. 			/// </summary>
  757. 			SM_CXDRAG = 68,
  758.  
  759. 			/// <summary>
  760. 			/// The width of a 3-D border, in pixels. This metric is the 3-D counterpart of SM_CXBORDER.
  761. 			/// </summary>
  762. 			SM_CXEDGE = 45,
  763.  
  764. 			/// <summary>
  765. 			/// The thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels.
  766. 			/// SM_CXFIXEDFRAME is the height of the horizontal border, and SM_CYFIXEDFRAME is the width of the vertical border.
  767. 			/// This value is the same as SM_CXDLGFRAME.
  768. 			/// </summary>
  769. 			SM_CXFIXEDFRAME = 7,
  770.  
  771. 			/// <summary>
  772. 			/// The width of the left and right edges of the focus rectangle that the DrawFocusRectdraws.
  773. 			/// This value is in pixels.
  774. 			/// Windows 2000:  This value is not supported.
  775. 			/// </summary>
  776. 			SM_CXFOCUSBORDER = 83,
  777.  
  778. 			/// <summary>
  779. 			/// This value is the same as SM_CXSIZEFRAME.
  780. 			/// </summary>
  781. 			SM_CXFRAME = 32,
  782.  
  783. 			/// <summary>
  784. 			/// The width of the client area for a full-screen window on the primary display monitor, in pixels.
  785. 			/// To get the coordinates of the portion of the screen that is not obscured by the system taskbar or by application desktop toolbars,
  786. 			/// call the SystemParametersInfofunction with the SPI_GETWORKAREA value.
  787. 			/// </summary>
  788. 			SM_CXFULLSCREEN = 16,
  789.  
  790. 			/// <summary>
  791. 			/// The width of the arrow bitmap on a horizontal scroll bar, in pixels.
  792. 			/// </summary>
  793. 			SM_CXHSCROLL = 21,
  794.  
  795. 			/// <summary>
  796. 			/// The width of the thumb box in a horizontal scroll bar, in pixels.
  797. 			/// </summary>
  798. 			SM_CXHTHUMB = 10,
  799.  
  800. 			/// <summary>
  801. 			/// The default width of an icon, in pixels. The LoadIcon function can load only icons with the dimensions
  802. 			/// that SM_CXICON and SM_CYICON specifies.
  803. 			/// </summary>
  804. 			SM_CXICON = 11,
  805.  
  806. 			/// <summary>
  807. 			/// The width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size
  808. 			/// SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CXICON.
  809. 			/// </summary>
  810. 			SM_CXICONSPACING = 38,
  811.  
  812. 			/// <summary>
  813. 			/// The default width, in pixels, of a maximized top-level window on the primary display monitor.
  814. 			/// </summary>
  815. 			SM_CXMAXIMIZED = 61,
  816.  
  817. 			/// <summary>
  818. 			/// The default maximum width of a window that has a caption and sizing borders, in pixels.
  819. 			/// This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions.
  820. 			/// A window can override this value by processing the WM_GETMINMAXINFO message.
  821. 			/// </summary>
  822. 			SM_CXMAXTRACK = 59,
  823.  
  824. 			/// <summary>
  825. 			/// The width of the default menu check-mark bitmap, in pixels.
  826. 			/// </summary>
  827. 			SM_CXMENUCHECK = 71,
  828.  
  829. 			/// <summary>
  830. 			/// The width of menu bar buttons, such as the child window close button that is used in the multiple document interface, in pixels.
  831. 			/// </summary>
  832. 			SM_CXMENUSIZE = 54,
  833.  
  834. 			/// <summary>
  835. 			/// The minimum width of a window, in pixels.
  836. 			/// </summary>
  837. 			SM_CXMIN = 28,
  838.  
  839. 			/// <summary>
  840. 			/// The width of a minimized window, in pixels.
  841. 			/// </summary>
  842. 			SM_CXMINIMIZED = 57,
  843.  
  844. 			/// <summary>
  845. 			/// The width of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged.
  846. 			/// This value is always greater than or equal to SM_CXMINIMIZED.
  847. 			/// </summary>
  848. 			SM_CXMINSPACING = 47,
  849.  
  850. 			/// <summary>
  851. 			/// The minimum tracking width of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions.
  852. 			/// A window can override this value by processing the WM_GETMINMAXINFO message.
  853. 			/// </summary>
  854. 			SM_CXMINTRACK = 34,
  855.  
  856. 			/// <summary>
  857. 			/// The amount of border padding for captioned windows, in pixels. Windows XP/2000:  This value is not supported.
  858. 			/// </summary>
  859. 			SM_CXPADDEDBORDER = 92,
  860.  
  861. 			/// <summary>
  862. 			/// The width of the screen of the primary display monitor, in pixels. This is the same value obtained by calling 
  863. 			/// GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, HORZRES).
  864. 			/// </summary>
  865. 			SM_CXSCREEN = 0,
  866.  
  867. 			/// <summary>
  868. 			/// The width of a button in a window caption or title bar, in pixels.
  869. 			/// </summary>
  870. 			SM_CXSIZE = 30,
  871.  
  872. 			/// <summary>
  873. 			/// The thickness of the sizing border around the perimeter of a window that can be resized, in pixels.
  874. 			/// SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border.
  875. 			/// This value is the same as SM_CXFRAME.
  876. 			/// </summary>
  877. 			SM_CXSIZEFRAME = 32,
  878.  
  879. 			/// <summary>
  880. 			/// The recommended width of a small icon, in pixels. Small icons typically appear in window captions and in small icon view.
  881. 			/// </summary>
  882. 			SM_CXSMICON = 49,
  883.  
  884. 			/// <summary>
  885. 			/// The width of small caption buttons, in pixels.
  886. 			/// </summary>
  887. 			SM_CXSMSIZE = 52,
  888.  
  889. 			/// <summary>
  890. 			/// The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.
  891. 			/// The SM_XVIRTUALSCREEN metric is the coordinates for the left side of the virtual screen.
  892. 			/// </summary>
  893. 			SM_CXVIRTUALSCREEN = 78,
  894.  
  895. 			/// <summary>
  896. 			/// The width of a vertical scroll bar, in pixels.
  897. 			/// </summary>
  898. 			SM_CXVSCROLL = 2,
  899.  
  900. 			/// <summary>
  901. 			/// The height of a window border, in pixels. This is equivalent to the SM_CYEDGE value for windows with the 3-D look.
  902. 			/// </summary>
  903. 			SM_CYBORDER = 6,
  904.  
  905. 			/// <summary>
  906. 			/// The height of a caption area, in pixels.
  907. 			/// </summary>
  908. 			SM_CYCAPTION = 4,
  909.  
  910. 			/// <summary>
  911. 			/// The height of a cursor, in pixels. The system cannot create cursors of other sizes.
  912. 			/// </summary>
  913. 			SM_CYCURSOR = 14,
  914.  
  915. 			/// <summary>
  916. 			/// This value is the same as SM_CYFIXEDFRAME.
  917. 			/// </summary>
  918. 			SM_CYDLGFRAME = 8,
  919.  
  920. 			/// <summary>
  921. 			/// The height of the rectangle around the location of a first click in a double-click sequence, in pixels.
  922. 			/// The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider
  923. 			/// the two clicks a double-click. The two clicks must also occur within a specified time. To set the height of the double-click
  924. 			/// rectangle, call SystemParametersInfo with SPI_SETDOUBLECLKHEIGHT.
  925. 			/// </summary>
  926. 			SM_CYDOUBLECLK = 37,
  927.  
  928. 			/// <summary>
  929. 			/// The number of pixels above and below a mouse-down point that the mouse pointer can move before a drag operation begins.
  930. 			/// This allows the user to click and release the mouse button easily without unintentionally starting a drag operation.
  931. 			/// If this value is negative, it is subtracted from above the mouse-down point and added below it.
  932. 			/// </summary>
  933. 			SM_CYDRAG = 69,
  934.  
  935. 			/// <summary>
  936. 			/// The height of a 3-D border, in pixels. This is the 3-D counterpart of SM_CYBORDER.
  937. 			/// </summary>
  938. 			SM_CYEDGE = 46,
  939.  
  940. 			/// <summary>
  941. 			/// The thickness of the frame around the perimeter of a window that has a caption but is not sizable, in pixels.
  942. 			/// SM_CXFIXEDFRAME is the height of the horizontal border, and SM_CYFIXEDFRAME is the width of the vertical border.
  943. 			/// This value is the same as SM_CYDLGFRAME.
  944. 			/// </summary>
  945. 			SM_CYFIXEDFRAME = 8,
  946.  
  947. 			/// <summary>
  948. 			/// The height of the top and bottom edges of the focus rectangle drawn byDrawFocusRect.
  949. 			/// This value is in pixels.
  950. 			/// Windows 2000:  This value is not supported.
  951. 			/// </summary>
  952. 			SM_CYFOCUSBORDER = 84,
  953.  
  954. 			/// <summary>
  955. 			/// This value is the same as SM_CYSIZEFRAME.
  956. 			/// </summary>
  957. 			SM_CYFRAME = 33,
  958.  
  959. 			/// <summary>
  960. 			/// The height of the client area for a full-screen window on the primary display monitor, in pixels.
  961. 			/// To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars,
  962. 			/// call the SystemParametersInfo function with the SPI_GETWORKAREA value.
  963. 			/// </summary>
  964. 			SM_CYFULLSCREEN = 17,
  965.  
  966. 			/// <summary>
  967. 			/// The height of a horizontal scroll bar, in pixels.
  968. 			/// </summary>
  969. 			SM_CYHSCROLL = 3,
  970.  
  971. 			/// <summary>
  972. 			/// The default height of an icon, in pixels. The LoadIcon function can load only icons with the dimensions SM_CXICON and SM_CYICON.
  973. 			/// </summary>
  974. 			SM_CYICON = 12,
  975.  
  976. 			/// <summary>
  977. 			/// The height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size
  978. 			/// SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CYICON.
  979. 			/// </summary>
  980. 			SM_CYICONSPACING = 39,
  981.  
  982. 			/// <summary>
  983. 			/// For double byte character set versions of the system, this is the height of the Kanji window at the bottom of the screen, in pixels.
  984. 			/// </summary>
  985. 			SM_CYKANJIWINDOW = 18,
  986.  
  987. 			/// <summary>
  988. 			/// The default height, in pixels, of a maximized top-level window on the primary display monitor.
  989. 			/// </summary>
  990. 			SM_CYMAXIMIZED = 62,
  991.  
  992. 			/// <summary>
  993. 			/// The default maximum height of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop.
  994. 			/// The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing
  995. 			/// the WM_GETMINMAXINFO message.
  996. 			/// </summary>
  997. 			SM_CYMAXTRACK = 60,
  998.  
  999. 			/// <summary>
  1000. 			/// The height of a single-line menu bar, in pixels.
  1001. 			/// </summary>
  1002. 			SM_CYMENU = 15,
  1003.  
  1004. 			/// <summary>
  1005. 			/// The height of the default menu check-mark bitmap, in pixels.
  1006. 			/// </summary>
  1007. 			SM_CYMENUCHECK = 72,
  1008.  
  1009. 			/// <summary>
  1010. 			/// The height of menu bar buttons, such as the child window close button that is used in the multiple document interface, in pixels.
  1011. 			/// </summary>
  1012. 			SM_CYMENUSIZE = 55,
  1013.  
  1014. 			/// <summary>
  1015. 			/// The minimum height of a window, in pixels.
  1016. 			/// </summary>
  1017. 			SM_CYMIN = 29,
  1018.  
  1019. 			/// <summary>
  1020. 			/// The height of a minimized window, in pixels.
  1021. 			/// </summary>
  1022. 			SM_CYMINIMIZED = 58,
  1023.  
  1024. 			/// <summary>
  1025. 			/// The height of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged.
  1026. 			/// This value is always greater than or equal to SM_CYMINIMIZED.
  1027. 			/// </summary>
  1028. 			SM_CYMINSPACING = 48,
  1029.  
  1030. 			/// <summary>
  1031. 			/// The minimum tracking height of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions.
  1032. 			/// A window can override this value by processing the WM_GETMINMAXINFO message.
  1033. 			/// </summary>
  1034. 			SM_CYMINTRACK = 35,
  1035.  
  1036. 			/// <summary>
  1037. 			/// The height of the screen of the primary display monitor, in pixels. This is the same value obtained by calling 
  1038. 			/// GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, VERTRES).
  1039. 			/// </summary>
  1040. 			SM_CYSCREEN = 1,
  1041.  
  1042. 			/// <summary>
  1043. 			/// The height of a button in a window caption or title bar, in pixels.
  1044. 			/// </summary>
  1045. 			SM_CYSIZE = 31,
  1046.  
  1047. 			/// <summary>
  1048. 			/// The thickness of the sizing border around the perimeter of a window that can be resized, in pixels.
  1049. 			/// SM_CXSIZEFRAME is the width of the horizontal border, and SM_CYSIZEFRAME is the height of the vertical border.
  1050. 			/// This value is the same as SM_CYFRAME.
  1051. 			/// </summary>
  1052. 			SM_CYSIZEFRAME = 33,
  1053.  
  1054. 			/// <summary>
  1055. 			/// The height of a small caption, in pixels.
  1056. 			/// </summary>
  1057. 			SM_CYSMCAPTION = 51,
  1058.  
  1059. 			/// <summary>
  1060. 			/// The recommended height of a small icon, in pixels. Small icons typically appear in window captions and in small icon view.
  1061. 			/// </summary>
  1062. 			SM_CYSMICON = 50,
  1063.  
  1064. 			/// <summary>
  1065. 			/// The height of small caption buttons, in pixels.
  1066. 			/// </summary>
  1067. 			SM_CYSMSIZE = 53,
  1068.  
  1069. 			/// <summary>
  1070. 			/// The height of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors.
  1071. 			/// The SM_YVIRTUALSCREEN metric is the coordinates for the top of the virtual screen.
  1072. 			/// </summary>
  1073. 			SM_CYVIRTUALSCREEN = 79,
  1074.  
  1075. 			/// <summary>
  1076. 			/// The height of the arrow bitmap on a vertical scroll bar, in pixels.
  1077. 			/// </summary>
  1078. 			SM_CYVSCROLL = 20,
  1079.  
  1080. 			/// <summary>
  1081. 			/// The height of the thumb box in a vertical scroll bar, in pixels.
  1082. 			/// </summary>
  1083. 			SM_CYVTHUMB = 9,
  1084.  
  1085. 			/// <summary>
  1086. 			/// Nonzero if User32.dll supports DBCS; otherwise, 0.
  1087. 			/// </summary>
  1088. 			SM_DBCSENABLED = 42,
  1089.  
  1090. 			/// <summary>
  1091. 			/// Nonzero if the debug version of User.exe is installed; otherwise, 0.
  1092. 			/// </summary>
  1093. 			SM_DEBUG = 22,
  1094.  
  1095. 			/// <summary>
  1096. 			/// Nonzero if the current operating system is Windows 7 or Windows Server 2008 R2 and the Tablet PC Input
  1097. 			/// service is started; otherwise, 0. The return value is a bitmask that specifies the type of digitizer input supported by the device.
  1098. 			/// For more information, see Remarks.
  1099. 			/// Windows Server 2008, Windows Vista, and Windows XP/2000:  This value is not supported.
  1100. 			/// </summary>
  1101. 			SM_DIGITIZER = 94,
  1102.  
  1103. 			/// <summary>
  1104. 			/// Nonzero if Input Method Manager/Input Method Editor features are enabled; otherwise, 0.
  1105. 			/// SM_IMMENABLED indicates whether the system is ready to use a Unicode-based IME on a Unicode application.
  1106. 			/// To ensure that a language-dependent IME works, check SM_DBCSENABLED and the system ANSI code page.
  1107. 			/// Otherwise the ANSI-to-Unicode conversion may not be performed correctly, or some components like fonts
  1108. 			/// or registry settings may not be present.
  1109. 			/// </summary>
  1110. 			SM_IMMENABLED = 82,
  1111.  
  1112. 			/// <summary>
  1113. 			/// Nonzero if there are digitizers in the system; otherwise, 0. SM_MAXIMUMTOUCHES returns the aggregate maximum of the
  1114. 			/// maximum number of contacts supported by every digitizer in the system. If the system has only single-touch digitizers,
  1115. 			/// the return value is 1. If the system has multi-touch digitizers, the return value is the number of simultaneous contacts
  1116. 			/// the hardware can provide. Windows Server 2008, Windows Vista, and Windows XP/2000:  This value is not supported.
  1117. 			/// </summary>
  1118. 			SM_MAXIMUMTOUCHES = 95,
  1119.  
  1120. 			/// <summary>
  1121. 			/// Nonzero if the current operating system is the Windows XP, Media Center Edition, 0 if not.
  1122. 			/// </summary>
  1123. 			SM_MEDIACENTER = 87,
  1124.  
  1125. 			/// <summary>
  1126. 			/// Nonzero if drop-down menus are right-aligned with the corresponding menu-bar item; 0 if the menus are left-aligned.
  1127. 			/// </summary>
  1128. 			SM_MENUDROPALIGNMENT = 40,
  1129.  
  1130. 			/// <summary>
  1131. 			/// Nonzero if the system is enabled for Hebrew and Arabic languages, 0 if not.
  1132. 			/// </summary>
  1133. 			SM_MIDEASTENABLED = 74,
  1134.  
  1135. 			/// <summary>
  1136. 			/// Nonzero if a mouse is installed; otherwise, 0. This value is rarely zero, because of support for virtual mice and because
  1137. 			/// some systems detect the presence of the port instead of the presence of a mouse.
  1138. 			/// </summary>
  1139. 			SM_MOUSEPRESENT = 19,
  1140.  
  1141. 			/// <summary>
  1142. 			/// Nonzero if a mouse with a horizontal scroll wheel is installed; otherwise 0.
  1143. 			/// </summary>
  1144. 			SM_MOUSEHORIZONTALWHEELPRESENT = 91,
  1145.  
  1146. 			/// <summary>
  1147. 			/// Nonzero if a mouse with a vertical scroll wheel is installed; otherwise 0.
  1148. 			/// </summary>
  1149. 			SM_MOUSEWHEELPRESENT = 75,
  1150.  
  1151. 			/// <summary>
  1152. 			/// The least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use.
  1153. 			/// </summary>
  1154. 			SM_NETWORK = 63,
  1155.  
  1156. 			/// <summary>
  1157. 			/// Nonzero if the Microsoft Windows for Pen computing extensions are installed; zero otherwise.
  1158. 			/// </summary>
  1159. 			SM_PENWINDOWS = 41,
  1160.  
  1161. 			/// <summary>
  1162. 			/// This system metric is used in a Terminal Services environment to determine if the current Terminal Server session is
  1163. 			/// being remotely controlled. Its value is nonzero if the current session is remotely controlled; otherwise, 0.
  1164. 			/// You can use terminal services management tools such as Terminal Services Manager (tsadmin.msc) and shadow.exe to
  1165. 			/// control a remote session. When a session is being remotely controlled, another user can view the contents of that session
  1166. 			/// and potentially interact with it.
  1167. 			/// </summary>
  1168. 			SM_REMOTECONTROL = 0x2001,
  1169.  
  1170. 			/// <summary>
  1171. 			/// This system metric is used in a Terminal Services environment. If the calling process is associated with a Terminal Services
  1172. 			/// client session, the return value is nonzero. If the calling process is associated with the Terminal Services console session,
  1173. 			/// the return value is 0.
  1174. 			/// Windows Server 2003 and Windows XP:  The console session is not necessarily the physical console.
  1175. 			/// For more information, seeWTSGetActiveConsoleSessionId.
  1176. 			/// </summary>
  1177. 			SM_REMOTESESSION = 0x1000,
  1178.  
  1179. 			/// <summary>
  1180. 			/// Nonzero if all the display monitors have the same color format, otherwise, 0. Two displays can have the same bit depth,
  1181. 			/// but different color formats. For example, the red, green, and blue pixels can be encoded with different numbers of bits,
  1182. 			/// or those bits can be located in different places in a pixel color value.
  1183. 			/// </summary>
  1184. 			SM_SAMEDISPLAYFORMAT = 81,
  1185.  
  1186. 			/// <summary>
  1187. 			/// This system metric should be ignored; it always returns 0.
  1188. 			/// </summary>
  1189. 			SM_SECURE = 44,
  1190.  
  1191. 			/// <summary>
  1192. 			/// The build number if the system is Windows Server 2003 R2; otherwise, 0.
  1193. 			/// </summary>
  1194. 			SM_SERVERR2 = 89,
  1195.  
  1196. 			/// <summary>
  1197. 			/// Nonzero if the user requires an application to present information visually in situations where it would otherwise present
  1198. 			/// the information only in audible form; otherwise, 0.
  1199. 			/// </summary>
  1200. 			SM_SHOWSOUNDS = 70,
  1201.  
  1202. 			/// <summary>
  1203. 			/// Nonzero if the current session is shutting down; otherwise, 0. Windows 2000:  This value is not supported.
  1204. 			/// </summary>
  1205. 			SM_SHUTTINGDOWN = 0x2000,
  1206.  
  1207. 			/// <summary>
  1208. 			/// Nonzero if the computer has a low-end (slow) processor; otherwise, 0.
  1209. 			/// </summary>
  1210. 			SM_SLOWMACHINE = 73,
  1211.  
  1212. 			/// <summary>
  1213. 			/// Nonzero if the current operating system is Windows 7 Starter Edition, Windows Vista Starter, or Windows XP Starter Edition; otherwise, 0.
  1214. 			/// </summary>
  1215. 			SM_STARTER = 88,
  1216.  
  1217. 			/// <summary>
  1218. 			/// Nonzero if the meanings of the left and right mouse buttons are swapped; otherwise, 0.
  1219. 			/// </summary>
  1220. 			SM_SWAPBUTTON = 23,
  1221.  
  1222. 			/// <summary>
  1223. 			/// Nonzero if the current operating system is the Windows XP Tablet PC edition or if the current operating system is Windows Vista
  1224. 			/// or Windows 7 and the Tablet PC Input service is started; otherwise, 0. The SM_DIGITIZER setting indicates the type of digitizer
  1225. 			/// input supported by a device running Windows 7 or Windows Server 2008 R2. For more information, see Remarks.
  1226. 			/// </summary>
  1227. 			SM_TABLETPC = 86,
  1228.  
  1229. 			/// <summary>
  1230. 			/// The coordinates for the left side of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.
  1231. 			/// The SM_CXVIRTUALSCREEN metric is the width of the virtual screen.
  1232. 			/// </summary>
  1233. 			SM_XVIRTUALSCREEN = 76,
  1234.  
  1235. 			/// <summary>
  1236. 			/// The coordinates for the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors.
  1237. 			/// The SM_CYVIRTUALSCREEN metric is the height of the virtual screen.
  1238. 			/// </summary>
  1239. 			SM_YVIRTUALSCREEN = 77,
  1240. 		}
  1241.  
  1242.  
  1243. 		#endregion Properties Enumeration
  1244. 	}
  1245. }
  1246.  

page last modified: 2024-04-16; loaded in 0.0203 seconds