using System.Runtime.InteropServices;
-----------------------------------------------
[DllImport("user32.dll")]
public static extern bool SetWindowPos(IntPtr hWnd,IntPtr hPos,int x,int y,int cx,int cy,uint nflags);
------------------------------------------------
IntPtr HWND_TOPMOST = new IntPtr(-1);
uint SWP_NOSIZE = 0x0001;
uint SWP_NOMOVE = 0x0002;
SetWindowPos(handle,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
窗口置前
最新推荐文章于 2022-02-25 18:19:43 发布
本文介绍如何使用C#及P/Invoke调用Windows API中的SetWindowPos函数来实现窗口置顶功能。通过DllImport属性引入user32.dll库,并定义了HWND_TOPMOST常量使窗口始终保持在最前面。
1269

被折叠的 条评论
为什么被折叠?



