473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cursor on Win32 Window

I have a control (created by interop from Win32) wich placed into other
control (regular C#), BUT I can not recieve mouse events from Win32 control
even when listening to WM_MOUSE... messages from WinProc. The only way I
can capture the mouse in the control is using MyWin32Control.Capture = true;
from the parent form, BUT after the first click in parent form the capture
stops ( even if MyWin32Control.Capture = true after perform of OnClick
event), How to rid of it? How to get Win32 control listen to parent mouse
forever???

TNX

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
Nov 16 '05 #1
2 3610
Hi Tamir,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you put a win32 control in a .net
control (such as form), the win32 control cannot receive any mouse
messages. If there is any misunderstanding, please feel free to let me know.

Could you let me know what kind if control you are working on? Is it an
ActiveX control? I have tried to put an ActiveX control on a C# windows
application form. However, it works well on my computer. Could you please
try to use Spy++ to check if the message can be captured. Here are the
steps:

1. Start Spy++ from Start -> All Programs -> Microsoft Visual Studio .NET
2003 -> Visual Studio .NET Tools -> Spy++.
2. Start your application from VS.NET.
3. Click on Log Message button on the toolbar of Spy++.
4. Drag and drop the Finder Tool to the ActiveX control and click ok.
5. Then you can move mouse to the control to see if message can be captured.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2
Thank you for response. The control added is DirectShow Windows, in Spy++ I
can see Wnd event, but the control do not escalate those messages to parent
control, HOWEVER I already solved it by inplementing
put_MessageDrain callbackes into parent.

Thank you for your time:

Following the solution (for those who interested in)

----------------Win32-----------------------------

[PreserveSig]

int put_MessageDrain( IntPtr drain );

[PreserveSig]

int get_MessageDrain( out IntPtr drain );

-------------------------------------------------------

-----------------C#-----------------------------------

hr = videoWin.put_MessageDrain(this.Handle);

if( hr < 0 )

Marshal.ThrowExceptionForHR( hr );

------------------------------------------------------------

TNX to all
--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:wj*************@cpmsftngxa10.phx.gbl...
Hi Tamir,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you put a win32 control in a .net
control (such as form), the win32 control cannot receive any mouse
messages. If there is any misunderstanding, please feel free to let me
know.

Could you let me know what kind if control you are working on? Is it an
ActiveX control? I have tried to put an ActiveX control on a C# windows
application form. However, it works well on my computer. Could you please
try to use Spy++ to check if the message can be captured. Here are the
steps:

1. Start Spy++ from Start -> All Programs -> Microsoft Visual Studio .NET
2003 -> Visual Studio .NET Tools -> Spy++.
2. Start your application from VS.NET.
3. Click on Log Message button on the toolbar of Spy++.
4. Drag and drop the Finder Tool to the ActiveX control and click ok.
5. Then you can move mouse to the control to see if message can be
captured.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Csaba2000 | last post by:
The following code has me so confused, I don't even know the right questions to ask. Opera 7.01 and IE 5.5 both exhibit behaviours I don't understand while NN 6.1 seems to ignore me altogether. ...
3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
9
by: Chris Michael | last post by:
I am using the following class in a CSS document: ..loginsubmit { background-color: #ffffff; FONT-WEIGHT: bold; color: #002980; cursor: hand } It works perfectly well, but it won't validate...
1
by: Tee | last post by:
Hi, From my main form, I am executing another application using System.Diagnostics.Process.Start. The application has its own window displaying when the applicaiton is run. I want to change...
5
by: Vlad Simionescu | last post by:
Hello I'm trying to let my Windows Form application perform a lengthy operation while displaying a progress bar in a modal dialog window; the dialog has a cancel button. The dialog is displayed...
1
by: Thilo Frank | last post by:
I want to add a flashing text cursor to my selfmade user control. Is there an existing class availible for this problem or do I have to write a thread, which flashs the cursor? THX for your help...
2
by: Paul Cheetham | last post by:
Hi, I am trying to load a custom cursor from my programs resources. I have successfully included the cursor resource, and I have confirmed that the name I am using is correct. Below is the...
5
by: Paul Cheetham | last post by:
Hi, I have some custom colour cursors which I have added to my c# project, and set them to be compiled as "Embedded Resource" It seems impossible to load a colour cursor using the standard...
2
by: Danny | last post by:
Hi I need to get the handle to the windows control that is directly below the mouse. This must work on any windows application, win32 and dotnet forms. The reason is I would like to highlight...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.