Wndows Programming book Knowledge and code excerpt-get video display pixels and other parameters GetSystemMetrics

Source: Internet
Author: User

The following code snippet is used to get the height width of the video display, in pixels.

1 int Sxscreen, Cyscreen; 2 cxscreen = getsystemmetrics (sm_cxscreen); 3 cyscreen = GetSystemMetrics (Sm_cyscreen);

Additional information about this function can be obtained through the Baidu Encyclopedia

Http://baike.baidu.com/link?url=ZaNA7uLcPBpdGmkIFNkXJ_GvJ-lgwaphwjVAjaKKNT2qPeIubmYZ6b-AUcMAP6YSwTHMIgsuz7IWynMe7rw9Iq

Here are some excerpts:

Sm_cmousebuttons The return value is the number of mouse keys supported by the system and returns 0, the mouse is not installed on the system. Sm_cxborder,sm_cyborder returns the width and height of the Windows window border in pixels, equivalent to the Sm_cxedge parameter if Windows is in 3D form Sm_cxcursor,sm_cycursor Returns the width and height of the standard cursor in pixel values sm_cxdlgframe,sm_cydlgframe equivalent to Sm_cxfixedframe and sm_cyfixedframesm_cxdoubleclk,sm_ CYDOUBLECLK Double-click a valid rectangular area in pixel values sm_cxedge,sm_cyedge the width and height of the 3D border in pixels sm_cxfixedframe,sm_cyfixedframe The thickness of the border around a window that has a title but cannot be changed (usually some dialog boxes) is sm_cxframe,sm_cyframe equivalent to Sm_cxsizeframe and sm_cysizeframesm_cxfullscreen,sm_ Cyfullscreen the width and height of the window area of the Full-screen window sm_cxhscroll,sm_cyhscroll the height of the horizontal scrollbar and the width of the arrows on the horizontal scrollbar sm_cxhthumb the width of the slider on the horizontal scroll bar in pixels sm_ Cxicon,sm_cyicon the height and width of the default icon for the system (typically 32*32) sm_cxiconspacing,sm_cyiconspacing the space between icons when viewed with a large icon, which is always greater than or equal to Sm_ Cxicon and Sm_cyicon. Sm_cxmaximized,sm_cymaximized The default size of the maximized window in the top-level sm_cxmaxtrack,sm_cymaxtrack has the default maximum size of the window that can change the size border and the title bar, if the window is larger than this size, The window is not movable. Sm_cxmenucheck,sm_cymenucheck the size of the menu checkmark bitmap in pixels sm_cxmenusize,sm_cymenusize the size of the menu bar button calculated in pixels sm_cxmin,sm_cymin The minimum size that the window can reach sm_cxminimized,sm_cyminimized the size of the normal minimized window Sm_cxmintrack,sm_cYmintrack minimum tracking distance, the window will not move when the user drags the window less than this value. Sm_cxscreen,sm_cyscreen the screen size calculated in pixels. Sm_cxsize,sm_cysize the size of the title bar button calculated in pixels sm_cxsizeframe,sm_cysizeframe the thickness of the border around the window that can be resized Sm_cxsmicon,sm_cysmicon The size of small icons in pixels, and small icons typically appear on the window's title bar. Sm_cxvscroll,sm_cyvscroll the width of the vertical scrollbar calculated in pixels and the height of the arrows on the vertical scroll bar sm_cycaption The height of the normal window caption in pixels sm_cymenu the height of a single menu bar calculated in pixels sm_ Cysmcaption the height of the window's small title bar computed in pixels sm_cyvthumb the height of the thumb in the vertical scrollbar in pixels sm_dbcsenabled if TRUE or not 0 indicates that the system has a double-byte version of USER.EXE installed, is False or 0 is not. Sm_debug if the value of TRUE or not 0 indicates that the system has a DEBUG version of USER.EXE installed, false or 0 is not. Sm_menudropalignment if the value is true or not 0, the drop-down menu is right-aligned or left-aligned. Sm_mousepresent if a value of true or not 0 is installed, the mouse is not installed. Sm_mousewheelpresent a Wheel Mouse is installed if the value is true or not 0, otherwise it is not installed. (Windows NT only) Sm_swapbutton if TRUE or not a value of 0 then the mouse key is exchanged or not.

Wndows Programming book Knowledge and code excerpt-get video display pixels and other parameters GetSystemMetrics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.