473,785 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing text in Windows UI controls with C#

Hi,

With C#, is it possible to hover a mouse pointer on the Windows UI controls
and show the UI text? For example, can I hover my mouse over "File" in the
menu bar and show the text "File" on a label?

I've seen a program like this but not sure if it can be done with C#.

Thanks!
TomTom
Nov 16 '05 #1
5 9611
The MenuItem has a Select event that is called when the mouse is over it.
Use this to set the label text.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uW******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

With C#, is it possible to hover a mouse pointer on the Windows UI controls and show the UI text? For example, can I hover my mouse over "File" in the menu bar and show the text "File" on a label?

I've seen a program like this but not sure if it can be done with C#.

Thanks!
TomTom

Nov 16 '05 #2
Sorry, I didn't describe what I wanted to do in more details.

I need to capture the text that's in other programs. The scenario looks
like:

1. I activate MyApp.
2. I hover mouse pointer over some menu text, command bar text, etc. in MS
Word.
3. The pointed text show up in MyApp.

Is this possible?

Thanks,
TomTom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
The MenuItem has a Select event that is called when the mouse is over it.
Use this to set the label text.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uW******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

With C#, is it possible to hover a mouse pointer on the Windows UI

controls
and show the UI text? For example, can I hover my mouse over "File" in

the
menu bar and show the text "File" on a label?

I've seen a program like this but not sure if it can be done with C#.

Thanks!
TomTom


Nov 16 '05 #3
I don't know of any way to do it using .NET.
You would probably need functionality similar to Spy++, I tried to select a
MenuItem, but could only get the whole menu.
If it is possible, it would require some interop, try asking in the some of
the win32 api groups, if there are APIs you can use,
these can be wrapped in DllImport for use in .NET.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uX******** ******@TK2MSFTN GP09.phx.gbl...
Sorry, I didn't describe what I wanted to do in more details.

I need to capture the text that's in other programs. The scenario looks
like:

1. I activate MyApp.
2. I hover mouse pointer over some menu text, command bar text, etc. in MS
Word.
3. The pointed text show up in MyApp.

Is this possible?

Thanks,
TomTom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
The MenuItem has a Select event that is called when the mouse is over it. Use this to set the label text.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uW******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

With C#, is it possible to hover a mouse pointer on the Windows UI

controls
and show the UI text? For example, can I hover my mouse over "File"
in the
menu bar and show the text "File" on a label?

I've seen a program like this but not sure if it can be done with C#.

Thanks!
TomTom



Nov 16 '05 #4
Thanks for your suggestion. I'll ask around a little more.

Tomtom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
I don't know of any way to do it using .NET.
You would probably need functionality similar to Spy++, I tried to select a MenuItem, but could only get the whole menu.
If it is possible, it would require some interop, try asking in the some of the win32 api groups, if there are APIs you can use,
these can be wrapped in DllImport for use in .NET.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uX******** ******@TK2MSFTN GP09.phx.gbl...
Sorry, I didn't describe what I wanted to do in more details.

I need to capture the text that's in other programs. The scenario looks
like:

1. I activate MyApp.
2. I hover mouse pointer over some menu text, command bar text, etc. in MS
Word.
3. The pointed text show up in MyApp.

Is this possible?

Thanks,
TomTom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
The MenuItem has a Select event that is called when the mouse is over

it. Use this to set the label text.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uW******** *****@TK2MSFTNG P11.phx.gbl...
> Hi,
>
> With C#, is it possible to hover a mouse pointer on the Windows UI
controls
> and show the UI text? For example, can I hover my mouse over "File" in the
> menu bar and show the text "File" on a label?
>
> I've seen a program like this but not sure if it can be done with C#. >
> Thanks!
> TomTom
>
>



Nov 16 '05 #5
I had a little progress on my search on how I can do this. Below is the step
I gathered on the web, but I am yet to find how I could use this.

1. In Visual Studio by going to Project->Add Reference. In the .NET tab,
choose the Accessibility.d ll..

2. Add the following code in the C# program.

[DllImport("olea cc.dll", EntryPoint="Acc essibleObjectFr omPoint",
SetLastError=tr ue, CharSet=CharSet .Auto,
CallingConventi on=CallingConve ntion.StdCall)]
public static extern int AccessibleObjec tFromPoint(Poin t pt, ref
Accessibility.I Accessible ppacc,ref object pvarChild);//(IntPtr hWnd);

[DllImport("olea cc.dll", EntryPoint="Acc essibleObjectFr omEvent",
SetLastError=tr ue, CharSet=CharSet .Auto,
CallingConventi on=CallingConve ntion.StdCall)]
public static extern int AccessibleObjec tFromEvent(int hwnd, int objid,
int childid, ref Accessibility.I Accessible ppacc, ref object pvarChild);

