This may sound like a simple problem (and perhaps it is) but I've been having some irritation over the following:

All I want to do is create a dialog, and set the default focus and default button (the dotted rectangle) from the OK button to another button. The only way I could do this was to change the tab order manually in the resource editor.

The problem is I want to change it dynamically during program execution, and I tried using the SetFocus() API, but it does not work. Try it yourself! Create a simple dialog box and call this API to set the focus to a desired button---you'll see that it does not work atleast as described in the documentation. What's going on?

Any suggestions, folks?

Cheers,

Shanker.