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: start a program minimized  (Read 15389 times)
Stefan S.
Posts: 90


« on: November 19, 2008, 09:35:58 am »

Hello,

program A starts another program B with fglrun. Now I want to set program A in the foreground. Is that possible ?
I want to start Program B always minimized.  There is an windowstate for "maximized", but not for minimized ?

Any idea


Thanks
Stefan Serwe
Lionel F.
Four Js
Posts: 83


« Reply #1 on: November 21, 2008, 11:08:57 am »

Hello Stefan,

For now, windowState style attribute can only be set to values "normal" or "maximized", not to "minimized"
It has not been implemented because, until then, we did not find any obvious interest to start an application in minimized state.

What is exactly the aim of your program supposed to start in background/minimized ? Maybe we could help you to find a nearing solution.  Thank you for precising.

Best regards,
Lionel


Stefan S.
Posts: 90


« Reply #2 on: November 25, 2008, 08:57:05 am »

Program B starts every 20 Second to Import Data from a sps connected to that local PC.
So it is not necessary to see Program B at start-up.

Hello Stefan,

For now, windowState style attribute can only be set to values "normal" or "maximized", not to "minimized"
It has not been implemented because, until then, we did not find any obvious interest to start an application in minimized state.

What is exactly the aim of your program supposed to start in background/minimized ? Maybe we could help you to find a nearing solution.  Thank you for precising.

Best regards,
Lionel



Lionel F.
Four Js
Posts: 83


« Reply #3 on: November 25, 2008, 10:33:13 am »

Hello Stefan,

For now, I'm afraid there is no way to do this. This is nevertheless the object of a feature request already referenced in our database :
fz.#2335 => Be able to choose the way a window gets open (Minimized, Maximized,Default)

I added your name to the list of requesters. There is currently no date planned for implementation mainly due to other priorities, especially the version 2.20. However, it has been taken into account, and the development team will evaluate the opportunity of implementing this in the future.
Thanks for the suggestion,

Best regards,
Lionel
Lionel F.
Four Js
Posts: 83


« Reply #4 on: November 25, 2008, 12:40:47 pm »

Hello Stefan,

I get back to you regarding this. Would a style attribute which allows to start an application "minimized (e.g. windowState = minimized) be sufficient to do what you're expecting?

Or, do you need a way to change the window state directly in the 4GL code (for instance, using a function) ?

Any other comments or impressions on this are also welcome...
Stefan S.
Posts: 90


« Reply #5 on: November 25, 2008, 01:00:53 pm »

for my aim it will be enough to have a style attribute to start an applivation mimimized
Stefan S.
Posts: 90


« Reply #6 on: December 15, 2008, 12:30:54 pm »

is there a possibility to set the focus to program a when program b is running ?
Perhaps something with dom-note manipulation ?

Reuben B.
Four Js
Posts: 1126


« Reply #7 on: December 15, 2008, 11:22:14 pm »

If you are using Windows you can use appActivate via a front-call to set the focus to a particular window, see attached example.

It would probably also be possible to open a window minimized using a similar technique and sendKeys

Code
  1. MAIN
  2. DEFINE ch base.Channel
  3.  
  4.   CLOSE WINDOW SCREEN
  5.   IF base.Application.getArgumentCount() = 0 THEN
  6.      -- start 3 programs and send a vbs script to the client
  7.      LET ch = base.Channel.create()
  8.      CALL ch.openFile("appActivate.vbs","w")
  9.  
  10.      CALL ch.writeLine('strWindowTitle = WScript.Arguments(0)')
  11.      CALL ch.writeLine('set WshShell = WScript.CreateObject("WScript.Shell")')
  12.      CALL ch.writeLine('WshShell.AppActivate strWindowTitle')
  13.  
  14.      CALL ch.close()
  15.      CALL FGL_PUTFILE("appActivate.vbs","appActivate.vbs")
  16.  
  17.      RUN "fglrun appActivate aaa" WITHOUT WAITING
  18.      RUN "fglrun appActivate bbb" WITHOUT WAITING
  19.      RUN "fglrun appActivate ccc" WITHOUT WAITING
  20.   ELSE
  21.      -- open program that has 3 buttons that call vbscript to change the window/program with focus
  22.      OPEN WINDOW w WITH FORM "appActivate"  ATTRIBUTES(TEXT=base.Application.getargument(1))
  23.  
  24.      MENU ""
  25.         ON ACTION aaa
  26.            CALL appactivate("aaa")
  27.         ON ACTION bbb
  28.            CALL appactivate("bbb")
  29.         ON ACTION ccc
  30.            CALL appactivate("ccc")
  31.         ON ACTION calculator
  32.            -- Calculator has to be running
  33.            CALL appactivate("Calculator")
  34.         ON ACTION close
  35.            EXIT MENU
  36.      END MENU
  37.   END IF
  38. END MAIN
  39.  
  40. FUNCTION appactivate(window)
  41. DEFINE window STRING
  42. DEFINE command STRING
  43. DEFINE result INTEGER
  44.  
  45.   LET command = SFMT("appActivate.vbs %1", window)
  46.   CALL ui.Interface.FrontCall("standard","shellexec",command,result)
  47. END FUNCTION


Code
  1. LAYOUT (MINHEIGHT=15)
  2. GRID
  3. {
  4. Click on button to make window active
  5. }
  6. END
  7. END

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


« Reply #8 on: December 18, 2008, 01:42:26 pm »

thanks,
I can use thte vbs-script on the local PC to activate my Window.
Is there a possibility to activate/maximize a program with wsh if it is minimized ?

Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines