rodrigocfd / winsafe

Windows API and GUI in safe, idiomatic Rust.
https://crates.io/crates/winsafe
MIT License
520 stars 30 forks source link

please font settings #120

Closed Asm322 closed 8 months ago

Asm322 commented 8 months ago

Hi, please winsafe add an example with the font and its settings. Thank you.

rodrigocfd commented 8 months ago

Could you explain a bit further what you're trying to accomplish?

Asm322 commented 8 months ago

hi, sorry for my English. I just started learning rust. I like your winsafe box, great. I want to write a simple program. I can do it. I can’t figure out how to change the font, size and how to work with it. thank you, please lead by example

--

rodrigocfd commented 8 months ago

How would you do it in C++?

Asm322 commented 8 months ago

Thanks for the reply. I just started in programming. I started with Masm32, minimum C. I liked Rust and its concepts, after Masm32, memory management and errors with it are clear, your examples are clear to me. Sorry for the stupid questions. I understand the description on the Microsoft website. How to apply this in rust is not always clear. If you would make an example with the text, I would be very grateful to you.

rodrigocfd commented 8 months ago

Changing the font is done by creating a font, then sending a WM_SETFONT message.

WinSafe is just a thin layer over the Win32 API. If you learn how to do this in C (or C++), you can simply translate the code. Google around and you'll find plenty of examples.

Asm322 commented 8 months ago

Hello. I'll ask one question, thank you. There are no problems with gui::Edit) But with wm_get_font, wm_set_font I can't figure out how to transfer and receive parameters I don't understand)))

rodrigocfd commented 8 months ago

Please see here: