UPDATE:  In the end, found this was the best way of using the Enter key, with many thanks to those who advised me..
                       IF GETKEYSTATE(0x0D) Then   'check virtual code for enter key
				IF (GetForegroundWindow() = shopping.hwnd) AND  GETKEYSTATE(0x0D) AND getcontroltext (shopping,0x101)<>"" Then  
                                rem Check foreground window is the one used in this program, and that enter key pressed, and that combobox edit field is blank
				Gosub updatecombo    'addstring to the combobox
				DO
				WAIT(1)
				UNTIL (GETKEYSTATE(0x0D) = 0)
				ENDIF
				ENDIF
Requires DECLARE import, GetForegroundWindow(),INT
19th December 2009
In the manual, Paul says that 'setcontrolnotify' is designed for edit boxes but should work with other controls.
Although I found someone asking about this in the forums, I couldn't find the answer.  Should SETCONTROLNOTIFY work with user input in a combo box, as I'd like to get the user to press ENTER rather than click a button?
If it doesn't work, I will find another solution.
 :)
FOUND ANOTHER WAY OF DOING THIS... 
if GETKEYSTATE(0x0D)then 
				 
	gosub updatecombo
This simply captures the virtual keycode 0D for the return key.
So I've now at least two ways of doing the same thing.
			
			
			
				Hi Adrian!
I don't know you did try it but I assume you did and dosn't work. :)
A combo box combines an edit box or static text and a list. 
Therefore you have to address the (sub) controls if something can't be accomplish addressing the combo.
You have to get the ID of the edit box using "GetComboBoxInfo" + "GETCONTROLHANDLE" that's my gues. ;)
			
			
			
				Thanks for the suggestions, Ficko.  
Yes, I did try it but SETCONTROLNOTIFIY doesn't seem to work with a combobox, at least you can't code it in the same simple way as with an edit box.  I've worked round it temporarily by allowing the user to enter a # key after the entry which then results in ADDSTRING.
I've looked at the command GETCONTROLHANDLE, but not sure how to go about 'GetComboBoxInfo' as can't find that in the manual.  Sorry if I'm being stupid!
			
			
			
				I don't know my suggestion would work may with subclassing but this "hack" seems to work: ;)
SELECT @CONTROLID
CASE COMBO
 IF (@NOTIFYCODE = 0) THEN
  MESSAGEBOX MainD,"HELLO","Enter Pressed!"
 ENDIF
ENDSELECT
			
			
				Hi Ficko,
Sorry to be a pain, but although that works fine in a dialog, as soon as I change the dialog to a window it stops working. (which explains why I couldn't get this to work in the main program.)
'Test program to use Enter in a combobox.  
'This works when d1 is a dialog, but not when it is a window as below
CONST COMBO_1 = 1
window d1
openwindow d1,0,0,300,202,0x80C80080,0,"Caption",&d1_handler
CONTROL d1,@COMBOBOX,"ComboBox1",69,12,165,178,@CTCOMBOSIMPLE|@ctcombosort,COMBO_1
setcontrolnotify d1,1,1,1
centerwindow d1
waituntil d1=0
SUB d1_handler
	SELECT @MESSAGE
		CASE @IDINITDIALOG
			CENTERWINDOW d1
			'setcontrolnotify d1,1,1,1  'used in dialog            
			/* Initialize any controls here */
		CASE @IDCLOSEWINDOW
			CLOSEwindow d1:end
		CASE @IDCONTROL
			
			SELECT @CONTROLID
			
			
				CASE COMBO_1
				/* respond to combobox notifications here */
				IF (@NOTIFYCODE = 0) THEN
  MESSAGEBOX d1,"HELLO","Enter Pressed!"   'works when d1 is a dialog
  ENDIF
				
				
				
			ENDSELECT
	ENDSELECT
RETURN
ENDSUB
I know from what Paul says, many features are designed to operate only with dialogs.  I guess I will have to stick with my original '#' key command, unless you have any further thoughts and can understand what creates this limitation.
Thanks for your help, very much appreciated 
Adrian 
			
			
			
				Change 0 to 9
"IF @NOTIFYCODE = 9"
And you don't need the "setcontrolnotify" stuff.
			
			
			
				 :D :D :D :D :D :D :D :D :D!!!!!
Brilliant!  It works!
Merci infiniment!
I think that's probably an incredibly useful solution as I noticed several posts where people were trying to overcome this problem.
Can you explain WHY it works, to non-programming old duffers like me?
Have a great Christmas!
			
			
			
				$define CBN_ERRSPACE        (-1)
$define CBN_SELCHANGE       1
$define CBN_DBLCLK          2
$define CBN_SETFOCUS        3
$define CBN_KILLFOCUS       4
$define CBN_EDITCHANGE      5
$define CBN_EDITUPDATE      6
$define CBN_DROPDOWN        7
$define CBN_CLOSEUP         8
$define CBN_SELENDOK        9
$define CBN_SELENDCANCEL    10
CBN_SELENDOK is working for you probably because enter key is detected when you use keyboard to select an item.
			
			
			
				 :)  Thanks Sapero.  That's helpful.  It's important to understand why things work, not just that they do.  Will keep a record of those codes.
Seasons greetings,
 ;)