http://bugs.winehq.org/show_bug.cgi?id=12226
Summary: DrawTextA/W + DT_CALCRECT + Empty String returns 0 Product: Wine Version: 0.9.58. Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: J.Duttke@web.de
If I call DrawTextA or DrawTextW to calculate the dimensions of a string, the return value of Wine is 0, if the string is empty. In Windows, the height of a single line get returned in such a case.
0 is the value which indicate that the function failed, but since it did not failed in Wine, it should not return 0.
That's how I can reproduce it in VB6: Dim s As String Dim r As RECT
MsgBox DrawTextA(Me.hDC, s, -1, r, DT_CALCRECT Or DT_LEFT Or DT_SINGLELINE)