Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get mouse positions on desktop when my frame isrunning



On 3-Nov-09, at 9:13 AM, Vijay Kachhawal wrote:

Thanks for your valuable suggestion. I tried the above approach. Everything
is working fine with one exception. The only problem with this approach is,
the frame inside which I am showing the captured image is not coming on top
of MAC Menubar. I tried by changing the frame location to match the captured
image positions exactly with the MAC Menu bar, but found that the frame is
going behind the MAC Menu bar. Due to this, there is a chance that user can
perform some other activities before actually generating the desired mouse
events.
Is there any way to solve this issue?

I don't think it can be done easily, from pure Java. You CAN get a window to lie above the menu bar, but it requires native code, using JAWT to gain access to the NSView and NSWindow Cocoa objects, and setting the window level of the NSWindow object to a value above the menu bar (not forgetting to shift this operation onto the AppKit thread once you're running in Objective C). If you're cool with JNI, JAWT and Objective-C, take a look at /System/Library/Frameworks/ ApplicationServices.framework/Frameworks/CoreGraphics.framework/ Headers/CGWindowLevel.h for the various window level values, and http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/index.html#/ /apple_ref/doc/uid/TP40004151 for the NSWindow documentation.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden


This email sent to email@hidden
References: 
 >Re: How can I get mouse positions on desktop when my frame isrunning (From: "Vijay Kachhawal" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.