OnSetFocus(), OnKillFocus()

Hi,

I have a standard MDI app. My view class is CFormView based. I have a
microsoft chart activex control placed on top of the form.

In the CFormView class I have a handler for OnSetFocus() and
OnKillFocus().

I have this strange behaviour where if I click on another view in my
app, the previous view that had focus first gets a kill focus message,
then gets a set focus message somehow! It should just get a kill focus
and that is it when losing focus.

I have no idea why this is happening, but without the control present,
the focus problem goes away and the set/kill focus messages are
received as expected.

So is there something I'm not aware of with focus issues and activex
controls? Any ideas would be great,

Thanks

0
markww (42)
8/4/2006 12:32:25 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
885 Views

Similar Articles

[PageSpeed] 21

Reply:

Similar Artilces:

OnKillFocus
When pNewWind (pointer passed to OnKillFoucus handler) will be NULL? On May 21, 9:25=A0am, rahul <hyrahu...@gmail.com> wrote: > When pNewWind (pointer passed to OnKillFoucus handler) will be NULL? On my machine, when I set focus on any other program's window. Why do you care (IOW, you have a bad question here)? MSDN says that it can be NULL. It means that you are not supposed to know the next window at any given time WM_KILLFOCUS is sent. And indeed, it is possible, especially in Vista+, that random program can't receive a HWND of another program (e.g. that other ...

OnSetFocus(), OnKillFocus()
Hi, I have a standard MDI app. My view class is CFormView based. I have a microsoft chart activex control placed on top of the form. In the CFormView class I have a handler for OnSetFocus() and OnKillFocus(). I have this strange behaviour where if I click on another view in my app, the previous view that had focus first gets a kill focus message, then gets a set focus message somehow! It should just get a kill focus and that is it when losing focus. I have no idea why this is happening, but without the control present, the focus problem goes away and the set/kill focus messages are receive...

OnKillFocus problems
Hi all I've created a set of controls derived from CEdit in order to do in-place validation (i.e when you tab out of the field rather than when you complete the form). Mostly (at least 99%), they're working fine, but I've had a couple of problems with one particular form and, sadly, intermittently. Basically, I've over-ridden OnKillFocus() and do my validation there, saving the validated data for later use. When the "save" button is clicked, UpdateData(TRUE) is called which (I believe) then calls DoDataExchange(), where the data is taken from my controls into a set ...

OnSetFocus called twice?
Hi, MDI app using CRichEditDoc/View derived classes. I'm using OnSetFocus() to toggle the state of a BOOL member variable but when I call OnFileNew() it seems to call OnSetFocus() twice thus the BOOL seems to stay the same. When I switch between view it seems to work fine though as OnSetFocus() is only called once. Is OnSetFocus() supposed to be called twice? Adrian. adriangibbons@yahoo.co.uk (Adrian Gibbons) wrote in message news:<34a2acd5.0404200803.4a3f9e29@posting.google.com>... > Hi, MDI app using CRichEditDoc/View derived classes. > > I'm using OnSetFocus() t...

OnKillfocus event eats OnClick event
Greetings! An application I am trying to debug has several edit boxes and a Save button. One of the edit boxes displays a name retrieved from a database. That edit box has an OnKillfocus event that checks to see if the user has changed the box's contents. If so, then the other edit boxes are initialized from the database. If not, the user is asked if he wants to create a new object. If the user wants to create a new object with the same properties as the current object, he would enter a new name and then click Save. The OnKillfocus event of the edit box fires, correctly asking the us...

WM_KILLFOCUS or OnKillFocus
I have created a modeless window. When I click on the parent window, I want it to close, something like a context menu that closes. In the modeless window, I tried OnKillFocus, and also trapping WM_KILLFOCUS in OnWindowProc but none works. How to auto close the modeless window? Thanks. Foci Problem fixed. I change the parent window from Dialog type to FormView type. In the FormView's OnSetFocus function will destroy the modeless window. "Allan" <nothing@nothing.com> wrote in message news:OxxhVALbFHA.3196@TK2MSFTNGP14.phx.gbl... >I have created a modeless win...

OnKillFocus, not working with topmost window
Hi, I have a Dlg, and i used SetWindowpos(...) to ensure that it is the top most window. But, i also want to ensure that i never looses the focus for that window. If i click on another window and want the focus to return to my window until the user has finished with it. How could that be done? Many Thanks Sims "Sims" <siminfrance@hotmail.com> wrote in message news:<bv84bd$p469v$1@ID-162430.news.uni-berlin.de>... > Hi, > > I have a Dlg, and i used SetWindowpos(...) to ensure that it is the top most > window. > But, i also want to ensure that i never...