News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

editing edit controls

Started by alpha, December 23, 2004, 10:35:03 AM

Previous topic - Next topic

alpha

how? e.g. different fonts, sizes etc.
I can only find code in C++.

hutch--

MASM32 project has a complete rich edit control as an editor. The normal messages for an edit control are documented in win32.hlp where you can set text, get text and set fonts to the edit control.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

donkey

You must first create a font using CreateFont then send the edit control a WM_SETFONT message. For example...

.data
Courier_New_10 LOGFONT <-13,0,0,0,400,0,0,0,0,3,2,1,49,"Courier New">

.code
invoke CreateFontIndirect,offset Courier_New_10
mov [hFont],eax

invoke SendMessage,[hEdit],WM_SETFONT,[hFont],TRUE


When you no longer need the font use DeleteObject to destroy it. In this case I used CreateFontIndirect that allows you to store the complete font structure in memory however the parameters are the same for CreateFont. In order to fill the structure, if you use RadASM you can use the FontBuilder plugin and it will automatically insert the filled structures based on a font you choose.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable