• 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
Re: Bringing app to front
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bringing app to front


  • Subject: Re: Bringing app to front
  • From: Bill Houston <email@hidden>
  • Date: Fri, 14 May 2004 15:08:55 -0700

Zach,

None of these works in my case. A carbon app with the code I sent earlier
comes to the fore just fine, but the Cocoa app does not. Here is the
complete section of code I have tried:

// method 1
[window makeKeyAndOrderFront:self];

// method 2
// ProcessSerialNumber processSerialNum;
// GetCurrentProcess(&processSerialNum);
// SetFrontProcess(&processSerialNum);

// method 3
// [NSApp activateIgnoringOtherApps:YES];

I tested each method bu its self and of course I didn't have it commented
out when I tested it!

Bill

On 5/14/04 2:27 PM, "Zach Wily" <email@hidden> wrote:

>> I have a Cocoa application which needs to be launched from a script.
>> In the past (using Carbon Applications) I have used this in the
>> application:
>>
>> ProcessSerialNumber processSerialNum;
>> GetCurrentProcess(&processSerialNum);
>> OSErr persOSErr = SetFrontProcess(&processSerialNum);
>>
>> with complete success, however it does not seem to work for Cocoa
>> applications. I would rather not have to rewrite this as a Carbon app
>> if I
>> can help it.
>>
>> Does anyone know how to do this with Cocoa?
>
> [NSApp activateIgnoringOtherApps:YES];
>
> Or you can send -makeKeyWindow to one of your windows.
>
> Is that what you're looking for?
>
> zach
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Bringing app to front
      • From: Charles Srstka <email@hidden>
References: 
 >Re: Bringing app to front (From: Zach Wily <email@hidden>)

  • Prev by Date: Re: NSTableView customization
  • Next by Date: Re: window rotation
  • Previous by thread: Re: Bringing app to front
  • Next by thread: Re: Bringing app to front
  • Index(es):
    • Date
    • Thread