cancel
Showing results for 
Search instead for 
Did you mean: 

Global Send Key to Bring MS Edge Foreground

Lily.L
Level 5

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

29935.png

29936.png



------------------------------
Mia Mikela
------------------------------

7 REPLIES 7

John__Carter
Staff
Staff

Try Minimise then Restore (or Maximise)



------------------------------
John Carter
Blue Prism
------------------------------

GastonSalguero
Level 2

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.



------------------------------
Gaston Salguero
------------------------------

Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.



------------------------------
Mia Mikela
------------------------------

Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.



------------------------------
Mia Mikela
------------------------------

Hi, I have tried to minimize & maximise, to spy full window and have activated the application, etc... However, those steps are not working.



------------------------------
Mia Mikela
------------------------------

harish.m
Level 12

Hi Mia Mikela,

Try below code  in c#

https://stackoverflow.com/questions/11512373/findwindow-and-setforegroundwindow-alternatives


29929.pngI 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
------------------------------

----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

Hi Harish, thanks for your suggestions. However, I dont know C++ and I'm not allowed to change C++...



------------------------------
Mia Mikela
------------------------------