What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Visual Basics : Uptime

1 votes - 5 average   Visual Basics : Uptime
Author: Message:
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
32 / Male / –
Joined: May 2003
O.P. Huh?  Visual Basics : Uptime
Anybody know how to get system uptime in Visual Basics?

I searched google but the only things that looked useful were like in German or Dutch. And I couldn't understand them.

NoName: http://www.vb-magazin.de/new/postt682.html
See anything useful about getting uptime there , I cant understand :p
TheBlasphemer: It's german bitch -_-
TheBlasphemer: NEVER EVER compare dutch and german :P
NoName : How do I know , All looks the same
TheBlasphemer: That' insuling

:lol:
06-23-2004 09:13 PM
Profile PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
42 / Male / Flag
Joined: Jan 2003
RE: Visual Basics : Uptime
quote:
Originally posted by NoName
Anybody know how to get system uptime in Visual Basics?
use the GetTickCount API

.html File Attachment: gettickcount.html (4.07 KB)
This file has been downloaded 421 time(s).
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
06-23-2004 09:34 PM
Profile PM Find Quote Report
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
32 / Male / –
Joined: May 2003
O.P. RE: Visual Basics : Uptime
Thanks =)
06-23-2004 09:46 PM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Visual Basics : Uptime
Well Alec, I am willing to share this with you :P

Something I wrote quite a few months ago :)

.zip File Attachment: UptimeTicker.zip (16.1 KB)
This file has been downloaded 238 time(s).
06-24-2004 01:06 AM
Profile PM Web Find Quote Report
Sk3tch
Veteran Member
*****

Avatar
We are Samurai, the keyboard cowboys

Posts: 1675
Reputation: 4
38 / Male / –
Joined: Jul 2003
RE: Visual Basics : Uptime
this is what i used for my system info plug:
code:
Private Declare Function GetTickCount& Lib "kernel32" ()

Private Function WinUpTime()
    Dim Secs, Mins, Hours, Days
    Dim TotalMins, TotalHours, TotalSecs, TempSecs
    Dim CaptionText
    TotalSecs = Int(GetTickCount / 1000)
    Days = Int(((TotalSecs / 60) / 60) / 24)
    TempSecs = Int(Days * 86400)
    TotalSecs = TotalSecs - TempSecs
    TotalHours = Int((TotalSecs / 60) / 60)
    TempSecs = Int(TotalHours * 3600)
    TotalSecs = TotalSecs - TempSecs
    TotalMins = Int(TotalSecs / 60)
    TempSecs = Int(TotalMins * 60)
    TotalSecs = (TotalSecs - TempSecs)


    If TotalHours > 23 Then
        Hours = (TotalHours - 23)
    Else
        Hours = TotalHours
    End If


    If TotalMins > 59 Then
        Mins = (TotalMins - (Hours * 60))
    Else
        Mins = TotalMins
    End If
   
    If Hours = 0 Then
        CaptionText = Mins & " Minutes, " & TotalSecs & " seconds" & vbCrLf
    ElseIf Days = 0 Then
        CaptionText = Hours & " Hours, " & Mins & " Minutes, " & TotalSecs & " seconds" & vbCrLf
    Else
        CaptionText = Days & " Days, " & Hours & " Hours, " & Mins & " Minutes, " & TotalSecs & " seconds" & vbCrLf
    End If
    WinUpTime = CaptionText
End Function

not sure if will help you but :P....

should make sense :)
Sk3tch@Microsoft.com - Email
- 53 6B 33 74 63 68 34 64@hotmail.com - Messenger
06-24-2004 02:49 AM
Profile E-Mail PM Web Find Quote Report
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
42 / Male / Flag
Joined: Jan 2003
RE: Visual Basics : Uptime
quote:
Originally posted by Mnjul
Attachment: UptimeTicker.zip (16.1 KB)
nice :)
quote:
Originally posted by Sk3tch
TotalSecs = Int(GetTickCount / 1000)
    Days = Int(((TotalSecs / 60) / 60) / 24)
    TempSecs = Int(Days * 86400)
    TotalSecs = TotalSecs - TempSecs
    TotalHours = Int((TotalSecs / 60) / 60)
    TempSecs = Int(TotalHours * 3600)
    TotalSecs = TotalSecs - TempSecs
    TotalMins = Int(TotalSecs / 60)
    TempSecs = Int(TotalMins * 60)
    TotalSecs = (TotalSecs - TempSecs)


etc....



:O very complex code, isn't it? :P

what about this:
code:
Dim msecs As Long
Dim secs As Long
Dim mins As Long
Dim hours As Long
Dim days As Long
Dim total As Long
total = GetTickCount()

msecs = total Mod 1000
total = total / 1000

secs = total Mod 60
total = total / 60

mins = total Mod 60
total = total / 60

hours = total Mod 24
total = total / 24

days = total


'etc....

Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
06-24-2004 09:51 AM
Profile PM Find Quote Report
Salem
Senior Member
****

Avatar

Posts: 769
Reputation: 16
37 / Male / Flag
Joined: May 2004
RE: RE: Visual Basics : Uptime
quote:
Originally posted by Mnjul
Well Alec, I am willing to share this with you :P

Something I wrote quite a few months ago :)


Mnjul

I downloaded your file because i enquired on how to get a VB appliaction to test the version of Windows that is running. Unfortunately i cant get my prgram to do it. Please can you let me know how you did it?

This would be much appreciated.

RileyM
[Image: salem874.smart.jpg][Image: card.png]
Was i Helpful?[/url]
06-25-2004 03:43 PM
Profile PM Find Quote Report
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
32 / Male / –
Joined: May 2003
O.P. RE: Visual Basics : Uptime
You dodgy people post all the source only after I figure it out :dodgy:

quote:
Originally posted by RileyM
Mnjul

I downloaded your file because i enquired on how to get a VB appliaction to test the version of Windows that is running. Unfortunately i cant get my prgram to do it. Please can you let me know how you did it?

This would be much appreciated.

RileyM
The source is in that zip , look at it. :-/
06-25-2004 04:00 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On