![]() 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 ![]() 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 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 :/ 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |