Set app to frontmost app

[quote=61584:@Hanspeter Bleuler]Is there a Windows equivalent to this?
TIA Hanspeter[/quote]

[quote=127837:@Christian Schmitz]The best I have is my RemoteControlMBS.WinBringWindowToTop function in the MBS Plugin.
Brings as far as I know every window to front. (Where window.show often fails)[/quote]

This was at the end of https://forum.xojo.com/3929-solved-set-app-to-frontmost-app-for-app-in-mas/last in OS X so getting out of topic, so I started this new thread to reply.

Here is a page on msdn that explains how to do that under Windows :
http://support.microsoft.com/kb/186431

This is used in BringToFrontWFS.

Test it. I think the plugin does better :slight_smile:

Of course you would :wink:

How is the plugin better ?

because it does extra steps to make sure the window comes to front.

I just tried BringToFrontWFS with an app masked by the Global Floating Window of another program. It does bring the app in front of the other program GFW. I would say that is pretty efficient …

I can’t figure out how to get BringToFrontWFS working (I can’t find any reference or example of it, also tried googling, but probably I’m too dumb).

I tried to do this:

WindowExtensionsWFS.BringToFrontWFS(Window1)

but he throws me this error: “Static reference to extension method: call this on a value of class Window”
How can I get rid of it?

[quote=199219:@Manuel Romei]I can’t figure out how to get BringToFrontWFS working (I can’t find any reference or example of it, also tried googling, but probably I’m too dumb).

I tried to do this:

WindowExtensionsWFS.BringToFrontWFS(Window1)

but he throws me this error: “Static reference to extension method: call this on a value of class Window”
How can I get rid of it?[/quote]

You should really read the method itself. The parameter is extends W as Window.

This works :

self.BringToFrontWFS

Thank you Michel. I am the dumbness in person.

I’d just like to share our experience with ongoing issues with Windows appearing behind other windows (especially painful when that window is modal and the user can’t see it!). For a number of reasons we’re still using RS2011r4.3 and the problem just couldn’t be cured despite trying out the many suggestions on this forum (also developing some quite nice web apps and services with the latest Xojo).

Then I tried MBS RemoteControl plugin after reading it had a RemoteControlMBS.WinBringWindowToTop function (and an equivalent for Mac) - perfect! Windows now appear on top every time. Love the MouseClick function too - fixed another awful issue we had with controls losing focus. Keep up the good work Christian - your plugins are well worth the price - so much so I’ve repurchased MBS Complete with 2 years updates.