I think the reason for this "error" is that the mouse clicks on one of the pixels in the crosshair overlay and it confuses the game or windows or both. I set the magenta color as the transparent color and everything works perfectly except occasionally while playing the game, I get an error sound and the game screen loses focus and I need to quickly click back on the game window to resume playing. The image i made for the crosshair is completely 100% magenta in color except for the crosshair I want to see in-game. He/she had arranged it in such a way that I was able to mess with it enough to work the way I'd like it to.I'm using the SplashImage command to overlay an image on top of a game screen so as to have a better crosshair shown instead of the game's single white dot.
although Guest's code did not produce any changes in the crosshairs while mouse was not in Monitor 1, WinSet, alwaysontop,on,ahk_id %ID2% that are also ontop WinSet, alwaysontop,on,ahk_id %ID1% to get them ontop of other windows Yt=10 upper screenpixel of vertical crosshair Xl=10 left screenpixel of horizontal crosshair You can enter the pixelcoordinates for your screen instead.
I can get the one working on top of the PDF from here:īut somehow i broke it and now it doesn't work and when the crosshairs are placed overtop the PDF, they are placed underneath and cannot be seen. StringReplace, m1w, m1w, `.000000, All Removes decimal points and places remaining from above calculationsĪnd I'd like to add it to this, to make it only work in Monitor 1: #NoEnvĮDIT: I can use this "as is" but I'm using Gui, Add, ActiveXto show both a Flash menu, and to embed an Adobe Reader PDF. M1h := Mon1Bottom-Mon1Top Bottom side minus top side = height of monitor 1 I'm getting screen size of Monitor 1 like this: m1w := Mon1Right-Mon1Left Right side minus left side = width of monitor 1 I have a question though, I hope one or more of you can shed some light on it:)Ĭan the crosshairs be made to appear on Monitor 1 only? Variables for my screen size are not working. WinMove ahk_id %ID2%, % RulerX-VirtualScreenWidth, %RulerY%įirst of all, thank you all very much for these awesome crosshairs! They are way too cool and I must totally appropriate it for my own nefarious uses LOL. WinMove ahk_id %ID1%, %RulerX%, % RulerY-VirtualScreenHeight create crosshair by moving 1/2 length of segment Use Numeric0 & NumericDot to quit program Use Ctrl-NumericDot to lock/unlock position of crosshairs Use Ctrl-Numeric0 to toggle display of crosshairs Start script => nothing will happen (unless you change start-up behaviour) This script can make crosshairs appear on your screen. Here's a slight modification of Relayers crosshairs on screen: WinSet Transparent,255,ahk_id %ID% Opaque Winset AlwaysOnTop,ON,ahk_id %ID% Keep it always on the top Gui %n%: Show, Center W%wide% H%high% Show it Gui %n%:-Caption +ToolWindow +E0x20 No title bar, No taskbar button, Transparent for clicks WinMove ahk_id %ID2%, % RulerX-20, %RulerY% WinMove ahk_id %ID1%, %RulerX%, % RulerY-20 create crosshair by moving 1/2 length of segment RulerX := RulerX - 5 offset the mouse pointer a bit RButton:: using hotkey instead of waiting for a key keeps the right click from calling other behavior during script Here's a favorite of mine for painting a crosshair on the screen. IniWrite, %progclass%, %ScriptName%.ini, Main, progclass
IniWrite, %PosX%, %ScriptName%.ini, Main, PosX IniWrite, %PosY%, %ScriptName%.ini, Main, PosY WinSet, TransColor, White, %A_ScriptName% Gui, Add, Picture, w%ch_x% h%ch_y% AltSubmit, ch.gif IniRead, progclass, %ScriptName%.ini, Main, progclass, %progclass% IniRead, PosY, %ScriptName%.ini, Main, PosY, %PosY% IniRead, PosX, %ScriptName%.ini, Main, PosX, %PosX% PosX and PosY hold offset of cursor within window (From centre) WinGetPos, winx, winy, winw, winh, ahk_class %progclass%
exe from filename to get name for INI file DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING! Custom crosshairs can be used, edit ch.gif and edit size vars below This is NOT a hack, it merely creates a transparent window Settings saved to INI file so you only have to set up once Crosshair will ONLY appear while designated app is active 4) Use WIN+Arrow keys to move crosshair to right place 3) Crosshair will appear but probably in wrong place 2) Hit WIN+Insert to designate that as app to overlay to 1) Run app to overlay crosshair to and make it active Default size is 9x9 but you can use any size. You need a transparent GIF to use as the crosshair image. This will add a crosshair over a selected window