/// <summary>
        /// Checks the equality of the icon based on the hWnd and uID;
        /// </summary>
        /// <param name="other">The other NotifyIcon to compare to.</param>
        /// <returns>Indication of equality.</returns>
        public bool Equals(NotifyIcon other)
        {
            if (other == null)
            {
                return(false);
            }

            return((HWnd.Equals(other.HWnd) && UID.Equals(other.UID)) || (other.GUID != Guid.Empty && GUID.Equals(other.GUID)));
        }
    public void OnStoreBtn()
    {
        curHwnd = HWnd.Store;
        StageSelectWnd.SetActive(false);
        taskWnd.SetActive(false);

        ShowMainUI(false);
        storeWnd.SetActive(true);
    }
Exemple #3
0
        public static void Record()
        {
            recording = true;

            HWnd hDesk  = User32.GetDesktopWindow();
            HDc  hdcSrc = User32.GetWindowDC(hDesk);

            User32.GetWindowRect(hDesk, out Rect rect);

            int w = rect.Width;
            int h = rect.Height;


            HDc     hdcDest = Gdi32.CreateCompatibleDC(hdcSrc);
            HBitmap hBitmap = Gdi32.CreateCompatibleBitmap(hdcSrc, w, h);
            IntPtr  hold    = Gdi32.SelectObject(hdcDest, hBitmap);

            Gdi32.DeleteDC(hold);

            var m = typeof(Bitmap).GetMethod("FromGDIplus", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            Func <IntPtr, Bitmap> f = (Func <IntPtr, Bitmap>)m.CreateDelegate(typeof(Func <IntPtr, Bitmap>));

            var st  = DateTime.Now;
            int fps = 0;

            while (recording)
            {
                Gdi32.BitBlt(hdcDest, 0, 0, w, h, hdcSrc, 0, 0, TernaryRasterOperations.SRCCOPY);

                GdiPlus.GdipCreateBitmapFromHBITMAP(hBitmap, IntPtr.Zero, out IntPtr bmpPtr);
                RecordCallBack?.Invoke(f(bmpPtr));


                fps++;
                var et = DateTime.Now;
                if ((et - st).TotalMilliseconds >= 1000)
                {
                    FPS = 1000 / fps;
                    fps = 0;
                    st  = et;
                }
            }


            User32.ReleaseDC(hDesk, hdcSrc);
            Gdi32.DeleteObject(hBitmap);
        }
 public void OnBackBtn()
 {
     if (curHwnd == HWnd.Stage)
     {
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
     else if (curHwnd == HWnd.Main)
     {
         ThirdManager.instance.LoadScene("Home");
     }
     else if (curHwnd == HWnd.Store)
     {
         storeWnd.SetActive(false);
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
 }
 public void OnBackBtn()
 {
     if (curHwnd == HWnd.Stage)
     {
         StageSelectWnd.SetActive(false);
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
     else if (curHwnd == HWnd.Main)
     {
         ThirdManager.instance.LoadScene("Main");
     }
     else if (curHwnd == HWnd.Store)
     {
         storeWnd.SetActive(false);
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
     else if (curHwnd == HWnd.Task)
     {
         taskWnd.SetActive(false);
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
     else if (curHwnd == HWnd.Lottery)
     {
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
     else if (curHwnd == HWnd.Help)
     {
         helpWnd.SetActive(false);
         ShowMainUI(true);
         curHwnd = HWnd.Main;
     }
 }
Exemple #6
0
 /// <summary>
 /// Checks the equality of the icon based on the hWnd and uID;
 /// </summary>
 /// <param name="other">The other NotifyIcon to compare to.</param>
 /// <returns>Indication of equality.</returns>
 public bool Equals(NotifyIcon other)
 {
     return(HWnd.Equals(other.HWnd) && UID.Equals(other.UID));
 }
Exemple #7
0
 public static extern bool UpdateWindow(HWnd hwnd);
Exemple #8
0
 public static extern bool SetCursorPos(HWnd hWnd, [Out] out Rect lpRect);
Exemple #9
0
 public static extern bool ShowWindow([In] HWnd hWnd, [In][MarshalAs(UnmanagedType.I4)] OldShowWindowCommands cmdShow);
Exemple #10
0
 public static extern bool ValidateRect([In] HWnd hWnd, [In] ref Rect lpRect);
Exemple #11
0
 public static extern RgnStatus ExcludeUpdateRgn([In] HDc hDC, [In] HWnd hWnd);
Exemple #12
0
 public static extern bool SetForegroundWindow([In] HWnd hWnd);
Exemple #13
0
 public void OnTaskBtn()
 {
     curHwnd = HWnd.Task;
     ShowMainUI(false);
     taskWnd.SetActive(true);
 }
Exemple #14
0
 public void OnHelp()
 {
     curHwnd = HWnd.Help;
     ShowMainUI(false);
     helpWnd.SetActive(true);
 }
Exemple #15
0
 public void OnLotteryBtn()
 {
     curHwnd = HWnd.Lottery;
     ShowMainUI(false);
 }
Exemple #16
0
 public static extern RgnStatus GetWindowRgn([In] HWnd hWnd, [In] HRng hRgn);
Exemple #17
0
 public static extern RgnStatus GetWindowRgnBox([In] HWnd hWnd, [Out] out Rect lprc);
Exemple #18
0
 public static extern HDc GetWindowDC(HWnd hwnd);
Exemple #19
0
 public static extern bool InvalidateRect([In] HWnd hWnd, [In] ref Rect lpRect, [In] bool bErase);
Exemple #20
0
 public static extern bool ReleaseDC(HWnd hWnd, [In] HDc hDC);
Exemple #21
0
 public static extern HWnd SetFocus(HWnd hWnd);
Exemple #22
0
 public static extern HDc BeginPaint([In] HWnd hWnd, [Out] out PaintStruct lpPaint);
Exemple #23
0
 public static extern bool GetWindowRect([In] HWnd hWnd, [Out] out Rect lpRect);
Exemple #24
0
 public static extern bool EndPaint([In] HWnd hWnd, [In] ref PaintStruct hDC);
Exemple #25
0
 public static extern bool GetClientRect(HWnd hWnd, out Rect windowRect);
Exemple #26
0
 public static extern bool GetUpdateRect([In] HWnd hWnd, [Out] out Rect lpRect, [In][MarshalAs(UnmanagedType.Bool)] bool erase);
Exemple #27
0
 public static extern bool AnimateWindow([In] HWnd hWnd, [In][MarshalAs(UnmanagedType.I4)] int dwTime, [In][MarshalAs(UnmanagedType.I4)] WindowAnimateFlags dwFlags);
Exemple #28
0
 public static extern RgnStatus GetUpdateRgn([In] HWnd hWnd, [In] HRng hRgn, [In][MarshalAs(UnmanagedType.Bool)] bool erase);
 public override string ToString()
 {
     //return string.Format("{0}.{1} {2}", ProcessId, HWnd.ToString("X8"), ProcessName);
     return(string.Format("{0}.{1:x8} {2}", ProcessId, HWnd.ToInt64(), ProcessName));
 }
Exemple #30
0
 public static extern bool SetWindowRgn([In] HWnd hWnd, [Out] out HRng hRgn, [In][MarshalAs(UnmanagedType.Bool)] bool bRedraw);