Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.89 KB | None | 0 0
  1. #include <WinAPI.au3>
  2. #include <WindowsConstants.au3>
  3. #include <Array.au3>
  4.  
  5. Local $a[] = [_WinAPI_GetSystemMetrics($SM_CMONITORS)] _ ; Number of monitors.
  6.  
  7.  
  8.  
  9. $monitors = _WinAPI_GetSystemMetrics($SM_CMONITORS) ;Save amount of monitors in a Variable
  10.  
  11.  
  12. if $monitors = 1 Then
  13.    RegDelete("Computer\HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper")
  14.    RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper", "REG_SZ", "C:\Users\User\Desktop\Files\wallpapers\1mon.jpg")
  15.  
  16. Elseif $monitors = 2 Then
  17.    RegDelete("Computer\HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper")
  18.    RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "WallPaper", "REG_SZ", "C:\Users\Kevin\Desktop\Files\wallpapers\2mon.bmp"
  19. EndIf
  20.  
  21.  
  22. Run("commit.bat") ;This applys the changes I made in RegEdit. Content of this file is in the Post.
  23. ConsoleWrite("Wallpaper set for " & $monitors & " Monitors")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement