Click here to Skip to main content
15,881,827 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In a win32 mdi desktop app, how would you place an edit control in the mdi client area (just like the Output window in Visual Studio when it's docked at the bottom of the main window)? I'm doing an OpenGL graphics app and to complement using mouse input and getting coordinates from the cursor position I'd like an edit/textbox to take the focus of any active child window for the keyboard input of drawing coordinates, rather than have a toolwindow with an edit control in it floating about, or an edit control in every child window. I'm a C++ virgin so I'd like to keep it to win32 rather than MFC for now. Please be gentle.

What I have tried:

I've tried using CreateWindowEx() exactly the same way as I have with the toolbar and statusbar, which is successful, and using SetWindowPos() to respond to the WM_SIZE message in the main window callback results in a visible control, but I don't get the position right and more importantly it doesn't take the focus or display any text put in it at window creation. I can't find any help that goes beyond using the toolbar and status bar in this context.
Posted
Updated 13-Jul-19 5:00am

1 solution

Why not just create it as another child (Edit) window and let the MDI window control its positioning? See How to: Create MDI Child Forms | Microsoft Docs[^] for some sample code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900