Groups | Blog | Home
all groups > c# > september 2004 >

c# : GetWindowText: does not work!


Richard Blewett [DevelopMentor]
9/20/2004 3:54:17 PM
You need to use a System.Text.StringBuilder rather than a string for the lpString

Regards

Richard Blewett - DevelopMentor

http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<mn.a82d7d492018c311.18582@SPAM.no>

Hi,
as subject i've a problem with the API GetWindowText.
I declare the function GetWindowText:

[DllImport("user32.dll", EntryPoint="GetWindowTextA")]
public static extern int GetWindowTextt (
int hwnd,
string lpString,
int cch
);

When i try to call it in this way: Win32.GetWindText(hWnd,sName,128)
the sName string variable return empty!
how can i solve this problem?

thx!

Mauro.

--
Questa &egrave; una firma automatica di MesNews.
Sito: http://mesnews.no-ip.com


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004



Mauro
9/20/2004 10:42:58 PM
Hi,
as subject i've a problem with the API GetWindowText.
I declare the function GetWindowText:

[DllImport("user32.dll", EntryPoint="GetWindowTextA")]
public static extern int GetWindowTextt (
int hwnd,
string lpString,
int cch
);

When i try to call it in this way: Win32.GetWindText(hWnd,sName,128)
the sName string variable return empty!
how can i solve this problem?

thx!

Mauro.

--
Questa è una firma automatica di MesNews.
Sito: http://mesnews.no-ip.com
AddThis Social Bookmark Button