Lock Mouse to Window

Hi,
I’m trying to lock my cursor to the window when in build windowd mode.

using System;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine;



#if UNITY_STANDALONE_WIN
    [DllImport("user32.dll")]
    static extern bool ClipCursor(ref RECT lpRect);    //ERROR at bool 

    public struct RECT
    {
        public int Left;
        public int Top;
        public int Right;
        public int Bottom;
    }
#endif

public class Cam_Movement : MonoBehaviour {

    
    public InputsForCamera[] Inputs = new InputsForCamera[1];
    public float zoomMulti;
    public float moveMulti;
    public float turnMulti;
    public GameObject CamParent;

    private CamInputs camInput;

	// Use this for initialization


    public void Start()
    {
        RECT cursorLimits;
        cursorLimits.Left = 0;
        cursorLimits.Top = 0;
        cursorLimits.Right = Screen.width - 1;
        cursorLimits.Bottom = Screen.height - 1;
        ClipCursor(ref cursorLimits);
    }

dose anybody see the problem? I assume I’m just blind and not seeing it.

Thanks
SimssmiS

Im not talking about locking the mouse to the Screen center
I’m looking for a solution to keep the mouse in the bounds of the window.

We can’t see what’s happening in ClipCusor. How would we help?

My Problem is Not the dll itsself. Visual Studio teils me that it. Expertise a class enum or delegate insted of a bool.