Help: How to change the ClassNN or control name
Posted: 27 Mar 2020, 17:00
A great day for everyone my query is as follows, I want to change the ClassNN of each control that are png images, and replace the StaticNN that has the name of each image by default. There are two commands that I have tried GuiControl and ControlSetText, but when trying to rename the control disappears. What am I doing wrong? I'm just experiencing programming. I have more questions but I do not want to bother my first post .
Code: Select all
SendMode Input
#SingleInstance Force
#UseHook on
#HotkeyInterval 0
#NoEnv
#MaxThreads
Process, priority, , High
SetWorkingDir %A_ScriptDir%
Setbatchlines, -1
SetKeyDelay , -1, -1
SetMouseDelay, -1
SetControlDelay, -1
SetWinDelay, -1
SetDefaultMouseSpeed, 0
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
Gui ItemsBasico: +AlwaysOnTop +LastFound +ToolWindow -Caption
Win_TransColor:=0x123456
Gui ItemsBasico: Color, %Win_TransColor%
MainHandle:=WinExist()
Gui ItemsBasico: Add, Picture, X5 Y5, imageName1.png
Gui ItemsBasico: Add, Picture, X50 Y5, imageName2.png
Gui ItemsBasico: Show, x0 y0 w500 h800 NoActivate, Items
WinSet, TransColor, %Win_TransColor%, ahk_id %MainHandle%
; first attempt to change the "ClassNN" of the control
GuiControl ItemsBasico: Text, Static1, imageName1
GuiControl ItemsBasico: Text, Static2, imageName2
; second attempt to change the "ClassNN" of the control
ControlSetText ItemsBasico: Static1, imageName1, Items
ControlSetText ItemsBasico: Static2, imageName2, Items