473,467 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C#, getting the full text of a window (ala AHK)

15 New Member
Hello everyone!

I've got an application with multiple MDI windows that I need to be able to get the full text of (so the information can be parsed through my tool). What I need is a C# equivalent of the AHK function WinGetText, or a suggestion for a better way of going about it.

Much <3 for halp. Thanks!
Nov 28 '07 #1
6 3460
Plater
7,872 Recognized Expert Expert
What do you mean "full text"? You mean the window title?
use:
Expand|Select|Wrap|Line Numbers
  1. myform.Text
  2.  
Nov 28 '07 #2
RodneyAnonymous
15 New Member
Not trying to be rude, but it doesn't seem like you really read my question before you responded. I'm not trying to get the Title of my form. I'm trying to interface with a separate application, which contains multiple MDI windows, and get all the text currently being displayed by it, in the same way that the WinGetText function from AutoHotkey does.
Nov 28 '07 #3
Plater
7,872 Recognized Expert Expert
Well, not trying to be rude, but your question was rather poorly written.

I don't believe there are any .NET objects that will do this, you will probably have to use DLLImport and use the unmanaged function you mentioned.
The Process object can get you some information, but not all of it I don't believe.
Nov 28 '07 #4
RodneyAnonymous
15 New Member
Well, not trying to be rude, but your question was rather poorly written.

I don't believe there are any .NET objects that will do this, you will probably have to use DLLImport and use the unmanaged function you mentioned.
The Process object can get you some information, but not all of it I don't believe.
Question seemed pretty clear to me.

I'm fully expecting to have to use API functions to do this. What very little I've been able to find points to using SendMessage and WM_GETTEXT to get information from specific controls, once I have their handles. Problem is, looping through every control in the outside app seems stupidly inefficient when all I need is to get text information from a few Edit fields within the active MDI child window. And if I just went through all the Edits, I don't really have a way of telling which returned text corresponded to which Edit field.
Nov 28 '07 #5
RodneyAnonymous
15 New Member
I was able to put together something of a solution for my issue, but this has created a new problem. Since the locations of the Edit boxes that I need are always static in relation to their MDI window, I was able to use WindowFromPoint to get an initial Edit's handle, and then change X and Y coordinates to get others. Using SendMessage with WM_GETTEXT worked to get the text out of some controls.

This has, however, created a new problem. There are different levels of access to the program I am interfacing with, and some users may have certain text fields and combo boxes disabled for them. WindowFromPoint will not return the handle for any disabled controls.

Is there a way to get around this?
Nov 28 '07 #6
Plater
7,872 Recognized Expert Expert
This is really out of the scope of .NET now, you might try asking someone to bump this over to the "C/C++" forum for better help on the API calls.
Nov 28 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Shiperton Henethe | last post by:
Hi Can anyone tell me how to open up a new normal, full-sized browser window from a small popup window? I'm using something like this. <script language="javascript"> <!--
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
1
by: linuxnooby | last post by:
Hi I am trying to write a python script to run on windows xp that will have a full screen gui. The script has a function that creates a full screen (hides task bar) top level window using...
1
by: iwdu15 | last post by:
hi, how can i get the icon associated with a certain file type? thanks -- -iwdu15
1
by: empiresolutions | last post by:
Hello fellow code junkies, I am using the "Ajax dynamic list" http://dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list and i think its the best out there. I have found a compatibility...
4
by: Neil | last post by:
Just found out that the Microsoft Rich Textbox does not support full text justification, since it's based on Version 1.0 of the RichEdit Window Class, and full text justification is only available...
3
dmjpro
by: dmjpro | last post by:
I am using this JavaScript code to open a window in a full screen mode .... var styles =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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
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
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
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.