Launch another app at the top of the screen in tablet mode

When I run another .exe from my application, it starts in the background and does not show the application on top of the screen, and does not show the tablet’s home screen, it works fine in normal operating mode, but when I launch it in Windows 10 Tablet mode, then it not displayed on top, it starts in the background.

I used myWindow.TopMost = true;, but it does not work as intended in Windows 10 Tablet mode.

Code used to run exe file

Process p = new Process();
p.StartInfo.RedirectStandardOutput= true;
p.RedirectStandardInput = true;
p = Process.Start("myApp.exe");
p.WaitForExit();

The exe I am accessing (start) is my own exe application (this is not a system application), I am running the application on Windows 10.

It doesn't work from the top in Tablet mode (and I only target my application on tablets).

Any help is appreciated.!

+4
2

( Windows-10. WPF TopMost). : , FilterWindow TopMost ( , )

. .

private void OnFilter() {   
    var filterViewModel = ViewModelLocator.FilterViewModel;

    /* ... */

    var filterWindow = new FilterWindow {
        DataContext = filterViewModel,
        Owner = GetParentWindow()
    };
    filterWindow.ShowDialog();
    SelectedIndex = 0;
}

private static Window GetParentWindow() {
    Window parent = null;

    var activeWindows = Application.Current.Windows.Cast<Window>().Where(item => (item).IsActive).ToList();
    if (activeWindows.Any()) {
    parent = activeWindows[activeWindows.Count - 1];
    }
    else {
        foreach (var item in 
            Application.Current.Windows.Cast<object>().Where(item => item.GetType().Name == typeof(RibbonWindow).Name)) {
            parent = item as Window;
        }
    }
    return parent;
}

Owner = GetParentWindow().
Owner FilterWindow .

, . , . ( )

+3

Moerfi Owner = GetParentWindow() surperb, . , .

Surface 3, Windows 10 Pro , , MessageBox , , Win 10 "".

, , , , , Win 10. ,

. .

0

Source: https://habr.com/ru/post/1650022/


All Articles