How to set input focus only on that control which is editable or not read only? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Sabestian Caine
Posts: 149
Joined: 12 Apr 2015, 03:53

How to set input focus only on that control which is editable or not read only?

19 Apr 2017, 12:29

Friends I want that when I press f1 key then it should set input focus on the control which is editable or not read only. for example please look at this image-
Image

In the above image you can see that I used ranorexspy tool to get the information of current window’s controls and it is showing that the state of the current control is focusable and currently it is focused.

Now please look at this image-
Image

In this image you can see that the state of this control is unavailable and it is read only.

I know I can use winget command to get the list of all controls of the active window and then I can use a parsing loop to get specific control and then controlsetfocus can be used to set input focus on the specific control. Moreover, control’s ClassNN or Control ID can be retrieved by control’s position and the width and the height of the control but all these methods does not specify which control of the active window is focusable or not read only.

Can anybody help me to solve this issue?

Thanks a lot....
I don't normally code as I don't code normally
A_AhkUser
Posts: 161
Joined: 06 Mar 2017, 16:18
Location: France

Re: How to set input focus only on that control which is editable or not read only?  Topic is solved

19 Apr 2017, 15:44

Hi,

Maybe you could take advantage of the ControlGet, OutputVar, Style command.
It appears in the code above that controlStyle variable change depending on whether or not control has ReadOnly property:

0x50211844 ; << +readonly
0x50211044 ; << -readonly


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Actually, for edit controls, among Styles Usable by the Gui and GuiControl Commands we can find this one:

ES_READONLY := "0x800" ; for edit control.
I can't really say if it's reliable.


Hope this helps.
Sabestian Caine
Posts: 149
Joined: 12 Apr 2015, 03:53

Re: How to set input focus only on that control which is editable or not read only?

21 Apr 2017, 00:27

A_AhkUser wrote:Hi,

Maybe you could take advantage of the ControlGet, OutputVar, Style command.
It appears in the code above that controlStyle variable change depending on whether or not control has ReadOnly property:

0x50211844 ; << +readonly
0x50211044 ; << -readonly


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




Actually, for edit controls, among Styles Usable by the Gui and GuiControl Commands we can find this one:

ES_READONLY := "0x800" ; for edit control.
I can't really say if it's reliable.


Hope this helps.



Thanks dear A_Ahkuser................
you really did a great job.................
I don't normally code as I don't code normally

Return to “Ask For Help”

Who is online

Users browsing this forum: JeffKang, Solid_Pliskin and 28 guests