Unity窗口化无边框模式
来源:互联网 发布:python的语法结构 编辑:程序博客网 时间:2024/06/16 07:28
将下面代码复制进入脚本里,然后随便放到一个物体上即可实现窗口化启动无边框哦~
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Diagnostics;
using UnityEngine;
public class WindowMod : 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();
// not used rigth now
//const uint SWP_NOMOVE = 0x2;
//const uint SWP_NOSIZE = 1;
//const uint SWP_NOZORDER = 0x4;
//const uint SWP_HIDEWINDOW = 0x0080;
const uint SWP_SHOWWINDOW = 0x0040;
const int GWL_STYLE = -16;
const int WS_BORDER = 1;
void Start()
{
SetWindowLong(GetForegroundWindow(), GWL_STYLE, WS_BORDER);
bool result = SetWindowPos(GetForegroundWindow(), 0, (int)screenPosition.x, (int)screenPosition.y, (int)screenPosition.width, (int)screenPosition.height, SWP_SHOWWINDOW);
}
}
- Unity窗口化无边框模式
- Unity启用无边框模式
- 无边框窗口代码
- 无边框窗口拖动
- 无边框窗口
- 无边框/无标题窗口
- Uinty设置窗口大小和无边框模式
- 无边框窗口代码详解
- 无边框窗口代码详解
- 无边框窗口拖动问题
- qt创建无边框窗口
- 设置无边框全屏窗口
- C# 无边框窗口缩放
- QT无边框窗口拖动
- 无边框窗口关键代码
- QT移动无边框窗口
- 无边框,窗口移动代码
- MFC-移动无边框窗口
- java中oracle语句的时间表示
- 近5年133个Java面试问题列表
- mysql零碎笔记
- R语言基本操作函数
- selenium设置firefox profile之 不进入 firstrun页面
- Unity窗口化无边框模式
- 浅析NSSet与NSArray之间的区别
- Untiy逐行读取TXT中的信息
- 开发维护大型 Java 项目的建议
- lua 在cocos2dx 2.2 中的触摸事件
- [IMX6Q]u-boot_v2009.08编译过程
- Web开发之Cookie and Session
- Python正则表达式
- 类的扩展, 延展