TransformProcessType() to Foreground...Almost Works
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