• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dapplo / Dapplo.Windows / 21365007899

26 Jan 2026 04:17PM UTC coverage: 34.905% (-0.4%) from 35.341%
21365007899

push

github

Lakritzator
Added support for getting the cursor with the correct size.

647 of 2024 branches covered (31.97%)

Branch coverage included in aggregate %.

1 of 86 new or added lines in 5 files covered. (1.16%)

2 existing lines in 2 files now uncovered.

1818 of 5038 relevant lines covered (36.09%)

21.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Dapplo.Windows.User32/Structs/CursorInfo.cs
1
// Copyright (c) Dapplo and contributors. All rights reserved.
2
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3

4
using System;
5
using System.Runtime.InteropServices;
6
using Dapplo.Windows.Common.Structs;
7
using Dapplo.Windows.User32.Enums;
8
using Dapplo.Windows.User32.SafeHandles;
9

10
namespace Dapplo.Windows.User32.Structs;
11

12
/// <summary>
13
/// See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms648381(v=vs.85).aspx"></a>
14
/// </summary>
15
[StructLayout(LayoutKind.Sequential)]
16
public struct CursorInfo
17
{
18
        /// <summary>
19
        /// Size of the struct
20
        /// </summary>
21
        private int _cbSize;
22

23
        private readonly CursorInfoFlags _flags;
24
        private readonly IntPtr _hCursor;
25
        private readonly NativePoint _ptScreenPos;
26

27

28
        /// <summary>
29
        /// The cursor state, as CursorInfoFlags
30
        /// </summary>
31
        public CursorInfoFlags Flags => _flags;
×
32

33
        /// <summary>
34
        /// Handle (IntPtr) to the Cursor
35
        /// </summary>
NEW
36
    public SafeCursorHandle CursorHandle => new SafeCursorHandle(_hCursor);
×
37

38
    /// <summary>
39
    /// A structure that receives the screen coordinates of the cursor.
40
    /// </summary>
NEW
41
    public NativePoint Location => _ptScreenPos;
×
42

43
        /// <summary>
44
        /// Factory for the structure
45
        /// </summary>
46
        public static CursorInfo Create()
47
        {
48
                var result = new CursorInfo
×
49
                {
×
50
                        _cbSize = Marshal.SizeOf(typeof(CursorInfo))
×
51
                };
×
52
                return result;
×
53
        }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc