コード例 #1
0
 private void OnWindowResize(object sender, RoutedEventArgs e)
 {
     Trace.WriteLine("OnWindowResize raised...");
     System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight);
     //SHAppBarMessageHelper.QuerySetPosition(handle, size, SHAppBarMessage1.Win32.NativeMethods.ABEdge.ABE_TOP);
     SHAppBarMessageHelper.ABSetPos(handle, size);
 }
コード例 #2
0
 private void OnWindowClosing(object sender, CancelEventArgs e)
 {
     if (CairoMessage.ShowOkCancel("You will need to reboot or use the start menu shortcut in order to run Cairo again.", "Are you sure you want to exit Cairo?", "Resources/cairoIcon.png", "Exit Cairo", "Cancel") == true)
     {
         //SHAppBarMessageHelper.DeRegisterBar(handle);
         System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight);
         SHAppBarMessageHelper.RegisterBar(handle, size);
         SysTray.DestroySystemTray();
         Application.Current.Shutdown();
     }
     else
     {
         e.Cancel = true;
     }
 }
コード例 #3
0
ファイル: MenuBar.xaml.cs プロジェクト: MSylvia/cairoshell
        private void OnWindowLoaded(object sender, RoutedEventArgs e)
        {
            helper = new WindowInteropHelper(this);

            HwndSource source = HwndSource.FromHwnd(helper.Handle);

            source.AddHook(new HwndSourceHook(WndProc));

            handle = helper.Handle;
            System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight);

            appbarMessageId = SHAppBarMessageHelper.RegisterBar(handle, size);
            //SHAppBarMessageHelper.QuerySetPosition(handle, size, SHAppBarMessage1.Win32.NativeMethods.ABEdge.ABE_TOP);

            SysTray.InitializeSystemTray();
        }
コード例 #4
0
        private void OpenCloseCairoBox(object sender, RoutedEventArgs e)
        {
            bool?CloseCairoChoice = CairoMessage.ShowOkCancel("You will need to reboot or use the start menu shortcut in order to run Cairo again.", "Are you sure you want to exit Cairo?", "Resources/cairoIcon.png", "Exit Cairo", "Cancel");

            if (CloseCairoChoice.HasValue && CloseCairoChoice.Value)
            {
                //SHAppBarMessageHelper.DeRegisterBar(handle);
                System.Drawing.Size size = new System.Drawing.Size((int)this.ActualWidth, (int)this.ActualHeight);
                SHAppBarMessageHelper.RegisterBar(handle, size);
                SysTray.DestroySystemTray();
                Application.Current.Shutdown();
                // TODO: Will want to relaunch explorer.exe when we start disabling it
            }
            else
            {
            }
        }