WILL, but.. but... but he's working with win32 api... in freepascal :shock: Umm.. shutting up. You weren't writting to me afterall

Superboy, a listbox is nothing more than another control, so you just create a resource, pump out the messages and windows does the rest. Here's another example (just posting the differences from an earlier one):

example.pas
[pascal]program example;
...
const
...
IDC_LISTBOX = 1003;
...

case Msg of
WM_CLOSE:
begin
EndDialog(hWnd, 0); //Messed up last time. That's the supposed way of closing dialogs
end;
WM_COMMAND:
begin
case LoWord(wParam) of
IDC_BUTTON:
begin
Buffer[0] := #0;
GetDlgItemText(hWnd, IDC_TEXT, Buffer, 100);
SetDlgItemText(hWnd, IDC_TEXT, nil);
SendMessage(GetDlgItem(hWnd, IDC_LISTBOX), LB_ADDSTRING, 0, LongInt(@Buffer));
end;
end;
end;
...[/pascal]
example.rc
Code:
#define IDC_LISTBOX 1003
...
LISTBOX IDC_LISTBOX, 15, 35, 111, 100, WS_VSCROLL
...
Tadaa!

Btw, SuperBoy, you might wanna check out one site (there). It covers the basics of working with win32 api in delphi, so you might find some questions answered in it already

Bye,
fragle