Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / February 2006



Tip: Looking for answers? Try searching our database.

Bring an application into the foreground?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hans Stoessel - 09 Feb 2006 15:36 GMT
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.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.