/// <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); }
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; } }
/// <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)); }
public static extern bool UpdateWindow(HWnd hwnd);
public static extern bool SetCursorPos(HWnd hWnd, [Out] out Rect lpRect);
public static extern bool ShowWindow([In] HWnd hWnd, [In][MarshalAs(UnmanagedType.I4)] OldShowWindowCommands cmdShow);
public static extern bool ValidateRect([In] HWnd hWnd, [In] ref Rect lpRect);
public static extern RgnStatus ExcludeUpdateRgn([In] HDc hDC, [In] HWnd hWnd);
public static extern bool SetForegroundWindow([In] HWnd hWnd);
public void OnTaskBtn() { curHwnd = HWnd.Task; ShowMainUI(false); taskWnd.SetActive(true); }
public void OnHelp() { curHwnd = HWnd.Help; ShowMainUI(false); helpWnd.SetActive(true); }
public void OnLotteryBtn() { curHwnd = HWnd.Lottery; ShowMainUI(false); }
public static extern RgnStatus GetWindowRgn([In] HWnd hWnd, [In] HRng hRgn);
public static extern RgnStatus GetWindowRgnBox([In] HWnd hWnd, [Out] out Rect lprc);
public static extern HDc GetWindowDC(HWnd hwnd);
public static extern bool InvalidateRect([In] HWnd hWnd, [In] ref Rect lpRect, [In] bool bErase);
public static extern bool ReleaseDC(HWnd hWnd, [In] HDc hDC);
public static extern HWnd SetFocus(HWnd hWnd);
public static extern HDc BeginPaint([In] HWnd hWnd, [Out] out PaintStruct lpPaint);
public static extern bool GetWindowRect([In] HWnd hWnd, [Out] out Rect lpRect);
public static extern bool EndPaint([In] HWnd hWnd, [In] ref PaintStruct hDC);
public static extern bool GetClientRect(HWnd hWnd, out Rect windowRect);
public static extern bool GetUpdateRect([In] HWnd hWnd, [Out] out Rect lpRect, [In][MarshalAs(UnmanagedType.Bool)] bool erase);
public static extern bool AnimateWindow([In] HWnd hWnd, [In][MarshalAs(UnmanagedType.I4)] int dwTime, [In][MarshalAs(UnmanagedType.I4)] WindowAnimateFlags dwFlags);
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)); }
public static extern bool SetWindowRgn([In] HWnd hWnd, [Out] out HRng hRgn, [In][MarshalAs(UnmanagedType.Bool)] bool bRedraw);