Posts: 10
Threads: 3
Joined: Jan 2007
is there a way other than 'act' to put the keyboard focus in a rich text box ? i have the handle for the box just trying to put focus in it. act works sometimes but it does something funny to the rich text box other times.
MOZER.
Posts: 12,071
Threads: 140
Joined: Dec 2002
What is funny? Can you show all the code?
If in dialog, you can use SetFocus.
Posts: 10
Threads: 3
Joined: Jan 2007
whats funny = the text box takes the enter key some what like a chat box and when i act it sometimes i can longer use the enter key to input text.
i tried using SetFocus didnt seem to work im not sure of how to use this functon i could not find much info on it, and this is an outside app im controling not a qm dialog.
i found some things on WM_SETFOCUS seems like this is something that would work along with WM_KILLFOCUS, but using these just make the text box have keyboard focus but i can not type in it ? what ever window is ACTIVE just takes the focus back.
int hwnd=id(402 "RUN TIMER")
act hwnd
Posts: 12,071
Threads: 140
Joined: Dec 2002
If Tab can be used, try to insert this after act hwnd:
key TST
Or instead of act use lef:
lef 3 3 hwnd
Or send mouse message:
SendMessage hwnd WM_LBUTTONDOWN 1 0
0.02
SendMessage hwnd WM_LBUTTONUP 0 0
----
To test I made exe from this code:
;\Dialog_Editor
str controls = "3"
str rea3
if(!ShowDialog("" 0 &controls)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 222 134 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 RichEdit20A 0x54233044 0x200 4 4 96 48 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020001 "" ""
, and used this code to set focus:
int hwnd=id(3 "Form")
act hwnd
It always worked well.
Posts: 116
Threads: 19
Joined: Nov 2006
why not 'act" the window and id?????? would that not work???
Posts: 12,071
Threads: 140
Joined: Dec 2002
Usually works, but maybe the program also needs a mouse click.
Posts: 116
Threads: 19
Joined: Nov 2006