2 * System metrics functions
4 * Copyright 1994 Alexandre Julliard
6 static char Copyright[] = "Copyright Alexandre Julliard, 1994";
11 #include "sysmetrics.h"
13 short sysMetrics
[SM_CMETRICS
+1];
15 /***********************************************************************
18 * Initialisation of the system metrics array.
20 void SYSMETRICS_Init(void)
22 sysMetrics
[SM_CXSCREEN
] = screenWidth
;
23 sysMetrics
[SM_CYSCREEN
] = screenHeight
;
24 sysMetrics
[SM_CXVSCROLL
] = SYSMETRICS_CXVSCROLL
;
25 sysMetrics
[SM_CYHSCROLL
] = SYSMETRICS_CYHSCROLL
;
26 sysMetrics
[SM_CYCAPTION
] = SYSMETRICS_CYCAPTION
;
27 sysMetrics
[SM_CXBORDER
] = SYSMETRICS_CXBORDER
;
28 sysMetrics
[SM_CYBORDER
] = SYSMETRICS_CYBORDER
;
29 sysMetrics
[SM_CXDLGFRAME
] = SYSMETRICS_CXDLGFRAME
;
30 sysMetrics
[SM_CYDLGFRAME
] = SYSMETRICS_CYDLGFRAME
;
31 sysMetrics
[SM_CYVTHUMB
] = SYSMETRICS_CYVTHUMB
;
32 sysMetrics
[SM_CXHTHUMB
] = SYSMETRICS_CXHTHUMB
;
33 sysMetrics
[SM_CXICON
] = SYSMETRICS_CXICON
;
34 sysMetrics
[SM_CYICON
] = SYSMETRICS_CYICON
;
35 sysMetrics
[SM_CXCURSOR
] = SYSMETRICS_CXCURSOR
;
36 sysMetrics
[SM_CYCURSOR
] = SYSMETRICS_CYCURSOR
;
37 sysMetrics
[SM_CYMENU
] = SYSMETRICS_CYMENU
;
38 sysMetrics
[SM_CXFULLSCREEN
] = sysMetrics
[SM_CXSCREEN
];
39 sysMetrics
[SM_CYFULLSCREEN
] = sysMetrics
[SM_CYSCREEN
] - sysMetrics
[SM_CYCAPTION
];
40 sysMetrics
[SM_CYKANJIWINDOW
] = 0;
41 sysMetrics
[SM_MOUSEPRESENT
] = 1;
42 sysMetrics
[SM_CYVSCROLL
] = SYSMETRICS_CYVSCROLL
;
43 sysMetrics
[SM_CXHSCROLL
] = SYSMETRICS_CXHSCROLL
;
44 sysMetrics
[SM_DEBUG
] = 0;
45 sysMetrics
[SM_SWAPBUTTON
] = 0;
46 sysMetrics
[SM_RESERVED1
] = 0;
47 sysMetrics
[SM_RESERVED2
] = 0;
48 sysMetrics
[SM_RESERVED3
] = 0;
49 sysMetrics
[SM_RESERVED4
] = 0;
50 sysMetrics
[SM_CXMIN
] = SYSMETRICS_CXMIN
;
51 sysMetrics
[SM_CYMIN
] = SYSMETRICS_CYMIN
;
52 sysMetrics
[SM_CXSIZE
] = SYSMETRICS_CXSIZE
;
53 sysMetrics
[SM_CYSIZE
] = SYSMETRICS_CYSIZE
;
54 sysMetrics
[SM_CXFRAME
] = GetProfileInt( "windows", "BorderWidth", 4 );
55 sysMetrics
[SM_CYFRAME
] = sysMetrics
[SM_CXFRAME
];
56 sysMetrics
[SM_CXMINTRACK
] = SYSMETRICS_CXMINTRACK
;
57 sysMetrics
[SM_CYMINTRACK
] = SYSMETRICS_CYMINTRACK
;
58 sysMetrics
[SM_CXDOUBLECLK
] = (GetProfileInt( "windows","DoubleClickWidth", 4) + 1) & ~1;
59 sysMetrics
[SM_CYDOUBLECLK
] = (GetProfileInt( "windows","DoubleClickHeight", 4) + 1) & ~1;
60 sysMetrics
[SM_CXICONSPACING
] = GetProfileInt( "desktop","IconSpacing", 75);
61 sysMetrics
[SM_CYICONSPACING
] = GetProfileInt( "desktop","IconVerticalSpacing", 72);
62 sysMetrics
[SM_MENUDROPALIGNMENT
] = GetProfileInt( "windows","MenuDropAlignment", 0 );
63 sysMetrics
[SM_PENWINDOWS
] = 0;
64 sysMetrics
[SM_DBCSENABLED
] = 0;
65 sysMetrics
[SM_CMETRICS
] = SM_CMETRICS
;
69 /***********************************************************************
70 * GetSystemMetrics (USER.179)
72 int GetSystemMetrics( WORD index
)
74 if (index
> SM_CMETRICS
) return 0;
75 else return sysMetrics
[index
];