- Topics - 9
- Replies - 583
- Total Posts - 592
depends somewhat on how they send the dialog.
If they post the dialog to your handle you should be able to catch createWindow event with a cbtHook and the user will hear the error but (at least on my machines) the dialog is closed (post message with the controlId) before it even shows up. If however they run the dialog on another thread (I have a hp that does this)… then the cbt hook may not catch it (mine doesn’t). For those cases I have a second thread that I fire up to poll for windows that exist during the execution of the triplet that didn’t exist before the triplet was sent. Those dialogs show up for a moment before they’re closed. While the polling method is a bit slower (<100ms slower in most cases) it offers more accurate information (or I'm doing something wrong in my cbthook) In the cbthook the controlId is sometimes off, the controlId may be reported at 1 for OK and the polling thread says that the controlId for the ok button is 2. so far the detection with polling has never been wrong and the cbtHook has been *mostly* correct.
someone elses sample boxeater: