Sign in to follow this  
Followers 0
monstersnatch

Desktop Properties Automation

13 posts in this topic

hi, i've written a script using autoit v2, converted it using the "v2 to v3 converter" and tried to remove the most obvious mistakes caused during conversion, but it still dosn't convert to a running .exe

please help me spot the errors, since this is the first v3 script i've done so far.

;Set display properties for ASPIA VB13
;Required: 1280 x 1024 on monitor 1 and 2, 75 Hz, monitor 2 extends windows desktop

;This script works correctly only if display settings are the same as the initial settings
;before executing this script the first time!

;-- Init -----------
   ;tell user "hands off"
    $SplashText = 'DON\'T TOUCH THE KEYBOARD OR THE MOUSE' & @LF & 'while the script is running!'
    SplashTextOn ( 'Aspia Installer', $SplashText, 350, 80 )
    
;configure AutoIt
    global $__strcase = 0
    AutoItSetOption ( "WinWaitDelay", 1000 )
    
;set match mode less restrictive!
    AutoItSetOption ( "WinTitleMatchMode", 2 )

;-- Let's GO --------
   ;open Display Properties dialog and activate "settings" tabcard
    Run ( 'rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3' )
    Sleep ( 1000 )
    while (1)
    WinActivate ( 'Display Properties' )
    until WinActive ( 'Display Properties', '' ) 

    while (1)   ; DisplaySettings loop
   ;-- LOOP to set display properties for the two monitors --------------------------------------------------
    $Monitor = 1
    for $__n1_ = 1 to 2
        if NOT WinActive ( 'Display Properties', '' ) then
            WinActivate ( 'Display Properties' )
        endif

        while (1)   ; SelectTabCardSettings loop
            if NOT WinActive ( 'Display Properties', 'Settings' ) then
                Send ( '^{TAB}' )
        wend        ; SelectTabCardSettings loop end

    ; SelectMonitor
        Send ( '!d' )
        Send ( $Monitor )
        Send ( '!s' )
        Send ( '{LEFT 10}' )

        while (1)   ; ScreenResolution loop
        SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Screen resolution for monitor ' & $Monitor & '.' & @LF, 350, 125 )
        if NOT WinActive ( 'Display Properties', '1280 by 1024 pixels' ) then
            Send ( '!s' )
            Send ( '{RIGHT}' )
        wend        ; ScreenResolution loop end

    ; ApplyScreenResolution
    ;-----------------------------------------------------------------------------------------------------
    ;extend Windows desktop to monitor 2
    ;unfortunately no possibility to check the state of the checkbox at the moment
    ;must be done here, if not, the screen resolution will be reset to 640x480 after pressing "Apply".
    ;Why? Don't know.
        if NOT __cmp(@UserName, 'meduser') then
            if __cmp($Monitor, 2) then
                Send ( '!e' )
            endif
        endif
        Send ( '!a' )
        Sleep ( 1000 )
        if WinActive ( 'Monitor Settings', 'Your desktop has been reconfigured' ) then
            Send ( '!y' )
        endif
        Sleep ( 2000 )

    ; SetColorQuality
        SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Color quality for monitor ' & $Monitor & '.' & @LF, 350, 125 )
        if NOT WinActive ( 'Display Properties', '' ) then
            WinActivate ( 'Display Properties' )
        Send ( '!c' )
        Send ( 'h' )

        while (1)   ; AdvancedDisplaySettings loop
        SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Advanced display settings for monitor ' & $Monitor & '.' & @LF, 350, 125 )
        if NOT WinActive ( 'Display Properties', '' ) then
            WinActivate ( 'Display Properties' )
        endif
        Send ( '!v' )
        Sleep ( 2000 )
        if NOT WinActive ( 'NVIDIA Quadro', '' ) then
            WinActivate ( 'NVIDIA Quadro' )
        endif
        if WinActive ( 'NVIDIA Quadro FX 1400 Properties', '' ) then
            $GraphicAdapter = 'NVIDIA Quadro FX 1400'
        endif
        if NOT __cmp($GraphicAdapter, 'NVIDIA Quadro FX 1400') then
            Sleep ( 2000 )
            if WinActive ( 'NVIDIA Quadro4 980 XGL Properties', '' ) then
                $GraphicAdapter = 'NVIDIA Quadro4 980 XGL'
            endif
                if NOT __cmp($GraphicAdapter, 'NVIDIA Quadro4 980 XGL') then
                ;open a message box ABORT+RETRY+IGNORE+MB_ICONHAND+MB_SYSTEMMODAL
                    $__msgbox = MsgBox ( 4114, 'ASPIA Installer', 'Invalid graphics adapter! Only NVIDIA Quadro4 980 XGL and NVIDIA Quadro FX 1400 are allowed!' )
                    if NOT ( $__msgbox = 5 ) then
                        if NOT ( $__msgbox = 3 ) then
                            until NOT ( $__msgbox = 4 ) ; DisplaySettings loop end?
                    ; the 3 lines above should do the same as the following 3 lines in autoit script v2
                    ; but somehow i doubt it does the same..
                    ; IfMsgBox, IGNORE, Goto, SetRefreshRate
                    ; IfMsgBox, ABORT,  Goto, Finish
                    ; IfMsgBox, RETRY,  Goto, AdvancedDisplaySettings

   ; SetRefreshRate Force extra clausing
    SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Refresh rate for monitor ' & $Monitor & '.' & @LF, 350, 125 )
    if NOT WinActive ( 'NVIDIA Quadro', '' ) then
        WinActivate ( 'NVIDIA Quadro' )
    endif
    Send ( '^{TAB 2}' )
    Send ( '!s' )
    Send ( 7 )
    Send ( 5 )
    Send ( '!a' )
    Sleep ( 1000 )
   ;if a window pops up asking you to keep the settings, press Yes
    if WinActive ( 'Monitor Settings', 'Your desktop has been reconfigured' ) then
        Send ( '!y' )
    endif
    Sleep ( 1000 )

   ; ApplyPredefinedNVIDIAProfile
    if NOT WinActive ( 'NVIDIA Quadro', '' ) then
        WinActivate ( 'NVIDIA Quadro' )
    endif
    Send ( '^+{TAB 3}' )
    Sleep ( 1000 )
    Send ( '+{TAB}' )
    if NOT WinActive ( 'NVIDIA Properties', '' ) then
        WinActivate ( 'NVIDIA Properties' )
    endif
    Send ( '{UP 12}' )
    Send ( '{DOWN 2}' )
    Send ( '{TAB}' )
    Sleep ( 1000 )
    Send ( '!t' )
    Send ( 'ASPIA' )
    Send ( '!a' )
    Sleep ( 1000 )
    Send ( '{ENTER}' )

   ;-------------------------------------------------------------------------------------------------
    Sleep ( 1000 )
    if NOT WinActive ( 'Display Properties', '' ) then
        WinActivate ( 'Display Properties' )
    endif
    SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings of Monitor ' & $Monitor & ' finished!' & @LF, 350, 125 )
    $Monitor = $Monitor + 1

   ;END OF LOOP -----------------------------------------------------------------------------------------
    next

   ;---------------------------------------------------------------------------------------------------------
   ; set screen saver to "none" and power off monitor to "never"

    while (1)   ; SelectTabCardScreenSaver loop
    Sleep ( 1000 )
        if NOT WinActive ( 'Display Properties', 'Screen Saver' ) then
            Send ( '^+{TAB}' )
    wend        ; SelectTabCardScreenSaver
    
   ; ScreenSaverSettings
    Send ( '!s' )
    Send ( '(' )
   ; Monitor Power Management
    Send ( '!o' )
    Sleep ( 1000 )
    if NOT WinActive ( 'Power Options Properties', '' ) then
        WinActivate ( 'Power Options Properties' )
    endif
    Send ( '!m' )
    Send ( 'n' )
   ;press "Apply" followed by "OK"
    Send ( '!a' )
    Sleep ( 1000 )
    SplashTextOn ( 'ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings finished!' & @LF, 350, 125 )
    if WinActive ( 'Monitor Settings', 'Your desktop has been reconfigured' ) then
        Send ( '!y' )
    endif
    WinWaitActive ( 'Power Options Properties' )
    Send ( '+{TAB 3}' )
    Send ( '{ENTER}' )
   ;back at "Display Properties" dialog, press "Apply"
    Sleep ( 1000 )
    if NOT WinActive ( 'Display Properties', '' ) then
        WinWaitActive ( 'Display Properties' )
    endif
    Send ( '!a' )
    Sleep ( 1000 )
   ;if a window pops up asking you to keep the settings, press Yes
    if WinActive ( 'Monitor Settings', 'Your desktop has been reconfigured' ) then
        Send ( '!y' )
    endif
    Sleep ( 1000 )
    if NOT WinActive ( 'Display Properties', '' ) then
        WinWaitActive ( 'Display Properties' )
    endif
    Send ( '{TAB 2}' )
    Send ( '{ENTER}' )

;-- FINSIH ---------------------------------------------------------------------------------------------------

Exit

apparently the lines of the code have indented somehow, but i hope that is ok.

some questions:

what is global $__strcase = 0 supposed to do?!

the same for $__n1_

how can i end the DisplaySettings loop correctly?

hope u can give me some feedback soon. thanks a lot in advance!

Share this post


Link to post
Share on other sites



some questions:

what is global $__strcase = 0 supposed to do?!

the same for $__n1_

how can i end the DisplaySettings loop correctly?

hope u can give me some feedback soon. thanks a lot in advance!

please help :lmao:

the v2 script was working, but too error-prone (see attachment).

please see if u can find syntactical errors..

thx again in advance

SetScrn.txt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i tried to figure this out...it was missing alot of endifs...and the was an untill on a while loop...with this it only shpws your do not touch promp and opens the settings display properties, turns up the resolution. the it gets an error because __cmp () is not a known function

;Set display properties for ASPIA VB13
;Required: 1280 x 1024 on monitor 1 and 2, 75 Hz, monitor 2 extends windows desktop

;This script works correctly only if display settings are the same as the initial settings
;before executing this script the first time!

;-- Init -----------
;tell user "hands off"
$SplashText = "DON'T TOUCH THE KEYBOARD Or THE MOUSE" & @LF & "While the script is running!"
SplashTextOn('Aspia Installer', $SplashText, 350, 80)

