Bring IDE to the front

I have an external app that sends a XojoScript to the IDE to run through IDECommunicator. Once I’ve sent the script, and there are no reported errors, I want to bring the IDE to the front.

On the Mac, I did it this way:

    #if TargetMacOS then
      dim sh as new Shell
      sh.Execute "osascript -e 'tell app id ""com.xojo.xojo"" to activate'"
    #endif

Easy peasy. How do I do the same in Windows and Linux?

(This is an open-source project meant for developers, so practically anything goes.)

Maybe use FindWindow and SetForegroundWindow on Windows

https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633539(v=vs.85).aspx?f=255&MSPPError=-2147217396

[quote=197651:@Kem Tekinay]I have an external app that sends a XojoScript to the IDE to run through IDECommunicator. Once I’ve sent the script, and there are no reported errors, I want to bring the IDE to the front.

On the Mac, I did it this way:

    #if TargetMacOS then
      dim sh as new Shell
      sh.Execute "osascript -e 'tell app id ""com.xojo.xojo"" to activate'"
    #endif

Easy peasy. How do I do the same in Windows and Linux?

(This is an open-source project meant for developers, so practically anything goes.)[/quote]

I have no idea is you can call declares. If you can, this could help https://forum.xojo.com/4603-make-a-window-topmost

Have you tried Folderitem.launch?

How would I get the FolderItem representing the running IDE?

You need to find the application, which handles the Xojo files. On Windows this is problably done with the Registry.

Thank you all for your suggestions. I’ll try some of these in the next few days and report back.