Esempio n. 1
0
 bool enumCallBack(IntPtr hMonitor, IntPtr hdc, ref RectApi prect, int d)
 {
     if (!(prect.left == 0 && prect.top == 0) &&
         ((prect.width == 1920 && prect.height == 1080) ||
          (prect.width == 1080 && prect.height == 1920) ||
          (prect.width == 1280 && prect.height == 800))
         )
     {
         // (left,top) is not (0,0) and screen resolution is fullHD or WXGA(suppose they are OculusRifts)
         screenInfo.Add(prect);
     }
     return(true);
 }
    bool enumCallBack(IntPtr hMonitor, IntPtr hdc, ref RectApi prect, int d)
    {
        //if (!(prect.left == 0 && prect.top == 0) &&
        //    ((prect.width == 1920 && prect.height == 1080) ||
        //    (prect.width == 1080 && prect.height == 1920) ||
        //    (prect.width == 1280 && prect.height == 800))
        //)
        //{
        //    // (left, top)が(0, 0)以外(つまりメインモニター以外)でかつサイズがDK2(1920, 1080)または(1080, 1920)またはDK1(1280, 800)の場合、モニター情報をリストに追加
        //    screenInfo.Add(prect);
        //}

        screenInfo.Add(prect);
        screenName.Add("Monitor:" + screenInfo.Count);
        screenNumber.Add(screenInfo.Count);
        
        return true;
    }
Esempio n. 3
0
 public static extern IntPtr GetWindowRect(IntPtr hWnd, ref RectApi rect);