Чтобы сделать окно чуть меньше, нужно конкретно знать размер этой панельки по вертикали.
Спасибо всем, кто подсказывал
- Код: Выделить всё
using UnityEngine;
using System.Collections;
using System;
using System.Runtime.InteropServices;
public class DetectTaskBarSize : MonoBehaviour
{
public struct Rectangle
{
public int left;
public int top;
public int right;
public int bottom;
public int Width
{
get
{
return right - left;
}
}
public int Height
{
get
{
return bottom - top;
}
}
public Rectangle(int a, int b, int c, int d)
{
left = a;
top = b;
right = c;
bottom = d;
}
}
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern bool GetWindowRect(IntPtr lpHwnd, ref Rectangle lpRect);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, IntPtr lpWindowName);
IntPtr hDC;
Rectangle myRect;
float available_desktop_space;
void Start ()
{
hDC = FindWindow("Shell_TrayWnd", IntPtr.Zero);
myRect = new Rectangle(0, 0, 0, 0);
GetWindowRect(hDC, ref myRect);
available_desktop_space = myRect.top;
Debug.Log("available desktop space: "+available_desktop_space);
}
}