Jump to content

Recommended Posts

Posted (edited)

Hello,

I want to post my crosshair example because many people asked for it :lmao:

Hotkeys :

Ctrl + F12 = Show/Hide cursor

Ctrl + F5 = Stop crosshair

Ctrl + F4 = Start crosshair

Attachments :

Crosshair : Crosshair.au3

IsPressed_UDF : v2.0

Simple Crosshair v2 based on a GUI :

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

Local $iSize = 21

#region GUI
$hGUIMain = GUICreate("")

$hGUIChild = GUICreate("", $iSize, $iSize, -1, -1, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED, $WS_EX_TRANSPARENT), $hGUIMain)
GUISetBkColor($COLOR_BLACK)

GUICtrlCreateLabel("", 0, Int($iSize / 2), $iSize, 1)
GUICtrlSetBkColor(-1, $COLOR_BLUE)

GUICtrlCreateLabel("", Int($iSize / 2), 0, 1, $iSize)
GUICtrlSetBkColor(-1, $COLOR_BLUE)

_WinAPI_SetLayeredWindowAttributes($hGUIChild, $COLOR_BLACK)

GUISetState(@SW_SHOWNOACTIVATE, $hGUIChild)
#endregion

While 1
    Sleep(10)
    _WinAPI_SetWindowPos($hGUIChild, $HWND_TOPMOST, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOSENDCHANGING))
WEnd
Enjoy ! :)

Cheers, FireFox.

Edited by FireFox
Posted (edited)

@Ichigo
Added link of IsPressed_UDF...
I think its not an obligation because the udf is in my signature :)

Cheers, FireFox.

Edited by FireFox
Posted

@dgarrett8

Thanks :) Im waiting for a better way to write one time pixel on screen and it stay without have to rewrite them...

Cheers, FireFox.

Posted

@dgarrett8

Thanks :) Im waiting for a better way to write one time pixel on screen and it stay without have to rewrite them...

Cheers, FireFox.

you would have to use some directx api hooking, to make it work without flicker in fullscreen games..

  • 6 months later...

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
  • Recently Browsing   0 members

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