Edit box problem

Hi,

I am having a edit box and a function is called when focus is lost.
What is happening if focus is lost because a pop up window suddenly comes up or user tries to open another application an error message is coming which I want to show only when user set focus to someother control within same application only. so how to overcome this ?

thanks
regds
Raghavendra H
[397 byte] By [hraghavendra] at [2007-11-18 2:14:46]
# 1 Re: Edit box problem
Can you use punctuation, or make shorter sentences, for I don't understand what happens, and what you really want.
I might not be the only one.

Thanks.
Marina
Marina Vaillant at 2007-11-10 8:56:33 >
# 2 Re: Edit box problem
You probably call UpdateData from EN_KILLFOCUS handler.

You have set an edit control to accept certain range of values and verification routime (DDX. . .) invokes message box if validation fails.

Either validate it yourself, or call GetFocus and determine where a focus is set permitting change only if outside window is gaining focus without validation by not calling update data, or calling UpdateData(false) to set previous value.

That actually defeats reason for checking a value so you may consider removing validation.
JohnCz at 2007-11-10 8:57:33 >
# 3 Re: Edit box problem
Well...as far as I understood the question he wanted to know how he can prevent that his 'OnKillFocus' handler gets called if the user clicks to another application or changes automatically while a pop-up window is opened... :confused:
Andreas Masur at 2007-11-10 8:58:38 >
# 4 Re: Edit box problem
Hi Andreas,

you are right. That is exactly what I wanted. Please let me know if there is a way out.

thanks
regds
Raghavendra H
hraghavendra at 2007-11-10 8:59:33 >
# 5 Re: Edit box problem
Originally posted by hraghavendra
Hi Andreas,

you are right. That is exactly what I wanted. Please let me know if there is a way out.

thanks
regds
Raghavendra H
Unfortunately, I do not know of any way. Basically I assume that the bigger problem would be the pop-up window. Clicking on another application might send some message to your application that it is losing focus. I have the same problem but was too lazy until now to really take a look how to solve this. But I would like to know as well...maybe John or anybody else can provide appropriate answers...
Andreas Masur at 2007-11-10 9:00:32 >