473,804 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control handle under the mouse cursor

Hi

I need to get the handle to the windows control that is directly below the
mouse. This must work on any windows application, win32 and dotnet forms.
The reason is I would like to highlight the window's bounderies if possible,
and change the text in controls that allow it.

For example , when I hover the mouse over a win32 application with edit
boxes on, am going to drawy around the text box ( some how) not got that bit
yet!

I guess am going to have to pinvoke out to set/get text for text boxes as
well.

thanks
danny
Jun 9 '06 #1
2 13021
Hello Danny,

Look at functions like: WindowFromPoint , ChildWindowFrom Point, GetCursorPos,
GetClassName

It helps you to get form and control under you cursor and that analizing
type of class send messages changing frame

D> I need to get the handle to the windows control that is directly
D> below the mouse. This must work on any windows application, win32
D> and dotnet forms. The reason is I would like to highlight the
D> window's bounderies if possible, and change the text in controls that
D> allow it.
D>
D> For example , when I hover the mouse over a win32 application with
D> edit boxes on, am going to drawy around the text box ( some how) not
D> got that bit yet!
D>
D> I guess am going to have to pinvoke out to set/get text for text
D> boxes as well.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jun 9 '06 #2
Thanks for the reply.

You helped a great deal. From what you told me I found an article on the
codeproject with what I wanted to do
http://www.codeproject.com/csharp/sc...d=159109&fr=26

I know have what I wanted!

Danny

"Michael Nemtsev" <ne*****@msn.co m> wrote in message
news:9c******** *************** ***@msnews.micr osoft.com...
Hello Danny,

Look at functions like: WindowFromPoint , ChildWindowFrom Point,
GetCursorPos, GetClassName

It helps you to get form and control under you cursor and that analizing
type of class send messages changing frame

D> I need to get the handle to the windows control that is directly
D> below the mouse. This must work on any windows application, win32
D> and dotnet forms. The reason is I would like to highlight the
D> window's bounderies if possible, and change the text in controls that
D> allow it.
D> D> For example , when I hover the mouse over a win32 application with
D> edit boxes on, am going to drawy around the text box ( some how) not
D> got that bit yet!
D> D> I guess am going to have to pinvoke out to set/get text for text
D> boxes as well.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche

Jun 14 '06 #3

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

Similar topics

1
2198
by: Tee | last post by:
Hi, From my main form, I am executing another application using System.Diagnostics.Process.Start. The application has its own window displaying when the applicaiton is run. I want to change the cursor to a hourglass. But I only can change my own form's cursor using Cursor.Current, whenever I move my mouse cursor into the window, the mouse cursor back to default cursor. I want to change the cursor in the process's window too. Can...
1
3934
by: Tim | last post by:
Hi, I would like to create a custom mouse cursor for my print preview page. I want to use a bitmap of a magnifiying glass with a plus in it. Pretty standard stuff. How do I change the cursor? I found the code below but I just get the default mouse cursor dragging around the bitmap which is actually a little behind. I want to replace the
3
7539
by: Blaz Ziherl | last post by:
I have this control that has no MouseEnter or MouseLeave events. How could I find out whether the mouse cursor is over that control or not? Is there an equivalent to the WindowFromPoint API function available in VB.NET? Regards, Blaz Ziherl blaz.ziherl@abraxas.si
2
1461
by: Darrell Wesley | last post by:
When I place a Tab control on a form with one or more TabPages and click inside one of the pages and then click on a tab the mouse cursor gets trapped inside the tab control until I click on something other than a tab. Does anyone know what's taking place? One other thing how do you delete the control from the form?
6
8675
by: Andrea V.F. | last post by:
How can I determine the control under the mouse cursor when a user muves the mouse?? For example if the user moves the cursor over a textbox i would receive the name of that textbox without using the "MouseMove" event for that textbox. Thanks
8
2154
by: **Developer** | last post by:
Open some dialog boxes and the mouse cursor moves to one of the dialog buttons. I'd like to implement that . Is that simply something I have to program, i.e. figure out where I want the cursor and move it. Or does DotNet help somehow? Thanks
3
8917
by: Wayne Wengert | last post by:
In VB.NET is there a way to set the mouse cursor to the Wait cursor that will stay in effect across several forms? For example, I want to set the cursor to the WaitCursor in formA just before it calls formB and FormB may, in turn, call another form. I want the WaitCursor until control is returned to formA where I reset it to Default. (I believe that in VB6 there was the notion of a screen cursor - that is what I want) TIA Wayne
0
2530
by: haegens | last post by:
I am making a .NET Application which has a TreeView Control in it. I have 3 levels of nodes. The toplevel is a rootnode which contains all other nodes. The second level holds one kind of nodes that have one type of objects assigned to the tag property. The third level holds another kind of nodes. Also this level has one type of objects assigned to the tag property. The objects that are assigned in the third level nodes, are child objects of...
4
9245
by: cb.brite | last post by:
Hello, I have tried this using the MouseEnter/MouseLeave events. However these events do not really refer to the rectangular shape of the form, but the client area (form area minus children areas). This means that if the mouse is currently inside the form's client area and it enters a child, a MouseLeave event will be generated on the form. One little trick to overcome this is to do a point-in-rectangle test inside the MouseLeave...
0
9706
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
9577
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
10325
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...
1
10315
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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
9140
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
6847
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();...
1
4295
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
2
3815
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.