Now I have build my application like this: it runs in the container of Internet browser(IE, FireFox, Chrome and so on). There is a modeless dialog in my program, the dialog contains one CEdit control.
Here is my problem: when user activate the Edit control to type into something, the edit control get the focus. When the edit control loses the focus, I must check whether the input is valid. If not, I will display a model dialog with
. But now I cannot determine whether my edit control loses in my own application. Because the edit control may loses focus by a lot of means, for example, when user close the browser, when user open a text program. In these cases, I will just skip the invalidation check.
Any one can tell me how to find that in which way my edit control loses focus.
A common way to disable window closing is returning zero from WM_COMMAND. This is the place where ppl usually put the "Really wanna exit?" dialogs and they don't call DestroyWindow() if the user doesn't want to exit or has unsaved work (etc...). Some ppl like hiding the window more than destroying it on WM_CLOSE because this way it keeps the gui state. As for Ctrl+Alt+Del, and other ways to kill your process... If I guess right and you wanna prevent your program from closing/killing than instead of blocking Ctrl+Alt+Del it would be better to hide your process from process enumeration, I did that only on older windows systems and its quite windows version dependent how to do it, search a recent article about it with google.
EDIT: If you wanna block the Ctrl+Alt+Del to prevent windows shutdown, thats a useless idea because ppl use the power button from reflex in that case.
Last Visit: 31-Dec-99 19:00 Last Update: 27-Apr-15 14:53