Originally Posted by
layne3
Hey can you give me the code for keeping cross hair above the game? Thanks.
Well, enjoy this horrible code:
Code:
[DllImport("user32.dll", EntryPoint = "FindWindow")]
public static extern IntPtr FindWindow(string lp1, string lp2);
private void timer1_Tick(object sender, EventArgs e)
{
this.Hide();
int DH = Screen.PrimaryScreen.Bounds.Height / 2;
int DW = Screen.PrimaryScreen.Bounds.Width / 2;
IntPtr Handle = FindWindow(null, "Call of Duty®: Modern Warfare® 3");
try
{
using (Graphics g = Graphics.FromHwnd(Handle))
{
Pen PN = new Pen(Brushes.Red, 2);
g.DrawLine(PN, DW, DH + 25, DW, DH - 25);
g.DrawLine(PN, DW + 25, DH, DW - 25, DH);
g.Dispose();
}
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message, "Error Message:", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("If you could be so nice to report this on the released site, it would be great.", "Ops:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
Application.Exit();
}
}