W7 Pro 64-bit
I don't know if this is a bug or not, but decided to post it here first before submitting a bug report.
I have a script with three buttons. Any one of them can be marked as the Default when the user clicks on it (so that it is highlighted), while the other two are set as not Default (so that they are not highlighted). It works fine when the GUI first displays and it works fine when the user clicks a button, but here's the problem. When the user clicks any other open window, thereby taking focus away from the AHK window, and then comes back to the AHK window simply by clicking its title bar (not one of the buttons), the button that had been highlighted is not!
Here's a small script that I created to reproduce the problem:
Code: Select all
Gui,Font,s12 w1000
Gui,Add,Button,x10 y10 w30 h30 gLetterA vLetterA -Default,A
Gui,Add,Button,x50 y10 w30 h30 gLetterB vLetterB +Default,B
Gui,Add,Button,x90 y10 w30 h30 gLetterC vLetterC -Default,C
Gui,Show,w250 h50
Return
LetterA:
GuiControl,-Default,LetterB
GuiControl,-Default,LetterC
GuiControl,+Default,LetterA
Return
LetterB:
GuiControl,-Default,LetterC
GuiControl,-Default,LetterA
GuiControl,+Default,LetterB
Return
LetterC:
GuiControl,-Default,LetterA
GuiControl,-Default,LetterB
GuiControl,+Default,LetterC
Return
GuiClose:
GuiEscape:
ExitApp
Now run it again. The Letter B is Default (highlighted). Click the title bar of any other window. Now click the title bar of the AHK window. The GUI now shows Letter A as Default (highlighted)! Even though no user action took place in the GUI, the highlighted button changed simply because the window lost and regained focus.
I appreciate your thoughts on this one. Regards, Joe