.NET draw over fullscreen games

青春壹個敷衍的年華 提交于 2021-01-28 04:45:28

问题


Now I can draw over games but only if they are in window mode, i just draw on TopMost form and set it clickable-through:

//C++ .NET 4
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
    int initialStyle = GetWindowLong(this->Handle, -20);
    SetWindowLong(this->Handle, -20, initialStyle | 0x80000 | 0x20);
}

But I am not able to do it if the game runs in fullscreen :(

Can I do something with fullscreen games? (with C++ if possible)


回答1:


You just can't (at least that way). When the games enter full screen mode, they usually do this using low-level calls to DirectX or OpenGL, and this will disable all windowing logic of the Windows Desktop. The Game is then just drawing directly into the graphics device's framebuffer and the graphics driver will display this content on the screen - windowing is bypassed alltofether.

To really draw "over" that, you can forget all kind of WinForms/MFC calls, but you must look into low-level driver calls that would allow you to manipulate the framebuffer (though I doubt you can do this from an external process).



来源:https://stackoverflow.com/questions/14083291/net-draw-over-fullscreen-games

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!