Detecting whether FM Pro is "front" application
Posted: Sat Jun 02, 2018 6:23 am
I have a setup with both "schedulers" and "clinicians." The former schedule patients in one location for clinicians who are in many locations. My modified version of Dayback is hosted by Datatrium.
I've set things up such that when a scheduler makes a change to a clinician's schedule for the current week, it sets a flag. Instances of the Calendar run by clinicians periodically check the flag with a timer script. If a schedule change is flagged, that clinician's instance of Dayback refreshes itself (and resets the flag). That way, changes made by schedulers automatically appear on clinicians' calendars.
However, I suppress the refresh if the DayBack Calendar window is not front-most FM Pro Window, so the refresh doesn't push the DayBack solution window to the front and interrupt the clinician, who may be viewing an event window, a contact list, etc.
My problem: If I switch to another application entirely (say, Word) and a refresh is called for, FM Pro pushes itself to the front and interrupts use of the second application. This happens both on Mac and Windows.
Ideally, I'd like Dayback to refresh itself while remaining in the background. Alternatively, I'd like to determine whether FM Pro is the foreground application and suppress the refresh if it is not. I haven't found a way to do either.
Thoughts?
I've set things up such that when a scheduler makes a change to a clinician's schedule for the current week, it sets a flag. Instances of the Calendar run by clinicians periodically check the flag with a timer script. If a schedule change is flagged, that clinician's instance of Dayback refreshes itself (and resets the flag). That way, changes made by schedulers automatically appear on clinicians' calendars.
However, I suppress the refresh if the DayBack Calendar window is not front-most FM Pro Window, so the refresh doesn't push the DayBack solution window to the front and interrupt the clinician, who may be viewing an event window, a contact list, etc.
My problem: If I switch to another application entirely (say, Word) and a refresh is called for, FM Pro pushes itself to the front and interrupts use of the second application. This happens both on Mac and Windows.
Ideally, I'd like Dayback to refresh itself while remaining in the background. Alternatively, I'd like to determine whether FM Pro is the foreground application and suppress the refresh if it is not. I haven't found a way to do either.
Thoughts?