Shoutbox

Winamp 2 Scrolling > Patch and Matty figure it out - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Winamp 2 Scrolling > Patch and Matty figure it out (/showthread.php?tid=16755)

Winamp 2 Scrolling > Patch and Matty figure it out by matty on 10-16-2003 at 07:10 PM

hey guys, as you know i am dealing with greif for the lose of immy, so while i was surfing around the forum, i saw a post about people complaing that plus when you use the (!WAT) it will only capture what plus! sees in the taskbar, so i created the code that will find EXACTLY what its playing even if it is scrolling, now i dont have the time to create the code for the plugin and if any Visual Basic programmer out there wants to finish this for me then great (i will attach the code for the program (not the plugin code) to this thread

now there is an about window, and just pop your name into the plugin code part, but please leave the red text where it is, and what is says

well thats about all i have to say, so here you guys go, enjoy
(oh and the command could be something like (!WAT2))

ignore the first module, its just a standard one i make when i use api related programs
no need to change any of the code at all

if you just want to see what the program looks like (well the function to do it then here)

code:
Public winampTitle
Public Function winampSong2(frm As Form)

Dim winampvx As Long
winampvx = FindWindow("winamp v1.x", vbNullString)
Dim TheText As String, TL As Long
TL = SendMessageLong(winampvx, WM_GETTEXTLENGTH, 0&, 0&)
TheText = String(TL + 1, " ")
Call SendMessageByString(winampvx, WM_GETTEXT, TL + 1, TheText)
TheText = Left(TheText, TL)
If InStr(1, TheText, " - Winamp") Then
    TheText = Replace(TheText, " - Winamp", "")
    TheText = Replace(TheText, " [Stopped]", "")
    TheText = Replace(TheText, " [Paused]", "")
    For j = 1 To 500
        TheText = Replace(TheText, j & ". ", "")
    Next
End If
If TheText = "Winamp 2.91" Or TheText = "" Then
Else
    winampTitle = TheText
    frm.Caption = winampTitle
End If
End Function

RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by Patchou on 10-17-2003 at 07:01 AM

Thanks for posting this code Matty, however, that's exactly what Messenger Plus! is already doing (with some extra code for WinAmp 3). I guess the problem is in WinAmp3 Scrolling then :p


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by matty on 10-17-2003 at 02:47 PM

actually patch i hate to say it, but the code i wrote gets the song from the main part of the window (see image for what i mean)

so i hate to say it, but it does work since i have tested it, and with plus when the text IS scrolling it captures what it sees at the current time if you are online i will send you a compiled exe and you can test it out but its all relevant, i dont have time to actually make the plugin, and people have downloaded the code but no one as offered to finish the plugin, (ps i am also to lazy to make the plugin, i tried and had it working, (it just wouldn't convert the (!WAT2) to the song title , but if the song title was blank it would send a blank msg :S who knows patch who knows

[Image: attachment.php?tid=16755&pid=147501]

quote:
Originally posted by Patchou
I guess the problem is in WinAmp3 Scrolling then :p

sorry to say patch, but there is no scrolling in WinAmp3, there is in WinAmp2,
RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by Patchou on 10-17-2003 at 05:35 PM

lol, don't be so sorry, it's very possible I under looked something. However, I checked again and everything seems the same, as you, I even remove " - Winamp" when I find it. For those interested, here is an excerpt of the Messenger Plus! code that gets the song title for Winamp 2.

code:
HWND hWinamp = FindWindow(_T("Winamp v1.x"), NULL);
if(hWinamp)
{
    TCHAR sTitle[1024]; ZeroMemory(sTitle, 1024*sizeof(TCHAR));
    GetWindowText(hWinamp, sTitle, 1024);
    if(sTitle[0] != '\\0')
    {
        //Remove everything after the WinAmp marker
        for(int i = _tcsclen(sTitle)-9; i > 0; i--)
        {
            if(_tcsnicmp(sTitle+i, _T(" - Winamp"), 9) == 0)
            {
                sTitle[i] = '\\0';
                break;
            }
        }
    }
}


Let me know what I didn't saw in your VB code that makes the difference, and sorry for being such a moron lol, I'm just not that used to VB code, I can only guess what it does. Btw, WDZ, what about fixing the <code> tag so that it doesnt puts double carriage returns on every line? :)
RE: RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by matty on 10-17-2003 at 06:46 PM

quote:
Originally posted by Patchou
code:
HWND hWinamp = FindWindow(_T("Winamp v1.x"), NULL);
if(hWinamp)
{
    TCHAR sTitle[1024]; ZeroMemory(sTitle, 1024*sizeof(TCHAR));
    GetWindowText(hWinamp, sTitle, 1024);
    if(sTitle[0] != '\\0')
    {
        //Remove everything after the WinAmp marker
        for(int i = _tcsclen(sTitle)-9; i > 0; i--)
        {
            if(_tcsnicmp(sTitle+i, _T(" - Winamp"), 9) == 0)
            {
                sTitle[i] = '\\0';
                break;
            }
        }
    }
}



i dunno what to say patch, our code is identicle in everyway (except mine is vb and yours is c++ but i will post an image and show you it)

take a look at the forms caption and look at the first item in my taskbar , the winamp title is scrolling

and yes im aware of the 
code:
TheText = Replace(TheText, " [Paused]", "")
is there twice
RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by Patchou on 10-17-2003 at 11:38 PM

Well, my code is now improved and the scrolling bug is a goner, thanks to Matty. And to fix this bug, I discovered something very strange... calling GetWindowText() and sending a WM_GETTEXT message do not produce the same result (that was the difference between our two codes). I can't explain it but well, for now I'll take it as a fact.


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by matty on 10-18-2003 at 12:08 AM

GetWindowText() probably gets what is shown in the taskbar and WM_GETTEXT gets the actual window text (that would make sense to me :))

yay, i tought our god something, so yay, no more having to create a plugin for this
lol



do i get props for finding, and kinda fixing the bug??? LMAO


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by Patchou on 10-18-2003 at 12:36 AM

well, you are mentioned in the change file :)


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by matty on 10-18-2003 at 12:46 AM

