unity里设置窗口大小和位置的代码
来源:互联网 发布:2017年云计算市场规模 编辑:程序博客网 时间:2024/04/29 00:59
using System.Runtime.InteropServices;
#region DllImports
[ DllImport("user32.dll") ]
public static extern int WindowFromPoint(int xPoint,int yPoint);
[ DllImport("user32.dll") ]
public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags);
//参数分别是:x,y分别表示窗口左上角在屏幕的什么位置,width,height为0表示不改变窗口大小。
[ DllImport("user32.dll") ]
public static extern int GetForegroundWindow();
[ DllImport("user32.dll") ]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[ DllImport("user32.dll") ]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[ DllImport("user32.dll") ]
public static extern int GetWindowText(int hwnd,string lpString,int cch);
[DllImport("user32.dll")]
public static extern IntPtr GetActiveWindow();
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern long SetWindowLong(IntPtr hWnd,int nIndex,long dwNewLong);
#endregion
IEnumerator forceRes () {
yield return new WaitForSeconds(2);
Screen.SetResolution(3840, 1620, false);
yield return new WaitForSeconds(2);
SetWindowPos(GetActiveWindow(),-1,0,0,0,0,0x001);
}
- unity里设置窗口大小和位置的代码
- 设置窗口的客户区大小和位置
- 如何设置一个窗口的大小、位置和其他参数
- 如何设置应用程序窗口的初始大小和位置
- QT_OpenGL设置窗口出事位置和大小
- 窗口位置、大小设置
- MFC 设置窗口的大小与位置
- 代码中设置view的大小和位置
- 取得窗口大小和窗口位置-兼容所有浏览器的js代码
- 设置Gvim的启动位置与窗口大小,代码折叠及配色等
- 改变浏览器窗口的大小和位置
- 记录窗口的位置和大小
- Qt 获取窗口的位置和大小
- MFC窗口位置和大小的获取
- 设置窗口位置和大小+动态创建按钮
- mfc向导生成的 默认窗口大小和位置是如何设置的
- Ubuntu设置终端的默认窗口大小和位置坐标【OK】
- JS弹出窗口窗口的位置和大小
- restful服务接口访问乱码 和 505错误
- unindent does not match any outer indentation level
- 思科2014年中安全报告
- linux c源码之cat源码
- linux系统下配置qt开发环境
- unity里设置窗口大小和位置的代码
- 通过slider控制圆的缩放
- USACO3.4.2 Electric Fence (fence9)
- iOS判断一个字符串中是否都是数字
- IIViewDeckController侧滑出现黑影 去掉黑影
- hihoCoder - 1066 - 无间道之并查集 (并查集 + map)
- android listView 改变选中行的 字体颜色和 图片
- 程序员解决问题的60个策略
- MySQL修改root密码的多种方法