Some of the Gui, Win, and Control commands are returning hexadicimal values as strings and the receiving variables are typed as "String" too, e.g.
Code: Select all
GuiColor := 0xFF0000 ; red
Gui, +LastFound
Gui, Color, % Color2Hex(GuiColor)
; Gui, Color, %GuiColor% ; doesn't work properly with v2
Gui, Font, s10
Gui, Add, Edit, w600 r10 hwndHEDT
Gui, Show, , V2 Test - %A_AhkVersion%
HGUI := WinExist()
WinGetStyle, Styles
Send, % 'Type of HGUI is "' Type(HGUI) '" and the value is ' HGUI ".`n`n"
Send, % 'Type of HEDT is "' Type(HEDT) '" and the value is ' HEDT ".`n`n"
Send, % 'Type of Styles is "' Type(Styles) '" and the value is ' Styles ".`n`n"
Send, % "Styles & 0xC00000 = 0xC00000 is " ((Styles & 0xC00000) = 0xC00000 ? 'True' : 'False') '.`n`n'
Send, % 'Type of GuiColor is "' Type(GuiColor) '" and the value is ' GuiColor '.'
Sleep, 1000
Gui, Font, cMaroon
GuiControl, Font, % (HEDT + 0)
Return
GuiClose:
GuiEscape:
ExitApp
Color2Hex(C) { ; v2
If (Type(C) = "Integer") {
VarSetCapacity(Hex, 7 << !!A_IsUnicode, 0)
If (DllCall("Shlwapi.dll\wnsprintf", "Str", Hex, "Int", 7, "Str", "`%06I32X", "UInt", C & 0xFFFFFF, "Int") = 6)
Return Hex
}
Return ""
}
Could this be changed, so that (at least) handles are returned as integers?