//this's jni function in dll; JNIEXPORT jstring JNICALL Java_vc_CallVc_getActiveWindowTitle//get title (JNIEnv * jn, jclass) { jstring str; const char *strTitle =GetStringUTFChars( str , 0); ::GetWindowText(::GetForegroundWindow(),(LPSTR)strTitle,MAX_PATH); char srtMsg[MAX_PATH]; sprintf(srtMsg,this dialog title is:%s,strTitle); AfxMessageBox(strTitle); jn->ReleaseStringChars(str,0); return (jstring)strTitle;//error ??? }
//me demo dialog function for vc++2005 void CJniSparkDlg::OnBnClickedCancel6() { // TODO: Add your control notification handler code here JNIEnv *a; jclass c; Java_vc_CallVc_screenCameraShot(a,c); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)