Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the Win32 API window more modern looking?

I ordered Programming Windows Fifth Edition a few days ago, and started working with it.

I'm starting to learn the win32 api, however, I got a question. The windows do not look modern winxp/win vista/win 7 style at all. How do I fix this?

It currently looks like this, crap font and all.

enter image description here

Thanks in advance!

Machiel

like image 323
Machiel Avatar asked Jul 24 '10 02:07

Machiel


People also ask

Is the Win32 API still used?

The Win32 API is probably the longest-living user interface framework still in use, with its initial release through Windows NT 3.1 in 1993 and its origins dating back to Windows 1.0 for 16-bit processors of 1985.

Will Win32 be deprecated?

Win32 is essentially deprecated and the native toolkit from Windows 8 on is the WinRT components/engines in "Windows. UI. *" which natively speak XAML (and natively here means these are C++ components baked into the OS). WPF has much more in common with the modern Windows.

Is Win32 API written in C?

C and WindowsAll of the DLLs in the Win32 API, and most of the kernel-level structures are implemented in C code.

On which operating system could you use the Win32 API?

Win32 APIs exist for many features and technologies in Windows 10, including core user interface and windowing APIs, audio and graphics, and networking.


1 Answers

To get the font right you should call this after CreateWindow(Ex):

NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
HFONT hFont = ::CreateFontIndirect(&ncm.lfMessageFont);
::SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
like image 192
StackedCrooked Avatar answered Sep 26 '22 03:09

StackedCrooked