I am working on an application that is bootable for the installer, which I am also working on. The application makes several MSI calls to get the information I need to build the wizard, which is the main window of my application, which causes the progress window to open during the collection of information, and then leaves after that. Then the wizard is configured and started. My problem is that the wizard (derived from CPropertySheet) does not want to go to the front and be an active application without adding some calls to me for this.
I solved the problem of bringing it to the forefront with the following code in my OnInitDialog () method:
SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
My problem is that I still have not figured out how to make the window self-active (i.e. make myself the one who has the focus). SetFocus () will not work in this context. I need something that will force the window at the top of the Z-order and activate it, preferably as few calls as possible.
I assume that the progress window, opened initially by MSI calls, causes the main window to freeze, but I cannot prevent this window from appearing. In addition, it would be pointless to hide this, because it allows the user to find out what happens before the main window appears.
source share