Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatically proceed to next dialog field
#1
I understand that issuing a EN_MAXTEXT command you are notified when input characters in a field exceed the EM_LIMITTEXT value. I have two relevant questions :

1. If this limit is exceeded what is the best way to ask this macro to proceed to next field, as it would had happened if you pressed tab.

2. Is there any notification given when EN_MAXTEST is exactly reached?

These two questions could be compressed in a single one : Is there any way to automatically proceed to next dialog field when the specified number of characters is reached in the previous one?

Many thanks in advance

PS. I attach a dialog I wrote which it works as requested above, for your comments :

Function Dialog31
Code:
Copy      Help
\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Edit 0x54032080 0x200 10 12 96 12 ""
;4 Edit 0x54032000 0x200 10 30 96 12 ""
;5 Edit 0x54032000 0x200 10 48 96 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

str controls = "3 4 5"
str e3 e4 e5
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SendMessage id(3 hDlg) EM_LIMITTEXT 4 0

,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
int- swm
sel wParam
,
,case EN_CHANGE<<16|3
,_s.getwintext(id(3 hDlg))
,if len(_s)=4
,,SendKeysToWindow id(3 hDlg) key((VK_TAB))
,
,case IDOK
,case IDCANCEL
ret 1
#2
Function Dialog162
Code:
Copy      Help
sel wParam
,
,case [EN_CHANGE<<16|3,EN_CHANGE<<16|4]
,if GetWindowTextLengthW(lParam)=4
,,SetFocus GetNextDlgTabItem(hDlg lParam 0)

https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
#3
Perfect! Thanks again.


Forum Jump:


Users browsing this thread: 1 Guest(s)