Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enum Child Windows

843829Aug 11 2007 — edited Nov 26 2007
I am trying to implement a way of using the EnumChildWindows function using java. However I am running into some problems that I am unsure how to solve.

I have properly declared my native method in my java class like so..
 public static native boolean enumChildWindows( long parentHandle, Callback callback, long lparam );
According to MSDN, the syntax of the EnumChildWindows function in user32 is
BOOL EnumChildWindows(      
    HWND hWndParent,
    WNDENUMPROC lpEnumFunc,
    LPARAM lParam
);
..so I may seem a bit all unclear here.. but how do I declare my import in my C++ file so that it takes a jobject as one of its parameters i guess
[DllImport("user32")]
extern "C" long EnumChildWindows ( long handle, ??? callback, long lParam );
Also, how do I access it when in the body of my native method..
JNIEXPORT jboolean JNICALL Java_NativeFunctions_enumChildWindows
  (JNIEnv *, jclass, jlong handle, jobject callback, jlong lParam)
Basically, I am wanting to do the following
EnumChildWindows( handle, callback, lParam );
but I am unsure of how to go about doing that. Any help would be appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 24 2007
Added on Aug 11 2007
10 comments
754 views