web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get window, Set window...
Power Automate
Answered

Get window, Set window, set window visibility - fails when window is minimized

(0) ShareShare
ReportReport
Posted on by 39

I am using PAD to open client application and click some buttons on it.

I want my bot to

1) Open the application if it is closed and then click the desired button (which is working as expected)

2) Click the desired button if application is already opened (not working if application is minimized)

It's working fine if application is running at the background but not minimized, but gives error if I manually minimized that window.

I tried to use action Get window to find that window, Set window visibility to set status as maximized but it gives error 'Failed to get window'. I have to make it work because user is possibly use the application manually in between the flows

 

One more thing is, all the above actions work for default applications like NOTEPAD.EXE, CALC.EXE though these apps are minimized

I have the same question (0)
  • Pavel_NaNoi Profile Picture
    1,074 on at

    Mind sending a screenshot of your code + UI Elements pane?

    Sounds like a UI Element issue.

  • sakshinatekar Profile Picture
    39 on at

    sakshinatekar_2-1681363630383.png

    Application EXE is running and minimized (Check taskbar)

    sakshinatekar_1-1681362674800.png

     

  • Pavel_NaNoi Profile Picture
    1,074 on at

    You're getting the window, and storing it into an instance called AutomationWindow, however, you don't use it as the instance in any of the following actions you've listed, switch the mode of set window visibility / set window state - to window handle and set the handle to AutomationWindow or just switch it to an UI Element and point it to the application. 

     

    Also i'm scared to ask, but do you have 4 for eaches inside of one another? 👀💦

  • sakshinatekar Profile Picture
    39 on at

    No, I am getting error at Get window itself, so not able to use variable AutomationWindow ahead. (If I manually kept application exe at restored state, then value gets stored in AutomationWindow)

     

    Not all 4 are fors, two if statements and 2 fors 🙂

  • Pavel_NaNoi Profile Picture
    1,074 on at

    Hmm its a bit confusing, but try changing the Get window to foreground window state if you haven't already, also I got confused by your last comment are you saying that it does not store the handle if its minimized but will store it if its maximised?

     

    (Also thank god, 4 for loops inside one another is a nightmare)

  • sakshinatekar Profile Picture
    39 on at

    yes, correct.. my problem is, Get window action works well if window is at the background (creates problem if it is minimized) and that too for this specific application. works well when I tried that with other windows executables (notepad, calculator)

     

    yes, I am trying with all the actions with different properties

     

  • Verified answer
    Pavel_NaNoi Profile Picture
    1,074 on at

    Why not just store the handle the moment the application is open, so that when its 100% in the foreground you can catch it and then anytime its minimized you can make it restored / maximised with the other actions using that handle?

  • sakshinatekar Profile Picture
    39 on at

    Thanks a ton Pavel_NaNoi 

    It worked 👍

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard