Platform SDK: DirectX |
This topic pertains only to application development in C and C++. See DirectMusic Visual Basic Samples.
The DirectMusic Shell sample demonstrates interactive music that responds to Windows system events.
Source: (SDK root)\Samples\Multimedia\Dmusic\Src\DMShell
Executable: (SDK root)\Samples\Multimedia\DMusic\Bin\Dmshell.exe
When you run the program, its icon appears in the tray on the taskbar. Click on the icon to see a menu that allows you to change music schemes, select the output device, start and stop the music, and close the program.
Listen to the music and note how it changes and how motifs are introduced in response to system events such as minimizing, restoring, or closing a window, opening an application menu or the Start menu, and pressing a key (there are special sounds for a few keys).
The Windows system messages are obtained in Dmhook.dll, the source code for which is found in the (SDK root)\Samples\Multimedia\Dmusic\Src\DMHook folder. (Dmhook.dll must be compiled with a Microsoft compiler.)