private void overlay_launcher_Click(object sender, EventArgs e) { if (overlayWindow != null) { overlayWindow.Close(); overlayWindow = null; } else { overlayWindow = new Overlay_SharpDX(); overlayWindow.Show(); } }
public Overlay_SharpDX(Process process) { overlay_ = this; game = process; process.Exited += Exit; this.handle = Handle; SetWindowLong(Handle, -8, process.Handle); int initialStyle = GetWindowLong(this.Handle, -20); SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS); OnResize(null); InitializeComponent(); this.FormBorderStyle = FormBorderStyle.None; }