Hello, I have a simple console application that I wish to set as the active window if a certain condition is not met.
I have seen complex examples of how to use either the win32 API or MFC techniques to do this for windows applications, and am wondering if there is a more simple way to do this for console applications. As of yet I have not worked with the win32 API, but have some very basic experience using Visual Studio's MFC.
I won't ask for any code/examples, just sort of a direction to head in. If possible, I would like to avoid the win32 API in its complexity if at all possible, but I know I should probably learn how to use it, and will if that's the only way to do something like this.
The console has no notion of active/inactive windows, so if you really want to do this, you'll have to go through the win32 API.
To make things easier, people usually write their own API wrapper classes so they don't have to deal with it directly. Take a look at this once, for example:
I suggest you use that code as your main file, and call your current main() function from WinMain(). Try to keey WinAPI and non-WinAPI code separate to make it easier to debug. Once you get that working, you can add your "set active window" function.