Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Timer za gašenje PC problem

[es] :: Visual Basic 6 :: Timer za gašenje PC problem

[ Pregleda: 1468 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

bolepks
Nis

Član broj: 233371
Poruke: 426
*.dynamic.isp.telekom.rs.



+1 Profil

icon Timer za gašenje PC problem06.11.2012. u 11:20 - pre 138 meseci
Napravio sam timer za gašenje PC sve funkcioniše, osim kada kliknem i treba da se ugase on potpuno ne ugasi računar već se čuju ventilatori, u čemu je problem?
Evo koda

Public Class Form1


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Format(TimeOfDay)
End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer2.Enabled = True
TextBox1.Enabled = False
Button2.Enabled = True
Button1.Enabled = False

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer2.Enabled = False
TextBox1.Text = "00:00:00"
TextBox1.Enabled = True
Button1.Enabled = True
Button2.Enabled = False
End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If TextBox1.Text = Label1.Text Then
Shell("shutdown -s")
End If

End Sub
End Class
 
Odgovor na temu

FOX028
Visoka tehnicka skola strukovnih studija
Kosovska Mitrovica

Član broj: 258986
Poruke: 850

Sajt: https://www.zile028.com


+49 Profil

icon Re: Timer za gašenje PC problem06.11.2012. u 11:30 - pre 138 meseci
evo pogledaj na ovom linku imas nesto o proceduri za gasenje PC-a

http://www.vbforfree.com/218/how-to-easily-shutdown-restart-and-log-off-the-computer-without-apis/
 
Odgovor na temu

shpiki
Student
Novi Sad

Član broj: 50342
Poruke: 1651



+62 Profil

icon Re: Timer za gašenje PC problem06.11.2012. u 20:27 - pre 138 meseci
Code:
Declare Function ExitWindowsEx Lib "user32" Alias "ExitWindowsEx" (byval uFlags as Long, byval dwReserved as Long) as Long

public Const EWX_FORCE = 4
public Const EWX_LOGOFF = 0
public Const EWX_SHUTDOWN = 1
public Const EWX_REBOOT = 2

There are only 10 types of people in the world:
those who understand binary, and those who don't.
 
Odgovor na temu

[es] :: Visual Basic 6 :: Timer za gašenje PC problem

[ Pregleda: 1468 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.