Article # 94, added by Geoworks, historical record
| first | previous | index | next | last |

Opening an application in the background



Q. I tried to open an application via IACPConnect with
   MSG_GEN_PROCESS_OPEN_APPLICATION. I want the application to open
   behind other applications. 

   So, after I get the launch block from IACPCreateDefaultLaunchBlock, I
   locked down the block, set ALB_launchFlags to ALF_DO_NOT_OPEN_ON_TOP
   and unlock it before calling IACPConnect. However, the appl still opens
   up on top. Then, I tried ALF_OPEN_IN_BACK and it still doesn't work. 

   At last, I tried both ALF_DO_NOT_OPEN_ON_TOP and ALF_OPEN_IN_BACK,
   and then it works. How come? It sounds like either one of the flags
   should be enough. Am I missing something?

A. Looking at the code, I see these flags being checked in a couple of
   different places. If the app is being opened for the first time, in
   the MSG_META_ATTACH handler MSG_GEN_BRING_TOP is sent unless
   ALF_DO_NOT_OPEN_ON_TOP is set. In IACPOpenConnection the app is not
   sent MSG_GEN_BRING_TO_TOP if either of the two flags is set. I think
   that ALF_OPEN_IN_BACK is used to set the app's layer id to be lower
   than all others already open.