16,721
社区成员




[DllImport("User32.dll", EntryPoint = "SetWindowPos", SetLastError = true)]
public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndWinInsertAfter, int x, int y, int cx, int cy, int nFlags);
//窗口置顶,win+D失效
const int HWND_TOPMOST = -1;
const int SWP_NOSIZE = 0x0001;
const int SWP_NOMOVE = 0x0002;
SetWindowPos(Handle, (IntPtr)HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
//禁用alt+空格,alt+f4,重写wndproc
const int WM_SYSCOMMAND = 0x112;
if (m.Msg == WM_SYSCOMMAND)
{
if (m.LParam == IntPtr.Zero && radioButton1.Checked)
{
base.WndProc(ref m);
return;
}
else if (m.LParam == (IntPtr)32)
return;
}