I have a dialog box with 1 edit box and 2 buttons. I'm trying to get the TAB to work, moving from one control to the next. However, the focus goes from the first button to the second and then to the edit box, but it doesn't go back from the edit to the first button, the TAB doesn't respond. The dialog is modeless (CreateDialogParam) and I already use IsDialogMessage. Here follows the resource script, created with ResEd editor:

#define IDC_EDIT 300
#define IDC_BTN1 100
#define IDC_BTN2 200
FONT 10,"MS Sans Serif"
STYLE 0x10CA0800
EXSTYLE 0x00000000

CONTROL "",IDC_EDIT,"Edit",0x50211044,1,0,243,147,0x00000200
CONTROL "CODE",IDC_BTN1,"Button",0x50010001,1,150,120,18,0x00000000
CONTROL "DECODE",IDC_BTN2,"Button",0x50010000,124,150,120,18,

What do I have to do to make the focus passes by all the controls, making like a "cicle"? Check the program:
Thank you
Posted on 2004-06-24 23:05:21 by Marginais
How about attaching the DLG file from RadASM maybe the RAP file as well ? The RC file generated is a bit hard to read with hex values instead of equates.
Posted on 2004-06-24 23:15:25 by donkey
Anyway the ES_MULTILINE style is what is giving you the problem, it seems you cannot have tab selection and ES_MULTILINE at the same time.
Posted on 2004-06-24 23:39:38 by donkey
You can add the tab behaviour yourself though. Something like this:

(subclass it and make this proc the new wndproc)

NewEditProc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.if uMsg == WM_CHAR
.if wParam == VK_TAB
invoke SetFocus,hControlToTabTo
invoke CallWindowProc,oldWndProc,hWin,uMsg,wParam,lParam
NewEditProc endp
Posted on 2004-06-25 18:42:07 by Will
Thank you. I would be looking for mistakes in source code and the resource until now.
Posted on 2004-06-25 23:38:44 by Marginais