Follow us on Twitter!
Imagination is more valuable than knowledge - Albert Einstein
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 18
Guests Online: 15
Members Online: 3

Registered Members: 82909
Newest Member: awais
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Counting Down in VB6


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 03-04-05 00:47
how would i make a program that counts down from 1 hour and gos till 0? kinda like a timer for an oven although on your computer.


Author

RE: Counting Down in VB6

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 03-04-05 13:06
make a timer and a text box.

then have

Code


text1.text = "600000"   - (or whatever 1 hour is in seconds)

Timer.interval = 1000

------Timer Sub-------

Dim TimeCount as integer

TimeCount = val(text1.text)

TimeCount = TimeCount - 1

text1.text = TimeCount

------End Sub--------





easy :)


http://www.hellboundhackers.org/
Author

RE: Counting Down in VB6


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 03-04-05 18:06
thanks, but i did it another way b4 u replied.

Code
Option Explicit

Private AlarmTime As Date

Private Sub Form_Load()
    AlarmTime = DateAdd("h", 1, Now)
End Sub


Private Sub Timer1_Timer()
Dim txt As String

    txt = Format$(AlarmTime - Now, "h:mm:ss")
    Label1.Caption = txt
End Sub








now i also wanted to make it log off the computer when it goes to 0. this counts down from 1:00:00 to 0:00:00.




Edited by on 03-04-05 23:57
Author

RE: Counting Down in VB6


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 03-04-05 20:05
Mr_Cheese wrote:
make a timer and a text box.

then have

Code


text1.text = "600000"   - (or whatever 1 hour is in seconds)

Timer.interval = 1000

------Timer Sub-------

Dim TimeCount as integer

TimeCount = val(text1.text)

TimeCount = TimeCount - 1

text1.text = TimeCount

------End Sub--------





easy :)

i was just wondering...wouldn't this depend more on the speed of your puter rather than actual time?


Author

RE: Counting Down in VB6

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 03-04-05 23:21
i surpose, but it does what he asked, and the increased speed is gonna be extremely minimal, compared to how he did it.


http://www.hellboundhackers.org/
Author

RE: Counting Down in VB6


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 03-04-05 23:57
ok i got that, but what about login off windows? do i need API calls or what?


Author

RE: Counting Down in VB6

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 04-04-05 11:32
Code

call Shell ("logoff", vbHide)






http://www.hellboundhackers.org/
Author

RE: Counting Down in VB6


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 04-04-05 12:43
how would i put that in the code i already made? i dont really see anything i can loop?


Author

RE: Counting Down in VB6

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 04-04-05 16:50
just put it in a If statement, thats in the timer.

so like:

If Time = XXX then
Call Shell....

end if


http://www.hellboundhackers.org/