yay, my dream has come true... hey patch... maybe you can add in Immy into the software (she used it as well and was loyal to everyone)

if not its cool


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by Patchou on 10-18-2003 at 01:42 AM

The only place I could add her is the Tester area in the about box... do you think it would be appropriate?


RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by dotNorma on 10-18-2003 at 01:48 AM

I do , Maybe just add a little something like...." R.I.P Immy"

Something like that , I think that would be worth a million "I'm sorrys" I am sure she would appreciate it very much.


RE: RE: Winamp 2 Scrolling > Any VB Coder wanna finish the plugin? by matty on 10-18-2003 at 03:25 AM

quote:
Originally posted by Patchou
The only place I could add her is the Tester area in the about box... do you think it would be appropriate?

ya its a great idea, patch it would mean the world to me!
RE: Winamp 2 Scrolling > Patch and Matty figure it out by Wabz on 10-18-2003 at 12:29 PM

Great idea be nice to see a little dedication to such a wonderful person


RE: Winamp 2 Scrolling > Patch and Matty figure it out by dotNorma on 10-18-2003 at 03:02 PM

quote:
Originally posted by ---+[Matty]+---
ya its a great idea, patch it would mean the world to me!

It would mean even more to her ;)
RE: RE: Winamp 2 Scrolling > Patch and Matty figure it out by matty on 10-18-2003 at 03:47 PM

quote:
Originally posted by Messenger_Plus!
quote:
Originally posted by ---+[Matty]+---
ya its a great idea, patch it would mean the world to me!

It would mean even more to her ;)


thats true, i was going to suggest adding [Image: immyrip.jpg] in the about window, but that i think is a little to much , but it would be cool to still see
RE: Winamp 2 Scrolling > Patch and Matty figure it out by chris on 10-18-2003 at 05:59 PM

instead of adding it into the app just make her name a link to her profile with tha pic on it.. im not trying to be mean or anything but i we didnt know her and even if we did she was on the forms alot but just because she has died i dont think she should get a special spot in plus! but if its alright with patchou i guess its ok