MDI Container: putting a focus on a specific "child" application

Started by S., September 19, 2012, 04:55:37 PM

Previous topic - Next topic

S.

I am trying to find a way to automatically set the focus to a specific "child" application, where a MDI container can have many different child applications.

So instead of opening just another application A, I want to put the focus on A if it is already open.

If this is possible .. can somebody guide me or give me a hint ?

best regards,
Örn Sigurðsson

Lionel F.

Hello Örn,

This is something that has already been requested but that is not implemented yet. It corresponds to reference # 22263 of our issue tracker (MDI: Would like to have a new method: ui.Interface.showChild(appname)). I'll add you to requesters.

Indeed the idea would be to put the focus on the already existing instance instead of starting each time a new one.

Best regards,
Lionel




S.

Thanks, this would be greatly appreciated. 

Meanwhile I will just prompt users to use [Ctrl] + [Tab] to move between applications, if they by accident try to initiate another instance of an application that is already open.

cheers,
Örn

Reuben B.

Orn,

I'll just check, you are aware of CALL ui.Interface.getChildInstances(childname) https://4js.com/online_documentation/fjs-fgl-manual-html/User/ClassInterface.html#METHODS (second from bottom).  The demo MDI example FGLDIR/demo/Containers/Main1.4gl uses it.  So instead of "opening just another Application A" you can prevent another instance of application A opening.

The other thing you might want to look at, I experimented with it at my previous employment before I joined FourJs AP, so I don't have the source, it might not work with MDI windows and it might not be appropriate for Windows Vista and 7.  Look up AppActivate and VBScript.  The concept being create a little VB script that is something like ...

Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Title of your Child Window"

... send it to the client via FGL_PUTFILE() and then execute it via shellexec. 

Also a similar technique may require using the Windows Windows Id.  The frontcall getwindowid can be used to get that and then passed into a similar script

Hope that helps,

Reuben
Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero