5d5aa947
by Steven Don at 2026-06-10T18:36:22+02:00
atl: Implement registering ATL window messages.
The MSDN documentation for AtlAxWinInit states that it initialises ATL's
control hosting code by registering window classes *plus a couple of custom
window messages*
Logging calls to `RegisterWindowMessage` showed that Visual Studio 2005, when
going into Options -> Projects and Solutions -> VC++ Directories, calls this
function to get the message IDs for custom messages name WM_ATLGETCONTROL and
WM_ATLGETHOST.
I've then registered those same messages in AtlAxWinInit and logged when they
were called in `AtlAxWin_wndproc`. Since they were called with 0 for both
`wParam` and `lParam`, the only sensible implementation would be routing the
calls through `AtlAxGetControl` and `AtlAxGetHost` and returning the `IUnknown`
pointer from the window procedure.
This change now makes the VC++ Directories control in Visual Studio 2005 work
as expected (and probably other stuff too).