Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    17

    Progress bar in a file.run?

    Can you use the progress bar while running a background program during installation? (file.run). Even if it just shows it starting and finishing.

  2. #2
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    Here is one way to handle running another .exe and displaying a
    seperate Progress Screen while the .exe is registered as 'in use' :

    This example uses 'notepad.exe' as a concept test.

    Add a default 'Progress Screen' to Project then add example
    code (let's use notepad.exe to test it out) to the below
    screen events for the Progress Screen.

    (Tested with only the first progress bar properties enabled)

    On PRELOAD Event:

    Code:
    DlgProgressBar.SetRange(CTRL_PROGRESS_BAR_01,0,100);
    DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01,0);
    nreturncode = File.Run(_WindowsFolder.."\\NotePad.exe", "", "", SW_MINIMIZE, false); --could place in On Start event instead
    Application.Sleep(1000); --time to register with Os
    On START Event:

    Code:
    binuse = File.IsInUse(_WindowsFolder.."\\NotePad.exe"); --is it running
    while binuse do
    if false then break end
    curpos = DlgProgressBar.GetPos(CTRL_PROGRESS_BAR_01);
    DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01,curpos + 1);
    Application.Sleep(50);
    	if (curpos == 100) then
    	DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, 0); --reset
    	end
    binuse = File.IsInUse(_WindowsFolder.."\\NotePad.exe"); --recheck if in use
    end
    DlgProgressBar.SetPos(CTRL_PROGRESS_BAR_01, 100);
    Application.Sleep(1000);
    Auto Screen Close or 'on next' event, relies on the .exe to run will exit
    of its own accord, or if a visual .exe, User must close.(as in notepad.exe example).

    recommend not enabling the screen's Cancel button for a method such as this
    or add how you will control cleanup exit etc.

    could check the return code: 'nreturncode' for the .exe if known reliable exit codes for the .exe

    some things to think about anyway, hth
    Last edited by Eagle; 02-14-2006 at 09:23 PM.

Similar Threads

  1. Tutorial request for flash progress bar.
    By 4thstar in forum AutoPlay Media Studio 6.0
    Replies: 17
    Last Post: 12-06-2005, 11:44 AM
  2. Progress bar while executing batch file
    By StealthShadow in forum Setup Factory 7.0
    Replies: 3
    Last Post: 10-25-2005, 09:59 PM
  3. Progress Bar for installing files to hard drive
    By danfloun in forum Setup Factory 7.0
    Replies: 0
    Last Post: 02-11-2005, 09:27 AM
  4. Progress Bar...
    By tealmad in forum Setup Factory 7.0
    Replies: 14
    Last Post: 02-05-2005, 12:51 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