问题描述
现在我可以绘制游戏了,但是只有当它们处于窗口模式时,我才可以绘制 TopMost
表单并将其设置为可点击即可:
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 :(
我可以对全屏游戏做些什么吗?(如果可能,请使用C ++)
Can I do something with fullscreen games? (with C++ if possible)
推荐答案
您不能(至少是这样).当游戏进入全屏模式时,他们通常使用对DirectX或OpenGL的低级调用来执行此操作,这将禁用Windows桌面的所有窗口逻辑.然后,游戏将直接绘制到图形设备的帧缓冲区中,并且图形驱动程序将在屏幕上显示此内容-窗口被完全绕开.
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.
要真正得出结论,您可以忘记所有类型的WinForms/MFC调用,但是您必须研究允许您操纵帧缓冲区的低级驱动程序调用(尽管我怀疑您可以通过以下方式来执行此操作:外部过程).
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).
这篇关于.NET绘制全屏游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!