mrodrigues Posted October 26, 2005 at 09:43 PM Report #5860 Posted October 26, 2005 at 09:43 PM Não sei se alguém já colocou isso aqui. De qualquer modo, tem pouco de útil até ... 😄 Enfim, o código é este, e usa a API do Windows. Private Declare Function SendMessage Lib _ "user32" Alias "SendMessageA" (ByVal hWnd As Long, _ ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long Const SC_MONITORPOWER = &HF170& Const MONITOR_ON = -1& Const MONITOR_OFF = 2& Const WM_SYSCOMMAND = &H112 Dim x As Integer Private Sub Form_Load() Me.Hide DoEvents tmr.Enabled = True End Sub 'isto é um timer.. ok? Private Sub tmr_Timer() If x = 0 Then x = x + 1 SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF Else SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON x = 0 End If End Sub 'Anyway... o X pode ser uma variavel de estado booleana, mas as pessoas com o tempo aprendem o correcto. Bem, isso funcionava..
Guest Posted October 25, 2006 at 10:14 PM Report #60143 Posted October 25, 2006 at 10:14 PM na m faz nada.....
Crack Posted October 26, 2006 at 03:55 PM Report #60221 Posted October 26, 2006 at 03:55 PM para VB.NET 'Desligar SendMessage(Me.Handle, &H112, &HF170&, 2&) 'Ligar SendMessage(Me.Handle, &H112, &HF170&, -1&)
karva Posted October 26, 2006 at 04:00 PM Report #60222 Posted October 26, 2006 at 04:00 PM poe o codigo com o geshi, para se perceber melhor Proud LEIC-A@IST student!
Guest Posted November 12, 2006 at 10:27 PM Report #63942 Posted November 12, 2006 at 10:27 PM não faz nada!
Ivo Pereira Posted September 23, 2007 at 03:34 PM Report #134546 Posted September 23, 2007 at 03:34 PM alguem me pode dizer se isto funciona? é que nao tou para ir ao outro pc... tar a ligá-lo e nao sei que para ver se worka 😄 EDIT: ok... nao funciona ja experimentei 😛
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now