WndProc(ref Message m), Prevent minimize Games, Send key strokes.

Posted by Stanomatic on Stack Overflow See other posts from Stack Overflow or by Stanomatic
Published on 2010-03-08T22:53:14Z Indexed on 2010/03/09 2:21 UTC
Read the original article Hit count: 266

Filed under:
|
|

Overview: I am going to create a touch application that interfaces with games and other apps. This concept is similar to the app found on touch-buddy.com but I will be using C# and WPF instead of how the application is written in Perl. I have a few challenges I would like to evaluate. The touch-buddy app uses two approaches while interacting with games; 1. Client mode (Same machine runs both game and touch-buddy). 2. Server / Client mode where a separate box sends commands to the game machine. The reason I believe for this method was to circumvent the issue with games minimizing.

In Client only mode I am faced with the issue where I touch a screen OTHER than the main screen where the game is viewed and then the game minimizes. Not all games have this behavior but I would like to conquer the games that do minimize and prevent it.

Is it possible to keep a game front and center Focused and prevent minimizing utilizing C# WndProc(ref Message m)?

I have been experimenting with WndProc(ref Message m) where I created a win form and when I press minimize on my own Win form and it will close an instance of notepad. This proves to me that I can capture a message, prevent that message from bubbling up and then send a message to another application. I then tried to click on notepad with my touch screen and keep my win form application in focus and not minimize. At this point I am unsuccessful. I need more time understanding message codes.

Is this the right approach? Can it be done? Should I look at other libraries such as Windows Automation?

Key input is my other concern. What is the best way to send key strokes to other apps/games. Should I tap into DirectX, use some kind of send key, Automation Framework? Can any of these handle the multiple key strokes that some simulation games require?

I appreciate any links and or insight you may have. If you have gone down this path for any reason I would love to hear your comments.

Stan

© Stack Overflow or respective owner

Related posts about c#

Related posts about directx