Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Window Position - Mac

What about from a process that I start?  I can start the application I want from my program, so I could store the process and access it –

 

Do you have an example of how to access the window information with the current process?  The bare minimum that would get me by would be to find it’s x,y screen coordinates… anything else beyond that is icing.

------------------------

 

I'm pretty sure it's doable, I've seen applications on Mac that can affect windows on a global level. A quick look in the documentation for the NSWindow class I found this: http://developer.apple.com/Mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/clm/NSWindow/windowNumbersWithOptions:

 

I think it may be what he wants but I don't know how to get from a window number to an actual window. 

 

On Apr 21, 2010, at 03:54, Sky Yan wrote:



If the "any application" means the application in other process, the answer is: no. Mac do not have global window or control handle as HWND on win32. So you can just get window information within current process but have no idea about window in other process. 

 

But there is other method to get position of window in other process, you could try Accessibility API on Mac. You may need to write c code to use it. 

 

sendmsg in cocoa is object-c method. It is totally different with SendMessage on win32. 

On Tue, Apr 20, 2010 at 11:06 PM, Belcher, Josh <Josh.Belcher@xxxxxxxxxx> wrote:

I have been searching for awhile now for a Mac equivalent of the org.eclipse.swt.internal.win32 functions  FindWindow() and GetWindowRect().  I would like to be able to launch any application, gain control of it and query it to find out where it’s top left position is.  If there is a way to do it by setting its position, that would also work for me.

In the org.eclipse.swt.internal.cocoa I have seen some things about sendmsg – but I haven’t been able to find any good examples of how that works in swt, or if that is even what I need.


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev




--


Thanks,

Sky Yan

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev

 


Back to the top