Announcement

Collapse
No announcement yet.

SetForegroundWindow by PID

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dragodraki
    replied
    Thank you very much. I'll try it out the next days.

    Leave a comment:


  • Anders
    replied
    PHP Code:
    FindWindow $....
    System::Call 'USER32::GetWindowThreadProcessId(p$0,*i0r1)'
    ${If} $$mypid ... 
    It is possible to call FindWindow in a loop by using the childafter parameter...

    Leave a comment:


  • Dragodraki
    started a topic SetForegroundWindow by PID

    SetForegroundWindow by PID

    Hello everyone, this is my first post so please be gentle - if there is something wrong about the question format, let me know.

    My intention is to bring a window back to foreground with my Process ID.

    Here is what I'v found so far:

    code:
    Function .onGUIEnd
    FindWindow $0 "WindowClass" "Title"
    IsWindow $0 0 +2
    System::Call 'user32::SetForegroundWindow(i r0)'

    It works, but to make absolutely sure choosing the correct application (in case of multilingual or same name of windows), I would rather bring the window to foreground providing the process ID, not the window class or the title. I already have my necessary PID.

    Do you have any ideas how I can perform the SetForegroundWindow with PID?
Working...
X
😀
🥰
🤢
😎
😡
👍
👎