External Cross-Hair (C# Code)

Posts 1–10 of 10 · Page 1 of 1
External Cross-Hair (C# Code)
Well, this is the best I have came up with. And the best is that it don't crash
WARNING: This code is coded for 1900 x 1080 No Border screen.
So for your own, you need to change the Lines. (Marked with red in code.)
Remember to add the:
Code:
using System.Runtime.InteropServices;
Code:
[DllImport("user32.dll", EntryPoint = "FindWindow")]
        public static extern IntPtr FindWindow(string lp1, string lp2);

IntPtr Handle = FindWindow(null, "WhatYouWant");
            try
            {
                
                using (Graphics g = Graphics.FromHwnd(Handle))
                {
                    Pen PN = new Pen(Brushes.Khaki, 2);
                    g.DrawLine(PN, 961, 520, 961, 560);
                    g.DrawLine(PN, 985, 540, 935, 540);
                    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();
            }
Put it in a timer or add the for( ; ; )

Enjoy.


Image: (This is fake. Because the Cross-Hair don't show )
May iam stupid , but what exactly does this? Can you make an screenshot ? i have 1680x1050 how to change that? and Finally where to put this in ? config??
Quote Originally Posted by TeamDarkness View Post
May iam stupid , but what exactly does this? Can you make an screenshot ? i have 1680x1050 how to change that? and Finally where to put this in ? config??
This is for C# Programmers.
To change screen resolution. (You need to test out..)
You will need a Programming Program. (Like Visual C# Express.)
Screen. Taking then
The screenshot, please.
And if for 1024х768 then what values will be?
@ Jorndel thx for the info, but still not what iam looking for ;( i was looking for some changes to make crosshair permanent red in mw3 game . Anyway good job for thoose who knows what to do with
Quote Originally Posted by TeamDarkness View Post
@ Jorndel thx for the info, but still not what iam looking for ;( i was looking for some changes to make crosshair permanent red in mw3 game . Anyway good job for thoose who knows what to do with
To do what you wish:
Go in the Mw3 Main folder. iw_0
Find: center_cross.iwi
and texture edit. (Red might not go. But others )
You can use GetClientRect to find the the dimensions of the window and do some simple algebra/math to figure out where to put the crosshair.
@Jorndel I'm kind of new to coding i know how to make trainers and stuff but not this... i know pre much how to code abit in visual basic C++ but i don't know what project to start or do? please help!
@Jorndel

Could you not have it automatically set the position? Something like...

Code:
ScrW = Get current desktop width
ScrH = Get current desktop height
XhairW = Total width of the crosshair
XhairH = Total height of the crosshair
TweakW = +1*
TweakH = +1*

XhairXPosition = (ScrW/2)-(XhairW/2)+TweakW
XhairYPosition = (ScrH/2)-(XhairH/2)+TweakH

* Because screen dimensions are even there can never be a 'true' centre pixel. 
Going by Barrat scope MW3 has the centre pixel on a 1920x1080 screen at 961, 541)
Note: This isn't C++ code! Just a rough explanation...!
Quote Originally Posted by N1pp@ View Post
@Jorndel

Could you not have it automatically set the position? Something like...

Code:
ScrW = Get current desktop width
ScrH = Get current desktop height
XhairW = Total width of the crosshair
XhairH = Total height of the crosshair
TweakW = +1*
TweakH = +1*

XhairXPosition = (ScrW/2)-(XhairW/2)+TweakW
XhairYPosition = (ScrH/2)-(XhairH/2)+TweakH

* Because screen dimensions are even there can never be a 'true' centre pixel. 
Going by Barrat scope MW3 has the centre pixel on a 1920x1080 screen at 961, 541)
Note: This isn't C++ code! Just a rough explanation...!
Yes I can.
And, did you look at the date it was posted?
12-07-2011
And this is a bad version anyway :S
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us