Attribute VB_Name = "mDraw" Option Explicit ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Determina se está usando Win9x ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub Verify9xDraw() On Error GoTo Err: Dim OSInfo As OSVERSIONINFO ' Tamanho do bloco de informação OSInfo.dwOSVersionInfoSize = Len(OSInfo) ' Tenta recuperar informação If (GetVersionEx(OSInfo) > LN_NO_ADDRESS) Then ' Usará win9x caso não for NT ou superior bl_Win9x = (OSInfo.dwPlatformId <= 1) Else ' Força uso de win9x bl_Win9x = True End If Exit Sub Err: ' Seta que está usando win9x bl_Win9x = True End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Imprime texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function DrawTextE(ByVal hdc As Long, text As String, lpRect As RECT, ByVal wFormat As Long) As Long ' Se estiver usando win9x If (bl_Win9x) Then ' Chamada sem wide-char DrawTextE = DrawTextA(hdc, ByVal text, ByVal Len(text), lpRect, wFormat) Else ' Chamada com wide-char DrawTextE = DrawTextW(hdc, ByVal StrPtr(text), ByVal Len(text), lpRect, wFormat) End If End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Requisitando tamanho de texto ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Function GetTextExtentPoint32E(ByVal hdc As Long, text As String, lpSize As POINTAPI) As Long ' Se estiver usando win9x If (bl_Win9x) Then ' Chamada sem wide-char GetTextExtentPoint32E = GetTextExtentPoint32A(hdc, ByVal text, ByVal Len(text), lpSize) Else ' Chamada com wide-char GetTextExtentPoint32E = GetTextExtentPoint32W(hdc, ByVal StrPtr(text), ByVal Len(text), lpSize) End If End Function