[DllImport ("user32.dll", EntryPoint = "SetWindowPos", CharSet = CharSet.Auto)] static extern bool SetWindowPos ( IntPtr hWnd, IntPtr hwndinsertafter, int X, int Y, int cx, int cy, UINT uFl AGS); static readonly IntPtr hwnd_topmost = new IntPtr (-1); static readonly IntPtr hwnd_notopmost = new IntPtr (-2); static readonly IntPtr hwnd_top = new IntPtr (0); Const UINT32 swp_nosize = 0x0001; Const UINT32 Swp_nomove = 0x0002; Const UINT32 Swp_nozorder = 0x0004; Const UINT32 Swp_noredraw = 0x0008; Const UINT32 swp_noactivate = 0x0010; Const UINT32 swp_framechanged = 0x0020; Const UINT32 Swp_showwindow = 0x0040; Const UINT32 Swp_hidewindow = 0x0080; Const UINT32 swp_nocopybits = 0x0100; Const UINT32 Swp_noownerzorder = 0x0200; Const UINT32 swp_nosendchanging = 0x0400; Const UInt32 Topmost_flags = Swp_nomove | Swp_nosize; private void Button1_Click (object sender, EventArgs e) {Process process = Process.Start ("rundll32.exe", @ " C:\windows\system32\shimgvw.dll,imageview_fullscreen d:\1.jpg "); IntPtr str = process. Handle; SetWindowPos (this. Handle, hwnd_notopmost, 0, 0, 0, 0, 1 | 2); Last parameter also useful 1 | 4}
C # Open the system DLL with Run32dll (such as the system Picture Viewer, and place the topmost layer)