473,326 Members | 2,111 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,326 software developers and data experts.

Make a window "Click-through"

Hello everyone,

I've got two little apps which are able to create a window that displays
something on the desktop, but are not clickable. Instead, when you
click on the window, the item 'behind' or 'under' that window gets clicked.

I'd like to know how to do this, using VB6, VB.Net, Windows Forms, or
API functions.

Any ideas?

PS. The apps in question are (both freeware):
Desktop Logo - http://mt.smolyan.info/desktoplogo.php
ClocX - http://www.tenzor.cz/clocx/

Thanks in advance,
--
Martijn <@> Coppoolse <.com>
Nov 20 '05 #1
6 8097
Another opportunity to advertise one of my favorite API functions:
SendMessage. Use the SendMessage Win32 API method to send a WM_LBUTTONDOWN
message, adding the appropriate parameters as described in
http://www.mangovision.com/vbapi/ref...uttondown.html to pass the click
location to the target application.

There may be other ways, but based on my knowledge and experience, this is
how I would begin to tackle the problem.

Dale

"Martijn Coppoolse" <ms**********@martijn.coppoolse.com> wrote in message
news:40**************@martijn.coppoolse.com...
Hello everyone,

I've got two little apps which are able to create a window that displays
something on the desktop, but are not clickable. Instead, when you
click on the window, the item 'behind' or 'under' that window gets clicked.
I'd like to know how to do this, using VB6, VB.Net, Windows Forms, or
API functions.

Any ideas?

PS. The apps in question are (both freeware):
Desktop Logo - http://mt.smolyan.info/desktoplogo.php
ClocX - http://www.tenzor.cz/clocx/

Thanks in advance,
--
Martijn <@> Coppoolse <.com>

Nov 20 '05 #2
The problem is a bit more complicated. It requires that you enumerate windows
on the machine to find
the window that is immediately below you. GetWindow and GetNextWindow are prime
candidates.
Another possibility is to create you window with WS_EX_NOACTIVE (or is it
NO_ACTIVATE, can't
remember), and then set it top-most. It'll be top visible, but it won't be the
*foreground* window and so
it won't receive the input. I haven't tried this later one, but I did some
research yesterday after the original
post to try and find a concrete answer.

The biggest problem is that getting the window underneath you is not easy.
Z-Ordering in windows is not
easy to control or get information about. The closest I could come is that
GetNextWindow might allow
you to cycle windows in z-ordered order, so you could find the window at your
point, that was immediately
behind your window.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"DalePres" <no****@nomail.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Another opportunity to advertise one of my favorite API functions:
SendMessage. Use the SendMessage Win32 API method to send a WM_LBUTTONDOWN
message, adding the appropriate parameters as described in
http://www.mangovision.com/vbapi/ref...uttondown.html to pass the click
location to the target application.

There may be other ways, but based on my knowledge and experience, this is
how I would begin to tackle the problem.

Dale

"Martijn Coppoolse" <ms**********@martijn.coppoolse.com> wrote in message
news:40**************@martijn.coppoolse.com...
Hello everyone,

I've got two little apps which are able to create a window that displays
something on the desktop, but are not clickable. Instead, when you
click on the window, the item 'behind' or 'under' that window gets

clicked.

I'd like to know how to do this, using VB6, VB.Net, Windows Forms, or
API functions.

Any ideas?

PS. The apps in question are (both freeware):
Desktop Logo - http://mt.smolyan.info/desktoplogo.php
ClocX - http://www.tenzor.cz/clocx/

Thanks in advance,
--
Martijn <@> Coppoolse <.com>


Nov 20 '05 #3
I too went through some experimental code and created a form that handled
the WM_NCHITTEST message. This works a treat for controls but not forms and
top-level windows.

I created a clock that showed up semi-transparent on the desktop but I
couldn't click through it. I can set a transparency key and click through
that but the numerals on the clock are never transparent to clicks.

