Getting Dialog caption from a DLL file

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
JnLlnd
Posts: 487
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

Getting Dialog caption from a DLL file

Post by JnLlnd » 18 Nov 2022, 23:50

Hi,

I'm getting close to the solution but need some help. This page Windows 10 DLL File Information - sysdm.cpl describes the localized string available for the DLL file for the "Environment Variables" control panel applet. I found how to retrieve the various string resources using the code below. But what I need is to retrieve the localized name of the applet that is found in the "Dialog Caption" section #105. How could I retrieve this piece of text? Thanks.

Code: Select all

#requires AutoHotkey v1.1
#SingleInstance,Force
#NoEnv

MsgBox, % TranslateMUI("shell32.dll", 31236) ; example provided with the function WORKING

; https://windows10dll.nirsoft.net/sysdm_cpl.html
MsgBox, % TranslateMUI("sysdm.cpl", 3) ; String Text WORKING
MsgBox, % TranslateMUI("sysdm.cpl", 105) ; Dialog Caption NOT WORKING

;Gets a localized string from a resource file.
; https://github.com/7plus/7plus/blob/master/MiscFunctions.ahk
TranslateMUI(resDll, resID)
{
	VarSetCapacity(buf, 256) 
	hDll := DllCall("LoadLibrary", "str", resDll, "Ptr") 
	Result := DllCall("LoadString", "Ptr", hDll, "uint", resID, "str", buf, "int", 128)
	return buf
}
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey

Return to “Ask for Help (v1)”