1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Declare Function CreateEvent Lib "coredll.dll" (ByVal lpEventAttributes As String, ByVal bManualReset As Boolean, ByVal bInitialState As Boolean, ByVal lpName As String) As IntPtr
Declare Function EventModify Lib "Coredll" (ByVal hEvent As IntPtr, ByVal EventModification As Int32) As Int32
Declare Function CloseHandle Lib "Coredll" (ByVal h As IntPtr) As Int32
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Key As Microsoft.Win32.RegistryKey
Dim ehandle As IntPtr
Key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("\ControlPanel \Backlight", True)
Key.SetValue("ACBacklightLevel", 200)
Key.Close()
Key = Nothing
ehandle = CreateEvent(Nothing, False, True, "BackLightChangeEvent")
If (Not IsNothing(ehandle)) Then
EventModify(ehandle, 1)
CloseHandle(ehandle)
End If
End Sub |
Partager