focus application based on pid

Asked by Chetan

i have an application that is running and i know hte pid based on getprocess in powershell
i would like that application to come to focus. how can i do that?
app.focus(pid) does not work

i am getting app process by below command
cmd='powershell\n Get-Process | Where-Object { $_.MainWindowTitle -Match \"Adobe Acrobat\" }| Where-Object { $_.Name -Match \"Acrobat\" } | Format-Table ID,Name,Mainwindowtitle -AutoSize'

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ben Dix (bendix80) said (last edit ):

Hey 😄

maybe cmdow can help you.
I am using this additional cmd tool to resize, activate, hide and arrange windows of any application on win10.

in Sikuli IDE i am using

align_window = """
cmdow "WINDOWNAME" /MOV 0 0 /SIZ 400 742
returnCode = runScript(align_window)


Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
RaiMan (raimund-hocke) said :

2.0.6 will have
app = App.withPID(pid)

if valid, then app can be used normally.

Can you help with this problem?

Provide an answer of your own, or ask Chetan for more information if necessary.

To post a message you must log in.