;configure AutoIt
Global $__strcase = 0
AutoItSetOption("WinWaitDelay", 1000)
AutoItSetOption("WinTitleMatchMode", 2);set match mode less restrictive!

;-- Let's GO --------
;open Display Properties dialog and activate "settings" tabcard
Run('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3')
Sleep(1000)
Do
    WinActivate('Display Properties')
Until WinActive('Display Properties', '')

while (1) ; DisplaySettings loop
;-- LOOP to set display properties for the two monitors --------------------------------------------------
    $Monitor = 1
    For $__n1_ = 1 To 2
        If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
        
        while Not WinActive('Display Properties', 'Settings')
            Send('^{TAB}')
        WEnd     ; SelectTabCardSettings loop end
        
; SelectMonitor
        Send('!d')
        Send($Monitor)
        Send('!s')
        Send('{LEFT 10}')
        
        while Not WinActive('Display Properties', '1280 by 1024 pixels')
            SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Screen resolution for monitor ' & $Monitor & '.' & @LF, 350, 125)
                Send('!s')
                Send('{RIGHT}')
        WEnd     ; ScreenResolution loop end
        
; ApplyScreenResolution
;-----------------------------------------------------------------------------------------------------
;extend Windows desktop to monitor 2
;unfortunately no possibility to check the state of the checkbox at the moment
;must be done here, if not, the screen resolution will be reset to 640x480 after pressing "Apply".
;Why? Don't know.
        If Not __cmp (@UserName, 'meduser') Then
            If __cmp ($Monitor, 2) Then
                Send('!e')
            EndIf
        EndIf
        Send('!a')
        Sleep(1000)
        If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y')
        Sleep(2000)
        
; SetColorQuality
        SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Color quality for monitor ' & $Monitor & '.' & @LF, 350, 125)
        If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
        Send('!c')
        Send('h')
        _AdvancedDisplaySettings()
    Next
;---------------------------------------------------------------------------------------------------------
; set screen saver to "none" and power off monitor to "never"
    
    while (1) ; SelectTabCardScreenSaver loop
        Sleep(1000)
        If Not WinActive('Display Properties', 'Screen Saver') Then Send('^+{TAB}')
    WEnd     ; SelectTabCardScreenSaver
    
; ScreenSaverSettings
    Send('!s')
    Send('(')
; Monitor Power Management
    Send('!o')
    Sleep(1000)
    If Not WinActive('Power Options Properties', '') Then WinActivate('Power Options Properties')
    Send('!m')
    Send('n')
;press "Apply" followed by "OK"
    Send('!a')
    Sleep(1000)
    SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings finished!' & @LF, 350, 125)
    If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y')
    WinWaitActive('Power Options Properties')
    Send('+{TAB 3}')
    Send('{ENTER}')
;back at "Display Properties" dialog, press "Apply"
    Sleep(1000)
    If Not WinActive('Display Properties', '') Then WinWaitActive('Display Properties')
    Send('!a')
    Sleep(1000)
    If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y');if a window pops up asking you to keep the settings, press Yes
    Sleep(1000)
    If Not WinActive('Display Properties', '') Then WinWaitActive('Display Properties')
    Send('{TAB 2}')
    Send('{ENTER}')
    
