Form appp

  • Thread starter Thread starter RGwolf
  • Start date Start date
R

RGwolf

Guest
Hello so i need help with something i cant get it to be over a app code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace project_yes
{
public partial class Form_Overlay : Form
{
RECT rect;
public const string WINDOW_NAME = "Grand Theft Auto V";
IntPtr handle = FindWindow(null, WINDOW_NAME);

public struct RECT
{
public int left, top, right, bottom;
}


[DllImport("user32.dll")]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

[DllImport("user32.dll", SetLastError = true)]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);

[DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
private static extern IntPtr FindWindowCE(string lpClassName, string lpWindowName);

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]

static extern bool GetWindowRect(HandleRef hWnd, out RECT lpRect);



public Form_Overlay()
{
InitializeComponent();
}

private void Form_Overlay_Load(object sender, EventArgs e)
{
this.BackColor = Color.Wheat;
this.TransparencyKey = Color.Wheat;
this.TopMost = true;
//this.FormBorderStyle = FormBorderStyle.None;

int initialStyle = GetWindowLong(this.Handle, -20);
SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);


GetWindowRect(handle, out rect);
this.Size = new Size(rect.right = rect.left, rect.bottom = rect.top);
}
}
}

Continue reading...
 
Back
Top