![full screen crosshair overlay full screen crosshair overlay](https://images.anandtech.com/doci/13060/gameplus.png)
Employs the _MouseCursorFuncs UDF as well Author: Ascend4nt = #NoTrayIcon AutoItSetOption ( "TrayAutoPause", 0 ) = GLOBAL VARIABLES = Global $bHKPressed = False, $bPropertyHKPressed = False, $iResolutionchangeMsg = 0 = HOTKEY FUNCTIONS = ESC Key Pressed: Func _HotKeyPressed ( ) $bHKPressed = True EndFunc ALT-P Pressed: Func _ChangeXHairProperties ( ) 'Grow' the crosshairs and set them to Red, or alternately shrink them and set them to whitish If Not $bPropertyHKPressed Then _XHairSetDisplayProps ( 25, 25, 0xFF0000 ) Else _XHairSetDisplayProps ( 8, 8, 0xF0F0F0 ) EndIf $bPropertyHKPressed = Not $bPropertyHKPressed EndFunc = WINDOWS MESSAGE HANDLER FUNCTIONS = Func _Resolutionchanged($hWnd,$iMsg,$wParam,$lParam) Note this registers multiple-monitor settings changes too, but will only report on the primary monitor's resolution This is why we would need to call _WinAPI_GetSystemMetrics() to get the Virtual width/height = Func _Resolutionchanged ( $hWnd, $iMsg, $wParam, $lParam ) $iResolutionchangeMsg += 1 Return 'GUI_RUNDEFMSG' From Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' EndFunc = START MAIN CODE = Dim $aNewMousePos Create the crosshairs (but don't make them visible yet) _XHairInit ( 11, 11 ) HotKeySet ( "", "_HotKeyPressed" ) Alt-p switches between two alternate CrossHair properties HotKeySet ( "!p", "_ChangeXHairProperties" ) -| Register Display-Mode changes to our function.
Full screen crosshair overlay how to#
I'm looking for any solution to this problem (not neccesseraly one involving a transparent topmost window).Īlso on a sidenote if someone could explain to me how to effectively use GetLastError(), and also why are game behaving differently than a common window.Expand collapse popup #include #include = Simple test of _Crosshairs UDF. My guess is that application such as games have a more direct control over the display device. however its a pretty big file and I wasn't able to understand where the relevant part was. here was my code : SetWindowPos(handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE) Įrror = GetLastError() // i tried using GetLastError to understand what was happeningĬout << error << endl // but it only returns "5", I've read that you can look in WINNT.H for information about the meanings of error codes
![full screen crosshair overlay full screen crosshair overlay](http://dexmopla.weebly.com/uploads/1/3/3/2/133254373/575056720_orig.jpg)
I've also tried using SetWindowPos to set the game to Not TOPMOST, it didnt work either. If(myHandle = 0)//here SetWindowPos returns 0 (function failed) MyHandle = FindWindow(NULL,TEXT("Crosshair")) //retieving my own application window handle in this next part I tried using windows api to make my window appear on top of the game. tAttribute(Qt::WA_TranslucentBackground) //making the window see through tWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) // here making the window frameless and topMost via qt tGeometry(960-label->width()/2,540-label->height()/2,label->width(),label->height()) //here I'm making my window appear in the center of my screen
![full screen crosshair overlay full screen crosshair overlay](https://kbase.oncenter.com/images/ost394_crosshairs-full.png)
Label->setText("O") //I'm using an "O" as a crosshair until I can figure out how to display image transparency. Here is my code : (everything is in the main since im only testing the core functionalitys of my app, I've commented it extensively to try and make my problem more accessible) QApplication app(argc, argv) I've succesfully made my window topmost for everything except the games :/
![full screen crosshair overlay full screen crosshair overlay](https://desktopoverlay.com/en/help/custom_crosshair/configure-crosshair.png)
The aim is to have a crosshair in some FPS games that doesn't provide one. I'm trying to make an application displaying a crosshair at the center of the screen and staying on top of everything else.