This local variable has the same name as a global variable.
This variable has not been assigned a value.
Although such codes may work fine, I would like to know how a code should be adapted to avoid such warnings.
Here is a example using Acc functions.
Code: Select all
#NoEnv
#Warn
f2::
MouseGetPos, X, Y, Win, Control
WinGetClass, WinClass, Ahk_id %win%
if (WinClass ~= "CabinetWClass")
{
Value := getAccPointValue()
for window in ComObjCreate("Shell.Application").Windows
{
if (window.HWND != Win)
continue
sfv := window.Document
items := sfv.Folder.Items
for item in items
{
name := item.Name
if (name = Value)
{
sfv.SelectItem(item, true)
break 2
}
}
}
}
return
getAccPointValue()
{
Acc := Acc_ObjectFromPoint(ChildId)
Value := Acc.accValue(ChildId)
return Value
}
Acc_Init()
{
Static h
If Not h
h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
}
Acc_ObjectFromPoint(ByRef _idChild_ = "", x = "", y = "")
{
Acc_Init()
If DllCall("oleacc\AccessibleObjectFromPoint", "Int64", x==""||y==""?0*DllCall("GetCursorPos","Int64*",pt)+pt:x&0xFFFFFFFF|y<<32, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild,8+2*A_PtrSize,0)*0+&varChild)=0
Return ComObjEnwrap(9,pacc,1), _idChild_:=NumGet(varChild,8,"UInt")
}