Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Detecting being a THINK C project (1 liner) Message-ID: <31890@ucbvax.BERKELEY.EDU> Date: 13 Oct 89 10:00:44 GMT References: <5727@tank.uchicago.edu> <531@sunfs3.camex.uucp> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 14 Sometimes, it is useful for a program to know whether it is being run as a THINK C project or as an application. A program can tell the difference with the following routine: Boolean IsRealApp(){ return Count1Resources('CODE); } Call this just after your Init...() system calls. It works because when your program is a real application it is also the current resourc file. When you are running as a project, your .rsrc file is the currebt resource file (connected by the pre-main glue.) You might care abou this, say, to have your app allocate half-screen sized windows if a source level debugger might be running, but full size for real.