Eek.
Seriously, it's a lot easier if you work with the project manager instead of against it, and let the designer take care of your forms for you. What you're doing here is trying to create a "raw" Windows program from scratch, and the reason I use WinFBE is to avoid that.
Getting back to your problem, the IDC_xxx things are just numbers (LONG, to be specific). Every gadget you put on your form has to have a unique one. People who do these things typically start at 10000, say, for the first gadget and then 10001 for the next gadget, etc. FreeBasic was complaining because you used IDC_LISTBOX but you never defined it or gave it a value. If you're using the Visual Designer, it takes care of that for you, and you never even see the ID number unless you look for it.
Instead of that, use the project manager:
1. When you start WinFBE, click the "New Project" button. It will ask you for a path, and the "..." button will give you an Explorer-type window to help you choose one. That's where you choose a name for the project, for example, ListBoxTest. I always create a new folder for each project that I start: that way, when I've learned all I can from this project, I can delete the whole folder and not worry about losing something else that's still important.
2. Under "Templates", click "Visual Designer", and make sure the "Create Resource File and Manifest" box is checked. When you click OK, it does several things for you: (a) It creates a project file called, say, ListBoxTest.wfbe. Don't mess with that. (b) It creates a main program file called ListBoxTest.bas. For simple projects you won't even need to look at it, but if you need to reference outside files, this is where you put the #include statements. (c) It creates your initial Form file, called frmMain.inc. If you don't like the name frmMain, that's fine: the top entry in the Property box for the form is the name; change it to anything you like, but I recommend choosing the name before you start adding gadgets to the form.
Now you're ready to go. You can concentrate on designing your form and what to do when each gadget needs attention. You don't have to worry about the wsz... and the IDC... and the hideous message loop SELECT block.
Here's a quick sample, you can make it more elaborate:
' frmMain form code file
''
''
'My form consists of a text box, a button, and a list box.
'When you click the button the text is added to the list box
' and the text box shows the item number.
Function frmMain_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
dim as string TextLine
dim as long n
Textline = frmmain.Text1.text
n = frmmain.List1.Items.Add(TextLine)
frmmain.Text1.Text = "Added item #" + str(n)
Function = 0
End Function