声明这些:
[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
private const int GWL_EX_STYLE = -20;
private const int WS_EX_APPWINDOW = 0x00040000, WS_EX_TOOLWINDOW = 0x00000080;
Run Code Online (Sandbox Code Playgroud)
然后在显示表单之前使用它:
SetWindowLong(handle, GWL_EX_STYLE, (GetWindowLong(handle, GWL_EX_STYLE) | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);
Run Code Online (Sandbox Code Playgroud)
(将句柄更改为存储窗口句柄的任何内容)
| 归档时间: |
|
| 查看次数: |
3120 次 |
| 最近记录: |