Well i was getting annoyed by the number showing at the start of the track when i wanted to display or spam it.
So i fixed it and will share it with you, and it is very simple.
First, i found out the current track position (ironically), and put this number in an array and found out the length, simple eh? Luckily, wa_ipc.h provides us with the SendMessage id
Then find the string length:
int pos = SendMessage(winamp, WM_USER, 0, 125);
sprintf(szPos, "%i", pos);
The +2 ensures that the fullstop and space following the number is also included.
int n = realStrlen(szPos)+2;
Now, i reversed the string containing the song name + number which the winamp forums kindly provides us with, and reversed the string:
Then, set up a char array or buffer to hold the resulting string, and then copy the string without the number at the front, which is now at the back as it has been reversed.
char *szRev = _strrev(getCurrentTrack());
If you reverse it now and print the song ingame, you will end up with a lot of random characters after the song, as the array is not completely filled unless you put a restriction on it. So before you reverse the string, you have to put a null terminator where the track name ends, like so:
strncpy(buffer, szRev, realStrlen(szRev)-n);
Then, simply reverse the string and print in game or do with whatever you want.
Feel free to comment