|
|
#1 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
how do i get the playlist selection?
is there an equivalent for LB_GETSELITEMS or something?
or can i check if a certain playlist item is selected? thanx in advance! |
|
|
|
|
|
#2 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,210
|
will only work on a 5.x install (this should be the version that shaneh was happy with)
-daz |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
thanx for the code dro, but there are several things which i don't understand here. among them
|
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
typedef struct { char *filename; char *title; // 2048 bytes int length; int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit } waHookTitleStruct; wp + 8 is a pointer to the length (skipping over the first 2 char*'s in the struct.... since we are stuck in 32 bit, they are each 4 bytes hence the 2*4) and *(wp+8) is the length...... now as to why it actually is the playlist position and not the length beats the hell out of me.... lol....well also why they dont just reference it as wahts->length beats me too the two missing defines (fileinfo2, IPC_PE_GETINDEXTITLE) are in ipc_pe.h.... which is included with the SDK |
|
|
|
|
|
|
#5 |
|
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Actually it is referencing something outside of that structure, a value that is pushed on the stack for a function before calling yours through sendmessage. wParam just convienently is also pushed on the stack for the same function - so you can use wParam to find where on the stack to look.
Basically, you shouldnt have access to it, but I traced through the code and saw that this position is placed on the stack for you to take off - it could be changed at any time in theory - but I can't see it happening, there arne't too many changes like this happening with Winamp at the moment. Be aware that this trick won't work if format titles using ATF is disabled. |
|
|
|
|
|
#6 |
|
Senior Member
|
how is it not something in the struct?
waHookTitleStruct *wahts = (waHookTitleStruct*)wp; DWORD plpos = *((DWORD*)wp + 8); this is assuming wp really is a passed in waHookTitleStruct struct(just from looking at the code). the entire struct will be in one continuous place in memory (of course taking into account of keeping things aligned) so 8 bytes from the start of the struct is still inside the struct and should be where the length is stored. in other words you can rewrite those two lines as: waHookTitleStruct *wahts = (waHookTitleStruct*)wp; DWORD plpos = *((DWORD*)wahts + 8); and how is *(wahts + 8) different then wahts->length in this case? lol, anyhow, now time to wait and learn something :P |
|
|
|
|
|
#7 | ||
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
Quote:
Quote:
"(DWORD*)wp + 8" means wp is used as a DWORD-pointer. this affects pointer arithmetic: wp++ would increase 4 bytes, so wp+8 increases 8*sizeof(DWORD) == 32 bytes. |
||
|
|
|
|
|
#8 |
|
Senior Member
|
grrr duh
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Sep 2005
Location: Berlin, Germany
Posts: 207
|
i was able to fully test dro's code now.
i simplified it a little (see at the end). shaneh was right - it only works with ATF enabled. i originally needed to get the playlist selection to be able to replace the "edit playlist entry" dialog but i now use a solution modifing the existing dialog which also works with ATF off. thanx again for your help! code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|