Moved IWindowCore to MessagePump.cs

pull/372/head
David Hall 2023-01-21 17:52:46 -07:00
parent 9ae4a0007c
commit b6c6ae03d5
1 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,5 @@
using static Vanara.PInvoke.User32;
using System;
using static Vanara.PInvoke.User32;
namespace Vanara.PInvoke;
@ -24,6 +25,20 @@ public interface IMessagePump
int Run(IWindowCore mainWindow = null);
}
/// <summary>An interface that represents a Win32 window with created and destroyed events.</summary>
public interface IWindowCore
{
/// <summary>Occurs when the window is created and has a valid handle.</summary>
event Action Created;
/// <summary>Occurs when the window has been destroyed.</summary>
event Action Destroyed;
/// <summary>Gets the window handle.</summary>
/// <value>The window handle.</value>
HWND Handle { get; }
}
/// <summary>A basic message pump to use independently or with a window instance.</summary>
/// <example>
/// Simple example of a window creation and message pump.