Window state/handle bring to front .

  • 27 January 2021
  • 5 replies
  • 9 views

Badge +2

Hello ,

I have a wizard where I run a program through Run program AC , when it runs , its window stays background , now I want to bring it to front because I have to detect an object on its screen but anything I try it does not help , How can I do so ??

 

things I tried :

Control window state => bring window to front using the window handle returned from the Run program AC .

PowerShell script to bring to front a process by process name.

 

Any help would be appreciated !


5 replies

Hi Nawras,

 

In order to bring the window to the foreground, you need to record a step using that window. If you open the program, append a step to your wizard and adjust the window data parameters accordingly, once you launch the program using the Run Program AC the subsequent step will bring the window to the front.

 

Regards,

Darren

Badge +2

Hi Darren , I tried what you suggested , still encountring a problem.

Whenever I try to run the task 'offline' and by offline I mean when the session of my server is not in , the wizard does not complete the steps , however if I make an RDP to it , it continues the steps .

How can I make sure that the wizard runs all the steps without me logging into the server where the Robot works ?

 

Thanks !

Hi Nawras,

 

When you use unattended robots they will automatically log into the console session, not an RDP session. Console sessions use the computer's physical display adapter to show the image of the desktop and all the applications. RDP uses a kind of software adapter designed for network access which is different.

 

When you disconnect from an RDP session, the desktop actually disappears until you reconnect. This is why the robot does not work if you started the automation in an RDP session and then disconnect - because the desktop and apps are no longer visible to the robot.

 

I'd like to suggest logging into the console session of your system using a tool that will allow it such as VNC or Dameware Mini Remote and launch the robot in that session. You'll find that when you disconnect the session stays open and the robot can run successfully.

 

Regards,

Darren

Badge +2

Hi Darren ,

I understand what you said , but I think that it is not the RDP that causes this issue , the server where the robot is launched is always on , I just login to that through RDP to code or debug my wizards . Even when I logoff the session of the RDP the server/desktop is still on (I think) , why? because when I reconnect I see the app that the robot started using the AC Run Program opened , however the robot is unable to do the core action ' Double Click ' when I am out of the session .

Do you still think that the problem is about the RDP thing ?

I have something similar in other server and it just works fine even when I am out of the session of the RDP ..

 

I really need the help in this thing .

Thanks in advance,

Nawras.

Hi Nawras,

 

Was the problem still there even after you tried my suggestion? If so, you'll need to raise a support ticket and one of our engineers will have a screen sharing session with you.

 

Another thing you can test in the meantime, is to add a Take a Screenshot advanced command to your wizard and see what it captures.

 

Regards,

Darren

Reply