Send text to nvidia control panel ddl Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 09:40

In the nvidia control panel in Manage 3DSettings=>Program Settings=>Select a program to customize,that drop down list accepts only one letter
If I try to type some name,it will switch to each letter of what I am typing

Can AHK somehow send a full name in some way so the ddl don't just go to the letter I am typing

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 09:43

You could try Control, ChooseString.

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 09:56

I just tried right after posting and the control don't react at all
It does react to Control,Choose,number but trying to get the list gives me only the first item

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 09:58

Feel free to post your script for feedback about it.

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 10:26

This sends only the first item

Code: Select all

WinActivate,NVIDIA Control
ControlFocus,ComboBox1,A
ControlGet, Items, List,,ComboBox1, A
ClipBoard := Items
This does nothing

Code: Select all

WinActivate,NVIDIA Control
ControlFocus,ComboBox1,A
Control,ChooseString,3DMark,ComboBox1,A
This work properly but I cannot get the list and trying to get the items like that(one by one)will take an eternity and it also don't get the names properly

Code: Select all

Loop,5
{
Sleep,1000
Control, Choose,% A_Index, ComboBox1,NVIDIA Control
}
Edit:It actually don't work properly,number 3 and 4 is selecting the same profile as 1

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 11:15

Here is an example. You can change the window title; use the actual window title from Window Spy. If it does not work, you can try admin mode.

Code: Select all

Gui, Add, ComboBox, vcolor, Red|Green|Blue|Black|White
Gui, Show
; ----------------------------------------------------
winTitle = ahk_class AutoHotkeyGUI
ControlGet, list, List,, ComboBox1, %winTitle%
MsgBox, 64, ComboBox choices, %list%
Perhaps something like this.

Code: Select all

If !A_IsAdmin && !RegExMatch(DllCall("GetCommandLine", "str"), " /restart(?!\S)") {
 Try Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
 ExitApp
}
winTitle = NVIDIA Control
ControlGet, clist, List,, ComboBox1, %winTitle%
MsgBox, 64, ComboBox choices, %clist%

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 11:38

It does the exact same thing as my first example,only the first item is sended to the clipboard and with a wrong name(it's basically the same code but run as admin(the control panel is not running as admin))

This is what I get in the clipboard but there are over 2k items in the ddl

Code: Select all

007 ÿ

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 11:38

OK. Sorry I do not have a way to test it. I would post your revised script, in case others can help with it. Include a screenshot of your Windows Spy when overed over your control of interest.

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 12:24

I am pointing the combobox
Attachments
2021-11-28_172218.jpg
2021-11-28_172218.jpg (207.5 KiB) Viewed 2012 times

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 12:32

I would show your script as well.

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 12:56

I don't have a script,those 3 examples are the script(me trying different thing to achieve what I ask in the first post)

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 13:15

OK. Let's try it this way.

Run this script, and then post a screenshot of the MsgBox.

Code: Select all

winTitle = NVIDIA
ControlGet, clist, List,, ComboBox1, %winTitle%
MsgBox, 64, ComboBox choices, %clist%

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 28 Nov 2021, 13:32

Single line
Attachments
2021-11-28_183210.jpg
2021-11-28_183210.jpg (6.78 KiB) Viewed 1909 times

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: Send text to nvidia control panel ddl

Post by mikeyww » 28 Nov 2021, 13:46

OK. Sorry I haven't been of much help. Others may have some better ideas for you!

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Send text to nvidia control panel ddl

Post by malcev » 28 Nov 2021, 21:27

I think You can do it with nvapi sdk.

teadrinker
Posts: 4295
Joined: 29 Mar 2015, 09:41
Contact:

Re: Send text to nvidia control panel ddl

Post by teadrinker » 29 Nov 2021, 00:00

Perhaps this will work:

Code: Select all

ControlGet, hCtrl, hwnd,, ComboBox1, NVIDIA Control
if !hCtrl
   throw "Failed to get hwnd of ComboBox1"
WinWait, ahk_id %hCtrl%
WinGet, PID, PID
bitness := GetProcessBitness(PID)

items := ""
SendMessage, CB_GETCOUNT := 0x146
Loop % ErrorLevel {
   SendMessage, CB_GETITEMDATA := 0x150, A_Index - 1
   ReadProcessMemory(PID, buff, ErrorLevel, bitness//8)
   addr := NumGet(buff, bitness = 32 ? "UInt" : "UInt64")
   ReadProcessMemory(PID, buff, addr, 256)
   items .= (items = "" ? "" : "`n") . StrGet(&buff)
}

MsgBox, % items

GetProcessBitness(PID) {
   if !A_Is64bitOS
      Return 32
   hProc := DllCall("OpenProcess", "UInt", PROCESS_QUERY_INFORMATION := 0x400, "UInt", 0, "UInt", PID, "Ptr")
   DllCall("IsWow64Process", "Ptr", hProc, "IntP", is32)
   DllCall("CloseHandle", "Ptr", hProc)
   Return 32 << !is32
}

ReadProcessMemory(PID, ByRef localBuff, addr, size) {
   if !hProc := DllCall("OpenProcess", "UInt", PROCESS_VM_READ := 0x10, "Int", 0, "UInt", PID, "Ptr")
      throw "Can't open process, error: " . A_LastError
   VarSetCapacity(localBuff, size, 0)
   if !DllCall("ReadProcessMemory", "Ptr", hProc, "Ptr", addr, "Ptr", &localBuff, "Ptr", size, "PtrP", bytesRead)
      throw "Can't read data, error: " . A_LastError
   DllCall("CloseHandle", "Ptr", hProc)
   Return bytesRead
}

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 29 Nov 2021, 10:45

I get this error

Code: Select all

Error:  Can't read data, error: 299

	Line#
	030: Return,32 << !is32
	031: }
	033: {
	034: if !hProc := DllCall("OpenProcess", "UInt", PROCESS_VM_READ := 0x10, "Int", 0, "UInt", PID, "Ptr")  
	035: Throw,"Can't open process, error: " . A_LastError
	036: VarSetCapacity(localBuff, size, 0)  
	037: if !DllCall("ReadProcessMemory", "Ptr", hProc, "Ptr", addr, "Ptr", &localBuff, "Ptr", size, "PtrP", bytesRead)  
--->	038: Throw,"Can't read data, error: " . A_LastError
	039: DllCall("CloseHandle", "Ptr", hProc)  
	040: Return,bytesRead
	041: }
	042: Exit
	043: Exit
	043: Exit

The current thread will exit.

teadrinker
Posts: 4295
Joined: 29 Mar 2015, 09:41
Contact:

Re: Send text to nvidia control panel ddl

Post by teadrinker » 29 Nov 2021, 10:46

Use the 64 bit interpreter.

vsub
Posts: 541
Joined: 29 Sep 2015, 03:39

Re: Send text to nvidia control panel ddl

Post by vsub » 29 Nov 2021, 13:52

What do you mean?
I have the x64 version of AHK(the Unicode version to be exact)

teadrinker
Posts: 4295
Joined: 29 Mar 2015, 09:41
Contact:

Re: Send text to nvidia control panel ddl

Post by teadrinker » 29 Nov 2021, 14:53

For me this code works on 64 bit version (returns item list without errors). I don't know why it doesn't work for you.

Post Reply

Return to “Ask for Help (v1)”