Hi
I have an application (CW8.3, Mac OS X), which should come independently
into the foreground.
How can I do that?
Thanks
Hans
Phil Wasson - 09 Feb 2006 16:30 GMT
> I have an application (CW8.3, Mac OS X), which should come independently
> into the foreground.
> How can I do that?
If you want to bring your own process to the front, preferably only if
the user has indicated in some way that they want this to happen, you
can do this:
ProcessSerialNumber psn = { 0, kCurrentProcess };
OSErr err = SetFrontProcess( & psn );
That's right from a comment in Processes.h.
Gregory Weston - 09 Feb 2006 19:32 GMT
> Hi
>
> I have an application (CW8.3, Mac OS X), which should come independently
> into the foreground.
>
> How can I do that?
You _can_ with SetFrontProcess as Phil wrote. But if your user base is
larger than just you, you should be aware that an application which
"comes independently into the foreground" pisses off more users than it
pleases. They have this nasty habit of absorbing input that's intended
for the app the user was actually working with, and sometimes that input
has undesirable effects in the rude app.
Under normal circumstances, you should use an OS service called the
Notification Manager to let the user know you'd like their attention at
their pleasure.
<http://developer.apple.com/documentation/Carbon/Reference/Notification_M
anager/index.html>

Signature
"Congurutulation!!!" - The subject line on some spam I received last night.
I have no idea what it means, but it's such a cool "word" (by which I mean
pronouncable sequence of letters) regardless.