Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Sending messages to EG (Winamp + Albumlist) - help!

If you have a question or need help, this is the place to be.
Post Reply
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Sending messages to EG (Winamp + Albumlist) - help!

Post by stisev »

http://albumlist.sourceforge.net/page.php?p=developer

Go to that URL.

For complicated reasons, pressing F3 to bring up the search albums dialogue is NOT an option. Thus, the only other choice that I have is to manually "send a message" to albumlist (winamp) from EG.

However, I'm having a lot of problems. I've never done this before, so my inexperience confounds the difficulty. :(

I want to use: IPC_JUMPTOALBUM to Brings up the 'Jump to Album' dialog.


I tried this entry, but it didn't work:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1487">
    <Action>
        Window.SendMessage()
    </Action>
</EventGhost>
I don't know if this SendMessage() is doing anything. i entered IPC_JUMPTOALBUM but it doesn't let me save it.

Please help! :(
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Sending messages to EG (Winamp + Albumlist) - help!

Post by Pako »

Try this macro:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1487">
    <Macro Name="Find Window: Winamp AL" Expanded="True">
        <Action>
            Window.FindWindow(u'winamp.exe', u'Winamp AL', u'Winamp AL', None, None, None, True, 0.0, 0)
        </Action>
        <Action>
            EventGhost.PythonScript(u'from win32gui import SendMessage\nWM_ALL_IPC = 0x0400\nIPC_JUMPTOALBUM = 122\nSendMessage(eg.lastFoundWindows[0], WM_ALL_IPC, IPC_JUMPTOALBUM, 0)')
        </Action>
    </Macro>
</EventGhost>
Pako
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: Sending messages to EG (Winamp + Albumlist) - help!

Post by stisev »

Hi Pako,
Thanks for the response. Hang on while I try it!


EDIT:
Pako, wow great! It worked!

Another Q: Let's say I wanted to add another function from:


Code: Select all

from win32gui import SendMessage
WM_ALL_IPC = 0x0400
****IPC_JUMPTOALBUM**** = 122
SendMessage(eg.lastFoundWindows[0], WM_ALL_IPC, ****IPC_JUMPTOALBUM****, 0)
If I changed IPC_JUMPTOALBUM (the **** regions of the code), would it work?


Let's say I wanted to use IPC_PLAYRANDOMALBUM instead of JUMPTOALBUM. Would this work?


Code: Select all

from win32gui import SendMessage
WM_ALL_IPC = 0x0400
****IPC_PLAYRANDOMALBUM**** = 122
SendMessage(eg.lastFoundWindows[0], WM_ALL_IPC, ****IPC_PLAYRANDOMALBUM****, 0)
I guess I could try it and see, but I would like to make sure there would be no adverse affects.

Thanks as always. You're an invaluable resource for this forum!
Sev

EDIT #2:

Apparently I answered my own question. It does (sort of) work, but with errors.
ERROR:

Code: Select all

Traceback (most recent call last):
  Python script "16", line 4, in <module>
    SendMessage(eg.lastFoundWindows[0], WM_ALL_IPC, IPC_JUMPTOALBUM, 0)
IndexError: list index out of range


EDIT #3: stand by :)
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Sending messages to EG (Winamp + Albumlist) - help!

Post by Pako »

http://albumlist.sourceforge.net/page.php?p=developer
Winamp.png
Winamp.png (2.99 KiB) Viewed 1882 times
Pako
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: Sending messages to EG (Winamp + Albumlist) - help!

Post by stisev »

LOL. Sorry for my stupidity! Where exactly do I put that file. I didn't see any instructions on that site and Googled with no luck :(
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Sending messages to EG (Winamp + Albumlist) - help!

Post by topix »

He means, you should read the file. Then you will find that IPC_PLAYRANDOMALBUM = 102. The code would then look like this:

Code: Select all

from win32gui import SendMessage
WM_ALL_IPC = 0x0400
IPC_PLAYRANDOMALBUM = 102
SendMessage(eg.lastFoundWindows[0], WM_ALL_IPC, IPC_PLAYRANDOMALBUM, 0)
Post Reply