Uinty设置窗口大小和无边框模式
来源:互联网 发布:冒泡排序法c程序算法 编辑:程序博客网 时间:2024/06/06 05:15
纪念我这菜鸟找了一宿的的时间
using System;using System.Runtime.InteropServices;using UnityEngine; public class RemoveTheWindowsBorder : MonoBehaviour { [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; int _posX = 0; int _posY = 0; int _Txtwith = 800; int _Txtheight= 600; void Start() { StartCoroutine("Setposition");//Screen.SetResolution(_Txtwith, _Txtheight, false);//这个是Unity里的设置屏幕大小, } IEnumerator Setposition() { yield return new WaitForSeconds(0.1f);//不知道为什么发布于行后,设置位置的不会生效,我延迟0.1秒就可以 SetWindowLong(GetForegroundWindow(), GWL_STYLE, WS_POPUP); //无边框 bool result = SetWindowPos(GetForegroundWindow(), 0, _posX, _posY, _Txtwith, _Txtheight,SWP_SHOWWINDOW); //设置屏幕大小和位置 }}
1 0
- Uinty设置窗口大小和无边框模式
- C#无边框的窗口移动和设置窗体大小
- Qt无边框窗口实现拖动和改变大小(修改)
- 设置无边框全屏窗口
- Qt设置无边框窗口,窗口透明度
- Pyqt实现无边框窗口拖动及改变窗口大小
- Winform无边框窗口拖动及改变窗口大小
- Qt无边框窗口,自由缩放窗口大小
- 为无边框窗口设置阴影效果
- C# WPF 设置窗口无边框
- Unity窗口化无边框模式
- 无边框窗体拖动和改变大小
- 实现无边框可拖动调整大小的阴影窗口
- winform 无边框窗口 可改变窗体大小
- WPF无边框捕获消息改变窗口大小
- WPF无边框发送消息改变窗口大小
- WPF无边框窗口鼠标拖动缩放大小
- 1.2 对话框设置(样式、大小位置、无边框可拖动)
- Linux常用命令-挂载命令
- ubuntu 16.04安装opencv 2.4.9
- 【Unity】常用代码(一)
- IOS开发 UIScrollView 的属性和基本应用
- 基于Spring、Hibernate的通用DAO层与Service层的实现
- Uinty设置窗口大小和无边框模式
- 【Unity3D游戏开发】之常用代码 (二)
- 临时笔记&问题记录
- linux下查找某个字符串
- Fresco的基本使用
- 故障重现(内存篇2),JAVA内存不足导致频繁回收和swap引起的性能问题
- 献给初学labview数据采集的初学者
- myeclipse源码相关操作
- hibernate笔记