Dialog is lossing focus all the time!!

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
 
K

KS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top