Dialog is lossing focus all the time!!

  • Thread starter Thread starter Sims
  • Start date Start date
S

Sims

Hi,

I have a dialog box that ask the user to confirm a window operation.
The user must confirm within a certain amount of time otherwise the
operation is automatically cancelled.

It all works fine, the dialog is set as topmost and the 'cancel operation'
button is set as default.

But if something else happens, for example a new email arrives, (outlook
pops-up with a "You have a new Email"), or if you were busy opening another
window.
Then my dialog looses it's focus. It remains topmost but it no longer has
focus.

How can i ensure that my dialog, NEVER looses focus, some code/link would be
great.

Many Thanks in advance.

This is almost a repeat of a question i asked a few months ago.

Simon
 
Try this:

1. Add a timer to your dialog
2. In your OnTimer add "SetForegroundWindow()". You might also have to add
the "SetActiveWindow()" too?

This should in effect create a "always on top" window with the focus always
active to the window.

KS
 
Back
Top