I was working on a project some months ago, where the client had a showreel DVD with a number of videos on it. They needed a menu screen/window to pop up automatically whenever the DVD was inserted into a Windows PC. The Menu window was to be fairly straightforward, having a set of buttons, each of which was to trigger the playback of a different video. However, the client wanted the menu buttons to start each video, in whichever video-player was set as the default for that system.

I decided to code the app in C++, using the Cinder Framework (as the Menu needed some graphics and audio).

I came across various methods for opening files externally, via their default program. However, the simplest method was to use the ‘Shell Execute’ command.

The code snippet below, shows this method in action: it simply opens a video file in whichever program is assigned to open it by default.

About

Milan Prucha is a creative coder based in London. He specialises in creating interactive experiences for exhibitions and conferences. His work includes interactive installations, games, Virtual Reality and mobile/tablet apps.

Leave a Reply

Your email address will not be published. Required fields are marked *

*