Transparent form which records clicks and passes on to applicationbelow

M

matthewr

I want to create a fully-transparent fullscreen form which records
clicks but also passes on the 'click' to the desktop. Specifically, I
have an existing application which displays a webpage fullscreen. I
want my new application to run transparently over the top of the
existing app, and when the user clicks the mouse button, my
transparent application records the location of the click while
'passing on' the click to the application below it, allowing the user
to click on the webpage.

What is the best way to achieve this in .NET?

To achieve transparency, I have tried setting the form's opacity to 0,
or the background color to the same color as the transparency key, but
this means my form does not receive mouse clicks at all.

Alternatively, I can set opacity to 1%, which means the form is almost
transparent but recieves clicks. Now, how do I pass on clicks to the
application below? I could use PInvoke to simulate a click with
mouse_event, but this presumably clicks on the topmost application
(i.e. my transparent app) while I need to click on an application
beneath the topmost.

Is there some standard technique for this?
 
C

Chris Dunaway

I want to create a fully-transparent fullscreen form which records
clicks but also passes on the 'click' to the desktop. Specifically, I
have an existing application which displays a webpage fullscreen. I
want my new application to run transparently over the top of the
existing app, and when the user clicks the mouse button, my
transparent application records the location of the click while
'passing on' the click to the application below it, allowing the user
to click on the webpage.

What is the best way to achieve this in .NET?

To achieve transparency, I have tried setting the form's opacity to 0,
or the background color to the same color as the transparency key, but
this means my form does not receive mouse clicks at all.

Alternatively, I can set opacity to 1%, which means the form is almost
transparent but recieves clicks. Now, how do I pass on clicks to the
application below? I could use PInvoke to simulate a click with
mouse_event, but this presumably clicks on the topmost application
(i.e. my transparent app) while I need to click on an application
beneath the topmost.

Is there some standard technique for this?

I think you'd do better to create a mouse hook rather than a
transparent form.

Here is one article on CodeProject.com, but there are others:

http://www.codeproject.com/KB/dotnet/globalmousekeyboardlib.aspx

Chris
 

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