WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.X
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Non Responsive Dialog


Question:

I am writing an automated setup program to install a set of applications on a system. It keeps doing a series of tasks and keeps updating list of check boxes on the dialog to indicate that the task is completed. However while it does this, I found that I am not able to click the “Cancel” button which I have put in there to exit the setup program. The button is visible; however the program is busy and does not register the click and so does not exit. Only way to stop it is to go to task manager and kill it, which is ugly.

I have developed Setup Installers in Visual Basic and VC++ where this is not an issue. How do I ensure that that button is clickable even though it is doing a series of operations?

Answer:

Generally in WIL dialogs you don't want to have code that infinitely loops or takes a really long time to return to the dialog procedure Otherwise you will see the CPU get pegged and the dialog becomes non responsive.

In order to get around this you can use a Timer procedure. Basically this procedure executes at whatever time increment you want (i.e. 1 second intervals). This will allow the dialog to process messages like a button pressed cancel operation.

Say for example, you only want to execute the timer procedure when a button is pushed, you can enable the timer procedure when the Go button is pressed, and disable the timer procedure when the Stop button is pressed. You would use the DialogProcOption function to enable and disable the Timer procedure within the appropriate button pressed procedures. See the example code in the following technical support database article:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Dialog~Editor/Dialog~Editor~version~6.X+Display~Dialog~Along~with~RunWait.txt


Article ID:   W17771
Filename:   Non Responsive Dialog.txt
File Created: 2014:07:18:09:50:36
Last Updated: 2014:07:18:09:50:36