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

dapplo / Dapplo.Windows / 22204175531

19 Feb 2026 11:16PM UTC coverage: 33.49% (-0.8%) from 34.27%
22204175531

push

github

Lakritzator
Added a new SharedMessageWindow, which handled windows messages without Windows.Forms or WPF dependencies. Much easier to use...

610 of 1950 branches covered (31.28%)

Branch coverage included in aggregate %.

0 of 129 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

1673 of 4867 relevant lines covered (34.37%)

29.97 hits per line

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

0.0
/src/Dapplo.Windows.User32/Structs/WndClassEx.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 Dapplo.Windows.Messages.Native;
5
using Dapplo.Windows.User32.Enums;
6
using System.Runtime.InteropServices;
7

8
namespace Dapplo.Windows.User32.Structs;
9

10
/// <summary>
11
/// Represents the window class structure used to define the properties and behavior of a window class for registration with the Windows operating system.
12
/// </summary>
13
/// <remarks>The WndClassEx structure contains information such as the window procedure, class styles, instance
14
/// handles, and resource handles required to register a window class using the Windows API. Before registering a window
15
/// class, ensure that the cbSize field is set to the size of this structure. This structure is typically used with the
16
/// RegisterClassEx function when creating custom window classes in native Windows applications.</remarks>
17
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
18
public struct WndClassEx
19
{
20
    private int _cbSize;
21
    private WindowsClassStyles _windowsClassStyle;
22
    private WndProc _lpfnWndProc;
23
    private int _cbClsExtra;
24
    private int _cbWndExtra;
25
    private nint _hInstance;
26
    private nint _hIcon;
27
    private nint _hCursor;
28
    private nint _hbrBackground;
29
    private string _lpszMenuName;
30
    private string _lpszClassName;
31
    private nint _hIconSm;
32

33
    /// <summary>
34
    /// Gets or sets the Windows class styles that define the appearance and behavior of the associated window.
35
    /// </summary>
36
    /// <remarks>Modifying this property allows customization of window features such as redraw behavior,
37
    /// double-click support, and other class-level attributes. Changes to the class style may affect how the window
38
    /// interacts with the operating system and other applications.</remarks>
NEW
39
    public WindowsClassStyles WindowsClassStyle { get => _windowsClassStyle; set => _windowsClassStyle = value; }
×
40

41
    /// <summary>
42
    /// Gets or sets the handle to the current application instance.
43
    /// </summary>
NEW
44
    public nint HInstance { get => _hInstance; set => _hInstance = value; }
×
45

46
    /// <summary>
47
    /// Gets or sets the application-defined callback function that processes messages sent to a window.
48
    /// </summary>
49
    /// <remarks>This property typically specifies the window procedure used by the operating system to handle
50
    /// messages for a window. Assigning a custom delegate allows interception and processing of window messages. Ensure
51
    /// that the delegate remains valid for the lifetime of the window to avoid unexpected behavior.</remarks>
NEW
52
    public WndProc LpfnWndProc { get => _lpfnWndProc; set => _lpfnWndProc = value; }
×
53

54
    /// <summary>
55
    /// Gets or sets the name of the window class associated with this instance.
56
    /// </summary>
NEW
57
    public string ClassName { get => _lpszClassName; set => _lpszClassName = value; }
×
58

59
    /// <summary>
60
    /// Factory for the structure
61
    /// </summary>
62
    public static WndClassEx Create()
63
    {
NEW
64
        var result = new WndClassEx
×
NEW
65
        {
×
NEW
66
            _cbSize = Marshal.SizeOf(typeof(WndClassEx))
×
NEW
67
        };
×
NEW
68
        return result;
×
69
    }
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc