Skip to content
Win32 / MFC
-
Win32 / MFC
GetWindowText Buffers, Unicode and Other-Process Text
SetWindowText and GetWindowText done right: sizing with GetWindowTextLength, an old sizeof bug, WM_GETTEXT for other apps' controls, and LibraryImport.
-
Win32 / MFC
SendMessage vs PostMessage: Timeouts and WM_COPYDATA
Why SendMessage blocks and PostMessage does not, avoiding hangs with SendMessageTimeout, WM_COPYDATA between processes, and UIPI errors. MinGW and .NET 10 code.
-
Win32 / MFC
GetKeyState vs GetAsyncKeyState: What the Bits Mean
The high and low bits of GetKeyState and GetAsyncKeyState checked against the docs, queue vs physical state, and why WM_KEYDOWN beats polling.
-
Win32 / MFC
Current Directory vs Exe Path in Win32 and .NET
The current directory is per process and changes. Fix GetModuleFileName MAX_PATH truncation with a growing buffer; real .NET ProcessPath output.
-
Win32 / MFC
FindWindow vs EnumWindows: Finding Windows in Win32
Find another program's window with FindWindow: class name vs title, partial matches via EnumWindows, the ANSI build trap, UIPI, and a C# LibraryImport version.
-
Win32 / MFC
Win32 CreateWindowEx and ShowWindow: A Complete Window
A complete Win32 window: CreateWindowEx, ShowWindow, the message loop, WM_DESTROY, DPI awareness and a C# LibraryImport version, built with MinGW-w64.
↑