Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

ActiveX Focus Problem

When my ActiveX Control gain the focus with the TAB key it work fine but when it gain the focus with the mouse have draw problems and SetCapture() function stop working.

It have to be some thing with the Control Activation but my control have the ACTIVATEWHENVISIBLE on.
0
DAE
Asked:
DAE
  • 6
  • 3
1 Solution
 
Roshan DavisCommented:
Give some more idea, for what purpose you are using the SetCapture....
0
 
DAEAuthor Commented:
The ActiveX Control have a custom popup menu (child window), I use SetCapture to know when the user make a click outside the popup menu.

I release the mouse when the popup menu is closed.
0
 
DAEAuthor Commented:
Rosh, I fix the problem with:

int CxxxxCtrl::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
      if (AmbientUserMode()){
            if (!m_bUIActive) OnActivateInPlace (TRUE, NULL);
      }

      return COleControl::OnMouseActivate(pDesktopWnd, nHitTest, message);
}
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DAEAuthor Commented:
Can I ask you another question right here????

Is related to the SetCapture:

My control release the mouse in the mouse down message, but because the setcapture I loose this message for the rest of the windows. For example when the user make click on the minimize button on the container window, this click don´t respond the first time because the setcapture.

There is a way to after the ReleaseCapture, to send a MouseDown message to the windows clicked.

Thanks.
0
 
Roshan DavisCommented:
Hi DAE,
I was not here.

>> Can I ask you another question right here????
Yes, you can.

Rosh :)
0
 
DAEAuthor Commented:
Is related to the SetCapture:

My control release the mouse in the mouse down message, but because the setcapture I loose this message for the rest of the windows. For example when the user make click on the minimize button on the container window, this click don´t respond the first time because the setcapture.

There is a way to after the ReleaseCapture, to send a MouseDown message to the windows clicked.

Thanks.
0
 
DAEAuthor Commented:
Sorry for the last one :)

Is related to the SetCapture:

My control release the mouse in the mouse down message, but because the setcapture I loose this message for the rest of the windows. For example when the user make click on the minimize button on the container window, this click don´t respond the first time because the setcapture.

This is the question:
There is a way to after the ReleaseCapture, to send a MouseDown message to the windows clicked ???????????

Thanks.
0
 
Roshan DavisCommented:
Use WindowFromPoint, and post a mouse click to that window if needed.
0
 
DAEAuthor Commented:
Ok I'm goind to try that.

Do you know where I can find information about license protection (other than Microsoft) for my control????

Thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now