473,490 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Extract Text from External Application into C# Application.

1 New Member
Hello,
I have developed an Application in C# which extract text from external application's textbox , I am using user32.dll, The application is working fine but my problem is this - The external application's textbox contains text in unicode format, so whenever I extract text in my application it shows "??????" text. I have tried setting charset.unicode , and also used RichTextBox to show text in my application.
Please let me know how to exract unicode text from external application.

Here is code I am using


private void button1_Click(object sender, EventArgs e)
{
IntPtr MytestHandle = new IntPtr(0x00060342); // address of window displaying in SPY++.



HandleRef hrefHWndTarget = new HandleRef(null, MytestHandle);


// encode text into
richTextBox1.Text = ModApi.GetText(hrefHWndTarget.Handle);
}

public static class ModApi
{
[DllImport("user32.dll", EntryPoint = "SendMessageTimeout", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern uint SendMessageTimeoutText(IntPtr hWnd, int Msg, int countOfChars, StringBuilder text, uint flags, uint uTImeoutj, uint result);


public static string GetText(IntPtr hwnd)
{
var text = new StringBuilder(1024);

if (SendMessageTimeoutText(hwnd, 0xd, 1024, text, 0x2, 1000, 0) != 0)
{
return text.ToString();
}

MessageBox.Show(text.ToString());
return "";
}
}

Please look at image attached.. it is showing result after extraction.
Attached Images
File Type: jpg text.jpg (24.9 KB, 153 views)
Aug 14 '13 #1
0 1189

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

Similar topics

1
1883
by: sandyde2 | last post by:
Hi all, I am writing a java application as a mozilla extension. Because mozilla uses javascript for the frontend, i need the javascript to call my external java application and pass one...
1
12055
by: mickeydisn | last post by:
Sub: C++ Word automation Extract text hello. I want extact text form a word document using a visual c++ programme. I have see a lot of documentation. and my analysis is that I must use a...
0
901
by: Vagabond Software | last post by:
I have read the REDIST.TXT file that comes with Microsoft's Cabinet SDK API package and it seems to indicate that I could legally redistribute EXTRACT.EXE with my application. My question is how...
1
3351
by: Klaus Jensen | last post by:
Hi! Is it possible to extract text from an EPS-file using .Net? In this scenario, I need to process ads stored as EPS-files and extract all text (for fulltext-indexing purposes). I looked into...
0
1158
by: Joris De Groote | last post by:
Hi, I'm looking for some code to extract text from PDF files. Can somebody help me? Thanks Greetz
3
8817
by: Julien ARNOUX | last post by:
Hi, I have a problem :), I just want to extract text from pdf file with python. There is differents libraries for that but it doesn't work... pyPdf and pdfTools, I don't know why but it doesn't...
2
2300
by: Case | last post by:
I'm looking for help, on how to extract text between parens. The text before and after does not remain constant in length. Any ideas? For example I trying to pull out 123456789 from:...
0
1465
by: Dominic | last post by:
I need to extract text by using Visio IFilter. Actually, I am using Visio IFilter and it works when I manually install Visio IFilter component before/after install my application. But I don't...
5
1725
by: goje | last post by:
Hello I want to capture the Output of the External Console Application in my application and also want to send commands to External Console Application from my application. Someone have some...
5
10066
by: undbund | last post by:
Hi guys, can you guide me to tutorials, examples and scripts where I can learn how to extract text, images, etc from pdf file. Thanks Undbund
0
7112
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
7146
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,...
1
6852
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...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
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
3084
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
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
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 ...
0
277
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...

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.