private void timerCheckPendingInstalls_Tick(object sender, EventArgs e) { if (SetupApi.CMP_WaitNoPendingInstallEvents(0) == 0) { timerCheckPendingInstalls.Enabled = false; SynchronizationContext.Current.Post(postCloseForm, DialogResult.OK); } }
private void buttonInstallDriver_Click(object sender, EventArgs e) { DialogResult dr = DialogResult.OK; if (SetupApi.CMP_WaitNoPendingInstallEvents(0) != 0) { WaitForSetupForm fWait = new WaitForSetupForm(); dr = fWait.ShowDialog(this); } if (dr == DialogResult.OK) { buttonInstallDriver.Enabled = false; wizardPageFinishedEnable(false); Thread installSetupThread = new Thread(InstallSetupPackageFn); installSetupThread.Start(null); } }