home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!agate!ucbvax!mtxinu!taniwha!paul
- From: paul@taniwha.UUCP (Paul Campbell)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Detecting reboot or startup
- Message-ID: <1354@taniwha.UUCP>
- Date: 19 Dec 92 03:54:21 GMT
- References: <cmcclary-151292113831@mcclary-mac.ucs.indiana.edu>
- Organization: Taniwha Systems Design
- Lines: 20
-
- In article <cmcclary-151292113831@mcclary-mac.ucs.indiana.edu> cmcclary@ucs.indiana.edu (Charles McClary) writes:
- >What is the best/preferred method for an application to detect if the
- >system has been rebooted or restarted since it (the application) last ran.
-
- Assuming you saved the time your app last ran in a file and resource and
- then read it back again into 'last_time_ran' then try:
-
- unsigned long last_time_ran, now;
-
- ReadDateTime(&now);
- if ((now - (TickCount()/CLOCKS_PER_SEC)) > last_time_ran) {
- // - we rebooted since last time we ran
- }
-
- Paul
- --
- Paul Campbell UUCP: ..!mtxinu!taniwha!paul AppleLink: CAMPBELL.P
- Use up your Quayle jokes now while they're still good "Quayle for Pres. in '94"
- Q: Why is Marilyn Quayle like Marion Barry?
- A: They both suck a little dope.
-