Thank you for your reply. I tried it, but somehow I cannot loop through the elements (GetWindow never returns NULL with the GW_HWNDNEXT parameter). I however managed to get it right by using the EnumChildWindows function.
FloatingMarc wrote:
a bunch of functions called from a console application. One of them creates a CFrameWnd window
You need to look at the assertions and the code where they occur. You should see what's going wrong. You need to make sure you're making the right kind of DLL if you're using MFC in a DLL. All the info you need to do this can be found here: Kinds ofDLLs[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: