Can you use the progress bar while running a background program during installation? (file.run). Even if it just shows it starting and finishing.
Professional Software Development Tools
Can you use the progress bar while running a background program during installation? (file.run). Even if it just shows it starting and finishing.
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:
On START 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
Auto Screen Close or 'on next' event, relies on the .exe to run will exitCode: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);
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.