Link to home
Start Free TrialLog in
Avatar of sabrehagen
sabrehagenFlag for Australia

asked on

Set Song/Video position using the Windows Media Player control

Hi EE,

I am using Visual Basic 6 and have a Windows Media Player control on my form. I want to be able to set the position of the current file playing through the code - not by clicking the progress bar. I can get the current position in two formats - raw (1.04356834) and string (03:28) - but I just can't work out how to set the position.

Thank you very much for your help,


Jackson
This is the code to get the raw position where WMP is the Windows Media Player control:
 
WMP.controls.currentPosition
 
This is the code to get the string position where WMP is the Windows Media Player control:
 
WMP.Controls.currentPositionString

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of purquiz
purquiz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sabrehagen

ASKER

Great, I'm such an idoit, I only tried with the string not the raw :(

To finish the question, how do you convert "03:21" to a double?
You can parse the string looking for Hr Min Sec and CDbl to get your position.
Regrettably, I'm going to accept purquiz's answer, because even though it is right, I made the stupid mistake of only testing half the problem, the WRONG half :P If I hadn't given up, and tried to solve it myself, I'm sure I could have done it.

Thankyou anyway purquiz :)


Jackson