public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Thread processPostScanThread = new Thread(() => ProcessThreadScannedFile("test")); processPostScanThread.SetApartmentState(ApartmentState.STA); processPostScanThread.Start(); } private object ProcessThreadScannedFile(string p1) { win_form sc = new win_form (); Task.Run(() => sc.ShowDialog()); return true; } }
Quote:I have tried using pinvoke methods like (FindWindowA,SetForeGroundWindow etc.,) this.Focus(); this.Activate(); this.BringFront(); above all the three lines executed in shown,handle, activated event but also it also going in background.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)