Well, i just recently began to start win 32-bit Assembly from first learning VB/Delphi, and so far the transition has been smooth. However, i just have a question on displaying text, and this may probably sound very newbie to you...:stupid:

Being used to the labels, static labels, etc. from the RAD languages, i was just wondering how to display normal text on a form...

The problem is, whenever i use DrawText(), i displays a text enclosed in a white rectangle box, which the color does not match with the form itself. Using TextOut(), i get the same results..

I was just wondering, to make the text match the background color, would i have to create a rectangle, then fill the rectangle with a disired color/background, and then put the text in?

Or is there a simpiler way to do it?

i'm such a newbie :(


----------

Thanks in advanced!
Posted on 2003-01-23 00:24:00 by Drocon
invoke SetBkMode,hDC,TRANSPARENT

But to display text on a window you can also create a STATIC control, which is much like a "Label" control. You can find info on that in the tutorials that come with Masm32.

Basically, you call CreateWindowEx with "STATIC" as the class name and your main window as the hParent, and then you can set the text with SetWindowText (or SendMessage with uMsg==WM_SETTEXT).
Posted on 2003-01-23 00:45:00 by Qweerdy

The problem is, whenever i use DrawText(), i displays a text enclosed in a white rectangle box, which the color does not match with the form itself. Using TextOut(), i get the same results.
What linker are you using?

The MS linker for VC++ 4 and later normally sets the subsystem version to 4.0 or later.

The Borland/Inprise linker, TLINK32, normally needs the option /V4.0 to set the subsystem version to 4.0 (you can set it to a later version).

It's been a while since I've needed to specify those options, and I don't recall if it affected DrawText or not. I do know it affected the STATIC control.

If that doesn't solve the problem, you will need to use SetBkColor or SetBkMode.
Posted on 2003-01-23 21:34:05 by tenkey
You could also use a read-only disabled edit control if you're bored. :alright:
Posted on 2003-01-23 22:48:42 by iblis