View Single Post
Old 29th July 2010, 12:22   #1
theepot
Junior Member
 
Join Date: Jul 2010
Posts: 3
Winamp and Java (JNI) problem

Hi,
I'm trying to write a Winamp plugin in Java with use of JNI.

this is my JavaNative class:
code:

public class JavaNative
{
static
{
System.load("D:\\Applications\\Winamp\\Plugins\\gen_wmpTest.dll");
}

public static native void playPause();
}



this is the (important) code in gen_wmpTest:
code:

void config()
{
// invoked when plugin is configured
SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_STARTPLAY);
}

JNIEXPORT void JNICALL Java_JavaNative_playPause(JNIEnv *env, jclass cls)
{
printf("jni call\n");
SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_STARTPLAY);
}



When I configure my plugin in Winamp it will start playing (as it should).
But when I make a call to playPause() in Java it doesn't
i DO get the message "jni call" in my command prompt.

Anyone has a clue on what I am doing wrong?

Thanks,
Theepot
theepot is offline   Reply With Quote