Melba23,
I have modified your example to show the error.
It happens when the unbroken string is wider than the screen or almost.
#pragma compile(Icon, C:\Program Files (x86)\AutoIt3\Aut2Exe\Icons\AutoIt_Main_v11_256x256_RGB-A.ico)
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7
#include "ExtMsgBox.au3"
Global $aText[] = ["Short text", _
"Medium_text_Medium_text_Medium_text", _
"Long_text_Long_text_Long_text_Long_text_Long_text_Long_text_Long_text_Long_text", _
"Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text_Very_long_text"]
$aText[3] = $aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]&$aText[3]
For $i = 0 to 3
; Determine text width
$aSize = _StringSize($aText[$i])
; Set max size of the ExtMsgBox
_ExtMsgBoxSet(0, Default, Default, Default, Default, Default, Default, $aSize[2] + 40)
; Note use of 0 and not Default for the first parameter - read the function header to see why !!!!
; Add 40 to the text width to allow for the dialog borders, etc
; Display ExtMsgBox which will now expand to allow the text to display
$iRet = _ExtMsgBox(0, 0, "Width: " & $aSize[2], $aText[$i])
ConsoleWrite("@error = " & @error&@CRLF)
Next