In Touch Diamond/Touch Pro, the wired headset only allows you to control the playback of WMP mobile. Unfortunately, it does not allow you to control the playback of the TouchFlo3D’s media player. HTCbutton is an application which allows you to skip the song or play or pause the music being played.
Note: please note that you will need CF 3.5 to run this application. Most of the cooked ROMs comes with CF 3.5.
The developer of this application was generaous enough to make his code open source.