johneast
02-10-2006, 08:43 AM
Can you use the progress bar while running a background program during installation? (file.run). Even if it just shows it starting and finishing.
Eagle
02-14-2006, 10:15 PM
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:
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:
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
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.