Posted by mediastation in SWF Studio V3 on Jun 30 2008, 05:16 am

Hi all, hope someone can help.

I have a project that needs to go out today which is essentially a CD-ROM with links for various files (.doc, .pdf, .ppt etc)

I'm using ssCore.Shell.invoke to launch these files and all was fine. The client then had some issues with the documents loading behind the program so I starting using topmost:true to force to the front.

The problem is now is that the client cannot close some documents, and I think the problem is that some diaglog boxes are opening behind the document and cannot be seen.

Is there a way to use topmost:true but not keep it ALWAYS on top, just when it opens?

Thanks in advance.


Posted by AGo in SWF Studio V3 on Jun 30 2008, 09:27 am

instead of using the topmost flag, waitForWindow and then use Win.sendmessage to send a bringtofront message to the hwnd you got from invoke.


Posted by mediastation in SWF Studio V3 on Jun 30 2008, 09:40 am

Thanks for that, as a newbie - how do i do that? lol

Currently the code on the button is like this..

on (release) {
ssCore.Shell.invoke({path:"startdir://Rasilez\\Rasilez.doc", topmost:true});
}


Posted by northcode in SWF Studio V3 on Jun 30 2008, 03:52 pm

You do it just like AGo said :) Get rid of the topmost argument in Shell.invoke, add the waitForWindow flag. Once the Shell.invoke function returns you are given the handle of the new window so you can send a BringToFront message to it.

This should work for you...

on (release) 
{
   ssCore.Shell.invoke({path:"startdir://Rasilez\\Rasilez.doc", waitForWindow:true}, {callback:AfterInvoke});

   function AfterInvoke(r, c, e)
   {
      if (r.success)
      {
         if (r.hwnd != 0)
         {
            ssCore.Win.sendMessage({hwnd:r.hwnd, message:"BringToFront"});
         }
      }
   }

}