2

I just wanted to know, if there is someway to make a program (or part of a program) intangable with c#. I want to make it so that people can see the program is there, but if they were to click, it would click whatever is underneath it. I would also like to know if you can do that backwords. Is there someway to make an item that is invisable, clickable?

Thank you for your help!

Sean
  • 21
  • 2
  • 7
    You question, while not at all intangible is close to incomprehensible. Could you rephrase it? – leepowers Jan 18 '10 at 03:43
  • 2
    Also, it sounds a lot like you are trying to trick the user. Can you provide an explanation as to why you need to do this? – Adam Crossland Jan 18 '10 at 03:46
  • I am not trying to trick the user, I have no specific use in mind right now, I am more jsut wondering if it can be done. An example of when I might use it though might be if I wanted to show something on the screen without it getting in the way. Maybe a program that shows keystrokes on the screen. You would want that to be seen, but you might want to be able to click through it, because it might get in the way sometimes. – Sean Jan 18 '10 at 03:51
  • and @pygorex1 as I said, I want it so that you can see the program, but you can click through it, so that it does not get in the way. – Sean Jan 18 '10 at 03:52
  • Sounds almost like you're attempting to implement a clickjack attack on Desktop software. – Josh Sandlin Jan 18 '10 at 03:53
  • Is it _possible_? Sure... it's all in software with no defined impact outside the operating system, and so it's _possible_ to make a program that does anything. A better question is whether or not the system makes it _practical_. – Joel Coehoorn Jan 18 '10 at 03:56

3 Answers3

1

To your vague question, I offer a vague response:

Sounds like your option one is possible. You would need to send the click event (message) that you receive to the appropriate window (the one underneath yours). I suspect that you would have to DllImport some stuff to do this from c#.

Your option two, while more difficult, is probably also possible because you can inject code into other running executables. This will be a privileged operation, and you will likely again have to use stuff from non .NET dlls to do it from c#. See Three Ways to Inject Your Code into Another Process on CodeProject.

David
  • 728
  • 4
  • 20
0

If you want to display something to a user without it getting in the way of whatever it was they were doing at the time you could pop up your messages in bubble from the task bar perhaps?

The answer to this question covers this. Or if you're lazy here's the code project link.

Community
  • 1
  • 1
keith
  • 3,105
  • 2
  • 29
  • 34
0

Ok so it sometimes might be necessary to show something on screen and not let it be clickable (like On-Screen-Display for video playback to show volume increase, etc..)

Here's an example of how to this in C# - from codeproject: http://www.codeproject.com/KB/cs/OSDwindow.aspx

This uses the Win32 API ShowWindow(hWnd, SW_SHOWNOACTIVATE) to present the window without losing focus (can't be selected).

And here's the MSDN page for this call ShowWindow

To display a window that is invisible but clickable you can use a window with no border (FormBorderStyle=None) and set transparency to 1%.

Hope that helps!

Ezz
  • 642
  • 6
  • 11