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: fetching the window pointer of other applications (processes)



I am in a situation where I have to access the window pointer of a different application (which is running in a totally different process) and play with it.

It would be much better to let the "totally different process" "play" with it's own window and have the browser plug in tell the process to "do xxx with your window".


I have written browser plug-in for safari, which gets loaded inside safari process. Inside this browser plug-in I want to access the top level window pointer (window ref) of the other stand alone application which is running in a different process.

What is the "top level window pointer" of the other application? Do you mean you want to get the NSWindow* or Carbon WindowRef of a document window in the other application?


If I transfer the window pointer of the stand alone application to browser plug-in by some means (through apple events or some other way). Will I be able to use that window pointer from browser plug-in (which is part of the browser process)?

No. If you transfer a pointer to another address space, that pointer no longer means the same thing.


Does Mac let the application to fetch the window pointers of other applications like the Windows operating system allows?

No. This could be a security risk, and has proven to be so on MS Windows in the past.


Is there is security issues enforced by the process, so that any process cannot access the other process data structures?

Yes. Protected memory. Each process lives in it's own address space and with few exceptions (e.g. shared memory mapping) the processes are not allowed access to one another's memory.


I tried this without any luck, has anybody come across this kind of situation. Could you please share your experience?

You've told us a lot about how you are trying to do something, but you have not mentioned what you are trying to accomplish. Why is the browser plugin trying to control the window of another process? What is the other process that the browser wants to control.


There may be ways to accomplish the same effect, but not in the way you are trying to do it. AppleScript control of a window is one example, the accessibility APIs may also be an option.

What effect are you trying to accomplish?

Scott

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >fetching the window pointer of other applications (processes) (From: "Rangaswamy C T" <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.