News:

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

Associating Font to the Window

Started by bint, October 22, 2008, 03:20:10 PM

Previous topic - Next topic

bint

Hi!
How I can declare a one font (Tahoma) global for a window, buttons and other controls? Help me, please.

hutch--

In a dialog its easy, the font face name and the font size are part of a dialog definition. With a lower level Window where you have more manual control you must use different methods that involve the API CreateFont() and SendMessage hWin,WM_SETFONT,0,0 style code for each window.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bint

Hi, Hutch--!
Quote from: hutch-- on October 22, 2008, 11:08:17 PM
In a dialog its easy, the font face name and the font size are part of a dialog definition. With a lower level Window where you have more manual control you must use different methods that involve the API CreateFont() and SendMessage hWin,WM_SETFONT,0,0 style code for each window.
Thank you.


CreateWindowEx()
CreateFont()
SendMessage()


Insert it after CreateWindowEx()?

hutch--

With CreateWindowEx()) there are a couple of places you can set font handles, either in the WM_CREATE message processing that is done DURING the CreateWindowEx() call OR after you have done the CreateWindowEx() call using the returned handle. In the WM_CREATE message processing you must use the handkle from the Wndproc call for the main window.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bint

Hutch--, than you. I will try the first variant.

bint

A-a-a-a, understand! Yes-yes-yes!

if uMsg==WM_CREATE
    CreateFont(xxxxxxx)
    SendMessage hWin,WM_SETFONT,0,0

Thanks.

hutch--

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bint

How i know a height of taskbar of Windows in pixels?

hutch--

Get its handle then use GetClientRect() to get its height.



LOCAL rct:RECT

invoke GetClientRect,hWnd,ADDR rct
mov eax, rct.bottom
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bint


bint

I want to express my great gratitude to you.
Thank you, Steve. The big mans into the little world.