最近公司做一个考试系统,需要一个答题栏,要求:占用屏幕上方一部分区域,而且始终置顶,当其他窗口最大化时"答题栏"始终置前并且不遮挡最大化窗口的任何部分!就像windows任务栏一样. 最终效果图如下: 首先,我们必须声明所需的结构和常量. 我们声明RECT WINAPI结构如下: [StructLayout(LayoutKind.Sequential)] struct RECT { public int left; public int top; public int right; p…
[DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] public static extern int ShowWindow(int hwnd,int nCmdShow); private const int SW_HIDE = 0; private const…