• 0

[C++]getting windows uptime information in days,hours,etc?


Question

3 answers to this question

Recommended Posts

  • 0

Most times I use groups.google for infos like this.

I tried it and found this:

hrup = GetTickCount / 1000 / 60 / 60 'Hours

minup = GetTickCount / 1000 / 60 'Minutes

secup = GetTickCount / 1000 'Seconds

I think there must be another way because gettickcount will wrap when the uptime is more than 47 days. But if that does not bother you, gettickcount should be a good solution.

For details on each windows function you should also consider reading msdn.microsoft.com :)

  • 0

Thanks. One more thing, How would I go about easily making my program a graphical program inside Visual Studio .NET 2003 with C++ and making my project load with the GUI, im not a big fan of command line...

  • 0

Well you could use MFC, WFC, WinForms, or just straight Win32. :ninja: These are all MS technologies; there are others, but they're generally only used when portability is an issue.

As for which one you should go for, well, it depends. WinForms is the newest, and by far the easiest to learn and use, but requires the .NET framework to be installed for people to be able to run your app. MFC is up to version 7, and is showing its age, but otherwise is a good choice, supporting a wide range of features. WFC is also a good choice, being more modern than MFC and thus better designed, but lacks support from MS (AFAIK). Win32 is the underlying Windows API - huge, powerful, old, non-OO, requires significant investment of time to do even the most trivial of things ( :dead: ); not recommended for writing GUIs.

If you want the absolute easiest way to write GUI apps, consider switching to C# (included with Visual Studio .NET). Then you can use the excellent Visual Studio forms designer (which I'm pretty sure doesn't support C++) to quickly write GUI apps based on WinForms.

Hope this helps :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Cjam 2.0 by Razvan Serea Cjam is a lightweight and fast MP3 editor for Windows that lets you cut, join, and edit MP3 files without re-encoding. This means your audio quality remains untouched, and edits happen instantly. Cjam is ideal for quick, lossless edits—whether you're trimming music, combining tracks, or preparing audio for learning tools or podcasts. It features batch processing, scripting support, cue and playlist file handling, and a simple interface. Cjam is perfect for anyone who needs efficient MP3 editing without the complexity of full audio suites. Cjam requires a PC running Windows 10 or later and Microsoft .NET 6.0 or later. Key features for Cjam: No Re-encoding: Edit MP3 files without losing quality. Cut and Join MP3: Easily cut, trim, and combine MP3 tracks. Batch Processing: Edit multiple files at once for faster workflows. Scriptable Interface: Automate tasks with a custom command language. Cue and Playlist Support: Handle CUE and playlist files for seamless audio management. Fast and Lightweight: Quick processing with minimal system resources. Lossless Audio Editing: Ensure your edits don't affect audio quality. Simple User Interface: Clean, intuitive design for easy navigation. File Format Support: Works with MP3, Cjam-specific file formats (CJAMC, CJAMJ, CJAM). Cjam 2.0.0.0 fixes: Fixed a bug where the folder list was not updating on the vmp3 screen Download: Cjam 2.0 | 1.3 MB (Freeware) Links: Cjam Home Page | Cjam Manual | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Honestly, i either don't care, mind, use, or had any problem with those. 11 is really good for me, has a lot of little refinements, looks great, if i wanted to tweak/fix it's behavior i would with a range of tools, and wouldn't come back to the 2010's looking Win 10 even at gunpoint.
    • You dont want a expensive hp laptop either managed to get 3 new zbooks and they all died on me.
    • Nothing inherently wrong, but why buy 2021 tech in 2025? Assuming you were aiming for 6-10 years of usage, better to buy something current.
    • I have begun using Windows 11 native passkey feature. i have four passkeys set up so far. Three work fine, One has never worked. I have removed it and recreated it several times, still no luck. Anyway, on the websites in which it works, it works geat. No more two 2FA.
  • Recent Achievements

    • Dedicated
      Cole Multipass earned a badge
      Dedicated
    • Week One Done
      Alexander 001 earned a badge
      Week One Done
    • Week One Done
      icecreamconesleeves earned a badge
      Week One Done
    • One Year In
      PAC0 earned a badge
      One Year In
    • One Month Later
      PAC0 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      567
    2. 2
      +FloatingFatMan
      188
    3. 3
      ATLien_0
      186
    4. 4
      Skyfrog
      114
    5. 5
      Som
      109
  • Tell a friend

    Love Neowin? Tell a friend!