MT Execute File command and focus

I’ve noticed that using the “Execute File” command in Midi Translator Pro to launch a program is inconsistent. Sometimes the program I launch gets focus. Other times it doesn’t (either my desktop will show, or another window that I currently have open will show), and I have to switch to my newly launched program by clicking it in the taskbar (or alt-tabbing). Is this a bug? I’ve tried using the delay functionality to delay launching the program, but that doesn’t seem to help either.

Hi, and welcome to the community!

The behavior of the file you launch is completely up to the file or Windows. Bome MIDI translator Pro has no control of it other than launching the file. With that said, if the program you launch has command line options for displaying the newly launched program, you can certainly add these options to the command line. Perhaps you or Windows were navigating in a different window when the program was launched.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Steve, thanks for the response!

That’s the strange thing. If I launch the program on its own, it gets focus fine. But only when I launch with MT does it hiccup. There are no command line arguments. This is a program that I wrote myself…its very simple, it just turns the screen black. There’s maybe 10 lines of code. I’m happy to post it if you want to take a look at it.

Sure, I’ll take a look and see if I can duplicate. It may also help to post your MT Pro project file in case anything else is happening simultaneously with launching your application.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Here is my project file. The application in question is called ScreenSaver.exe. One more thing of note - this issue only occurs when MT is minimized to the taskbar. When it’s maximized, ScreenSaver.exe gets full focus.

vadims_general.bmtp (16.0 KB)

I don’t have ScreenSaver.exe so on my system translator 3.4 (which is the translator I expect you have in question) says Unknown/Not Supported. If this only occurs with this particular application, it is likely an issue with that application. Also you have 3.3 launching another instance of MT Pro, is that working correctly? I suspect you have multiple instances enabled otherwise, it would just loop back to re-launching itself.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Here’s my source code for ScreenSaver.exe - there’s also binaries if you feel safe running those. I had to change the zip file to a .bmtp in order to upload, so you can just change it back to a zip and extract. If you run ScreenSaver, it will run two forms, one for each of my monitors, so you can just disable one of them in the source.

Yep, 3.3 is working correctly. It actually just focuses MT (I usually have it minimized to the notification area). It looks like MT is smart enough to check if an instance is running and focuses that instance instead of creating a new one.

ScreenSaver.bmtp (391.9 KB)

OK, I’ll check it out. What about Kontakt? Does it get focus when run with MTPro as minimized?

No, Kontakt, doesn’t get focus either.

Don’t worry about it too much, I just found a workaround. Instead of launching the program, I pinned ScreenSaver.exe to my taskbar, and am switching to it using Windows+8 (similar to how I’m switching to RME totalmix using Windows+4). That works perfectly and focuses every time.

If you do end up running ScreenSaver.exe, do let me know if you’re able to repro on your machine. I am curious about whether something on my machine is causing this or now.

Thanks!

Hi. This is normal Windows behavior. When MT Pro is in the tray, it is, from POV Windows, a hidden program. Windows has strict policies who can control the focused process (the front most program), to avoid annoying or malicious behavior. Only the currently active application can launch a windows that becomes the active application. When MT Pro is in the tray, it’s not the currently active application.

An exception is when you try to make a process active upon clicking a tray icon which belongs to that process. That’s how MT Pro can make itself active from selecting Open in the tray menu.

There are ways to force an application to become front most or even active. That screensaver application should try that route.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Awesome, thanks for your help Steve!

Thank you @florian !

He actually helped me and provided the answer. This was something that I thought would take less time to figure out since he designed MT Pro in the first place. I could probably have spend several hours with it before coming to the same conclusion.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz