public void Set() { if (GameManager.Instance.GManager.GRef.Attacher == null) { return; } UIScale = D3Window.ActualHeight / 1200d; Root.Width = D3Window.ActualWidth / UIScale; Root.RenderTransform = new ScaleTransform(UIScale, UIScale, 0, 0); if (MainBar != null) { Int32Rect P = PInvokers.GetClientRect(D3Window.Process.MainWindowHandle); Size = new Size(Enigma.D3.Engine.Current.VideoPreferences.x0C_DisplayMode.x20_Width, Enigma.D3.Engine.Current.VideoPreferences.x0C_DisplayMode.x24_Height); MainBar.Width = (P.Width / UIScale); ItemOverlay.Width = (P.Width / UIScale); if (Search <LargeMap>("LargeMap") != null) { Search <LargeMap>("LargeMap").Width = (P.Width / UIScale); } } }
public static bool DiabloActive() { IntPtr hwnd = GetForegroundWindow(); uint pid; GetWindowThreadProcessId(hwnd, out pid); return(PInvokers.GetDiabloIIIFromPID((int)pid).ProcessName == "Diablo III"); }
private void SetWindowStyleTransparent(IntPtr windowHandle) { const int WS_EX_TRANSPARENT = 0x00000020; const int GWL_EXSTYLE = -20; //const int LWA_ALPHA = 0x2; // const int LWA_COLORKEY = 0x1; var exStyle = PInvokers.GetWindowLong(windowHandle, GWL_EXSTYLE); PInvokers.SetWindowLong(windowHandle, GWL_EXSTYLE, exStyle | WS_EX_TRANSPARENT | 0x00000080); // PInvokers.SetWindowLong(windowHandle, GWL_EXSTYLE, // (IntPtr)(PInvokers.GetWindowLong(windowHandle, GWL_EXSTYLE) ^ WS_EX_LAYERED ^ WS_EX_TRANSPARENT)); // PInvokers.SetLayeredWindowAttributes(windowHandle, 0, 255, LWA_ALPHA); }
public void IsOverlayVisible() { if (!PInvokers.DiabloActive()) { if (OverlayVisibility) { this.Visibility = Visibility.Hidden; } OverlayVisibility = false; } else { if (!OverlayVisibility) { this.Visibility = Visibility.Visible; } OverlayVisibility = true; } }
public void OnSizeChanged() { if ((Process == null)) { return; } if (Config._.FKConfig.General.FKSettings.UseAlternativeOverlay) { IsOverlayVisible(); } Int32Rect clientRect = PInvokers.GetClientRect(ParentHandle); if (!clientRect.Equals(ParentSize)) { Window.Width = clientRect.Width; Window.Height = clientRect.Height; Left = clientRect.X; Top = clientRect.Y; ParentSize = clientRect; } if (ParentSize == default(Int32Rect)) { ParentSize = clientRect; Process Process = PInvokers.CurrentWindow(); if (Process == null) { return; } ParentHandle = Process.MainWindowHandle; } }