Added SystemEventHandler.MessageWindowHandleCreated event

pull/250/head
dahall 2021-08-17 13:02:39 -06:00
parent 561400a001
commit 476b02ba21
1 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,9 @@ namespace Vanara.PInvoke
Dispose(false);
}
/// <summary>Occurs when the message window handle has been created.</summary>
public event EventHandler MessageWindowHandleCreated;
/// <summary>Gets a value indicating whether this instance is running in a thread.</summary>
/// <value><see langword="true"/> if this instance is running in a thread; otherwise, <see langword="false"/>.</value>
public bool IsRunningInThread => ThreadRunning is not null;
@ -191,6 +194,9 @@ namespace Vanara.PInvoke
{
}
/// <summary>Called when the message window handle is created.</summary>
protected virtual void OnMessageWindowHandleCreated() => MessageWindowHandleCreated?.Invoke(this, EventArgs.Empty);
/// <summary>Calls the delegate list associated with the key, passing the supplied parameters.</summary>
/// <param name="key">The key.</param>
/// <param name="args">The arguments.</param>
@ -256,6 +262,7 @@ namespace Vanara.PInvoke
private void Init()
{
msgWindow = new BasicMessageWindow(MessageFilter);
msgWindow.HandleCreated += (s, e) => OnMessageWindowHandleCreated();
}
}