JNI: Why this code not working?
Purpose: Moving the from...( means same thing what happens when you click on Titlebar and start dragging.)
private native void moveIt(int Handle);
public void mousePressed(MouseEvent e)
if(e.getButton() == MouseEvent.BUTTON1)
whats wrong here? why this code doesn't move the window(frame)?:confused:
* Class: BasicTest
* Method: moveIt
* Signature: (I)V
JNIEXPORT void JNICALL Java_BasicTest_moveIt
(JNIEnv *env, jobject obj, jint handle)
SendMessage((HWND)handle, WM_NCLBUTTONDOWN, HTCAPTION, NULL);
//SetWindowText((HWND)handle, "OK"); // test to see if HWND is right
rabbit hunting from 35,000 feet
Trying to get-going on JNI myself, but the HWND in the Java method call is not Java. I would not expect a window handle data type to be avilable in Java, something like rabbit hunting from 35,000 feet ( lame, yes - it's early am )
I don't see where we are going to manipulate windows behind the Java API if Java is the one to create the window.