I have attached an example of a method to:
The application does an initial check after opening the selected file and runs a function to monitor if the files viewer is open checking every 1/2 second then hides the AMS application
If the default viewer isn't in the table of enumerated processes (slow opening) then it waits 5 seconds and further checks if the window has been opened.
On opening the files default viewer it changes the window title text (A prompt to close the window to return to the AMS application)
On closing the default viewer window the AMS window shows
I am sure many users could appreciate having such an example, (I know that I would have) please feel free to correct any code, error handling as you see fit.
Hope this is useful to many users!
- Browse for a file
- Get the selected files default viewer
- Launch and monitor the opening of the default viewer
- Get the window handle of the default viewer
- Hide the AMS window
- Set the title text of the default viewer
- Monitor the closing of that default viewer window
- Show the AMS window
The application does an initial check after opening the selected file and runs a function to monitor if the files viewer is open checking every 1/2 second then hides the AMS application
If the default viewer isn't in the table of enumerated processes (slow opening) then it waits 5 seconds and further checks if the window has been opened.
On opening the files default viewer it changes the window title text (A prompt to close the window to return to the AMS application)
On closing the default viewer window the AMS window shows
I am sure many users could appreciate having such an example, (I know that I would have) please feel free to correct any code, error handling as you see fit.
Hope this is useful to many users!
Comment