;-- FINSIH ---------------------------------------------------------------------------------------------------
WEnd
Exit

Func _AdvancedDisplaySettings()
    while (1) ; AdvancedDisplaySettings loop
        SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Advanced display settings for monitor ' & $Monitor & '.' & @LF, 350, 125)
        If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
        Send('!v')
        Sleep(2000)
        If Not WinActive('NVIDIA Quadro', '') Then WinActivate('NVIDIA Quadro')
        If WinActive('NVIDIA Quadro FX 1400 Properties', '') Then $GraphicAdapter = 'NVIDIA Quadro FX 1400'
        If Not __cmp ($GraphicAdapter, 'NVIDIA Quadro FX 1400') Then
            Sleep(2000)
            If WinActive('NVIDIA Quadro4 980 XGL Properties', '') Then $GraphicAdapter = 'NVIDIA Quadro4 980 XGL'
            If Not __cmp ($GraphicAdapter, 'NVIDIA Quadro4 980 XGL') Then
    ;open a message box ABORT+RETRY+IGNORE+MB_ICONHAND+MB_SYSTEMMODAL
                $__msgbox = MsgBox(4114, 'ASPIA Installer', 'Invalid graphics adapter! Only NVIDIA Quadro4 980 XGL and NVIDIA Quadro FX 1400 are allowed!')
                If $__msgbox = 5) Then
        ; SetRefreshRate Force extra clausing
                    SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Refresh rate for monitor ' & $Monitor & '.' & @LF, 350, 125)
                    If Not WinActive('NVIDIA Quadro', '') Then
                        WinActivate('NVIDIA Quadro')
                    EndIf
                    Send('^{TAB 2}')
                    Send('!s')
                    Send(7)
                    Send(5)
                    Send('!a')
                    Sleep(1000)
        ;if a window pops up asking you to keep the settings, press Yes
                    If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then
                        Send('!y')
                    EndIf
                    Sleep(1000)
                    
        ; ApplyPredefinedNVIDIAProfile
                    If Not WinActive('NVIDIA Quadro', '') Then
                        WinActivate('NVIDIA Quadro')
                    EndIf
                    Send('^+{TAB 3}')
                    Sleep(1000)
                    Send('+{TAB}')
                    If Not WinActive('NVIDIA Properties', '') Then
                        WinActivate('NVIDIA Properties')
                    EndIf
                    Send('{UP 12}')
                    Send('{DOWN 2}')
                    Send('{TAB}')
                    Sleep(1000)
                    Send('!t')
                    Send('ASPIA')
                    Send('!a')
                    Sleep(1000)
                    Send('{ENTER}')
                    
        ;-------------------------------------------------------------------------------------------------
                    Sleep(1000)
                    If Not WinActive('Display Properties', '') Then
                        WinActivate('Display Properties')
                    EndIf
                    SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings of Monitor ' & $Monitor & ' finished!' & @LF, 350, 125)
                    $Monitor = $Monitor + 1
                    ExitLoop
        ;END OF LOOP -----------------------------------------------------------------------------------------
                Else
                    If $__msgbox = 3 Then ExitLoop
                    If $__msgbox = 4 Then
                        _AdvancedDisplaySettings()
                        ExitLoop
                    EndIf
                EndIf
            EndIf
        EndIf
    WEnd
EndFunc;==>_AdvancedDisplaySettings
Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

maybe

If Not __cmp (@UserName, 'meduser') Then
    If __cmp ($Monitor, 2) Then
        Send('!e')
    EndIf
EndIf

wants to be something like this?

If @UserName <> "meduser" Then
    If $Monitor = 2 Then
        If ControlCommand ( "Display Properties", "", "Button4", "IsEnabled", "") Then
            If ControlCommand ( "Display Properties", "", "Button4", "IsChecked", "") = 0 Then ControlClick("Display Properties", "", "Button4")
        EndIf
    EndIf
EndIf

i am guessing __cmp sees if the values match?

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Am i close now

;Set display properties for ASPIA VB13
;Required: 1280 x 1024 on monitor 1 and 2, 75 Hz, monitor 2 extends windows desktop

;This script works correctly only if display settings are the same as the initial settings
;before executing this script the first time!

