mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-03 10:36:30 +13:00
02ba400399
Forms replaced with WPF Migration not complete, yet Known open points marked with TODOs Limited and non-optimized feature set
58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
// <copyright file="FormsExtensions.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace SystemTrayMenu.Utilities
|
|
{
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
using System.Windows.Interop;
|
|
|
|
public static class FormsExtensions
|
|
{
|
|
public enum DialogResult
|
|
{
|
|
OK,
|
|
Cancel,
|
|
Ignore,
|
|
Retry,
|
|
}
|
|
|
|
public class NativeWindow : HwndSource
|
|
{
|
|
private HwndSourceHook hook;
|
|
|
|
public NativeWindow()
|
|
: base(new())
|
|
{
|
|
hook = new HwndSourceHook(WndProc);
|
|
AddHook(hook);
|
|
}
|
|
|
|
~NativeWindow()
|
|
{
|
|
RemoveHook(hook);
|
|
}
|
|
|
|
protected virtual IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
#if TODO
|
|
|
|
public static void HandleInvoke(this Control instance, Action action)
|
|
{
|
|
if (instance.InvokeRequired)
|
|
{
|
|
instance.Invoke(action);
|
|
}
|
|
else
|
|
{
|
|
action();
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
}
|