using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Interop; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace Launcher.XAML { /// /// Interaction logic for BackgroundWindowHook.xaml /// public partial class BackgroundWindowHook : Window { public BackgroundWindowHook() { InitializeComponent(); this.WindowState = WindowState.Minimized; } protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); HwndSource source = PresentationSource.FromVisual(this) as HwndSource; source.AddHook(WndProc); } private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { // Handle messages... if (msg == Code.NativeMethods.WM_SHOWME) { // TODO: ... handled = true; } return IntPtr.Zero; } } }