get open windows lazarus / 9-Editor ---------------------------------------------------------------------- skaner1900 · 2011-05-01 13:37 I useing WinAPI function: Code: [Select]function EnumWindowsProc(WHandle: HWND; LParM: LParam): Boolean;StdCall;Export; var Title,ClassName:array[0..128] of char;     sTitle,sClass,Linia:STRING ; begin  Result:=True;  GetWindowText(wHandle, Title,128);  GetClassName(wHandle, ClassName,128);  sTitle:=Title;  sClass:=ClassName;  if IsWindowVisible(wHandle) then  begin   Linia:=sTitle+'        '+sClass+'       '+IntToHex(wHandle,4);   Form1.ComboBox2.Items.Add(Linia);  end; end; But when I try to call it by: Code: [Select]EnumWindows(@EnumWindowsProc,0); I receive error: unit1.pas(416,31) Error: Incompatible type for arg no. 1: Got "
", expected "" What's wrong?! ---------------------------------------------------------------------- Marc · 2011-05-01 16:57 Boolean <> LongBool. Declare your function like the error said: function EnumWindowsProc(WHandle: HWND; LParM: LParam): LongBool;StdCall;Export; (you don't have to export btw)