title: Using WM_GETTEXT - what to set the Size?
body: <pre><code>Var
   PText : array[0..512] of Char;
   Handle, Child : HWND;
  begin
   FillChar(PText,512,0);
   Handle := FindWindow('Notepad',nil);
   Child := FindWindowEx(Handle,0,'Edit',nil);
  
   Caption := IntToStr(Handle)+' - '+IntToStr(Child);
  
   SendMessage(Child,WM_GETTEXT,512,Integer(@PText[0]));
  
   ShowMessage(PText);
  
  end;
  </code></pre>
  
  <p>I am just wondering - What should I normally set the size (Currently 512) to when using WM_GETTEXT? I guess it differs to how much text there is in the source control?</p>
  
  <p>What do you recommend to set it to, when dealing with rather large ammounts of text?</p>
  
  <p>Is there a way to do the same (Getting the text from a handle) without having to set sizes and such?</p>