[DllImport("user 32.dll", EntryPoint="Set WinEventHook", SetLastError=tr ue,
CharSet=CharSet .Auto, CallingConventi on=CallingConve ntion.StdCall)]
public static extern int SetWinEventHook (int eventMin, int eventMax, int
hmodWinEventPro c, WinEventProc lpfnWinEventPro c, int idProcess, int
idThread, int dwflags);

public delegate int WinEventProc(in t hWinEventHook, int idEvent, int hwnd,
int idObject, int idChild, int dwEventThread, int dwmsEventTime);
Then, I am stuck.... Basically I don't know how I can create the
IAccessible object in the C# and call the ac.get_accName function as the
mouse pointer moves... I crafted up an experimental code, but this does not
work.

Accessibility.I Accessible ac = new Accessibility.I Accessible();
Point pt = new Point(50,50);
string test = ac.get_accName( pt);
If you know a way to do this, can you please let me know? Even the general
pseudo-code would help.

Thanks.
Tomtom

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:un******** ******@TK2MSFTN GP09.phx.gbl...
Thanks for your suggestion. I'll ask around a little more.

Tomtom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
I don't know of any way to do it using .NET.
You would probably need functionality similar to Spy++, I tried to select
a
MenuItem, but could only get the whole menu.
If it is possible, it would require some interop, try asking in the some of
the win32 api groups, if there are APIs you can use,
these can be wrapped in DllImport for use in .NET.

Chris

"TomTom" <no*****@nospam fordiscussion.c om> wrote in message
news:uX******** ******@TK2MSFTN GP09.phx.gbl...
Sorry, I didn't describe what I wanted to do in more details.

I need to capture the text that's in other programs. The scenario looks like:

1. I activate MyApp.
2. I hover mouse pointer over some menu text, command bar text, etc.
in MS Word.
3. The pointed text show up in MyApp.

Is this possible?

Thanks,
TomTom

"Christophe r Kimbell" <a@b.c> wrote in message
news:40******** @news.broadpark .no...
> The MenuItem has a Select event that is called when the mouse is
over it.
> Use this to set the label text.
>
> Chris
>
> "TomTom" <no*****@nospam fordiscussion.c om> wrote in message
> news:uW******** *****@TK2MSFTNG P11.phx.gbl...
> > Hi,
> >
> > With C#, is it possible to hover a mouse pointer on the Windows UI
> controls
> > and show the UI text? For example, can I hover my mouse over
"File" in
> the
> > menu bar and show the text "File" on a label?
> >
> > I've seen a program like this but not sure if it can be done with

C#. > >
> > Thanks!
> > TomTom
> >
> >
>
>



Nov 16 '05 #6

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

Similar topics

5
2139
by: Moosebumps | last post by:
I have a large set of Python scripts that interface with command line utilities (primarily Perforce). I am currently capturing ALL the text output in order to get results and such. I am using the popen functions to get the stdout, stderr streams. However, some of the operations take a really long time (copying large files over the network). If you run Perforce directly (or through os.system, which doesn't return text output), it shows...
5
5626
by: Earl Eiland | last post by:
Anyone know how to capture text from GUI output? I need to process information returned via a GUI window. Earl
3
12891
by: Chris | last post by:
Hi, I need to get an image of a control (ListView) so i can save it to a file. It's pretty easy to get the Graphics with the CreateGraphics() function on every control, but I don't know how I might save the Graphics object as an image. Has anyone done this? Chris
9
4778
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and DataSet; and all I'm doing is showing one record in text fields, allowing the user to modify the text fields, and then updating the database again when the user clicks the Save button. The fields already show the correct data record since I have...
4
2632
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
14
2552
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the internet, they have to login. I want to be able to capture that login versus their Windows login because I need to know who they are from any computer rather than only their computer. Any ideas? Thanks
6
4210
by: Lance Geeck | last post by:
I have a simple form where I am using a dataset called Client. On the data entry screen, there are name, address, city state and zip. I have the fields bound to the dataset field. (Properties screen: Data bindings then Text ) When I run the program and make a change to an existing record in the City text box, the Dataset value for this column is changed as expected. When I check the HasChanges property it says false. I don't...
4
3887
by: tneufeld | last post by:
I am using a ListView control to display 2 columns of data that I populate manually. I can get the data in the first column easily enough. its when i try to get the data in the second column that I get the problem. I am just not sure where to start? Is there a method that lets me get this information easily? TIM
0
9647
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
9489
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
10162
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
10100
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
6744
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
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
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
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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.