Hi,
Welcome to our Microsoft Q&A platform!
You can try the following code:
public partial class MainWindow : Window
{
[DllImport("user32.dll")]
private static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
const int SWP_SHOWWINDOW = 0x0040;
public MainWindow()
{
InitializeComponent();
IntPtr handle = new WindowInteropHelper(this).Handle;
SetWindowPos(handle, HWND_TOPMOST, 0, 0, 100, 200, SWP_SHOWWINDOW);
}
}
Thanks.