Board index » delphi » Problem with GetWidowText

Problem with GetWidowText

    Hi !

    I want my application to read the text of the title bar of the active
window, but I have a problem with the GetWindowText function. I'm abble to
know the number of characters of the title, but when I call the
GetWindowText function, my PC "freeze".
    Could you help me ??

    Thanks
    @+
    Aurlien
    destroy...@usa.net

 

Re:Problem with GetWidowText


Here is an example (working!):

const
MaxPath=255;
var
PText:Array[0..MaxPath] of char;
Res:Integer;
begin
WindowHandle:=some window;
Res:=GetWindowText(WindowHandle,PText,MaxPath);
If Res<>0 then WindowName:=String(PText) else WindowName:='';
end;

Hope this helps.

Regardz,

Jevgenij Gorbunov - gorbu...@med.muni.cz
----------------------------------------------------------------------------
Czech Republic, Brno. ICQ: 11471114.
Medicine, computers, translations, ...
----------------------------------------------------------------------------
Anyone sending me unsolicited/commercial/junk/spam e-mail
will be MAILBOMBED. So think before you act...
----------------------------------------------------------------------------

Aurlien D??? ???Y?? <6l1gpt$o1...@front3.grolier.fr> ...

Quote
>    Hi !

>    I want my application to read the text of the title bar of the active
>window, but I have a problem with the GetWindowText function. I'm abble to
>know the number of characters of the title, but when I call the
>GetWindowText function, my PC "freeze".
>    Could you help me ??

>    Thanks
>    @+
>    Aurlien
>    destroy...@usa.net

Other Threads