;-- Init -----------
;tell user "hands off"
$SplashText = "DON'T TOUCH THE KEYBOARD Or THE MOUSE" & @LF & "While the script is running!"
SplashTextOn('Aspia Installer', $SplashText, 350, 80)

;configure AutoIt
AutoItSetOption("WinWaitDelay", 1000)
AutoItSetOption("WinTitleMatchMode", 2);set match mode less restrictive!
Dim $GraphicAdapter = ""
Dim $__msgbox = 0
Dim $Monitor = 1

;-- Let's GO --------
;open Display Properties dialog and activate "settings" tabcard
Run('rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3')
Sleep(1000)
Do
    WinActivate('Display Properties')
Until WinActive('Display Properties', '')
;---------------------------------------------------------------------------------------------------------
;-- LOOP to set display properties for the two monitors --------------------------------------------------
;---------------------------------------------------------------------------------------------------------
For $loop = 1 To 2
    If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
    
    While Not WinActive('Display Properties', 'Settings')
        Send('^{TAB}')
    WEnd       ; SelectTabCardSettings loop end
    
; SelectMonitor
    Send('!d')
    Send($Monitor)
    Send('!s')
    Send('{LEFT 10}')
    
    While Not WinActive('Display Properties', '1280 by 1024 pixels')
        SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Screen resolution for monitor ' & $Monitor & '.' & @LF, 350, 125)
        Send('!s')
        Send('{RIGHT}')
    WEnd       ; ScreenResolution loop end
    
; ApplyScreenResolution
;-----------------------------------------------------------------------------------------------------
;extend Windows desktop to monitor 2
;unfortunately no possibility to check the state of the checkbox at the moment
;must be done here, if not, the screen resolution will be reset to 640x480 after pressing "Apply".
;Why? Don't know.
    If @UserName <> "meduser" Then
        If $Monitor = 2 Then
            If ControlCommand("Display Properties", "", "Button4", "IsEnabled", "") Then
                If ControlCommand("Display Properties", "", "Button4", "IsChecked", "") = 0 Then ControlClick("Display Properties", "", "Button4")
            EndIf
        EndIf
    EndIf
    Send('!a')
    Sleep(1000)
    If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y')
    Sleep(2000)
    
; SetColorQuality
    SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Color quality for monitor ' & $Monitor & '.' & @LF, 350, 125)
    If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
    Send('!c')
    Send('h')
    _AdvancedDisplaySettings()
    Sleep(1000)
    If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
    SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings of Monitor ' & $Monitor & ' finished!' & @LF, 350, 125)
    $Monitor += 1
Next

;---------------------------------------------------------------------------------------------------------
; set screen saver to "none" and power off monitor to "never"
;---------------------------------------------------------------------------------------------------------

While Not WinActive('Display Properties', 'Screen Saver')   ; SelectTabCardScreenSaver loop
    Send('^+{TAB}')
    Sleep(1000)
WEnd       ; SelectTabCardScreenSaver

; ScreenSaverSettings
Send('!s')
Send('(')
; Monitor Power Management
Send('!o')
Sleep(1000)
If Not WinActive('Power Options Properties', '') Then WinActivate('Power Options Properties')
Send('!m')
Send('n')
;press "Apply" followed by "OK"
Send('!a')
Sleep(1000)
SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Display Settings finished!' & @LF, 350, 125)
If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y')
WinWaitActive('Power Options Properties')
Send('+{TAB 3}')
Send('{ENTER}')
;back at "Display Properties" dialog, press "Apply"
Sleep(1000)
If Not WinActive('Display Properties', '') Then WinWaitActive('Display Properties')
Send('!a')
Sleep(1000)
If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y');if a window pops up asking you to keep the settings, press Yes
Sleep(1000)
If Not WinActive('Display Properties', '') Then WinWaitActive('Display Properties')
Send('{TAB 2}')
Send('{ENTER}')

Exit; End Script

