Advertisement
Guest User

Thomas

a guest
Oct 26th, 2009
548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. ; Copyright � Thomas A. Osthege • http://eurocomp.info
  2.  
  3. #include <WinAPI.au3>
  4. Opt('MustDeclareVars', 1)
  5.  
  6. _Main()
  7.  
  8. Func _Main()
  9. If $CmdLine[0] <> 3 Then
  10. MsgBox(0, "Set Color Profile", "Instructions:" & @LF & @LF & _
  11. """path_to_autoit\AutoIt.exe"" " & _
  12. """path_to_this_file\ColorProfile.au3"" " & _
  13. """name_of_monitor"" " & _
  14. """path_and_name_of_icc_or_icm_file"" " & _
  15. """path_to_XCalib\XCalib.exe""")
  16. Exit
  17. EndIf
  18.  
  19. Local $aDevice, $i = 0
  20.  
  21. While 1
  22. $aDevice = _WinAPI_EnumDisplayDevices("", $i) ; get display device data
  23. If Not $aDevice[0] Then ExitLoop ; done if all devices processed
  24. If BitAND($aDevice[3], 4) = 0 Then ; we need only real devices
  25. $aDevice = _WinAPI_EnumDisplayDevices($aDevice[1], 0) ; get the name of the connected monitor
  26. If StringInStr($aDevice[2], $CmdLine[1]) Then
  27. ShellExecuteWait($CmdLine[3], "-s " & $i & " -c", "", "", @SW_HIDE)
  28. ShellExecuteWait($CmdLine[3], "-s " & $i & " """ & $CmdLine[2] & """", "", "", @SW_HIDE)
  29. ExitLoop
  30. EndIf
  31. EndIf
  32. $i += 1
  33. WEnd
  34. EndFunc ;==>_Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement