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

Re: Send text to nvidia control panel ddl

Post by vsub » 29 Nov 2021, 16:02

I found out why but that doesn't help me
If you uncheck the option "Show only programs found on this computer",you will probably get the same error
The thing is,I do have a lot of games installed but nvidia don't find them for some reason

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

Re: Send text to nvidia control panel ddl  Topic is solved

Post by teadrinker » 29 Nov 2021, 16:56

Try this:

Code: Select all

SetBatchLines, -1
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)

hProc := DllCall("OpenProcess", "UInt", PROCESS_VM_READ := 0x10, "Int", 0, "UInt", PID, "Ptr")
VarSetCapacity(buff, bitness//8)
items := ""
SendMessage, CB_GETCOUNT := 0x146
Loop % ErrorLevel {
   SendMessage, CB_GETITEMDATA := 0x150, A_Index - 1
   if !DllCall("ReadProcessMemory", "Ptr", hProc, "Ptr", ErrorLevel, "Ptr", &buff, "Ptr", bitness//8, "Ptr", 0)
      throw "Failed to read data"
   addr := NumGet(buff, bitness = 32 ? "UInt" : "UInt64")
   item := ""
   Loop {
      if DllCall("ReadProcessMemory", "Ptr", hProc, "Ptr", addr + (A_Index - 1)*2, "Ptr", &buff, "Ptr", 2, "Ptr", 0) {
         char := StrGet(&buff, 1, "UTF-16")
         if (char = "")
            break
         item .= char
      }
   }
   items .= (items = "" ? "" : "`n") . A_Index . ") " . item
}
DllCall("CloseHandle", "Ptr", hProc)

MsgBox, % Clipboard := 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
}

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

Re: Send text to nvidia control panel ddl

Post by vsub » 30 Nov 2021, 12:18

That worked,thanks
Now I can make a search function for the control panel and jump to the profile I want

Post Reply

Return to “Ask for Help (v1)”