I have the following setup:
Two applications on a single PC using a touch screen. One of the
applications get events in from an external source and that cause the
application to immediately take input focus on the computer.
BringToFront is used.
To switch back to the other application a button is selected on the
application with input focus and via the windows messaging system the
other application is informed to become the foreground application.
Now here is my problem.
If there is a sub-form open in Modal format and an automatic switch
occurs and I then switch back to the original application I loose the
input focus to this modal form. In fact the form is not shown at all.
The application main form is shown in stead. I have to do a single
Alt-Tab to get the modal form back. Why is this. Shouldn't Modal have
the always on top set in this case.
Interesting enough is that I also call sub forms from a Visual C++
generated DLL and these sub forms in modal format come to the foreground
when I force a switch back to the application.
Am I missing a setting on my form properties. I have tried AlwaysOnTop,
This is what I do in a switch request:
hndl = FindWindow(WindowClassStr, NULL);
PostMessage(hndl, WM_USER + 171, Switch_Command, 0);
WindowClassStr is the class name of the main form of the application to