Userlib, set text area font. Without blitzes font system.. need help..

BlitzPlus Forums/BlitzPlus Programming/Userlib, set text area font. Without blitzes font system.. need help..

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

skn3,

I'm not sure what message 0x444 (1024+68) refers to. I couldn't find it, and consequently I couldn't look up lparam or wparam.

But... what's wrong with something like this?
;.lib "user32.dll"
;SendMessageBank2%(hwnd,msg,wParam,lParam):"SendMessageA"

Const WM_SETFONT = 48

Global fntWing = LoadFont("Wingdings", 24)
Global fntArial = LoadFont("Arial", 12)
Global wndMain = CreateWindow("SetFont Example", 400, 300, 600, 300, 0, 1)
Global tarMain = CreateTextArea(0,0,ClientWidth(wndMain),ClientHeight(wndMain),wndMain,0)

SetTextAreaText(tarMain, "Testing..." + Chr(10) + "Testing again...")
Api_SetTextAreaFont(tarMain, fntWing)
Delay 1000
Api_SetTextAreaFont(tarMain, fntArial)

While WaitEvent() <> $803 : Wend

Function Api_SetTextAreaFont(textarea, fnt)
	Return SendMessageBank2(QueryObject(textarea,1), WM_SETFONT, QueryObject(fnt,3), 0)
End Function

(Look up "WM_SETFONT" in the Windows User Interface: Platform SDK docs of MSDN.)