Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Transparent Text Background over progress bar
#6
Looked here http://msdn.microsoft.com/en-us/library/...s.85).aspx

tried to do it like this based on above and dll user32 [DrawTextA]#DrawText hdc $lpchText cchText RECT*lprc format:

Code:
Copy      Help
,RECT r; DpiGetWindowRect dc &r ;;push button
,lpstr s = "TEST"
,DrawText dc s -1 &r  DT_CENTER

but text remains invisible.

not sure what you mean by [Ex] and [W] in DrawText[Ex][W]

Thanks, S

Quote:int DrawText(
_In_ HDC hDC,
_Inout_ LPCTSTR lpchText,
_In_ int nCount,
_Inout_ LPRECT lpRect,
_In_ UINT uFormat
);

Parameters
hDC [in]
A handle to the device context.
lpchText [in, out]
A pointer to the string that specifies the text to be drawn. If the nCount parameter is -1, the string must be null-terminated.
If uFormat includes DT_MODIFYSTRING, the function could add up to four additional characters to this string. The buffer containing the string should be large enough to accommodate these extra characters.
nCount [in]
The length, in characters, of the string. If nCount is -1, then the lpchText parameter is assumed to be a pointer to a null-terminated string and DrawText computes the character count automatically.
lpRect [in, out]
A pointer to a RECT structure that contains the rectangle (in logical coordinates) in which the text is to be formatted.
uFormat [in]
The method of formatting the text. This parameter can be one or more of the following values.
Value Meaning
DT_CENTER
Centers text horizontally in the rectangle.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)