4 /* Control extended styles */
5 #define MSLM_EX_ALLOWSELECTNONE 0x1
6 #define MSLM_EX_ALLOWSELECTDISABLED 0x2
7 #define MSLM_EX_HIDENUMBERONSINGLE 0x4
8 #define MSLM_EX_HIDENUMBERS 0x8
9 #define MSLM_EX_SELECTONRIGHTCLICK 0x10
10 #define MSLM_EX_SELECTBYNUMKEY 0x20
11 #define MSLM_EX_SELECTBYARROWKEY 0x40
13 /* MONSL_MONINFO Flags */
14 #define MSL_MIF_DISABLED 0x1
16 typedef struct _MONSL_MONINFO
20 DWORD Flags
; /* MSL_MIF_* */
22 } MONSL_MONINFO
, *PMONSL_MONINFO
;
24 typedef struct _MONSL_MONNMHDR
28 /* NOTE: MonitorInfo is only valid if Index >= 0 */
29 MONSL_MONINFO MonitorInfo
;
30 } MONSL_MONNMHDR
, *PMONSL_MONNMHDR
;
32 typedef struct _MONSL_MONNMBUTTONCLICKED
34 /* Used with MSLN_MONITORCHANGING */
37 } MONSL_MONNMBUTTONCLICKED
, *PMONSL_MONNMBUTTONCLICKED
;
39 typedef struct _MONSL_MONNMMONITORCHANGING
41 /* Used with MSLN_MONITORCHANGING */
45 } MONSL_MONNMMONITORCHANGING
, *PMONSL_MONNMMONITORCHANGING
;
48 * MSLN_MONITORCHANGING
49 * This notification code is sent through WM_NOTIFY before another monitor
50 * can be selected. This notification is not sent in response to a
51 * MSLM_SETCURSEL message.
53 * lParam: PMONSL_MONNMMONITORCHANGING
54 * Change AllowChanging to FALSE to prevent the new monitor to
57 #define MSLN_MONITORCHANGING 101
61 * This notification code is sent through WM_NOTIFY after a new monitor
62 * was selected. This notification is not sent in response to a
63 * MSLM_SETCURSEL message.
65 * lParam: PMONSL_MONNMHDR
67 #define MSLN_MONITORCHANGED 102
71 * This notification code is sent through WM_NOTIFY after the user did a
72 * right click on the control. If the control's extended style
73 * MSLM_EX_SELECTONRIGHTCLICK is set and the user clicked on a monitor,
74 * that monitor is selected and relevant notifications are sent before
75 * this notification is sent.
77 * lParam: PMONSL_MONNMBUTTONCLICKED
79 #define MSLN_RBUTTONUP 103
82 * MSLM_SETMONITORSINFO
84 * Count of MONSL_MONINFO structures provided as lParam.
85 * lParam: PMONSL_MONINFO
86 * Array of wParam MONSL_MONINFO structures.
88 * Returns non-zero value if successful.
90 #define MSLM_SETMONITORSINFO (WM_USER + 0x10)
93 * MSLM_GETMONITORSINFO
95 * Length of MONSL_MONINFO array buffer provided in lParam.
96 * lParam: PMONSL_MONINFO
97 * Array of wParam MONSL_MONINFO structures
99 * Returns number of structures copied.
101 #define MSLM_GETMONITORSINFO (WM_USER + 0x11)
104 * MSLM_GETMONITORINFOCOUNT
108 * Returns number of monitors.
110 #define MSLM_GETMONITORINFOCOUNT (WM_USER + 0x12)
115 * Pointer to a POINT structure specifying the coordinates
116 * relative to the client area of the control.
119 * Returns the index of the monitor at this point, or -1.
121 #define MSLM_HITTEST (WM_USER + 0x13)
126 * Selects the monitor with this index. Pass -1 to clear the selection.
129 * Returns a non-zero value if successful.
131 #define MSLM_SETCURSEL (WM_USER + 0x14)
138 * Returns the index of the selected monitor, or -1 if none is currently selected.
140 #define MSLM_GETCURSEL (WM_USER + 0x15)
143 * MSLM_SETMONITORINFO
145 * Index of the monitor information that is queried.
146 * lParam: PMONSL_MONINFO
147 * Pointer to a MONSL_MONINFO structures.
149 * Returns non-zero value if successful.
151 #define MSLM_SETMONITORINFO (WM_USER + 0x16)
154 * MSLM_GETMONITORINFO
156 * Index of the monitor information to be changed.
157 * lParam: PMONSL_MONINFO
158 * Pointer to a MONSL_MONINFO structures.
160 * Returns non-zero value if successful.
162 #define MSLM_GETMONITORINFO (WM_USER + 0x17)
168 * Can be a combination of the following flags:
169 * * MSLM_EX_ALLOWSELECTNONE
170 * Allow deselecting a monitor by clicking into
171 * unused areas of the control.
172 * * MSLM_EX_ALLOWSELECTDISABLED
173 * Allow selecting disabled monitors.
174 * * MSLM_EX_HIDENUMBERONSINGLE
175 * Hides the monitor number if the control only
176 * displays one monitor.
177 * * MSLM_EX_HIDENUMBERS
178 * Does not show monitor numbers.
179 * * MSLM_EX_SELECTONRIGHTCLICK
180 * Selects a monitor when the user right clicks
182 * * MSLM_EX_SELECTBYNUMKEY
183 * Allows selecting a monitor by using the keys
185 * * MSLM_EX_SELECTBYARROWKEY
186 * Allows selecting a monitor using the arrow keys.
188 * Returns non-zero value if successful.
190 #define MSLM_SETEXSTYLE (WM_USER + 0x18)
197 * Returns the control's extended style flags.
199 #define MSLM_GETEXSTYLE (WM_USER + 0x19)
202 * MSLM_GETMONITORRECT
204 * Index of the monitor whose display rectangle is queried.
206 * Pointer to a RECT structure that receives the rectangle
207 * in coordinates relative to the control's client area.
209 * Returns a positive value if the rectangle is visible.
210 * Returns zero if the rectangle is invisible.
211 * Returns a negative value if the index is not valid.
213 #define MSLM_GETMONITORRECT (WM_USER + 0x20)
215 BOOL
RegisterMonitorSelectionControl(IN HINSTANCE hInstance
);
216 VOID
UnregisterMonitorSelectionControl(IN HINSTANCE hInstance
);
218 #endif /* __MONSLCTL__H */