• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
TransformProcessType() to Foreground...Almost Works
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TransformProcessType() to Foreground...Almost Works


  • Subject: TransformProcessType() to Foreground...Almost Works
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 07 Jul 2005 18:56:15 -0700

Hi,

I want my app to be launched by cron in the background, then either quit or
come to the foreground depending on how things go.

I thought I found the answer:

1.  Set LSBackgroundOnly = 1 in the Info.plist.
2.  Run TransformProcessType() (in SystemConfiguration.framework) when I
want it to come forward and have verified that my user is at the console:

ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus returnCode = TransformProcessType(& psn,
kProcessTransformToForegroundApplication);

Almost.  It brings my app into the Dock, and into the cmd-tab Application
Switcher, but not into the Force-Quit menu.  Two out of three.  Not
acceptable.

I understand that a cleaner method would be to factor my app into a separate
tool which would be launched by cron and then have this launch the regular
app, but then I might have to learn all about inter-process communication
and shared objects.  If anyone knows where I might look to fix this, I'd be
most grateful.

I tried calling SetSystemUIMode(kUIModeNormal, nil) but that gives me 0 out
of 3; from the docs it looks like this function is designed to turn things
off, not on.

Jerry Krinock


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: New Documentation Available - Time to Fire Up Xcode
  • Next by Date: Re: NSURLConnection timeout bug?
  • Previous by thread: Re: New Documentation Available - Time to Fire Up Xcode
  • Next by thread: hosting NSLevelIndicator in a menu
  • Index(es):
    • Date
    • Thread