Eteinder

Résolu
zido85 Messages postés 14 Date d'inscription mardi 15 mars 2005 Statut Membre Dernière intervention 18 février 2006 - 10 févr. 2006 à 19:01
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 - 10 févr. 2006 à 19:49
je me demande comment je peux eteindre un ecran en cliquant sur une commande, merci.

1 réponse

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
10 févr. 2006 à 19:49
salut,

je suppose que tu t'attends à une réponse un peu plus spirituelle que "en tendant l'index" ?



je tape eteindre ecran première source...

c'est pas bête quand même, cette case ....






'source : http://www.vbfrance.com/code.aspx?id=22715



Option Explicit

'ben si ya des ajout a ce code la prevenez moi par

'Mailto : wallas_imad@hotmail.com



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

' Un Grand Merci pour MicroSoft pour le Win32Api

'Appel a La command system

Const WM_SYSCOMMAND = &H112

Const SC_ECRANPOWER = &HF170&

Const ECRAN_ON = 0&

Const ECRAN_OFF = 1&

Private Sub Form_KeyPress(KeyAscii As Integer)

'allumer l'ecran

SendMessage Me.hWnd, SC_ECRANPOWER, ECRAN_ON

End

End Sub

Private Sub Form_Load()

'Eteindre l'ecran

SendMessage Me.hWnd, WM_SYSCOMMAND, SC_ECRANPOWER, ECRAN_OFF

End

End Sub

' Amussez vous bien

' By Napster (imad )




<small> Coloration
syntaxique automatique [AFCK]</small>




attention à son code END
3
Rejoignez-nous