That is a Windows API type of programming. Where you actually manipulate a UI Control from Windows. I am not sure how, and it would depend on the language you are doing it in? .NET or Non-.NET??
As well, Why would you want to do that? The user should not have access to you ODBC connection directly. And the error handling to consider. Ouch. What if they selected a SQL connection as oppose to an Access or Oracle connection? Kind of hard to avoid.
Why not setup several DSN's that you are coding to use, and have a "pseudo" odbc dialog come up in your program to mimic the one in windows. ????