Imagine that we have a form with two buttons on it. I run the application and I click on the first button. nothing happens and no focus rectangle is displayed. But when I press a key, it shows a focus rect on the button and even if I click on the second one, it moves the focus rect to it. So it doesn’t display the focus rect unless I press a key. I’m creating my own component and I need to know whether or not I should display the focus rect to draw it.
How do I know it?
Imagine that we have a form with two buttons on it. I run the
Share
I think it’s not meant to display the focus rectangle by default, that’s until a keyboard accelerator is used. Read UI State on MSDN, that suggests
WM_QUERYUISTATEshould be used to determine if keyboard accelerators or focus indicators should be drawn or not.