Desiboy
26th April 2002, 04:55
I'm trying to write a simple program for java. My current objective is simply to forward the current song by 5 seconds (WM_COMMAND message 40148). Here's what I have so far:
/** @dll.import("USER32") */
private static native long FindWindow(String lpClassName, String lpWndowName);
/** @dll.import("USER32") */
private static native long SendMessage( long hWnd, long mes, long shit, long blah);
Public Class1(){
long WM_COMMAND = 0x0111;
long winamp_hWnd = FindWindow("Window v1.x", null);
long ret = SendMessage(winamp_hWnd, WM_COMMAND, 0, 40148);
}
The code finds the winamp window fine, however, I always get an exception while trying to call SendMessage. It says "Wrong number of parameters, 16 bytes expected, 32 bytes sent." I realize that I am probably just declaring SendMessage wrong, but does anyone know the working declration for it? Thanks in advance.
/** @dll.import("USER32") */
private static native long FindWindow(String lpClassName, String lpWndowName);
/** @dll.import("USER32") */
private static native long SendMessage( long hWnd, long mes, long shit, long blah);
Public Class1(){
long WM_COMMAND = 0x0111;
long winamp_hWnd = FindWindow("Window v1.x", null);
long ret = SendMessage(winamp_hWnd, WM_COMMAND, 0, 40148);
}
The code finds the winamp window fine, however, I always get an exception while trying to call SendMessage. It says "Wrong number of parameters, 16 bytes expected, 32 bytes sent." I realize that I am probably just declaring SendMessage wrong, but does anyone know the working declration for it? Thanks in advance.