Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KEYBOARD FOCUS
#1
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.
#2
What is funny? Can you show all the code?

If in dialog, you can use SetFocus.
#3
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.

Code:
Copy      Help
int hwnd=id(402 "RUN TIMER")
act hwnd
#4
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:

Code:
Copy      Help
;\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:

Code:
Copy      Help
int hwnd=id(3 "Form")
act hwnd

It always worked well.
#5
why not 'act" the window and id?????? would that not work???
#6
Usually works, but maybe the program also needs a mouse click.
#7
k kool lol


Forum Jump:


Users browsing this thread: 2 Guest(s)