Click to See Complete Forum and Search --> : discrepancy in MSDN...


Mark Williamson
April 6th, 1999, 07:20 AM
There seems to be some discrepancy in VC++ 6, or I am confused. In previous posts I was told how to use the setfocus() function. It said to pass the ID of the window as a parameter. Seemed logical so I did this but I got an error message saying that Setfocus does not take 1 parameters (don't you just love error messages?). I then checked MSDN. Looking at 'window focus' in general I find set focus takes a parameter, a HWND, as do SetActiveWindow and SetCapture. I then check the SetFocus function itself and it says it takes no parameters. SetCapture and SetActiveWindow in their respective help topics also say that they take no parameters. When actually typing code the autocomplete finishes off the function, saying that it takes no parameters. This makes no sense so could someone please explain what is going on here.

I also have included an activeX control in my program (SDI app). I want to know when the user clicks on the app and changes some variables, however the WM_LBUTTONDOWN only fires when I don't click on the control. Does anyone know how I could be notified when the user clicks on the control.

Thanks

Mark

Martin Speiser
April 6th, 1999, 08:48 AM
Hi Mark,

the reason for the different number of parameters is the MFC. There is a SetFocus function of the system, which takes a HWND as parameter, and there is a SetFocus member function of CWnd, which doesn't take a parameter. The reason for this is that the MFC maps it to the system function the the member variable m_hWnd of the class CWnd as parameter.

Sorry, but I can't help you with your second question. I have too less experience with ActiveX controls, but I think, if the control doesn't notifies the owner window, you have no chance.


Martin