06-02-24 03:15 AM
Hi guys,
I run the bot in the control room. After launching Ms Edge, the window is hiding.
I have tried many ways to bring the window foreground but have been UNsuccessful.
I try Global Send Key ALT + TAB to switch between the control room window and Ms Edge.
However, the Ms Edge is not always pop-up. Even, when the Ms Edge pops up, the window is closed immediately. I have used the retry stage to re-launch, but it's happened again: pop-up then closes immediately.
Can someone please suggest ideas to bring Ms Edge foreground or what else I can do with Global Send Key ALT TAB?- Thank you!
Here's the screenshot
------------------------------
Mia Mikela
------------------------------
06-02-24 09:53 AM
Try Minimise then Restore (or Maximise)
06-02-24 01:53 PM
Hi!
Try map the Window (Full) with Win32 and then in a Navigate Stage, call an "Activate Application" to that element.
Let me know if this works.
06-02-24 06:13 PM
Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.
06-02-24 06:14 PM
Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.
06-02-24 06:15 PM
Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.
06-02-24 09:42 PM
Hi Mia Mikela,
Try below code in c#
https://stackoverflow.com/questions/11512373/findwindow-and-setforegroundwindow-alternatives
I would do some thing like this
in the global code:
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
In the code stage:
Processname here you need to pass as input parameter as 'msedge'
Process[] p = Process.GetProcessesByName(processName);
foreach(Process p1 in p){
IntPtr wh = p1.MainWindowHandle;
SetForegroundWindow(wh);
}
Namespace imports:
1) System.Runtime.InteropServices
2) System.Diagnostics
------------------------------
-----------------------
If I answered your query. Please mark it as the "Best Answer"
Harish Mogulluri
Lead developer
America/New_York TX
------------------------------
07-02-24 07:06 AM
Hi Harish, thanks for your suggestions. However, I dont know C++ and I'm not allowed to change C++...