コード例 #1
0
ファイル: SugzWindow.cs プロジェクト: Sugz/CSharp
        public SugzWindow()
        {
            Loaded       += SugzWindow_Loaded;
            ShowInTaskbar = false;
            WindowInteropHelper windowHandle = new WindowInteropHelper(this);

            windowHandle.Owner = AppSDK.GetMaxHWND();
            AppSDK.ConfigureWindowForMax(this);
            Show();
        }
コード例 #2
0
ファイル: MaxPlugin.cs プロジェクト: rdsgautier/DccPlugin
        public void Show()
        {
            // Create an interop helper
            System.Windows.Interop.WindowInteropHelper windowHandle =
                new System.Windows.Interop.WindowInteropHelper(_wnd);

            // Assign the 3ds Max HWnd handle to the interop helper
            windowHandle.Owner = AppSDK.GetMaxHWND();

            // Setup 3ds Max to handle the WPF correctly
            AppSDK.ConfigureWindowForMax(_wnd);

            _wnd.Show();
        }
コード例 #3
0
        public static void OpenMainWindow()
        {
            mainWindow = new MainWindow();
            mainWindow.ShowInTaskbar = false;

            // ReSharper disable once ObjectCreationAsStatement
            new WindowInteropHelper(mainWindow)
            {
                Owner = AppSDK.GetMaxHWND()
            };

            AppSDK.ConfigureWindowForMax(mainWindow);

            Interactions.Setup(mainWindow, new MaxProvider());
            mainWindow.Show();
        }
コード例 #4
0
        private void OpenJobConfigWindow()
        {
            try
            {
                var dialog = new Window
                {
                    Title                 = Strings.SubmitJob_Title,
                    SizeToContent         = SizeToContent.WidthAndHeight,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    ResizeMode            = ResizeMode.CanResizeWithGrip,
                    ShowInTaskbar         = true
                };

                _maxRequestInterceptor = new MaxRequestInterceptor();
                var jobSubmissionForm = new JobSubmissionForm(LabsRequestHandler, _maxRequestInterceptor, Log.Instance);
                dialog.Content = jobSubmissionForm;

#if !DEBUG
                // only works in the context of 3ds Max
                var maxIcon = GetMaxIcon();
                if (maxIcon != null)
                {
                    dialog.Icon = maxIcon;
                }

                var windowHandle = new WindowInteropHelper(dialog);
                windowHandle.Owner = AppSDK.GetMaxHWND();
                AppSDK.ConfigureWindowForMax(dialog);
#endif
                dialog.Show();
            }
            catch (Exception ex)
            {
                Log.Instance.Error($"{ex.Message}\n{ex}", Strings.SubmitJob_Error, true);
                MessageBox.Show($"{Strings.SubmitJob_Error}.\n{ex.Message}\n{ex}");
            }
        }
コード例 #5
0
ファイル: SugzForm.cs プロジェクト: Sugz/CSharp
 /// <summary>
 /// Handles the Closed event.
 ///
 /// </summary>
 /// <param name="sender">The object that generated the event this method handles.</param><param name="e">The args for this event. EventArgs.Empty by default.</param>
 private void FormClosedHandler(object sender, FormClosedEventArgs e)
 {
     this.FormClosed -= new FormClosedEventHandler(this.FormClosedHandler);
     Win32API.BringWindowToTop(AppSDK.GetMaxHWND());
 }
コード例 #6
0
ファイル: SugzForm.cs プロジェクト: Sugz/CSharp
 /// <summary>
 /// Displays this form as a modal dialog and
 ///             sets the main application's window as the parent.
 ///
 /// </summary>
 ///
 /// <returns>
 /// The result of this modal interaction.  The
 ///             return value is the same as Form.ShowDialog(IWin32Window)
 ///
 /// </returns>
 public virtual DialogResult ShowModal()
 {
     return(this.ShowDialog((IWin32Window)NativeWindow.FromHandle(AppSDK.GetMaxHWND())));
 }
コード例 #7
0
ファイル: SugzForm.cs プロジェクト: Sugz/CSharp
 /// <summary>
 /// Displays this form modelessly sets the main application's window as
 ///             the parent.
 ///
 /// </summary>
 public virtual void ShowModeless()
 {
     this.Show((IWin32Window)NativeWindow.FromHandle(AppSDK.GetMaxHWND()));
 }