Jump to content

Turning SLI on and off with a double click


HAZEHELL
 Share

Recommended Posts

Hello World!

I mean.... Hello Everyone. Since my first scrpit I was impressed by the versality of this software and decided to do a second, my first was a COD4MW autopatcher, so that all the patch updates (from 1.2-1.7) will install in one go.AutoIt left a great impression of how powerful and easy tool it is.

That was my first script ever! and so much I liked the program that some other couple ideas started, like this one. I'm in the process of making a script to turn on/off the SLI , most games nowdays use it, but some others don't (like some old ones) so I thought it was a pain in the neck to be activating and deactivating every time (I usually disable it when not playing), and figured why not, lets make a script for it to make it easier to activate/deactivate.

Now, lets get to the important part, the reason I'm here is because, as I said, Im a begginer in this scripting world, but I like the "trial and error method" a lot, and I have learned a lot on the go, right now I'm stuck after doing all I could, I came to a point where I couldn't find a why to work this out, due to my lack of knowledge ,and of course, experience.

The first thing I was trying to do was to get the SLI to be enabled, before going deeper into to the conditionals, etc, right now this is what I got, so far it seems to be working up to the point where SLI is applied, then get teh box "Your desktop configuration has changed.

Would you like to keep these changes?" thats where the problem starts, I could not get the mouseclick to work on the coordinates given on that window and could not get controlclick to click on the dreaded "button1". I would like to recieve some advise as of how to work with this one since the script doesn't seem to be recognizing the commands given in regards to this pop up window. I will leave my humble code in here and also the Summary of Autoit Window Info.

AutoIt Version: 3.2.12.1
 Author:  HAZEHELL

 Script Function:
    Turns SLI on/off
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here

Run ("nvcplui.exe")
WinWaitActive("nvcplui.exe", "", 1)
Opt("MouseCoordMode", "2")
MouseClick("primary", 46, 104, 1)
ControlClick("NVIDIA Control Panel", "", "Button2")
ControlClick("NVIDIA Control Panel", "", "Button4")
WinWaitActive("Applications Shutdown Required")
ControlClick("Applications Shutdown Required", "", "Button1")
WinWaitActive("Apply Changes")
ControlClick("Apply Changes","","Button1")

CODE
>>>> Window <<<<

Title: Apply Changes

Class: #32770

Position: 554, 352

Size: 414, 117

Style: 0x94C800CC

ExStyle: 0x00010101

Handle: 0x009E0100

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID: 1

Text: &Yes

Position: 242, 57

Size: 75, 23

ControlClick Coords: 22, 13

Style: 0x50010000

ExStyle: 0x00000004

Handle: 0x022004FC

>>>> Mouse <<<<

Position: 267, 95

Cursor ID: 0

Color: 0xD4D4D4

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Your desktop configuration has changed.

Would you like to keep these changes?

Reverting in 9 seconds

&Yes

&No

>>>> Hidden Text <<<<

I would like to avoid mouseclicks at all costs, if anyone has a suggestion to avoid the mouseclick used in my scprit would be really apreciated, because I could not get a controlclick, or a send to work on that "set SLI configuration" static option, I will leave also the summary of that one just in case.

CODE
>>>> Window <<<<

Title: NVIDIA Control Panel

Class: Afx:00400000:b:00010011:00000006:019E083F

Position: 233, 41

Size: 685, 672

Style: 0x14CF0000

ExStyle: 0x00010100

Handle: 0x000A0356

>>>> Control <<<<

Class: Static

Instance: 11

ClassnameNN: Static11

Advanced (Class): [CLASS:Static; INSTANCE:11]

ID: 4100

Text: Set SLI configuration

Position: 38, 104

Size: 107, 16

ControlClick Coords: 59, 9

Style: 0x5000C18C

ExStyle: 0x00000000

Handle: 0x0160043A

>>>> Mouse <<<<

Position: 101, 159

Cursor ID: 0

Color: 0x555555

>>>> StatusBar <<<<

>>>> Visible Text <<<<

{3156EC84-29BD-4EAA-AE0A-817ED606FA99}:{DE0549BD-F34D-4748-AD94-0F2F22749F4F}

Select the SLI configuration for your system:

&Do not use SLI technology

Enable &SLI technology (recommended)

Description:

Typical usage scenarios:

Restore Defaults

Select a Task...

Select a Task...

Left View

Adjust image settings with preview

Manage 3D settings

Set SLI configuration

Run display optimization wizard

Move CRT screen position

Change resolution

Adjust desktop color settings

Rotate display

Manage custom resolutions

Set up multiple displays

Adjust video color settings

Adjust video image settings

System Information

<a id="LINK_TARGET">System Information</a>

>>>> Hidden Text <<<<

Simple View Pages

Apply Bar

&Apply

Cancel

Link to comment
Share on other sites

I hope you like this one, I can't tell if it will work or not, I only translated it to AutoIt.

; Open the SLI Multi-GPU applet.
Run('rundll32.exe C:\WINDOWS\system32\nvcpl.dll,LaunchMultiGpuApplet')
; On slower machines this Sleep value may need to be increased.
Sleep(500)

; Send the keystrokes to change the mode.
Send("!E"); alt + E
Send("{ENTER}")

Original code: http://forums.nvidia.com/lofiversion/index.php?t12566.html

Link to comment
Share on other sites

Thank you Pain, that script works. BUT, I really don't know how was intended to work or I should say with what drivers, once applied you still need to use the mouse, this is just like a shortcut to get a window that enables or disables the SLI, different from the one in Nvidia Control Panel, and also requires restarting the computer, My Goal is to avoid that, so that with a simple doubleclick on the script, or a combination keystroke an automatically do the job for you, I guess I can try to work out a little with that one and might figure something out, but is not exactly what I', currently working on.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...