I am writing an Autohotkey script that fiddles with some Photoshop windows and controls.
I need to be able to unfocus the currently focused control (say, Edit3), so that no control has focus after that (I could explain why exactly I need to do that if necessary, but it seems irrelevant, I just really need all controls unfocused).
AHK’s ControlFocus command doesn’t provide such an option.
I tried using a Windows Message like this:
SendMessage, 0x8, 0, 0, Edit3, A ; WM_KILLFOCUS = 0x08
but it doesn’t do anything.
In comparison, the opposite one works as expected and focuses the control:
SendMessage, 0x7, 0, 0, Edit3, A ; WM_SETFOCUS = 0x07
Perhaps I’m doing something wrong with the WM_KILLFOCUS message?
Just to clarify: I don’t want to simulate clicks, switch windows, add new invisible controls which to focus etc. I just want to know how to unfocus a control.
So, any idea how to unfocus a control, without focusing another one?
2
Answers
You can send #d and you will go to Desktop. Which is going to focus on the desktop but can work for you.