Message Hook Window is working, Added BAR sendKeys and fixed colon key.
Message Hook Window is working and will allow you to see all messages being processed by a target window. Had to build Message Hook Window inside the native MsgHook.dll was having issues keep a java window's WndProc callback processing.
This commit is contained in:
@@ -8,12 +8,53 @@
|
||||
#include "stdafx.h"
|
||||
#include "org_synthuse_MsgHook.h"
|
||||
|
||||
|
||||
/*
|
||||
* Class: org_synthuse_MsgHook
|
||||
* Method: createMsgHookWindow
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_createMsgHookWindow(JNIEnv *env, jobject obj)
|
||||
{
|
||||
CreateMsgHookWindow(NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_synthuse_MsgHook
|
||||
* Method: setMsgHookWindowTargetHwnd
|
||||
* Signature: (I)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMsgHookWindowTargetHwnd(JNIEnv *env, jobject obj, jint jhwnd)
|
||||
{
|
||||
_stprintf_s(targetHwndStr, _T("%ld"), (long)jhwnd);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_synthuse_MsgHook
|
||||
* Method: setMsgHookWindowTargetClass
|
||||
* Signature: (Ljava/lang/String;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMsgHookWindowTargetClass(JNIEnv *env, jobject obj, jstring jclassname)
|
||||
{
|
||||
const char *classname = env->GetStringUTFChars(jclassname, 0);//convert string
|
||||
|
||||
memset((void *)&targetClassname, '\0', sizeof(TCHAR) * MAX_TEST_SIZE); // set TCHAR array to all 0
|
||||
int tstrLen = MultiByteToWideChar(CP_UTF8, 0, classname, (int)strlen(classname), NULL, 0); //get t len
|
||||
MultiByteToWideChar(CP_UTF8, 0, classname, (int)strlen(classname), targetClassname, tstrLen); // convert char to tchar
|
||||
|
||||
env->ReleaseStringUTFChars(jclassname, classname); //release string
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_synthuse_MsgHook
|
||||
* Method: setMessageHook
|
||||
* Signature: (JJ)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMessageHook(JNIEnv *env, jobject obj, jlong jhWnd, jlong jthreadId)
|
||||
//JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMessageHook(JNIEnv *env, jobject obj, jlong jhWnd, jlong jthreadId)
|
||||
JNIEXPORT jboolean JNICALL Java_org_synthuse_MsgHook_setMessageHook(JNIEnv *env, jobject obj, jint jhWnd, jint jthreadId)
|
||||
{
|
||||
return SetMsgHook((HWND)jhWnd, (DWORD)jthreadId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user