473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ 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 8119
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**********@m artijn.coppools e.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******** ******@TK2MSFTN GP09.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**********@m artijn.coppools e.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****@games4d otnet.com> wrote in message
news:Ov******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP09.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**********@m artijn.coppools e.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@_spamkille r_bobpowell.net > wrote in message
news:e$******** *****@TK2MSFTNG P11.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****@games4d otnet.com> wrote in message
news:Ov******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP09.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**********@m artijn.coppools e.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(ByV al sender As System.Object, ByVal e As System.EventArg s) Handles Timer1.Tic
Dim dc As IntPtr = Me.GetDC(IntPtr .Zero
Dim grfx As Graphics = Graphics.FromHd c(dc
Dim ft As New Font(Me.Font.Na me, 25, GraphicsUnit.Po int
grfx.DrawString ("Writing on the desktop! Isn't this cool?", ft, Brushes.Black,1 25, 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
2969
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. I have a list in a particular order that I want to split into two lists: the list of every nth item, and the list of remaining items. It's...
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
9785
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 in a link. that function can have parameters for URL and window name passed to it. This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two...
1
1798
by: nihil | last post by:
Where can I download the code used in this book? Thanks in advance!
2
5336
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 40,top=0,left=0") window.opener = "OPENER_IS_NOT_NULL";
44
9398
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 causes my pages to fail validation (strict doctype). The validator says "There is no attribute 'target'.." So...how do I open a link in a new...
4
15071
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 the default deslection to be the latter. How can I change this, please? Thanks! Ron
1
12484
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 Setup program. >From the Documentation http://msdn2.microsoft.com/en-us/library/5f981xa1.aspx ...
33
2332
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 a background image -or- a background color -- in other words, the page has neither content nor placed images -- any click, ANYWHERE, will launch...
2
6942
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 reliable) way to have the link open in a new window/tab (using JS)? I have no control over the JS already on the page - this is for a selenium user...
0
7532
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7461
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7971
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.