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.
Thanks in advance!
Machiel
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.
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.
C and WindowsAll of the DLLs in the Win32 API, and most of the kernel-level structures are implemented in C code.
Win32 APIs exist for many features and technologies in Windows 10, including core user interface and windowing APIs, audio and graphics, and networking.
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));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With