Reputation:
Normally in Obj C, NSApplicationDelegate handles this. But how would I do it in C? I guess what I am asking it, how did Mac programs do this before OS/X came along? Thanks.
Upvotes: 2
Views: 131
Reputation:
In Mac OS 9, applications opened documents at launch (or later on) by registering for and receiving an 'odoc'
Apple Event at startup. This is nontrivial to do in C, and I'd strongly recommend you not attempt it. In particular, note that this is unlikely to work properly unless your application has a Carbon event loop.
Before even that, there was also a mechanism whereby files for an application to open at launch were specified in a block of memory at the top of the stack. This mechanism no longer exists on OS X, so it's irrelevant today.
Upvotes: 5