Fullscreen DirectX Overlay? Yes.. again C#

纵饮孤独 提交于 2019-11-27 14:53:22

问题


It looks like this question has been asked multiple times each in a different context and I have made some strides in making an overlay for a game (This is for informational data, etc..). I Would also like to make it inter-actable like Steam and XFire.

I have managed to get an overlay for a directx game while its in window mode... kinda.

I have looked all over stack overflow and google without a lot of luck.

If required, I can try this in C++ instead of C#. I know C# but I don't consider myself to be a professional by any means. Just need a better explanation. Heck I will be willing to put together a nice screencast/tutorial if I can get this working right.

NOTE : I would really like to do this with native code rather than a library but if there is a good free library out there, I would like to check it out.

Examples : How to overlay graphics on Windows games?

http://www.gamedev.net/community/forums/topic.asp?topic%5Fid=359794

C# "Lock" an overlay form to the position of another window

More Info : I did manage to get a windows form to overlay a game window with and set its parent to that with SetParent. This however, does not work very well because it will not work in fullscreen at all and the transparency didn't work. (basically had a transparency key and the TopMost was set to TRUE.) I would really like to find a different method.


回答1:


I did this in Delphi years ago. The only options at the time was to Inject a Native Win32 DLL into the process, the process would call my DLL DirectDraw functions and I would proxy the rest to the real DirectDraw. This was the only way I could guarantee it would work if the program switch full screen to/from windowed. My DLL would create a in-memory shared file space to communicate between it and my program.

The reason I did this was to write in game the persons(s) speaking in TeamSpeak or Ventrilo.

However, This method is not possible with CLR runtime objects. Your only optiont is to look into C++ Native DLL Injectrion/Wrapping.



来源:https://stackoverflow.com/questions/3549004/fullscreen-directx-overlay-yes-again-c-sharp

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