Sign in to follow this  
Followers 0
Shatteredhand

Drawing on-screen

7 posts in this topic

#1 ·  Posted (edited)

After searching for how to draw things on-screen and finding a function someone wrote called get_drawing(), making references to dllcalls to gdi32.dll and user32.dll (which despite looking up the commands, I don't fully understand), I modified it in an attempt at a static reticle for games. The problem with this method is that it draws once, and if anything draws over it, it is lost. I remedied this in my script by having the draw code loop every 10 milliseconds, which works perfect on desktop, but inside a game the drawing blinks in and out. It works well enough, but I am curious if there is a better method for doing this that would achieve a permanent drawing and perhaps not require fast looping. Has anyone tackled this problem before?

Edited by Shatteredhand

Share this post


Link to post
Share on other sites



After searching for how to draw things on-screen and finding a function someone wrote called get_drawing(), making references to dllcalls to gdi32.dll and user32.dll (which despite looking up the commands, I don't fully understand), I modified it in an attempt at a static reticle for Borderlands. The problem with this method is that it draws once, and if anything draws over it, it is lost. I remedied this in my script by having the draw code loop every 10 milliseconds, which works perfect on desktop, but inside a game the drawing blinks in and out. It works well enough, but I am curious if there is a better method for doing this that would achieve a permanent drawing and perhaps not require fast looping. Has anyone tackled this problem before?

Kinda off topic, but back when I used to play Counter Strike, I used to zoom in with the awp and put a tiny dot of bluetack on my screen where the targetting reticle was, and then zoom out.

This way I could get decent shots without having to zoom in :) dunno if you could do that here instead of trying to draw a static reticle.

Share this post


Link to post
Share on other sites

Try putting the drawing on a transparent window so it can be permanent.


My Projects:Smart Icons

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try putting the drawing on a transparent window so it can be permanent.

Been awhile since I made this topic. I didn't know how to make a transparent window so I put it off awhile. I finally did make a transparent window though and used a picture as my reticle. I used the gui style $WS_EX_TOPMOST, and it works for the desktop but not games. Is there another trick or style I could apply to get it on top of games?

Edited by Shatteredhand

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is what I have so far.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

picture()

Func picture()
    Local $gui, $background, $pic, $reticle, $msg, $width, $height
    Local $sFile = "picture.gif"
    
$width = @DesktopWidth / 2
$height = @DesktopHeight / 2
    ; transparent MDI child window
    $pic = GUICreate("crosshair", 64, 64, $width, $height, $WS_POPUP,  BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED))
    ; transparent pic
    $reticle = GUICtrlCreatePic($sFile, 0, 0, 64, 64)
    GUISetState(@SW_SHOW)
    WinSetOnTop("crosshair", "", 1)

    Do
        $msg = GUIGetMsg()

    Until $msg = $GUI_EVENT_CLOSE
EndFunc
Edited by Shatteredhand

Share this post


Link to post
Share on other sites

Borderlands is an online multiplayer game and since using a cross-hair hack is considered cheating, I refer you to Game Bots topic.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Borderlands is an online multiplayer game and since using a cross-hair hack is considered cheating, I refer you to Game Bots topic.

The game is not important at all, I edited out any references to it.

The crux of my problem is I can't get a picture to always be on top. Several games overlay it, task manager overlays it. I just want to know why that's the case, and if anyone knows a solution. I've tried WinSetOnTop() function, and the $WS_EX_TOPMOST style, that is the extent of my knowledge.

Edited by Shatteredhand

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