Jump to content
  • Advertisement
Sign in to follow this  
karaethon

Controlling an outside application

This topic is 4971 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a question that maybe some of the QA guys out there can help me with. I'm trying to figure out how to control the GUI of an outside application. I'd like for MY application to be able to launch a movie player, have it open a file, run for a time, and then close. The player doesn't have an API for plug-ins or even command line parameters, so my only thought was to use the windows SendInput() function to execute keyboard shortcuts, but that seems kind of hacked to me (If it would even work). I know a lot of QA automation software can "drive" other applications, but I'm not sure how that works. Does anyone have any information that could help? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Several players, Actually. Let's say, various versions of Windows Media Player, the divx player, PowerDVD, etc. None of which are open source, nor do I have access to the source for any of them. That would be the problem. The purpose of the app would be to monitor CPU/Memory usage for comparison purposes.

I guess thats why I'm looking for a generic solution. The QA automation software I talked about earlier seems to be able to do just that. And since there are many of those, I was curious what they all knew and I didn't.

Share this post


Link to post
Share on other sites
I'm not sure about the divx player but all the others should respond to command line arguments (all decent players do). If that doesn't work you could always try to emulate a drag'n'drop request.
I'm not sure if there's any more you can do except attempt to write plugins for each supported player.

Share this post


Link to post
Share on other sites
i would use SendInput and PostMessage. i cant really see any other way of automating something like that.

Share this post


Link to post
Share on other sites
Quote:
Original post by twkr
i would use SendInput and PostMessage. i cant really see any other way of automating something like that.
I guess you could try to write some kind of macro recording system to simplify supporting different applications in this way.
But still, emulating mouse input would be next to impossible since people seem to have an obsession with skinning their media players. And the keyboard shortcuts are often localization dependent.

Share this post


Link to post
Share on other sites
Thanks for the replies, guys. I guess my instinct was right. Yeah, I was thinking about just making a little script for shortcuts and/or mouse movements, and a macro recorder would be a great addition that I didn't think of.

Well, I'll get started now. Thanks again!

Share this post


Link to post
Share on other sites
If you wanted to send input to other programs, there is an old post here that covers it towards the middle and bottom. It is a quick and hackish way, but it should work with testing out the basics [wink]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!