Page 1 of 1

windows api SendMessage() 'n' php

Posted: Tue Nov 09, 2004 6:20 pm
by bimo
I've been having a little discussion with the winamp developers board about controlling the start time of streaming mp3s. DrO said that the only way I could make an audio clip start in the middle is if I used SendMessage() which as I understand it is a function from the windows api.

I've also searched this forum for ways to communicate with Windows and found the [php_man]Program Execution Functions[/php_man], which looks good b/c it's built into PHP, and [php_man]w32api_invoke_function[/php_man], which looks good b/c it's meant specifically for communicating with windows aps but it is supposedly experimental.

DrO says that I would use SendMessage like this:

Code: Select all

SendMessage(winamp_hwnd,WM_WA_IPC,1000,IPC_JUMPTOTIME)
winamp_hwnd is a window handle which is unique to winamp whilst it's running

WM_WA_IPC is the message to be sent to the window (it's defined in the sdk header files as WM_USER)

the next two parameters in SendMessage are for sending relevant information/data for use when processing that message by the window (hence in this case the first is the time to jump and the second is an internal message identifier to tell winamp that it's a jump in time we want to do).
so all I need to do is find a way to send that.

It seems like all of the Program execution functions all have some output which I don't need. With w32api_invoke_function, it says you can turn off the output but I'm just afraid it's not going to work. Does it depend on whether it has been installed on your server?

I really appreciate your help. (and I hope that I'm not babbling)

Posted: Tue Nov 09, 2004 6:29 pm
by Weirdan
do you wan't to send the message from the server to its client? (i.e. clients connects to server, starts receiving streaming media and receives the message from the server)

Posted: Tue Nov 09, 2004 11:21 pm
by bimo
I was thinking that the user would click on the link, which would have the start time embedded in it, something like

Code: Select all

<a href="dingy.m3u?starttime=330000">5:30</a>
which would call the mp3 to stream (or the server to stream the mp3) but then the start time would get sent to a function which would send the start time to winamp in a SendMessage, like

Code: Select all

SendMessage(winamp_hwnd,WM_WA_IPC,330000,IPC_JUMPTOTIME)
(where IPC_JUMPTOTIME is the Wunamp function) which would make the stream start at 5:30 (330000 miliseconds).

or something like that.

Posted: Wed Nov 10, 2004 12:04 pm
by Weirdan
You can't call winapi functions of client computer from the server.