using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;
using System;
using System.Diagnostics; //进程的类
public class ProperScreen : MonoBehaviour {
int _posX;
int _posY;
int _Txtwith;
int _Txtheight;
[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();
//获取最前端窗体句柄
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
// [DllImport("user32.dll")]
// static extern IntPtr GetWindowThreadProcessld();
void Start ()
{
bool result = SetWindowPos(GetForegroundWindow(), 0, _posX, _posY, _Txtwith, _Txtheight, SWP_SHOWWINDOW);// 设置屏大小和显示位置
}
}