Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    14

    Restoring Application Window

    OK, I am lhaving trouble getting my Autoplay Apllication window to restore after running an installation routine.
    Scritpting used:

    OnClick
    File.Open("AutoPlay\\Docs\\setup.exe", _SourceFolder.."\\AutoPlay\\Docs", SW_SHOWNORMAL)
    Window.Minimize(Application.GetWndHandle());

    OnLeave
    Window.Restore(Application.GetWndHandle());
    result = Dialog.Message("Notice", "Thank You for Installing dabl Primary. Click OK to continue", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Page.Jump("Page1");

    This all works well except for the restore bit. The problem I think is that the Autoplay window is losing its windows focus. Because after I click on the minimised window, the rest of the routine works.

    Being a non-programmer, I have no idea how to get the focus back to the Autoplay minimised window automatically.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Try this -

    On Click

    Dialog.Message("Notice", "Thank You for Installing dabl Primary. Click OK to continue", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Window.Minimize(Application.GetWndHandle());
    File.Run("AutoPlay\\Docs\\setup.exe", "", "", SW_SHOWNORMAL, true); -- tells the application to "wait" until the setup.exe is complete
    Window.Restore(Application.GetWndHandle());
    Page.Jump("Page1");


    If your setup routine relies on other sub-processes, that may not work. You may have to do some windows targeting to further the conditional routine (Enumerate...)

    Also try Window.Hide - works extremely well in that case.

  3. #3
    Join Date
    Oct 2003
    Posts
    14
    Ok, Just changed the order a bit. Message not supposed to appear until exe is installed. (Actually tried the text exactly as above and got same result)

    The minimise and restore now work great, but the installation of setup.exe is being skipped.

    Window.Minimize(Application.GetWndHandle());
    File.Run("AutoPlay\\Docs\\setup.exe", _SourceFolder.."\\AutoPlay\\Docs", SW_SHOWNORMAL, true);
    Window.Restore(Application.GetWndHandle());
    Lines = "Thank You for Installing dabl® Primary.\n Setup is now Complete. \n Click OK to continue";
    result = Dialog.Message("v8.1.5.2", Lines, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Page.Jump("Page1");

  4. #4
    Join Date
    Oct 2003
    Posts
    14
    Bit more tweaking and I have found that this works:

    Window.Minimize(Application.GetWndHandle());
    File.Open("AutoPlay\\Docs\\setup.exe", _SourceFolder.."\\AutoPlay\\Docs", SW_SHOWNORMAL, true);
    Window.Restore(Application.GetWndHandle());
    Lines = "Thank You for Installing dabl® Primary.\n Setup is now Complete. \n Click OK to continue";
    result = Dialog.Message("v8.1.5.2", Lines, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Page.Jump("Page1");

    However the window is restoring slightly before the setup.exe has a change to open its window. So Window minimises and restores almost immediately.

    I can see how File.Run and true are the better option but my setup.exe wouldn't execute this way? Don't know why.

  5. #5
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Yeah, as I stated, your setup.exe probably has internal processes that fire and AMS thinks that setup.exe is finished because it executes the other internals and the mother exe is done.

    The way you currently have your code is useless, because the scripting occurs one after the other in virtual milliseconds. The Window.Maximize is being fired almost (like you said) immediately after the File.Open. There are probably a few ways you can achieve exactly what you want, but it sounds as if you're satisfied

    edit: or Window.Restore (not Window.Maximize)
    Last edited by rhosk; 11-14-2005 at 07:23 AM.

  6. #6
    Join Date
    Oct 2003
    Posts
    14
    Quote Originally Posted by rhosk
    Yeah, as I stated, your setup.exe probably has internal processes that fire and AMS thinks that setup.exe is finished because it executes the other internals and the mother exe is done.

    The way you currently have your code is useless, because the scripting occurs one after the other in virtual milliseconds. The Window.Maximize is being fired almost (like you said) immediately after the File.Open. There are probably a few ways you can achieve exactly what you want, but it sounds as if you're satisfied
    No you are right. It is useless. Pointless to minimise and restore immediately.
    (looks NAF)
    Any quick ideas to delay the restore?
    Maybe thats the easiest solution (aside from the easier option of not bothering with the minimise at all) Was only to look a bit more polished.

    (Hope they pay you here for your time

  7. #7
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Did you build the install routine?

    In any event, if you could get the window handle(s), you may be able to use the File.Run and start the Page Timer to locate the window (or process) and tell AMS that as soon as the process is complete, Restore the application.

    Or, if you built the install, you could have the end of the install routine to send a message to AMS via command-line to Restore as well.

    Or maybe instead of minimizing, jump to a specific page with a [custom background] or whatever...just don't know the precise details of the app.

  8. #8
    Join Date
    Oct 2003
    Posts
    14
    No it was built for me by 2 (FUSSR) programmers. I am just trying to move it beyond mere functionality. I will see if they can append "the end of the install routine to send a message to AMS via command-line to Restore".

    If not will leave it un-minimised. Still looks very acceptable.

    Thanks again Ron.

Similar Threads

  1. HOWTO: Distribute an AutoPlay Application with Setup Factory 6.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-25-2002, 02:33 PM
  2. INFO: Dynamically Resizing an Application at Runtime
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-21-2002, 02:23 PM
  3. HOWTO: Make an AutoPlay Application Expire
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-09-2002, 10:10 AM
  4. HOWTO: Get the Position and Size of a Window
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 09-27-2002, 09:40 AM
  5. INFO: How to Set the Default Application Directory
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts