Unity3D 去掉 exe 边框
2016-12-07 15:28
771 查看
public class NoWindows : MonoBehaviour {
public Rect screenPosition;
[DllImport("user32.dll")]
static extern IntPtr SetWindowLong(IntPtr hwnd, int _nIndex, int dwNewLong);
[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
const uint SWP_SHOWWINDOW = 0x0040;
const int GWL_STYLE = -16;
const int WS_BORDER = 1;
const int WS_POPUP = 0x800000;
void Start()
{
IntPtr handle = GetForegroundWindow();
SetWindowLong(handle, GWL_STYLE, WS_POPUP);//将网上的WS_BORDER替换成WS_POPUP
bool result = SetWindowPos(handle, 0, (int)screenPosition.x, (int)screenPosition.y, (int)screenPosition.width, (int)screenPosition.height, SWP_SHOWWINDOW);
}
}
public Rect screenPosition;
[DllImport("user32.dll")]
static extern IntPtr SetWindowLong(IntPtr hwnd, int _nIndex, int dwNewLong);
[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport("user32.dll")]
static extern IntPtr GetForegroundWindow();
const uint SWP_SHOWWINDOW = 0x0040;
const int GWL_STYLE = -16;
const int WS_BORDER = 1;
const int WS_POPUP = 0x800000;
void Start()
{
IntPtr handle = GetForegroundWindow();
SetWindowLong(handle, GWL_STYLE, WS_POPUP);//将网上的WS_BORDER替换成WS_POPUP
bool result = SetWindowPos(handle, 0, (int)screenPosition.x, (int)screenPosition.y, (int)screenPosition.width, (int)screenPosition.height, SWP_SHOWWINDOW);
}
}
相关文章推荐
- 【Unity3D自学记录】Unity3D去掉exe版本的边框
- Unity3d 去掉exe版本的边框
- Unity3d 去掉exe版本的边框
- Unity3d 去掉exe版本的边框
- Unity3d 去掉exe版本的边框
- Unity3D 发布无边框exe
- Unity exe去掉边框
- Unity3D 发布无边框exe
- C# WinFrom 去掉groupbox的边框
- 【原】去掉WebBrowser内嵌网页时的边框(含有FrameSet的情况如何处理)
- 自定义AlertDialog,去掉黑色边框
- MFC对话框程序,去掉边框和标题栏;窗口全屏显示。
- JavaFX8中去掉ScrollPane边框的3种方式
- css中textarea去掉边框和选中后的蓝色边框问题的解决方法
- 去掉谷歌浏览器获取焦点时默认的input、textarea的边框和背景
- 动态调整对话框属性(去掉标题栏,去掉边框,修改类似成Border:NONE样式)
- css去掉谷歌浏览器input、textarea、select中黄色边框
- 去掉a的虚拟边框
- imagemap控件开热点后出来的蓝色边框线去掉的办法
- Unity3D导出exe窗口参数调整培训