Posts: 1,058
Threads: 367
Joined: Oct 2007
I am in need to clear a dialogue control, under certain conditions. I guess I would may use of a statement of type :
Quote: SendKeysToWindow id(5 hDlg) key(...)
but I am sorry I failed to configure the key combination.
Any advice would be mostly welcome.
Posts: 12,090
Threads: 142
Joined: Dec 2002
What control it is? Can I test?
What keys you would use to clear it manually or with the key function?
Posts: 1,058
Threads: 367
Joined: Oct 2007
Many thanks for your help. The control to be cleared is number 5 in the following dialog. The key combination to manually clear could be "Home - Shift/End - Back".
Function
tempf05
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 45 "Dialog"
;3 Static 0x54000000 0x0 6 3 60 12 "Θερμοκρασία (C) :"
;4 Static 0x54000000 0x0 123 3 50 12 "Υγρασία (%) :"
;5 Edit 0x540300C2 0x204 71 3 31 12 ""
;8 Edit 0x540320C2 0x204 177 3 31 12 ""
;6 Button 0x54032000 0x0 5 24 48 14 "Calculate"
;7 Edit 0x54030880 0x200 66 25 103 14 ""
;1 Button 0x54030001 0x4 172 24 48 14 "Exit"
;END DIALOG
;DIALOG EDITOR: "" 0x2040400 "*" "" "" ""
str controls = "5 7 8"
str e5 e7 e8
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
Posts: 12,090
Threads: 142
Joined: Dec 2002
Why SendKeysToWindow? Why not setwintext?
Posts: 1,058
Threads: 367
Joined: Oct 2007
You are absolutely right. However, what would you propose to position the cursor, immediately after clearing its content to field numbered 5?
Posts: 12,090
Threads: 142
Joined: Dec 2002
To show the text cursor (caret) in the field? Need to focus the control.
Posts: 1,058
Threads: 367
Joined: Oct 2007
Thank you for your help. Best regards.