Hi!
Some ActiveX controls have their own window handle, some use parent Window handle to draw self. There are different technologies for that. Most controls use their own window handle, so API functions used inside of the ActiveX control for the HWND of that ActiveX control can affect also parent windows. For example, focusing of the ActiveX HWND by API function inside the ActiveX control will cause also activating of the parent window and its parent and so on in all windows hierarchy. This is strictly depended on the ActiveX and how it is written, how it uses API functions and how it cares about such things. No way to avoid that outside of the ActiveX but handle Windows events fired during such weird behavior. However, you will have to handle Window events handling procedure in VFP, that is call-back, that is not possible directly in VFP,, that requires anotehr ActiveX ... Damn! I had the same problem with MS TreeView control, and workaround was only change of the interface design.
>Hello everybody
>
>I'd like to hear opinions from people who really knows how to create ActiveX controls (and who know how this works). I have the following problem.
>I have a form with following code in INIT event:
>
>thisform.olecontrol1.enabled=.f.
>thisform.enabled=.f.
>
>So, the form and the ActiveX are disabled and should not receive focus. When I open this form with other form (not disabled) with following code
>
>do form form1 && disabled form
>do form form2 && enabled form (without anything)
>
>then for most of ActiveX installed on my computer (MS-made, third-party), I can click on active X area and the form becomes active!!! BUT! neither ActiveX nor the form don't generate any mouse* events. Nonetheless, the form with ActiveX becomes active.
>However, I've found that a few of controls do not expose such a werid behaviour and behave exactly as I'd expect. IOW, they don't respond to mouse clicks and the form does not becomes active.
>
>Can anyone step in and explain what is going on and how I can fix it
>
>TIA
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.