473,486 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 8112
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
2958
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
254
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
9776
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
1796
by: nihil | last post by:
Where can I download the code used in this book? Thanks in advance!
2
5331
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
9382
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
15056
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
12443
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
2306
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
6938
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
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
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
7173
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...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.