Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: MDI Container: putting a focus on a specific "child" application  (Read 9329 times)
Posts: 2

« on: September 19, 2012, 04:55:37 pm »

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.
Four Js
Posts: 82

« Reply #1 on: September 20, 2012, 11:58:35 am »

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,

Posts: 2

« Reply #2 on: September 20, 2012, 01:13:24 pm »

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.

Reuben B.
Four Js
Posts: 1066

« Reply #3 on: September 20, 2012, 11:18:36 pm »


I'll just check, you are aware of CALL ui.Interface.getChildInstances(childname) (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,


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of
Contributor to
Pages: [1]
  Reply  |  Print  
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines