If you are writing pure C++ then forget all about .NET and use the proper libraries. If you are adding a wrapper class to use some .NET features then just make the whole thing CLR aware. Trying to do it in the way you describe is just making things more difficult for yourself and achieves nothing.
It is not clear, hat do you want. Do you want to change behavior of all programs, running under Windows? It is rather problematic (and what would be the reason for it?). But, if you write you own code, you may change behavior of edit control for example- all of what you need is to replace its own WindowProc by your own one, which gulps some messages and calls old WindowProc for all others. It is a way to get a non-editable edit window. Use GetWindowLong() to get address of old WindowProc and SetWindowLong() to replace it with your own one.
You would need to ensure that you do not include any code that is platform specific. For example you would not be able to use any of the Windows SDK code if creating a UI, but would need one of the general libraries such as Qt[^].
Visual Studio will only target the Windows OS (create executable for that specific OS).
You will have to create different project on the OS you also want to release your application (linux, mac, ... )
Generic C++ code can be easily made to be portable (compilable) on all compilers on all the platforms you want to support.
OS dependent code will need to be written for each platform (mostly UI, filesystem, ... )
There are toolkit for UI and filesystem that are cross-platform (QT, for example) that will let you write most of the code on one platform and rebuild the same code on the different other platform you want to support (I'm not expert, you will have to look that up).
You will need to have a development environment for each platform you wish to develop for.
I was asked to build a MFC appliation, which will execute a window Command line when you type a window Command line & press "Eter".
But i don't know how to handle Enter key event in multiline Edit control.
Your description indicates that your edit control will only contain a single line of text but uses the multi line style to allow entering long lines without scrolling parts out of view.
If this is true, create the control without the ES_WANTRETURN style. Then pressing ENTER behaves like with other controls of a dialog: The keypress is passed to the default push button of the dialog. The handler for the default button can then get the text from the edit control and execute the command.
So if you know about SetWindowsHookEx(), which I assume you do, since you know about hooking other apps, you cant actually write a hook dll, inject it into other processes, and intercept WM_CLOSE just from MSDN?
You are so lazy or inept that you actually want someone to give you source code on how to do it?
And no, this isnt a project, it is for work isnt it. You are up against it and you post here saying its a project hoping someone will give you the code.
Good god. What have SW engineers become these days.