Jump to content

Drawing "on top" of desktop?


Recommended Posts

Is there anyway I can create something like a 10x10 white square that I can have stay on top of every window using autoit? I'm not even sure where to start for making a script for this. It's for an old FPS game that I play, and it lacks a crosshair and I don't exactly feel like putting a dot on my monitor, lol. Kind of a strange script request, I know.. :D

Link to comment
Share on other sites

#include<guiconstants.au3>
#include <WindowsConstants.au3>

HotKeySet("^+Z", "_Exit")


$maingui =guicreate("dot", 3, 3, @desktopwidth/2-1.5, @desktopheight/2-1.5, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
guisetstate()
WinSetOnTop("dot", "", 1)
GUISetBkColor(0xffff33)

while 1
sleep(100)
WinSetOnTop("dot", "", 1)
$msg = guigetmsg()
Select
    Case $msg = $gui_event_close
        Exit
        EndSelect
WEnd

Func _Exit()
    Exit
EndFunc  ;==>_Exit

I wrote this awhile back, it worked on some FPS, didn't work on others. The only true way of making one to work in every game would be to have it draw directly from the video card...Also, I am tagging it with a "Works on My Machine" cert.

"The true measure of a man is how he treats someone who can do him absolutely no good."

Link to comment
Share on other sites

#include<guiconstants.au3>
#include <WindowsConstants.au3>

HotKeySet("^+Z", "_Exit")


$maingui =guicreate("dot", 3, 3, @desktopwidth/2-1.5, @desktopheight/2-1.5, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
guisetstate()
WinSetOnTop("dot", "", 1)
GUISetBkColor(0xffff33)

while 1
sleep(100)
WinSetOnTop("dot", "", 1)
$msg = guigetmsg()
Select
    Case $msg = $gui_event_close
        Exit
        EndSelect
WEnd

Func _Exit()
    Exit
EndFunc  ;==>_Exit

I wrote this awhile back, it worked on some FPS, didn't work on others. The only true way of making one to work in every game would be to have it draw directly from the video card...Also, I am tagging it with a "Works on My Machine" cert.

This is just what I was looking for, thank you! Works like a charm. :D
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...