public SugzWindow() { Loaded += SugzWindow_Loaded; ShowInTaskbar = false; WindowInteropHelper windowHandle = new WindowInteropHelper(this); windowHandle.Owner = AppSDK.GetMaxHWND(); AppSDK.ConfigureWindowForMax(this); Show(); }
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(); }
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(); }
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}"); } }
/// <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()); }
/// <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()))); }
/// <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())); }