3 /* Control extended styles */
4 #define MSLM_EX_ALLOWSELECTNONE 0x1
5 #define MSLM_EX_ALLOWSELECTDISABLED 0x2
6 #define MSLM_EX_HIDENUMBERONSINGLE 0x4
7 #define MSLM_EX_HIDENUMBERS 0x8
8 #define MSLM_EX_SELECTONRIGHTCLICK 0x10
9 #define MSLM_EX_SELECTBYNUMKEY 0x20
10 #define MSLM_EX_SELECTBYARROWKEY 0x40
12 /* MONSL_MONINFO Flags */
13 #define MSL_MIF_DISABLED 0x1
15 typedef struct _MONSL_MONINFO
19 DWORD Flags
; /* MSL_MIF_* */
21 } MONSL_MONINFO
, *PMONSL_MONINFO
;
23 typedef struct _MONSL_MONNMHDR
27 /* NOTE: MonitorInfo is only valid if Index >= 0 */
28 MONSL_MONINFO MonitorInfo
;
29 } MONSL_MONNMHDR
, *PMONSL_MONNMHDR
;
31 typedef struct _MONSL_MONNMBUTTONCLICKED
33 /* Used with MSLN_MONITORCHANGING */
36 } MONSL_MONNMBUTTONCLICKED
, *PMONSL_MONNMBUTTONCLICKED
;
38 typedef struct _MONSL_MONNMMONITORCHANGING
40 /* Used with MSLN_MONITORCHANGING */
44 } MONSL_MONNMMONITORCHANGING
, *PMONSL_MONNMMONITORCHANGING
;
47 * MSLN_MONITORCHANGING
48 * This notification code is sent through WM_NOTIFY before another monitor
49 * can be selected. This notification is not sent in response to a
50 * MSLM_SETCURSEL message.
52 * lParam: PMONSL_MONNMMONITORCHANGING
53 * Change AllowChanging to FALSE to prevent the new monitor to
56 #define MSLN_MONITORCHANGING 101
60 * This notification code is sent through WM_NOTIFY after a new monitor
61 * was selected. This notification is not sent in response to a
62 * MSLM_SETCURSEL message.
64 * lParam: PMONSL_MONNMHDR
66 #define MSLN_MONITORCHANGED 102
70 * This notification code is sent through WM_NOTIFY after the user did a
71 * right click on the control. If the control's extended style
72 * MSLM_EX_SELECTONRIGHTCLICK is set and the user clicked on a monitor,
73 * that monitor is selected and relevant notifications are sent before
74 * this notification is sent.
76 * lParam: PMONSL_MONNMBUTTONCLICKED
78 #define MSLN_RBUTTONUP 103
81 * MSLM_SETMONITORSINFO
83 * Count of MONSL_MONINFO structures provided as lParam.
84 * lParam: PMONSL_MONINFO
85 * Array of wParam MONSL_MONINFO structures.
87 * Returns non-zero value if successful.
89 #define MSLM_SETMONITORSINFO (WM_USER + 0x10)
92 * MSLM_GETMONITORSINFO
94 * Length of MONSL_MONINFO array buffer provided in lParam.
95 * lParam: PMONSL_MONINFO
96 * Array of wParam MONSL_MONINFO structures
98 * Returns number of structures copied.
100 #define MSLM_GETMONITORSINFO (WM_USER + 0x11)
103 * MSLM_GETMONITORINFOCOUNT
107 * Returns number of monitors.
109 #define MSLM_GETMONITORINFOCOUNT (WM_USER + 0x12)
114 * Pointer to a POINT structure specifying the coordinates
115 * relative to the client area of the control.
118 * Returns the index of the monitor at this point, or -1.
120 #define MSLM_HITTEST (WM_USER + 0x13)
125 * Selects the monitor with this index. Pass -1 to clear the selection.
128 * Returns a non-zero value if successful.
130 #define MSLM_SETCURSEL (WM_USER + 0x14)
137 * Returns the index of the selected monitor, or -1 if none is currently selected.
139 #define MSLM_GETCURSEL (WM_USER + 0x15)
142 * MSLM_SETMONITORINFO
144 * Index of the monitor information that is queried.
145 * lParam: PMONSL_MONINFO
146 * Pointer to a MONSL_MONINFO structures.
148 * Returns non-zero value if successful.
150 #define MSLM_SETMONITORINFO (WM_USER + 0x16)
153 * MSLM_GETMONITORINFO
155 * Index of the monitor information to be changed.
156 * lParam: PMONSL_MONINFO
157 * Pointer to a MONSL_MONINFO structures.
159 * Returns non-zero value if successful.
161 #define MSLM_GETMONITORINFO (WM_USER + 0x17)
167 * Can be a combination of the following flags:
168 * * MSLM_EX_ALLOWSELECTNONE
169 * Allow deselecting a monitor by clicking into
170 * unused areas of the control.
171 * * MSLM_EX_ALLOWSELECTDISABLED
172 * Allow selecting disabled monitors.
173 * * MSLM_EX_HIDENUMBERONSINGLE
174 * Hides the monitor number if the control only
175 * displays one monitor.
176 * * MSLM_EX_HIDENUMBERS
177 * Does not show monitor numbers.
178 * * MSLM_EX_SELECTONRIGHTCLICK
179 * Selects a monitor when the user right clicks
181 * * MSLM_EX_SELECTBYNUMKEY
182 * Allows selecting a monitor by using the keys
184 * * MSLM_EX_SELECTBYARROWKEY
185 * Allows selecting a monitor using the arrow keys.
187 * Returns non-zero value if successful.
189 #define MSLM_SETEXSTYLE (WM_USER + 0x18)
196 * Returns the control's extended style flags.
198 #define MSLM_GETEXSTYLE (WM_USER + 0x19)
201 * MSLM_GETMONITORRECT
203 * Index of the monitor whose display rectangle is queried.
205 * Pointer to a RECT structure that receives the rectangle
206 * in coordinates relative to the control's client area.
208 * Returns a positive value if the rectangle is visible.
209 * Returns zero if the rectangle is invisible.
210 * Returns a negative value if the index is not valid.
212 #define MSLM_GETMONITORRECT (WM_USER + 0x20)
214 BOOL
RegisterMonitorSelectionControl(IN HINSTANCE hInstance
);
215 VOID
UnregisterMonitorSelectionControl(IN HINSTANCE hInstance
);