;################################################ FUNCTION _AdvancedDisplaySettings() ################################################
Func _AdvancedDisplaySettings()
    While 1
        SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Advanced display settings for monitor ' & $Monitor & '.' & @LF, 350, 125)
        If Not WinActive('Display Properties', '') Then WinActivate('Display Properties')
        Send('!v')
        Sleep(2000)
        
        If Not WinActive('NVIDIA Quadro', '') Then WinActivate('NVIDIA Quadro')
        If WinActive('NVIDIA Quadro FX 1400 Properties', '') Then $GraphicAdapter = 'NVIDIA Quadro FX 1400'
        If WinActive('NVIDIA Quadro4 980 XGL Properties', '') Then $GraphicAdapter = 'NVIDIA Quadro4 980 XGL'
        If $GraphicAdapter = "NVIDIA Quadro FX 1400" Or $GraphicAdapter = "NVIDIA Quadro4 980 XGL" Or $__msgbox = 5 Then
        ; SetRefreshRate Force extra clausing
            SplashTextOn('ASPIA Installer', $SplashText & @LF & @LF & 'Refresh rate for monitor ' & $Monitor & '.' & @LF, 350, 125)
            If Not WinActive('NVIDIA Quadro', '') Then WinActivate('NVIDIA Quadro')
            Send('^{TAB 2}')
            Send('!s')
            Send(7)
            Send(5)
            Send('!a')
            Sleep(1000)
        ;if a window pops up asking you to keep the settings, press Yes
            If WinActive('Monitor Settings', 'Your desktop has been reconfigured') Then Send('!y')
            Sleep(1000)
            
        ; ApplyPredefinedNVIDIAProfile
            If Not WinActive('NVIDIA Quadro', '') Then WinActivate('NVIDIA Quadro')
            Send('^+{TAB 3}')
            Sleep(1000)
            Send('+{TAB}')
            If Not WinActive('NVIDIA Properties', '') Then WinActivate('NVIDIA Properties')
            Send('{UP 12}')
            Send('{DOWN 2}')
            Send('{TAB}')
            Sleep(1000)
            Send('!t')
            Send('ASPIA')
            Send('!a')
            Sleep(1000)
            Send('{ENTER}')
            ExitLoop
        Else
            Send('{ENTER}'); close properties window
        ;open a message box ABORT+RETRY+IGNORE+MB_ICONHAND+MB_SYSTEMMODAL
            $__msgbox = MsgBox(4114, 'ASPIA Installer', 'Invalid graphics adapter! Only NVIDIA Quadro4 980 XGL and NVIDIA Quadro FX 1400 are allowed!')
            If $__msgbox = 3 Then ExitLoop;abort
            If $__msgbox = 4 Then 
            ;ContinueLoop
            EndIf
            If $__msgbox = 5 Then;ignore, reopen propeties window
            ;ContinueLoop
            EndIf
        EndIf
    WEnd
EndFunc  ;==>_AdvancedDisplaySettings

the only problem i see is that if you choose to ignore the error on a non nforce adapter, the properties window does not exit (and i dont have a nforce....so i cant test you properties window stuff)

Script.au3

Edited by ACalcutt

Andrew Calcutt

Http://www.Vistumbler.net

Http://www.TechIdiots.net

Its not an error, its a undocumented feature

Share this post


Link to post
Share on other sites

thank zou so much. i will test it right away and then post some lines..

Share this post


Link to post
Share on other sites

I think most of this could be done with some registry edits. I just think your making harder than it has to be. Download Regmon from sysinternals and see what keys are edited while making the changes.

Share this post


Link to post
Share on other sites

it works so sweet! i was surprised to see how classy autoit v3 can be! wow! really wow! this is really going to whet my appetite for more nifty scripts! thank you again! :lmao:

Share this post


Link to post
Share on other sites

@big_daddy i have tried also the reg-method, but maybe not hard enough. i will evaluate Regmon and see if i can solve it easier this way. thanks a lot.

Share this post


Link to post
Share on other sites

@big_daddy: RegMon is a nice tool (i even remember using it some time ago) but definetly not applicable for this task. after all the filtering i still had over 10k lines in the log file..

thx anyway

Share this post


Link to post
Share on other sites

@big_daddy: RegMon is a nice tool (i even remember using it some time ago) but definetly not applicable for this task. after all the filtering i still had over 10k lines in the log file..

thx anyway

If you tell it to only log writes and success then you won't have as many items to sort through. I use it all the time to figure out how to push changes throughout our domain.

For example if I wanted to display my computer on the desktop I would go into display properties, check the box for my computer, click ok. Before I click apply I open regmon, then click apply, wait for it to take effect, and stop the capture. Doing that I get about 74 items, which isn't that hard to sort through. From that I can tell that these are the two values that I need to change in the registry to make this change.

rundll32.exe:3412   SetValue    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu\{20D04FE0-3AEA-1069-A2D8-08002B30309D}    SUCCESS 0x0 
rundll32.exe:3412   SetValue    HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\{20D04FE0-3AEA-1069-A2D8-08002B30309D}       SUCCESS 0x0

So I write a script like this:

RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu\", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "0")
RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel\", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "0")

Hope this helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0