From: a on
"Boris" <somewhere(a)nowhere.net> wrote

>> I was going to say just check the value of GetTickCount(), but that's no
>> good if the user has rebooted the PC. Maybe check that once, and store a
>> flag value somewhere (with the date) so that subsequent checks on the same
>> day know that the PC has already been previously started that day? That
>> should work fine.
>
> Thanks for the response - but I don't think so. GetTickCount() counter is reset to 0 each time OS boots - you cannot tell cold
> boot from warm boot that way. It's possible, some HAL lib functions can extract that info from system BIOS - but I couldn't find
> anything relevant.

Upon thinking about it more, I was close in my tip above anyway. All you need
to do is: when Windows boots, check if a file called "<date>" exists in your
app's folder. If not, then the app assumes it's the first boot of the day and
creates the file, so any subsequents reboots on the same day can be identified.

And if the file "<date>" does NOT exist when your app starts at bootup, then
your app knows it IS the first boot of the day, and creates the file to mark
the boot as "known". Your app then deletes any "<date>" files from the past,
to keep the PC clean.

This will work fine.


From: Maxim S. Shatskih on
> or even if there is still a memory test (other than sizing).

Yes, memory tests are still here.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com