I am currently developing an application that interacts directly with a puzzle in C #. He is able to play on the screen, scraping the state of the game, and then decides for the next step that he must take.
The application captures the width and height of the game, viewing the process and capturing its rectangle, as shown below.
var p = Process.GetProcessesByName("game")[0];
var r = new User32.Rect();
User32.SetForegroundWindow(p.MainWindowHandle);
User32.GetWindowRect(p.MainWindowHandle, ref r);
int width = r.right - r.left;
int height = r.bottom - r.top;
I was interested to know if it is possible to find out if the same sound outputs a sound or not, and then somehow identifies this sound, if any. Sound is used to indicate several events, so if I could directly capture the sound from the process, I could improve the way my application handles several scenarios in the game.
, " " , , , , ? , , .
.