![]() |
I need to determine which track in the playlist is highlighted (by just single-clicking on an item). I tried using the IPC_GETLISTPOS user message, but this will only return the track number (minus 1) that is currently selected. How can I go about checking for the highlighted track in the playlist, not the selected one? Thanks!
|
Well... good news first:
It is possible to read the currently highlighted track from the playlist editor's memory space - and it really works :) Now the bad news: Besides the fact that the method I use would be regarded as a 'dirty hack' by 'professional' programmers, the memory address where the variable containing the value is located might change. However I think that the location is different only for different winamp versions (if the location is different at all). To check this out you can give my plugin a try: http://www1.inetmail.de/Bitfummler/g...geNotifier.zip Tell me if it works... if so I will translate it to MSVC++ and give you the code - if not I will have to investigate a bit. btw - I'm using winamp v2.7 Regards, -Søren |
Thanks for your reply. I tried your plugin, but unfortunately when WinAmp 2.74 loads your plugin, it only gives me a messagebox saying "Error 1875". I looked up this error code on MSDN; it is "Multiple warnings occurred performing the requested index modifications." Does your plugin normally give a messagebox stating the highlighted track? If you want, you can send me the source code (in VC++) anyway and I will try to look at it too. Thanks for helping!
|
It isn't an error, the number is just the number which the plugin extracts from the memory address I told it to get the highlighted track from. So don't worry :)
The reason why it says 'Error' is that I pass an empty character string as the title for the MessageBox() call. As I guessed the location seems to be different in version 2.7 and 2.74. I just downloaded v2.74 and look for the new location. Regards, -Søren |
How are you finding the memory address for the playlist? Just for the heck of it, I tried using Spy++ to see if there were any messages on the playlist window related to highlighting a track, but I didn't see anything useful.
|
This is becoming quite tricky now...
What I have found out so far: The highlighted track is stored in multiple locations - to be exact: 3. For version 2.70 the dword at the playlist editor's memory address 0x00450620 stores the ID of the track that was highlighted by clicking into the playlist. The dword at winamp's memory address 0x0071A5F4 stores the ID of the track that was highlighted by using the cursor keys. To mess everything up these values are not equal. If you have marked track #4 using the mouse and then using the <cur down> key to select track #5 - which value should your plugin evaluate? So this is where the third value (PE's memory addr: 0x0071C27C) is becoming important: If the last track was highlighted using the mouse then it's value is equal to the PE's memory address 0x00450620. However if the keyboard was used then it contains some ID representing the key (38 being <cur up> and 40 <cur down> ) and thereafter contains some high number as 64717458 or 26668 - always exceeding the playlist length. Using this third memory address you could decide which value you have to use. ...but as everything is following Murphy's laws it can't be this easy. Right. If the user presses some other key as <cur right> to fast forward within the currently played track then the value at 0x0071A5F4 is some strange number as -1074314757. This is what I would call a 'dirty hack'... :D One can surely get it to work, however it becomes more work than I thought. What I will do is: getting the thing working under Delphi and then translating everything to C++ (I haven't written anything in C++ yet). How I found out the memory addresses? Well... :) As I'm a quite curious person I have some nice debug/exploit tools lying around - one of them being GameHack. You can get it here: http://www.gamehack.com/ Regards, -Søren |
Using Gamehack, I found the three memory addresses corresponding to the highlighted track. In C++, how would I go about accessing this specific memory address? I know it's easy to access it if I've allocated the memory myself from within the program, but since this has been allocated externally, I can't figure out how to get to it. Thanks.
|
| All times are GMT. The time now is 02:41. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.