Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance Force
- #Persistent
- #NoEnv
- #NoTrayIcon
- Loop
- {
- If !GetPowerStatus()
- {
- Run "C:\Windows\Resources\Ease of Access Themes\classic.theme"
- WinWait , Personalization
- Sleep , 5000
- WinClose , Personalization
- Loop
- {
- If GetPowerStatus()
- {
- Run "<Put the path of the theme you want to have when on AC power here>"
- WinWait , Personalization
- Sleep , 5000
- WinClose , Personalization
- Break
- }
- }
- }
- }
- Return
- GetPowerStatus()
- {
- Global
- VarSetCapacity(powerstatus, 12)
- success := DllCall("kernel32.dll\GetSystemPowerStatus", uInt, &powerstatus)
- ACLineStatus := GetInt(&powerstatus,0,1)
- BatteryLifePercent := GetInt(&powerstatus,2,1)
- Return ACLineStatus
- }
- GetInt( p_address, p_offset, p_size )
- {
- local value
- loop, %p_size%
- value += ( *( (p_address+p_offset) + (a_Index-1) ) << ( 8* ( a_Index-1 ) ) )
- return, value
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement