├── .editorconfig
├── .github
└── FUNDING.yml
├── .gitignore
├── .gitmodules
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── Winook.sln
├── doc
└── Winook.svg
├── src
├── Winook.Common
│ ├── DebugHelper.h
│ ├── MainWindowFinder.h
│ ├── TimestampLogger.h
│ └── Winook.h
├── Winook.Lib.Host
│ ├── Host.cpp
│ ├── Makefile
│ ├── Resource.h
│ ├── Winook.Lib.Host.ico
│ ├── Winook.Lib.Host.rc
│ ├── Winook.Lib.Host.vcxproj
│ ├── Winook.Lib.Host.vcxproj.filters
│ └── application.manifest
├── Winook.Lib
│ ├── Lib.cpp
│ ├── Lib.def
│ ├── Lib.h
│ ├── Makefile
│ ├── MessageSender.h
│ ├── Winook.Lib.rc
│ ├── Winook.Lib.vcxproj
│ └── Winook.Lib.vcxproj.filters
└── Winook
│ ├── Helper.cs
│ ├── HookBase.cs
│ ├── HookType.cs
│ ├── KeyCode.cs
│ ├── KeyDirection.cs
│ ├── KeyboardHook.cs
│ ├── KeyboardMessageEventArgs.cs
│ ├── MessageEventArgs.cs
│ ├── MessageReceiver.cs
│ ├── Modifiers.cs
│ ├── MouseHook.cs
│ ├── MouseMessageCode.cs
│ ├── MouseMessageEventArgs.cs
│ ├── MouseMessageTypes.cs
│ ├── MouseXButtons.cs
│ ├── Properties
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ └── Winook.props
│ ├── Winook.csproj
│ ├── WinookException.cs
│ └── winook.support
│ ├── Winook.Lib.Host.x64.exe
│ ├── Winook.Lib.Host.x86.exe
│ ├── Winook.Lib.Keyboard.x64.dll
│ ├── Winook.Lib.Keyboard.x86.dll
│ ├── Winook.Lib.Mouse.x64.dll
│ └── Winook.Lib.Mouse.x86.dll
└── test
├── Winook.Desktop.Core.Test
├── App.xaml
├── App.xaml.cs
├── AssemblyInfo.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
└── Winook.Desktop.Core.Test.csproj
└── Winook.Desktop.Test
├── App.config
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
└── Winook.Desktop.Test.csproj
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Remove the line below if you want to inherit .editorconfig settings from higher directories
2 | root = true
3 |
4 | # C# files
5 | [*.cs]
6 |
7 | #### Core EditorConfig Options ####
8 |
9 | # Indentation and spacing
10 | indent_size = 4
11 | indent_style = space
12 |
13 | # New line preferences
14 | end_of_line = crlf
15 | insert_final_newline = false
16 |
17 | #### .NET Coding Conventions ####
18 |
19 | # Organize usings
20 | dotnet_separate_import_directive_groups = false
21 | dotnet_sort_system_directives_first = false
22 |
23 | # this. and Me. preferences
24 | dotnet_style_qualification_for_event = false:silent
25 | dotnet_style_qualification_for_field = false:silent
26 | dotnet_style_qualification_for_method = false:silent
27 | dotnet_style_qualification_for_property = false:silent
28 |
29 | # Language keywords vs BCL types preferences
30 | dotnet_style_predefined_type_for_locals_parameters_members = true:silent
31 | dotnet_style_predefined_type_for_member_access = true:silent
32 |
33 | # Parentheses preferences
34 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
35 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
36 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
37 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
38 |
39 | # Modifier preferences
40 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
41 |
42 | # Expression-level preferences
43 | dotnet_style_coalesce_expression = true:suggestion
44 | dotnet_style_collection_initializer = true:suggestion
45 | dotnet_style_explicit_tuple_names = true:suggestion
46 | dotnet_style_null_propagation = true:suggestion
47 | dotnet_style_object_initializer = true:suggestion
48 | dotnet_style_prefer_auto_properties = true:silent
49 | dotnet_style_prefer_compound_assignment = true:suggestion
50 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent
51 | dotnet_style_prefer_conditional_expression_over_return = true:silent
52 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
53 | dotnet_style_prefer_inferred_tuple_names = true:suggestion
54 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
55 | dotnet_style_prefer_simplified_interpolation = true:suggestion
56 |
57 | # Field preferences
58 | dotnet_style_readonly_field = true:suggestion
59 |
60 | # Parameter preferences
61 | dotnet_code_quality_unused_parameters = all:suggestion
62 |
63 | #### C# Coding Conventions ####
64 |
65 | # var preferences
66 | csharp_style_var_elsewhere = false:silent
67 | csharp_style_var_for_built_in_types = false:silent
68 | csharp_style_var_when_type_is_apparent = false:silent
69 |
70 | # Expression-bodied members
71 | csharp_style_expression_bodied_accessors = true:silent
72 | csharp_style_expression_bodied_constructors = false:silent
73 | csharp_style_expression_bodied_indexers = true:silent
74 | csharp_style_expression_bodied_lambdas = true:silent
75 | csharp_style_expression_bodied_local_functions = false:silent
76 | csharp_style_expression_bodied_methods = false:silent
77 | csharp_style_expression_bodied_operators = false:silent
78 | csharp_style_expression_bodied_properties = true:silent
79 |
80 | # Pattern matching preferences
81 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
82 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
83 | csharp_style_prefer_switch_expression = true:suggestion
84 |
85 | # Null-checking preferences
86 | csharp_style_conditional_delegate_call = true:suggestion
87 |
88 | # Modifier preferences
89 | csharp_prefer_static_local_function = true:suggestion
90 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
91 |
92 | # Code-block preferences
93 | csharp_prefer_braces = true:silent
94 | csharp_prefer_simple_using_statement = true:suggestion
95 |
96 | # Expression-level preferences
97 | csharp_prefer_simple_default_expression = true:suggestion
98 | csharp_style_deconstructed_variable_declaration = true:suggestion
99 | csharp_style_inlined_variable_declaration = true:suggestion
100 | csharp_style_pattern_local_over_anonymous_function = true:suggestion
101 | csharp_style_prefer_index_operator = true:suggestion
102 | csharp_style_prefer_range_operator = true:suggestion
103 | csharp_style_throw_expression = true:suggestion
104 | csharp_style_unused_value_assignment_preference = discard_variable:suggestion
105 | csharp_style_unused_value_expression_statement_preference = discard_variable:silent
106 |
107 | # 'using' directive preferences
108 | csharp_using_directive_placement = inside_namespace:silent
109 |
110 | #### C# Formatting Rules ####
111 |
112 | # New line preferences
113 | csharp_new_line_before_catch = true
114 | csharp_new_line_before_else = true
115 | csharp_new_line_before_finally = true
116 | csharp_new_line_before_members_in_anonymous_types = true
117 | csharp_new_line_before_members_in_object_initializers = true
118 | csharp_new_line_before_open_brace = all
119 | csharp_new_line_between_query_expression_clauses = true
120 |
121 | # Indentation preferences
122 | csharp_indent_block_contents = true
123 | csharp_indent_braces = false
124 | csharp_indent_case_contents = true
125 | csharp_indent_case_contents_when_block = true
126 | csharp_indent_labels = one_less_than_current
127 | csharp_indent_switch_labels = true
128 |
129 | # Space preferences
130 | csharp_space_after_cast = false
131 | csharp_space_after_colon_in_inheritance_clause = true
132 | csharp_space_after_comma = true
133 | csharp_space_after_dot = false
134 | csharp_space_after_keywords_in_control_flow_statements = true
135 | csharp_space_after_semicolon_in_for_statement = true
136 | csharp_space_around_binary_operators = before_and_after
137 | csharp_space_around_declaration_statements = false
138 | csharp_space_before_colon_in_inheritance_clause = true
139 | csharp_space_before_comma = false
140 | csharp_space_before_dot = false
141 | csharp_space_before_open_square_brackets = false
142 | csharp_space_before_semicolon_in_for_statement = false
143 | csharp_space_between_empty_square_brackets = false
144 | csharp_space_between_method_call_empty_parameter_list_parentheses = false
145 | csharp_space_between_method_call_name_and_opening_parenthesis = false
146 | csharp_space_between_method_call_parameter_list_parentheses = false
147 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
148 | csharp_space_between_method_declaration_name_and_open_parenthesis = false
149 | csharp_space_between_method_declaration_parameter_list_parentheses = false
150 | csharp_space_between_parentheses = false
151 | csharp_space_between_square_brackets = false
152 |
153 | # Wrapping preferences
154 | csharp_preserve_single_line_blocks = true
155 | csharp_preserve_single_line_statements = true
156 |
157 | #### Naming styles ####
158 |
159 | # Naming rules
160 |
161 | dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
162 | dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
163 | dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
164 |
165 | dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
166 | dotnet_naming_rule.types_should_be_pascal_case.symbols = types
167 | dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
168 |
169 | dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
170 | dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
171 | dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
172 |
173 | # Symbol specifications
174 |
175 | dotnet_naming_symbols.interface.applicable_kinds = interface
176 | dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
177 | dotnet_naming_symbols.interface.required_modifiers =
178 |
179 | dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
180 | dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
181 | dotnet_naming_symbols.types.required_modifiers =
182 |
183 | dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
184 | dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
185 | dotnet_naming_symbols.non_field_members.required_modifiers =
186 |
187 | # Naming styles
188 |
189 | dotnet_naming_style.pascal_case.required_prefix =
190 | dotnet_naming_style.pascal_case.required_suffix =
191 | dotnet_naming_style.pascal_case.word_separator =
192 | dotnet_naming_style.pascal_case.capitalization = pascal_case
193 |
194 | dotnet_naming_style.begins_with_i.required_prefix = I
195 | dotnet_naming_style.begins_with_i.required_suffix =
196 | dotnet_naming_style.begins_with_i.word_separator =
197 | dotnet_naming_style.begins_with_i.capitalization = pascal_case
198 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | custom: ['https://paypal.me/mancote']
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "3rd/asio"]
2 | path = 3rd/asio
3 | url = https://github.com/chriskohlhoff/asio
4 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to find out which attributes exist for C# debugging
3 | // Use hover for the description of the existing attributes
4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/test/Winook.Desktop.Core.Test/bin/Debug/netcoreapp3.1/Winook.Desktop.Core.Test.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/test/Winook.Desktop.Core.Test",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "internalConsole",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach",
24 | "processId": "${command:pickProcess}"
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "files.associations": {
3 | "iomanip": "cpp"
4 | }
5 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/test/Winook.Desktop.Core.Test/Winook.Desktop.Core.Test.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/test/Winook.Desktop.Core.Test/Winook.Desktop.Core.Test.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "${workspaceFolder}/test/Winook.Desktop.Core.Test/Winook.Desktop.Core.Test.csproj",
36 | "/property:GenerateFullPaths=true",
37 | "/consoleloggerparameters:NoSummary"
38 | ],
39 | "problemMatcher": "$msCompile"
40 | }
41 | ]
42 | }
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 1.3.2 (2021-05-08)
4 |
5 | ### Fixed
6 |
7 | - #31: Fix Dispose() issue in MouseHook
8 |
9 | ### Added
10 |
11 | - #30: Add RemoveAllHandlers()
12 |
13 | ## 1.3.1 (2021-04-30)
14 |
15 | ### Fixed
16 |
17 | - #28: Fix Dispose() issue in KeyboardHook
18 |
19 | ## 1.3.0 (2021-04-23)
20 |
21 | ### Added
22 |
23 | - #26: Add Shift, Control, Alt state to mouse messages
24 |
25 | ## 1.2.1 (2021-04-15)
26 |
27 | ### Fixed
28 |
29 | - #24: Fix Shift, Control and Alt handling
30 |
31 | ## 1.2.0 (2021-03-02)
32 |
33 | ### Added
34 |
35 | - #22: Add code to identify XButtons
36 |
37 | ## 1.1.1 (2021-02-09)
38 |
39 | ### Fixed
40 |
41 | - #21: Restore asio code
42 |
43 | ## 1.1.0 (2020-06-24)
44 |
45 | ### Changed
46 |
47 | - #20: Remove asio dependency
48 |
49 | ## 1.0.1 (2020-06-24)
50 |
51 | ### Added
52 |
53 | - #17: Support .NET Standard 2.0
54 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Permission is hereby granted, free of charge, to any person obtaining a copy
2 | of this software and associated documentation files (the "Software"), to deal
3 | in the Software without restriction, including without limitation the rights
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5 | copies of the Software, and to permit persons to whom the Software is
6 | furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all
9 | copies or substantial portions of the Software.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 | SOFTWARE.
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | [![nuget][nuget-badge]][nuget-url]
4 |
5 | [nuget-badge]: https://img.shields.io/badge/nuget-v1.3.2-blue.svg
6 | [nuget-url]: https://www.nuget.org/packages/Winook
7 |
8 | Winook is a Windows library that let you install thread-level hooks inside processes. This library offers an alternative to solutions that use global hooks. With thread-level hooks, performance and management issues can be avoided.
9 |
10 | # Information
11 | Winook uses host processes and dll injection to setup hooks. Both 32-bit and 64-bit support host applications and dlls are included.
12 |
13 | ## Features
14 | - Works in .NET Framework and .NET Core applications
15 | - 32-bit and 64-bit dynamic support
16 | - Mouse and keyboard specific message handlers
17 | - Extensive keyboard modifiers support
18 | - Mouse message filtering at dll level
19 | - Ability to ignore mouse move messages to improve performance
20 |
21 | ## Application
22 | - Game Helpers
23 | - Winook can be used in game helpers. In-game keyboard and mouse events can be tied to event handlers in your application. For example, Winook is used in [Poe Lurker](https://github.com/C1rdec/Poe-Lurker) to provide additional trading functionality.
24 | - Application Inspection
25 | - Winook can be used as a telemetry inspection tool.
26 | - Other Uses
27 | - Please share how you use Winook!
28 |
29 | # Installation
30 |
31 | ## NuGet
32 | ```
33 | Install-Package Winook
34 | ```
35 |
36 | # Usage
37 | ``` csharp
38 | _process = Process.Start(@"c:\windows\notepad.exe");
39 | //_process = Process.Start(@"c:\windows\syswow64\notepad.exe"); // works also with 32-bit
40 |
41 | _mouseHook = new MouseHook(_process.Id);
42 | //_mouseHook = new MouseHook(_process.Id, MouseMessageTypes.IgnoreMove);
43 | _mouseHook.MessageReceived += MouseHook_MessageReceived;
44 | //_mouseHook.LeftButtonUp += MouseHook_LeftButtonUp;
45 | //_mouseHook.AddHandler(MouseMessageCode.NCLeftButtonUp, MouseHook_NCLButtonUp);
46 | _mouseHook.InstallAsync();
47 |
48 | _keyboardHook = new KeyboardHook(_process.Id);
49 | _keyboardHook.MessageReceived += KeyboardHook_MessageReceived;
50 | //_keyboardHook.AddHandler(KeyCode.Y, Modifiers.ControlShift, KeyboardHook_ControlShiftY);
51 | _keyboardHook.InstallAsync();
52 |
53 | ...
54 |
55 | private void MouseHook_MessageReceived(object sender, MouseMessageEventArgs e)
56 | {
57 | Debug.Write($"Code: {e.MessageCode}; X: {e.X}; Y: {e.Y}; Modifiers: {e.Modifiers:x}; ");
58 | Debug.WriteLine($"Delta: {e.Delta}; XButtons: {e.XButtons}");
59 | }
60 |
61 | private void KeyboardHook_MessageReceived(object sender, KeyboardMessageEventArgs e)
62 | {
63 | Debug.Write($"Code: {e.KeyValue}; Modifiers: {e.Modifiers:x}; Flags: {e.Flags:x}; ");
64 | Debug.WriteLine($"Shift: {e.Shift}; Control: {e.Control}; Alt: {e.Alt}; Direction: {e.Direction}");
65 | }
66 |
67 | ```
68 |
69 | # License
70 | MIT
71 |
72 | # Acknowledgements
73 | Thanks to [C1rdec](https://github.com/C1rdec) for the inspiration and motivation. I created this initially to help him with his [project](https://github.com/C1rdec/Poe-Lurker).
74 |
--------------------------------------------------------------------------------
/Winook.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30011.22
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1464C5EF-06A7-45E9-948E-AF7F17D5C397}"
7 | ProjectSection(SolutionItems) = preProject
8 | .editorconfig = .editorconfig
9 | .gitignore = .gitignore
10 | .gitmodules = .gitmodules
11 | CHANGELOG.md = CHANGELOG.md
12 | LICENSE = LICENSE
13 | README.md = README.md
14 | EndProjectSection
15 | EndProject
16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Winook", "src\Winook\Winook.csproj", "{800700A9-E0BD-47DD-9095-318E2F4C7ADA}"
17 | EndProject
18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Winook.Lib", "src\Winook.Lib\Winook.Lib.vcxproj", "{5FB052A8-82FA-46E9-A9DF-078BF725A548}"
19 | EndProject
20 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Winook.Lib.Host", "src\Winook.Lib.Host\Winook.Lib.Host.vcxproj", "{69306344-BD77-4AF6-8890-BF001D8EA7EE}"
21 | EndProject
22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Winook.Desktop.Test", "test\Winook.Desktop.Test\Winook.Desktop.Test.csproj", "{BFE61D8C-E947-4F75-98E2-17A276F72175}"
23 | EndProject
24 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Winook.Desktop.Core.Test", "test\Winook.Desktop.Core.Test\Winook.Desktop.Core.Test.csproj", "{26BEFC8F-B812-4637-95DE-1AF365DAEBD5}"
25 | EndProject
26 | Global
27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
28 | Debug|Any CPU = Debug|Any CPU
29 | Debug|x64 = Debug|x64
30 | Debug|x86 = Debug|x86
31 | Release|Any CPU = Release|Any CPU
32 | Release|x64 = Release|x64
33 | Release|x86 = Release|x86
34 | EndGlobalSection
35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
36 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|x64.ActiveCfg = Debug|Any CPU
39 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|x64.Build.0 = Debug|Any CPU
40 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|x86.ActiveCfg = Debug|Any CPU
41 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Debug|x86.Build.0 = Debug|Any CPU
42 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU
43 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|Any CPU.Build.0 = Release|Any CPU
44 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|x64.ActiveCfg = Release|Any CPU
45 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|x64.Build.0 = Release|Any CPU
46 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|x86.ActiveCfg = Release|Any CPU
47 | {800700A9-E0BD-47DD-9095-318E2F4C7ADA}.Release|x86.Build.0 = Release|Any CPU
48 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Debug|Any CPU.ActiveCfg = Debug|Win32
49 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Debug|x64.ActiveCfg = Debug|x64
50 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Debug|x64.Build.0 = Debug|x64
51 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Debug|x86.ActiveCfg = Debug|Win32
52 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Debug|x86.Build.0 = Debug|Win32
53 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Release|Any CPU.ActiveCfg = Release|Win32
54 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Release|x64.ActiveCfg = Release|x64
55 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Release|x64.Build.0 = Release|x64
56 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Release|x86.ActiveCfg = Release|Win32
57 | {5FB052A8-82FA-46E9-A9DF-078BF725A548}.Release|x86.Build.0 = Release|Win32
58 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Debug|Any CPU.ActiveCfg = Debug|Win32
59 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Debug|x64.ActiveCfg = Debug|x64
60 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Debug|x64.Build.0 = Debug|x64
61 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Debug|x86.ActiveCfg = Debug|Win32
62 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Debug|x86.Build.0 = Debug|Win32
63 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Release|Any CPU.ActiveCfg = Release|Win32
64 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Release|x64.ActiveCfg = Release|x64
65 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Release|x64.Build.0 = Release|x64
66 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Release|x86.ActiveCfg = Release|Win32
67 | {69306344-BD77-4AF6-8890-BF001D8EA7EE}.Release|x86.Build.0 = Release|Win32
68 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|Any CPU.Build.0 = Debug|Any CPU
70 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|x64.ActiveCfg = Debug|Any CPU
71 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|x64.Build.0 = Debug|Any CPU
72 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|x86.ActiveCfg = Debug|Any CPU
73 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Debug|x86.Build.0 = Debug|Any CPU
74 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|Any CPU.ActiveCfg = Release|Any CPU
75 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|Any CPU.Build.0 = Release|Any CPU
76 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|x64.ActiveCfg = Release|Any CPU
77 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|x64.Build.0 = Release|Any CPU
78 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|x86.ActiveCfg = Release|Any CPU
79 | {BFE61D8C-E947-4F75-98E2-17A276F72175}.Release|x86.Build.0 = Release|Any CPU
80 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
82 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|x64.ActiveCfg = Debug|Any CPU
83 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|x64.Build.0 = Debug|Any CPU
84 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|x86.ActiveCfg = Debug|Any CPU
85 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Debug|x86.Build.0 = Debug|Any CPU
86 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
87 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|Any CPU.Build.0 = Release|Any CPU
88 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|x64.ActiveCfg = Release|Any CPU
89 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|x64.Build.0 = Release|Any CPU
90 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|x86.ActiveCfg = Release|Any CPU
91 | {26BEFC8F-B812-4637-95DE-1AF365DAEBD5}.Release|x86.Build.0 = Release|Any CPU
92 | EndGlobalSection
93 | GlobalSection(SolutionProperties) = preSolution
94 | HideSolutionNode = FALSE
95 | EndGlobalSection
96 | GlobalSection(ExtensibilityGlobals) = postSolution
97 | SolutionGuid = {40FB57A0-76CF-4B66-ACBA-6B945B119F11}
98 | EndGlobalSection
99 | EndGlobal
100 |
--------------------------------------------------------------------------------
/doc/Winook.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/src/Winook.Common/DebugHelper.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include
6 | #include