ReactOS 0.4.16-dev-136-g52192f1
mouse.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS system libraries
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Mouse keys notification icon handler
5 * COPYRIGHT: Copyright 2022 Mark Jansen <mark.jansen@reactos.org>
6 */
7
8#include "precomp.h"
9
13
16{
17 TRACE("MouseKeys_Init!\n");
18
19 return MouseKeys_Update(pSysTray);
20}
21
24{
25 TRACE("MouseKeys_Shutdown!\n");
26
27 if (g_MkStateIcon)
28 {
31 }
32
33 if (g_MkState)
34 {
35 g_MkState = 0;
36 pSysTray->NotifyIcon(NIM_DELETE, ID_ICON_MOUSE, g_MkStateIcon, L"MouseKeys");
37 }
38
39 return S_OK;
40}
41
44{
45 TRACE("MouseKeys_Update!\n");
46
47 g_Mk.cbSize = sizeof(g_Mk);
49
50 UINT state = 0;
52 {
54 {
56 {
57 case 0:
58 default:
60 break;
63 break;
67 break;
70 break;
74 break;
77 break;
83 break;
87 break;
91 break;
92 }
93 }
94 else
95 {
97 }
98 }
99
100 UINT uId = NIM_MODIFY;
101 if (state != g_MkState)
102 {
103 if (g_MkStateIcon)
104 {
107 }
108
109 if (g_MkState == 0)
110 uId = NIM_ADD;
111
113 if (g_MkState)
114 {
116 }
117 }
118
119 if (g_MkState == 0)
120 {
121 uId = NIM_DELETE;
122 }
123
124 return pSysTray->NotifyIcon(uId, ID_ICON_MOUSE, g_MkStateIcon, L"MouseKeys");
125}
HINSTANCE g_hInstance
Definition: MainWindow.cpp:18
static int state
Definition: maze.c:121
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define NULL
Definition: types.h:112
static UINT g_MkState
Definition: mouse.cpp:11
HRESULT STDMETHODCALLTYPE MouseKeys_Shutdown(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:23
HRESULT STDMETHODCALLTYPE MouseKeys_Init(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:15
HRESULT STDMETHODCALLTYPE MouseKeys_Update(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:43
static MOUSEKEYS g_Mk
Definition: mouse.cpp:10
static HICON g_MkStateIcon
Definition: mouse.cpp:12
#define ID_ICON_MOUSE
Definition: precomp.h:36
#define IDI_MOUSE_R_DOWN
Definition: resource.h:64
#define IDI_MOUSE_R_ACTIVE
Definition: resource.h:63
#define IDI_MOUSE_R_ACTIVE_L_DOWN
Definition: resource.h:68
#define IDI_MOUSE_L_ACTIVE_R_DOWN
Definition: resource.h:67
#define IDI_MOUSE_L_DOWN
Definition: resource.h:62
#define IDI_MOUSE_NOBTN
Definition: resource.h:60
#define IDI_MOUSE_L_ACTIVE
Definition: resource.h:61
#define IDI_MOUSE_LR_DOWN
Definition: resource.h:66
#define IDI_MOUSE_DISABLED
Definition: resource.h:59
#define IDI_MOUSE_LR_ACTIVE
Definition: resource.h:65
#define S_OK
Definition: intsafe.h:52
static HICON
Definition: imagelist.c:80
#define _In_
Definition: ms_sal.h:308
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define NIM_DELETE
Definition: shellapi.h:96
#define NIM_MODIFY
Definition: shellapi.h:95
#define NIM_ADD
Definition: shellapi.h:94
#define TRACE(s)
Definition: solgame.cpp:4
UINT cbSize
Definition: winuser.h:3414
DWORD dwFlags
Definition: winuser.h:3415
#define MKF_RIGHTBUTTONSEL
Definition: winuser.h:2156
#define MKF_MOUSEMODE
Definition: winuser.h:2157
#define SPI_GETMOUSEKEYS
Definition: winuser.h:1406
#define MKF_LEFTBUTTONDOWN
Definition: winuser.h:2153
#define MKF_LEFTBUTTONSEL
Definition: winuser.h:2155
#define LoadIcon
Definition: winuser.h:5825
#define MKF_INDICATOR
Definition: winuser.h:2150
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define MKF_RIGHTBUTTONDOWN
Definition: winuser.h:2154
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define MKF_MOUSEKEYSON
Definition: winuser.h:2145
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105