Example #1
0
        public void HideSplash()
        {
            Splash.Visibility  = Visibility.Collapsed;
            this.ShowInTaskbar = false;
            IntPtr parent  = new WindowInteropHelper(this).Handle;
            IntPtr console = NTMinerConsole.Alloc();

            SafeNativeMethods.SetParent(console, parent);
            SafeNativeMethods.SetWindowLong(console, SafeNativeMethods.GWL_STYLE, SafeNativeMethods.WS_VISIBLE);
            _isSplashed = true;
            OnSplashHided?.Invoke();
        }
Example #2
0
 private ConsoleWindow()
 {
     this.Width  = AppStatic.MainWindowWidth;
     this.Height = AppStatic.MainWindowHeight;
     InitializeComponent();
     this.Loaded += (sender, e) => {
         IntPtr parent  = new WindowInteropHelper(this).Handle;
         IntPtr console = NTMinerConsole.Alloc();
         SafeNativeMethods.SetParent(console, parent);
         SafeNativeMethods.SetWindowLong(console, SafeNativeMethods.GWL_STYLE, SafeNativeMethods.WS_VISIBLE);
         hwndSource = PresentationSource.FromVisual((Visual)sender) as HwndSource;
         hwndSource.AddHook(new HwndSourceHook(Win32MessageProc.WindowProc));
     };
 }