Moving further along, I am embedding the Frame3D control into my GTEXT routine for the TextOut function... (see below code, where slen=length of text to print, XWid&YWid=x&y resolutions of fonts(pitch I guess ya call it), and x&y = position of textout to print)...

the Y size of the frame doesn't seem to be too much of an issue,
it's the X size, it overextends due to the pitch between the letters in the font varying. All I'm tryin to do is frame text. Do I need to do a pixel-conversion or something?

My other question is multiparted: from programming with VB it seems there are lots of controls, buttons, listboxes, etc. to use.. y not use these instead of reinventing the wheel... is it part of the API? DLL? where would I find an example? Would it be better to use those instead of recreating?


mov eax,slen ; compute length of frame
mul XWid ; overextends the text by 1/4
mov XRES,eax ; slen = length of text to print

mov eax,y ; compute height of frame
add eax,YWid
mov YRES,eax

mov btn_hi, eax

invoke GetSysColor,COLOR_BTNSHADOW
mov btn_lo, eax

invoke Frame3D,hDC,btn_lo,btn_hi,x,y,XRES,YRES,2
sub x,3
sub y,3
add YRES,3
invoke Frame3D,hDC,btn_hi,btn_lo,x,y,XRES,YRES,2
FrameIt endp
Posted on 2001-08-29 15:18:37 by drarem

The Frame3D is a procedure from the MASM32 library and it is meant to be run from within a WM_PAINT message handler. In the type of code that you will find in the examples in MASM32, it would be in the Paint_Proc which is called from the WM_PAINT message in the WndProc for the main window.

Some of the examples use it to draw frames on the client area of a window and its not hard to use.

Posted on 2001-08-30 03:00:26 by hutch--
Hutch: yes it is being called from within the paint (technically speaking I think), and it is working great :) I am using it on the client area, am framing text in my testing. The x,y, and YWid work fine for the frame. The only issue I have is with the XWid, the frame is longer than the text. I think it has something to do with the point size of the font. Maybe my math below is in error for the multiplying of the XWID..

- multiplies the XWID (horizontal resolution? or pitch?) by the slen (length of the text) and moves it to XRES to become the horizontal width of the frame.

mov eax,slen ; compute length of frame
mul XWid ; overextends the text by 1/4
mov XRES,eax ; slen = length of text to print

mov eax,y ; compute height of frame
add eax,YWid
mov YRES,eax

great stuff BTW, gettin me excited to get back into it as I feared for the longest assembly was dead.

Posted on 2001-08-30 06:57:30 by drarem

First the bad news: all those nifty controls in VB *may* be coaxed into working in an asm app (see Xtreme's web browser posted just last week in the COM section for the first ever example), but it's a ton of work to get a bloated control.

The good news is VB took intrinsic windows controls and wrote wrappers around them, 3rd party controls excepted, of course.

So for VB's "textbox" class you'll find a windows "edit box" class, and so on for all the "basic" window types. They are not as eazy to use as in VB, but still simpler then using the VB ones in asm.

Lots of tuts abound, see Icz for one (see it first, it's the best source). Otherwise, your best source of info is all written for C/C++, so you'll need to learn to read C to use those docs. That opens things like the book "Programming Windows 95" to "98" (various editions abound). MSDN has a full book written by Nancy Clutz that does a decent job of explaining them.
Posted on 2001-08-30 12:07:10 by Ernie
That's fine then, I have no problem writing my own stuff.. don't like the bloatware which is why I am delving into this. I'm just trying to move from 'hello, world' to 'hello, world' with color :)

I suppose I have to research SetFont and the like to figure out how to perfectly frame the text I am writing to the client.

Can't wait to hit dialog boxes >)

Posted on 2001-08-31 14:32:51 by drarem
Set Font? Ez, but not clearly laid out for new commers (I know, took me months to realize :rolleyes: )

invoke GetStockObject, ANSI_VAR_FONT
invoke SendMessage, hWind_to_Set_font, WM_SETFONT, eax, TRUE

hehehehe ;)

Posted on 2001-08-31 23:15:24 by NaN