473,839 Members | 1,318 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 8137
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
3042
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 important to maintain the original order in both lists. So the first list is simple:
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
9808
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 separate computers, I get an "onject expected" error. Going to the MS-based debugger just tells me...
1
1808
by: nihil | last post by:
Where can I download the code used in this book? Thanks in advance!
2
5356
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
9467
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 window, without Javscript, and pass strict validation?
4
15136
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
12675
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 =========================================================== "The InstallAllUsers property for a deployment project determines whether an application is...
33
2403
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 the URL in your browser. I realize I can make traditional text links and graphics links; what I'm...
2
6983
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 extension that I'd like to write.
0
9855
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10587
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10295
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7018
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.