title: Delphi - procedure return a error
body: <p>I'm having problems in my code but can not find the solution, already modified in various ways but no success.</p>
  
  <p>Code:</p>
  
  <pre><code>private
  { Private declarations }
  procedure getImgInfo(Sender: TObject; A, B: String);
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>procedure TfMain.Button1Click(Sender: TObject);
  var
  i, Idx, Left, Top, Count : integer;
  Graph : TGraphic;
  Img : TImage;
  EdPath, EdFileName : TEdit;
  begin
    openImg.Execute;
    Left := 5;
    Top := 5;
    Count := 0;
    Idx := 0;
  for i:=0 to openImg.Files.Count-1 do
    begin
      try
        begin
          Graph := TPngImage.Create;
          Graph.LoadFromFile(openImg.Files[i]);
  
          EdPath := TEdit.Create(pImgs);
          EdPath.Left := Left + 101;
          EdPath.Visible := False;
          EdPath.Text := ExtractFilePath(openImg.Files[i]);
  
          EdFileName := TEdit.Create(pImgs);
          EdFileName.Left := Left + 101;
          EdFileName.Visible := False;
          EdFileName.Text := ExtractFileName(openImg.Files[i]);
  
          Img := TImage.Create(pImgs);
          Img.Parent := pImgs;
          Idx := Idx + 1;
          Img.Name := 'Img_'+IntToStr(Idx);
          Img.Width := 100;
          Img.Height := 100;
          Img.Left := Left;
          Img.Proportional := True;
          Left := Left + 101;
          Img.Top := Top;
          Img.Picture.Assign(Graph);
          Img.BringToFront;
          Count := Count + 1;
          Img.OnClick := getImgInfo(Img, edPath.Text, edFileName.Text); //Error line
  
          if Count = 2 then
            begin
              Left := 5;
              Top := Top + 101;
              Count := 0;
            end;
        end;
      except on E : Exception do
        ShowMessage('Error: :' + E.Message);
      end;
    end;
  end;
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>[dcc32 Error] uMain.pas(74): E2010 Incompatible types: 'TNotifyEvent' and 'procedure, untyped pointer or untyped parameter'</p>
  </blockquote>
  
  <p>What is wrong?
  Thanks!</p>