Sign in to follow this  
Followers 0
FireFox

[NOT RESOLVED] make crosshair

54 posts in this topic

#1 ·  Posted (edited)

hello,

I've found some script on the forum for crosshair ; some with winapi or transparent window , but the problem is that the crosshair isn't on top with the game : I don't see it.

for that would work I have to inject process or not ? that is the question !

thanks for answers.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites



As you might already have found out in other topics, use OnTopMost for your GUI if you don't already does.

Another verry simple way is _WinAPI_SetCursor() after you started your game.

I assume the game will change/hide or something else with the cursor, that's why you have to run _WinAPI_SetCursor() after you started the game.

Depending on the game other methods is possible but I can't tell for your game.

Share this post


Link to post
Share on other sites

As you might already have found out in other topics, use OnTopMost for your GUI if you don't already does.

Another verry simple way is _WinAPI_SetCursor() after you started your game.

I assume the game will change/hide or something else with the cursor, that's why you have to run _WinAPI_SetCursor() after you started the game.

Depending on the game other methods is possible but I can't tell for your game.

Thanks I will try it later!


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks I will try it later!

The crosshair is visible over all windows except all fps games... This is my script :

#include <WindowsConstants.au3>
 #include <EditConstants.au3>
 #include <GUIConstantsEx.au3>
 
 $GUI=GUICreate("CROSSHAIR",@DesktopWidth,@DesktopHeight,0,0)
 WinSetTrans($GUI,"",0)
 GUISetState(@SW_HIDE,$GUI)
 
 
 $win=GUICreate("",@DesktopWidth,@DesktopHeight,0,0,$WS_POPUP,$WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_MDICHILD,$GUI)
 $CUR=GUICtrlCreatePic("Crosshair.bmp",350,350,35,35)
 GUISetBkColor(0x0000FF,$win)
 _Transparent($win,0x0000FF)
 GUISetState()
 
 
 Func _Transparent($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
     If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03
 
     If Not $isColorRef Then
         $i_transcolor = Hex(String($i_transcolor), 6)
         $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
     EndIf
 
     Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
 
     Select
         Case @error
             Return SetError(@error, 0, 0)
 
         Case Else
             Return 1
     EndSelect
 EndFunc;==>_Transparent
 
 
 While 1
 Sleep(50)
 WinSetOnTop($win,"",1)
 WEnd

Anyone have idea for is would be visible all the time ?

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

To be honest I dont think you'll do it .... I tried it with counter strike source , and as css is topmost already you'll struggle to win the fight ...The only way I could see of doing it was to somehow use the "GameOverlayRenderer.dll" ...But thats for css...if the dll works with all fps games I dont know....

Heres the GameOverlayRenderer.dll if you wanna try it...

it has 2 functions

1, OverlayHookD3D3

2, SetNotificationPosition

the first one looks good though

GameOverlayRenderer.dll

heres what i could find on it:

http://forum.gamedeception.net/showthread.php?p=91412

Edited by bluerein

Share this post


Link to post
Share on other sites

Thanks but how can i use this dll for autoit ?...

*void __fastcall HookFunc_10007AC0(int iHookChainDepth, void *pOrgFunc, int pCallback)

I don't know use dll call so anyone can translate this to autoit please ?


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Most of these full screen games will minimize if they lose focus or realize they are not top most in the z-order.

The only possible solution for something like this I can think of is to embed the window/crosshair as a child (like a control) on the game itself, and test various things to see what loses integrity that way.

Things you may want to look at:

SetWindowsLong

GetWindowsLong

And if you can get the source of AnyGUI.au3, you may see specifically how to do it with native code even.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

And if your still having troubles and eventually give up you could do it the old fashioned way. Put a spitball in the middle of your screen. :mellow:

Share this post


Link to post
Share on other sites

A friend of mine(Monoceres) was describing this to me yesterday. These fullscreen FPS games that use D3D aren't really fullscreen apps. They actually go to the video card. Thus the reason you can't 'overlay' them without a massive flicker. He can describe it a lot better than I can.

It is possible. But you need to know some C++ and be able to create a custom DLL. And if I remember right he said a normal windows app won't show/work with it. You need to use D3D to create a custom window. :mellow:

If I find the code I had I'll post it(If I have it). I did get a normal window to overlay, however the flicker was still bad enough that it was hard to read. It will be good enough for a quick short notification.

Szhlopp

Share this post


Link to post
Share on other sites

A friend of mine(Monoceres) was describing this to me yesterday. These fullscreen FPS games that use D3D aren't really fullscreen apps. They actually go to the video card. Thus the reason you can't 'overlay' them without a massive flicker. He can describe it a lot better than I can.

It is possible. But you need to know some C++ and be able to create a custom DLL. And if I remember right he said a normal windows app won't show/work with it. You need to use D3D to create a custom window. :mellow:

If I find the code I had I'll post it(If I have it). I did get a normal window to overlay, however the flicker was still bad enough that it was hard to read. It will be good enough for a quick short notification.

Szhlopp

Thanks Szhlopp


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

I don't mean to sound dumb, but I'm pretty sure I've seen this done in "Delta Force : Black Hawk Down". It was actually quite simplistic using WinAPI stuff to draw a cross-hair... I know it's an old game, but it utilized DX9.0c, so I can see where this is definitely possible... Just watch out for the new PunkBuster bull, I'm pretty sure a new version takes screenies, and a programmed Cross-hair could get you kicked... :mellow:

Share this post


Link to post
Share on other sites

I don't mean to sound dumb, but I'm pretty sure I've seen this done in "Delta Force : Black Hawk Down". It was actually quite simplistic using WinAPI stuff to draw a cross-hair... I know it's an old game, but it utilized DX9.0c, so I can see where this is definitely possible... Just watch out for the new PunkBuster bull, I'm pretty sure a new version takes screenies, and a programmed Cross-hair could get you kicked... :mellow:

Yeah, i see some script in autoit with winapi but doesnt work so that's not what you seen...i hope that someone know crosshair working ! :(


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@xroot

Thanks for crosshair but i appears 1millisec in game and hide away...


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Hey there I've been having this little trouble myself... however I am a complete rookie at autoit lol :)

I've been scrounging around the forums and I'm really close to getting what i want. I run css in a window because i have two screens so i have no problems with "on top". However, what i found applies a gif on top of the screen which is, unfortunately, clickable... is there any way to make something have a "click-through" feature? I also have no idea how to make this a center of a window instead of center of a monitor.

Any help is much appreciated, thanks all.

Yiyas

#include <WindowsConstants.au3>

$x = @DesktopWidth/2 - 68/2
$y = @DesktopHeight/2 - 68/2

GUICreate("", 68, 68, $x, $y, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
GUICtrlCreatePic("crosshair.gif",0,0,68,68)
GUISetState()

While 1
    Sleep(25)
WEnd
Edited by Yiyas

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Hey there I've been having this little trouble myself... however I am a complete rookie at autoit lol :)

I've been scrounging around the forums and I'm really close to getting what i want. I run css in a window because i have two screens so i have no problems with "on top". However, what i found applies a gif on top of the screen which is, unfortunately, clickable... is there any way to make something have a "click-through" feature? I also have no idea how to make this a center of a window instead of center of a monitor.

Any help is much appreciated, thanks all.

Yiyas

#include <WindowsConstants.au3>

$x = @DesktopWidth/2 - 68/2
$y = @DesktopHeight/2 - 68/2

GUICreate("", 68, 68, $x, $y, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
GUICtrlCreatePic("crosshair.gif",0,0,68,68)
GUISetState()

While 1
    Sleep(25)
WEnd
Thanks but can you give us your gif ? Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

I've seen other threads on this and so far the only way I've seen that works is to refresh the custom cursor (in this case the crosshair) at the same refresh rate as the game.

Share this post


Link to post
Share on other sites

@dbzfanatic

perhaps this is what you mean for refresh the window

While 1
GuiSetState(@SW_SHOW,$crosshair)
Wend

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0