FROM : Scott Thompson
DATE : Thu Feb 14 18:25:32 2008
> 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
DATE : Thu Feb 14 18:25:32 2008
> 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
| Related mails | Author | Date |
|---|---|---|
| Rangaswamy C T | Feb 13, 15:05 | |
| Mike Abdullah | Feb 13, 15:57 | |
| Chris Hanson | Feb 13, 20:46 | |
| Scott Thompson | Feb 14, 18:25 |






Cocoa mail archive

