I'm having trouble trying to automate SAP GUI windows for parallel extraction of data via VBA in Access when that activity is under a lock screen.
Specifically there are times when a context menu opens on top of the wrong window and causes the VBA to hang waiting for a response. On a visible screen not locked the code for altering Z order works and corrects the Z order, allowing the VBA to continue.
But when under a lock screen I can't correct the Z order to put the parent window directly underneath the child context menu to allow the VBA to respond as despite whatever code I've tried the actual Z order doesn't change even when the calls themselves seem to return a valid value.
I've tried numerous variations of calls and combinations of calls using the Win32 API to try and get the Z order to change, but they've all come to nought.
APIs attempted include BringWindowToTop; GetForegroundWindow; SetForegroundWindow; SetActiveWindow; SetWindowPos; ShowWindow; SetFocus
Is it genuinely impossible to alter Z order under a lock screen in Windows?