C # Open the system DLL with Run32dll (such as the system Picture Viewer, and place the topmost layer)

Source: Internet
Author: User

  [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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.