Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key edit control sequences in a dialog Edit Control
#1
Could you please advise, how can I key edit controls (ie Select All - Ca) in the Edit control of the following dialog :

Function SESInputDialog
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;Get help in : DialogWithMenu
str controls = "3"
str e3
if(!ShowDialog("SESInputDialog" &SESInputDialog &controls 0 0 0 0 0 0 0 "$user profile$\My Documents\Local Settings\sysman\Ico\SESGroup1.ICO" "SESInputDialog")) ret
mes e3

;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 382 172 "SES-Multiline Input"
;3 Edit 0x54231044 0x200 0 0 382 194 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030307 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,__Font-- f
,f.Create("Tahoma" 11 0)
,f.SetDialogFont(hDlg "3")

,
,case WM_SIZE
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 106  DT_Ok hDlg
,
,case 103
,key Cc
,
,case 104
,key Ca
,
,case IDOK
,case IDCANCEL DT_Cancel hDlg
ret 1


;BEGIN MENU
;>&Edit
,;&Copy : 103 0 0 Cc
,;-
,;&Paste : 105 0 0 Cv
,;-
,;Select &All : 104 0 0 Ca
,;<
;E&xit : 106 0
;END MENU

Do I have to change any of the Edit control styles?

Thanks in advance

Simos
#2
Infinite loop. Somehow it breaks, not allowing to hang.
key should never be used in a dialog or window procedure to send keys to the window. Especially if it is a hotkey like here. If not hotkey, can use, but with opt keysync 1 and with SetFocus.

Function SESInputDialog
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
;Get help in : DialogWithMenu
str controls = "3"
str e3
if(!ShowDialog("SESInputDialog" &SESInputDialog &controls 0 0 0 0 0 0 0 "$user profile$\My Documents\Local Settings\sysman\Ico\SESGroup1.ICO" "SESInputDialog")) ret
mes e3

;BEGIN DIALOG
;0 "" 0x10CF0A44 0x100 0 0 382 172 "SES-Multiline Input"
;3 Edit 0x54231044 0x200 0 0 382 194 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030307 "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,__Font-- f
,f.Create("Tahoma" 11 0)
,f.SetDialogFont(hDlg "3")

,
,case WM_SIZE
,RECT r; GetClientRect(hDlg &r)
,siz r.right r.bottom id(3 hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,;menu items:
,case 106 DT_Ok hDlg
,
,case 103
,;key Cc ;;this would send Ctrl+C, it would send command 103, and so on. Endless loop.
,SendMessage id(3 hDlg) WM_COPY 0 0
,
,case 105
,SendMessage id(3 hDlg) WM_PASTE 0 0
,
,case 104
,SendMessage id(3 hDlg) EM_SETSEL 0 -1
,
,case IDOK
,case IDCANCEL
ret 1


;BEGIN MENU
;>&Edit
,;&Copy : 103 0 0 Cc
,;-
,;&Paste : 105 0 0 Cv
,;-
,;Select &All : 104 0 0 Ca
,;<
;E&xit : 106 0
;END MENU
#3
Dear Gintaras,

Many thanks for a very useful advice.

Bets regards


Forum Jump:


Users browsing this thread: 1 Guest(s)