1

In our application, a modal dialog is shown that the user needs to confirm/close before other interaction is possible/allowed. This dialog is a self-implemented form, so can be adjusted to our needs.

An external event (in our case: a scan from a manual barcode scanner) provides input for the application. When the dialog is in front of the application, I would like to inform the user the scan/input is not processed. An idea is to simulate the behaviour that happens when clicking the form in the background of the modal dialog. By default, Windows then lets the dialog borders 'flash' and a sound is heard ('bonk' sound as described here: Delphi - How do you generate an event when a user clicks outside modal dialog?).

My question is:

Is it possible to programmatically simulate that behaviour, in order to let user know the dialog has to be closed first?

Additional question: is this proper UI handling or should the dialog itself display an additional info text (e.g. as a footer text) instead of just 'flash'. I like to avoid displaying another modal dialog on top of the first one; to me that not seem best practice as well.

Thank you for any feedback/solution.

Muhammad Hasham
  • 273
  • 1
  • 6
  • 14
user729103
  • 631
  • 2
  • 10
  • 24
  • Could do something like Mathematica which after a beep/flash displays a help link for "Why the beep?" that explains what happened for the specific issue in a help topic. – Brian Jan 31 '19 at 21:50
  • @Brian: yes, the idea is to probably add a footer text to our dialog explaining why the dialog is blocking the user interface. – user729103 Feb 01 '19 at 08:57

1 Answers1

2

Use the FlashWindow or FlashWindowEx functions to achieve this.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Thanks for your (speedy) answer! I did not know those functions. The difficulty was to explain my problem, as I did not find the right words/terms to search for similar questions. I then found an example here: https://stackoverflow.com/a/51004132/729103 – user729103 Feb 01 '19 at 08:55