Solved

ActiveX Focus Problem

Posted on 2003-12-05
9
505 Views
Last Modified: 2013-11-20
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
Comment
Question by:DAE
  • 6
  • 3
9 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 250 total points
ID: 9881309
Give some more idea, for what purpose you are using the SetCapture....
0
 

Author Comment

by:DAE
ID: 9883581
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
 

Author Comment

by:DAE
ID: 9889540
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:DAE
ID: 9889585
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
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9894400
Hi DAE,
I was not here.

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

Rosh :)
0
 

Author Comment

by:DAE
ID: 9894451
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
 

Author Comment

by:DAE
ID: 9894453
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
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9894458
Use WindowFromPoint, and post a mouse click to that window if needed.
0
 

Author Comment

by:DAE
ID: 9894527
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now