   How to hook/overlay a game with C#?
  Hello. Can anyone tell me how to hook/overlay a game in C#?I've searched around but I couldn't find anything.I've tried getting a fullscreen C# window to overlap a game, however it wont.After researching a little, I found out that I need to hook the game and then display the C# window.Can anyone explain how I would do this? :)Thanks!   
  Still can't find anything, except this:http://www.gamedev.net/community/forums/topic.asp?topic_id=359794Could I maybe get that to hook the game, and then run the C# program?Would that make the C# program show, or doesn't it work like that?Thanks for the help.I really appreciate it.   ;  Please describe what you're trying to do. "hook/overlay" leaves things rather vague.   ;  In general, in order to get C++ and C# code to communicate, you need to stuff your C++ code into a straight C DLL interface, and then have C# call functions from this DLL. It'll look something like this:// Export.cppextern "C" DLLExport void MyFunc() { /* Call game code */ }// NativeMethods.cs[DllImport("DLLName.dll")]public static extern void MyFunc();The C# method will then reference the C method defined in your DLL. If you give us a better idea of what you're trying to do, we might be able to provide more specific advice.   ;  Thanks for the replies! :DI'm trying to create an overlay for games.Something like the ones both Steam and xFire have.I've created an app (in C#) which launches games, but I would like to have an overlay as well.The Steam overlay lets users surf the net while playing games, which is mainly the reason why I want it for my app.I've tried creating another C# program but I can't get it to overlap/go on top of a directx game, even though it will go above any Windows program.I want the overlay to display when a certain key is pressed. (Maybe something like "Alt+Z"?)Any advice how I would do this would be very helpful.Even if it's just pointers in the right direction.Thanks.   ;  Make a forms application with a panel inside it, get the window handle for the panel, pass it to your native renderer, render to it, overlay the form with a c# gui of your choosing?   ;Quote:Original post by return0Make a forms application with a panel inside it, get the window handle for the panel, pass it to your native renderer, render to it, overlay the form with a c# gui of your choosing?Okay, I can make a app with a panel in it, but everything else I don't know what you mean.I've never done any rendering before.Also, when you say "overlay the form with a c# gui", couldn't I just use the gui of the forms?Can you explain further please?Thanks.   ;  You may want to take a look at http://www.codingthewheel.com/archives/how-to-inject-a-managed-assembly-dll   