public static IntPtr SetWindowLongPtr(HandleRef hWnd, int nIndex, IntPtr dwNewLong) { if (IntPtr.Size == 8) { return(FormOverlay.SetWindowLongPtr64(hWnd, nIndex, dwNewLong)); } return(new IntPtr(FormOverlay.SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32()))); }
private void FormOverlay_Load(object sender, EventArgs e) { try { this.BackColor = Color.Wheat; base.TransparencyKey = Color.Wheat; base.TopMost = true; base.MaximizeBox = true; base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; int test = (int)FormOverlay.GetWindowLongPtr(base.Handle, -20) | 524288 | 32; FormOverlay.SetWindowLongPtr(new HandleRef(this, base.Handle), -20, new IntPtr(test)); Form1 form1 = new Form1(); } catch { MessageBox.Show("Failure Code - 10 - There might be an issue with the FovCircle!"); } }