I'd post the code but it doesn't do what's needed so I won't bother. :-(

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

Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder...aspx?FeedId=41

"Justin Rogers" <Ju****@games4dotnet.com> wrote in message
news:Ov**************@tk2msftngp13.phx.gbl...
The problem is a bit more complicated. It requires that you enumerate windows on the machine to find
the window that is immediately below you. GetWindow and GetNextWindow are prime candidates.
Another possibility is to create you window with WS_EX_NOACTIVE (or is it
NO_ACTIVATE, can't
remember), and then set it top-most. It'll be top visible, but it won't be the *foreground* window and so
it won't receive the input. I haven't tried this later one, but I did some research yesterday after the original
post to try and find a concrete answer.

The biggest problem is that getting the window underneath you is not easy.
Z-Ordering in windows is not
easy to control or get information about. The closest I could come is that GetNextWindow might allow
you to cycle windows in z-ordered order, so you could find the window at your point, that was immediately
behind your window.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"DalePres" <no****@nomail.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Another opportunity to advertise one of my favorite API functions:
SendMessage. Use the SendMessage Win32 API method to send a WM_LBUTTONDOWN message, adding the appropriate parameters as described in
http://www.mangovision.com/vbapi/ref...uttondown.html to pass the click location to the target application.

There may be other ways, but based on my knowledge and experience, this is how I would begin to tackle the problem.

Dale

"Martijn Coppoolse" <ms**********@martijn.coppoolse.com> wrote in message news:40**************@martijn.coppoolse.com...
Hello everyone,

I've got two little apps which are able to create a window that displays something on the desktop, but are not clickable. Instead, when you
click on the window, the item 'behind' or 'under' that window gets

clicked.

I'd like to know how to do this, using VB6, VB.Net, Windows Forms, or
API functions.

Any ideas?

PS. The apps in question are (both freeware):
Desktop Logo - http://mt.smolyan.info/desktoplogo.php
ClocX - http://www.tenzor.cz/clocx/

Thanks in advance,
--
Martijn <@> Coppoolse <.com>



Nov 20 '05 #4
The reason you can click through with ClocX is because it's drawn directly
to the main screen (if you set it to click through). Otherwise, it sits on
its own form and you can't click through. A simple trick.
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:e$*************@TK2MSFTNGP11.phx.gbl...
I too went through some experimental code and created a form that handled
the WM_NCHITTEST message. This works a treat for controls but not forms and top-level windows.

I created a clock that showed up semi-transparent on the desktop but I
couldn't click through it. I can set a transparency key and click through
that but the numerals on the clock are never transparent to clicks.

I'd post the code but it doesn't do what's needed so I won't bother. :-(

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

Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder...aspx?FeedId=41

"Justin Rogers" <Ju****@games4dotnet.com> wrote in message
news:Ov**************@tk2msftngp13.phx.gbl...
The problem is a bit more complicated. It requires that you enumerate windows
on the machine to find
the window that is immediately below you. GetWindow and GetNextWindow are prime
candidates.
Another possibility is to create you window with WS_EX_NOACTIVE (or is it NO_ACTIVATE, can't
remember), and then set it top-most. It'll be top visible, but it won't be the
*foreground* window and so
it won't receive the input. I haven't tried this later one, but I did

some
research yesterday after the original
post to try and find a concrete answer.

The biggest problem is that getting the window underneath you is not easy. Z-Ordering in windows is not
easy to control or get information about. The closest I could come is

that
GetNextWindow might allow
you to cycle windows in z-ordered order, so you could find the window at

your
point, that was immediately
behind your window.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"DalePres" <no****@nomail.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Another opportunity to advertise one of my favorite API functions:
SendMessage. Use the SendMessage Win32 API method to send a

WM_LBUTTONDOWN message, adding the appropriate parameters as described in
http://www.mangovision.com/vbapi/ref...uttondown.html to pass the click location to the target application.

There may be other ways, but based on my knowledge and experience, this is
how I would begin to tackle the problem.

Dale

"Martijn Coppoolse" <ms**********@martijn.coppoolse.com> wrote in message news:40**************@martijn.coppoolse.com...
> Hello everyone,
>
> I've got two little apps which are able to create a window that displays > something on the desktop, but are not clickable. Instead, when you
> click on the window, the item 'behind' or 'under' that window gets
clicked.
>
> I'd like to know how to do this, using VB6, VB.Net, Windows Forms,

or > API functions.
>
> Any ideas?
>
> PS. The apps in question are (both freeware):
> Desktop Logo - http://mt.smolyan.info/desktoplogo.php
> ClocX - http://www.tenzor.cz/clocx/
>
> Thanks in advance,
> --
> Martijn <@> Coppoolse <.com>



Nov 20 '05 #5
"yEaH rIgHt" wrote:
The reason you can click through with ClocX is because it's drawn directly
to the main screen (if you set it to click through). Otherwise, it sits on
its own form and you can't click through. A simple trick.


How could that be done, then?

Drawing directly onto the desktop's hDC wouldn't show on screen, if
there's a window on top of it, would it?

In the meantime, I'll look into figuring out what other window's
supposed to get the clicks. Thanks for the pointers!
--
Martijn <@> Coppoolse <.com>
Nov 20 '05 #6
Try this out. This will get you started.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tic
Dim dc As IntPtr = Me.GetDC(IntPtr.Zero
Dim grfx As Graphics = Graphics.FromHdc(dc
Dim ft As New Font(Me.Font.Name, 25, GraphicsUnit.Point
grfx.DrawString("Writing on the desktop! Isn't this cool?", ft, Brushes.Black,125, 150
ft.Dispose(
grfx.Dispose(
End Su

Nov 20 '05 #7

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

Similar topics

33
by: Steven Bethard | last post by:
I feel like this has probably been answered before, but I couldn't find something quite like it in the archives. Feel free to point me somewhere if you know where this has already been answered. ...
0
by: Andres | last post by:
Does anyone now how to call to the "Open With" Window (i mean is the window that appears after u make a right click to a file and u select "Open With") Thanks
2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
1
by: nihil | last post by:
Where can I download the code used in this book? Thanks in advance!
2
by: edgarjang | last post by:
In JavaScript, I can hide menu bar ( ex) <html> <SCRIPT LANGUAGE="JavaScript"> function Test() { var win = window.open("test2.html","sale","menubar=no,scrollbars=no,width=780,height=5...
44
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
4
by: Ronald S. Cook | last post by:
I created an MSI install for a Windows app I wrote. When installing, however, it defaults to install for "Just Me" instead of "Eveveryone" (meaning anyone who uses this computer). I would like...
1
by: ImageAnalyst | last post by:
Yay!!! They fixed this for VS2005. You can now set the default installation to be "Everyone" instead of "Just Me" and you can control whether you even want those radio button installed in your...
33
by: STILL LEARNING | last post by:
I'm not sure if this can even be done, but what prompts the question is my desire to be able to create an "Uber Link" script/code of some sort, such that even if the html page contains nothing but...
2
by: wpollans | last post by:
Hello, I need to able to write JS that will click on a link with the middle mouse button - so that the link target will open in a new window or tab - using firefox. Or is there a better (more...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.