How to completely prevent captured mouse from getting grabbed by others?

B

Buddhist.CHinA

If one control has already captured the mouse, how to completely
prevent the mouse from getting captured by any other controls
(objects), even if a dialog popups, for example.
thx.
 
B

Bob Powell [MVP]

A window that has captured the mouse should only do so for a short time,
usually between one mousedown and the next mouseup event.

If you're trying to capture for longer than this then you're probably doing
something wrong.

Why do you need to do this?

If it's for some sort of kiosk program then you should consider using your
own custom shell.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
B

Buddhist.CHinA

A window that has captured the mouse should only do so for a short time,
usually between one mousedown and the next mouseup event.

If you're trying to capture for longer than this then you're probably doing
something wrong.

Why do you need to do this?

If it's for some sort of kiosk program then you should consider using your
own custom shell.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consultinghttp://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Trickshttp://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQhttp://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.






- Show quoted text -

Yep, basically a mouse capture should only happen between one
mousedown and the next mouseup event. But my problem was that the
capture owner got changed just after mouse down event. That's why I
had to grab mouse back, manually.
I also posted another one with more details at,
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1656463&SiteID=1
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top