using UnityEngine;
using System;
using System.Runtime.InteropServices;
public class MinSize : MonoBehaviour
{
[DllImport("user32.dll")]
public static extern bool ShowWindow(System.IntPtr hwnd, int nCmdShow);
[DllImport("user32.dll", EntryPoint = "GetForegroundWindow")]
public static extern System.IntPtr GetForegroundWindow();
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
private static extern bool EnableWindow(IntPtr hwnd, bool enable);
[DllImport("user32.dll")]
private static extern bool MoveWindow(IntPtr handle, int x, int y, int width,
int height, bool redraw);
void Start()
{
ShowWindow(FindWindow(null, "ReadQRcode"), 7);
}
}
unity最小化程序窗口
最新推荐文章于 2023-08-05 10:05:20 发布