Код:

#include <GUIConstants.au3>
$text = "Text Label"
$hGui = GUICreate("Test Label Size")
$Label_1 = GUICtrlCreateLabel($text, 20, 20)
GUICtrlSetFont(-1, 9, 400, 0, "Tahoma")
$Button = GUICtrlCreateButton("Change Label", 20, 300)
GUISetState()
While 1
Switch GUIGetMsg()
Case -3
Exit
Case $Button
$Text &= " and some more text, "
GUICtrlSetData($Label_1, $Text)
$TextLenght = _GetTextLabelWidth($Text, "Tahoma", 9)
GUICtrlSetPos($Label_1, 20, 20, $TextLenght)
EndSwitch
WEnd
Func _GetTextLabelWidth($s_WinText, $s_TextFont, $i_FontSize, $i_FontWeight = -1)
Local Const $DEFAULT_CHARSET = 0 ; ANSI character set
Local Const $OUT_CHARACTER_PRECIS = 2
Local Const $CLIP_DEFAULT_PRECIS = 0
Local Const $PROOF_QUALITY = 2
Local Const $FIXED_PITCH = 1
Local Const $RGN_XOR = 3
Local Const $LOGPIXELSY = 90
$h_WinTitle = "Get Label Width"
If $i_FontWeight = "" Or $i_FontWeight = -1 Then $i_FontWeight = 600 ; default Font weight
Local $h_GUI = GUICreate($h_WinTitle, 10, 10, -100, -100, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW)
Local $hDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $h_GUI)
Local $intDeviceCap = DllCall("gdi32.dll", "long", "GetDeviceCaps", "int", $hDC[0], "long", $LOGPIXELSY)
$intDeviceCap = $intDeviceCap[0]
Local $intFontHeight = DllCall("kernel32.dll", "long", "MulDiv", "long", $i_FontSize, "long", $intDeviceCap, "long", 72)
$intFontHeight = -$intFontHeight[0]
Local $hMyFont = DllCall("gdi32.dll", "hwnd", "CreateFont", "int", $intFontHeight, _
"int", 0, "int", 0, "int", 0, "int", $i_FontWeight, "int", 0, _
"int", 0, "int", 0, "int", $DEFAULT_CHARSET, _
"int", $OUT_CHARACTER_PRECIS, "int", $CLIP_DEFAULT_PRECIS, _
"int", $PROOF_QUALITY, "int", $FIXED_PITCH, "str", $s_TextFont)
DllCall("gdi32.dll", "hwnd", "SelectObject", "int", $hDC[0], "hwnd", $hMyFont[0])
Local $res = DllStructCreate("int;int")
Local $ret = DllCall("gdi32.dll", "int", "GetTextExtentPoint32", "int", $hDC[0], "str", $s_WinText, "long", StringLen($s_WinText), "ptr", DllStructGetPtr($res))
Local $intLabelWidth = DllStructGetData($res,1)
GUIDelete($h_GUI)
Return $intLabelWidth
EndFunc